/* ============================================================
   Полярная дуэль — стили.
   Тёмная арктическая палитра, сдержанное «стекло», единая
   система кнопок/полей, крупные тач-цели, safe-area для мобилок.
   Динамические стили в JS не дублируем — только классы.
   ============================================================ */

:root {
  --bg: #05080f;
  --bg-2: #0a1020;
  --panel: rgba(11, 18, 38, 0.82);
  --panel-soft: rgba(13, 22, 48, 0.6);
  --panel-border: rgba(148, 178, 255, 0.14);
  --panel-border-strong: rgba(148, 178, 255, 0.3);
  --text: #eaf1ff;
  --muted: #93a4c8;
  --faint: rgba(147, 164, 200, 0.6);
  --accent: #45d6ff;
  --accent-deep: #1b8fb8;
  --accent-2: #ffb054;
  --danger: #ff7a7a;
  --ok: #7ef0c0;
  --radius: 18px;
  --radius-sm: 12px;
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, 'JetBrains Mono', monospace;
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.5), 0 4px 18px rgba(0, 0, 0, 0.35);
  --ring: 0 0 0 3px rgba(69, 214, 255, 0.22);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Атрибут hidden и класс .hidden всегда побеждают явный display. */
[hidden],
.hidden {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
}

#app {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
}

.screen {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

/* Слой прицеливания перетаскиванием (активен только в свой ход). */
.gesture {
  position: absolute;
  top: 130px;
  bottom: 160px;
  left: 0;
  right: 0;
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* ---------- Панели ---------- */

.panel {
  pointer-events: auto;
  position: relative;
  background:
    linear-gradient(180deg, rgba(148, 178, 255, 0.07), rgba(148, 178, 255, 0) 42%),
    var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 30px 32px;
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  max-width: min(440px, calc(100vw - 28px));
  width: min(440px, calc(100vw - 28px));
  text-align: center;
  animation: panel-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Кнопки ---------- */

.btn {
  pointer-events: auto;
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  border: 1px solid var(--panel-border-strong);
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  cursor: pointer;
  color: var(--text);
  background: linear-gradient(180deg, rgba(56, 78, 138, 0.55), rgba(30, 45, 90, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.2s ease,
    border-color 0.2s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.14);
  border-color: rgba(148, 178, 255, 0.45);
}

.btn:active:not(:disabled) {
  transform: scale(0.975);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(180deg, #2fa8dc, #17719e);
  border-color: rgba(69, 214, 255, 0.55);
  box-shadow:
    0 6px 22px rgba(57, 195, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn.primary:hover:not(:disabled) {
  border-color: rgba(69, 214, 255, 0.8);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--panel-border);
  box-shadow: none;
}

.btn.ghost:hover:not(:disabled) {
  color: var(--text);
}

.btn.fire {
  min-width: 132px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: linear-gradient(180deg, #e07b2e, #b34d14);
  border-color: rgba(255, 176, 84, 0.65);
  box-shadow:
    0 6px 26px rgba(255, 140, 60, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn.fire:not(:disabled):hover {
  box-shadow:
    0 8px 32px rgba(255, 140, 60, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.icon-btn {
  pointer-events: auto;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(30, 45, 90, 0.55);
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  padding: 6px 11px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  touch-action: manipulation;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--panel-border-strong);
}

.icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* Ряд мелких действий под таймером хода (звук, выход). */
.hud-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

/* ---------- Поля ---------- */

input[type='text'] {
  width: 100%;
  font-family: var(--font);
  font-size: 17px;
  color: var(--text);
  background: rgba(4, 9, 24, 0.72);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  outline: none;
  margin: 6px 0 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type='text']::placeholder {
  color: var(--faint);
}

input[type='text']:focus {
  border-color: rgba(69, 214, 255, 0.6);
  box-shadow: var(--ring);
}

/* ---------- Экран входа ---------- */

.logo {
  margin: 0 0 4px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.22em;
  line-height: 1.15;
  text-indent: 0.22em; /* компенсация letter-spacing для центровки */
}

.logo span {
  display: block;
  font-size: 38px;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  background: linear-gradient(92deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 10px 0 24px;
  color: var(--muted);
  font-size: 13.5px;
  letter-spacing: 0.02em;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.auth-actions .btn {
  flex: 1 1 0;
}

.btn.join-ok {
  flex-basis: 100%;
}

/* ---------- Экран «Комната создана» ---------- */

/* Код комнаты: крупные одинаковые символы, удобные для чтения вслух. */
.code-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 2px 0 18px;
}

.code-field {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: var(--mono);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-align: center;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(4, 9, 24, 0.72);
  border: 1px solid rgba(69, 214, 255, 0.38);
  border-radius: var(--radius-sm);
  padding: 10px 8px 10px 18px; /* компенсируем letter-spacing справа */
  outline: none;
  user-select: all;
  -webkit-user-select: all;
  text-shadow: 0 0 18px rgba(69, 214, 255, 0.35);
}

.btn.copy {
  flex: none;
}

.created-link {
  margin: 4px 0 20px;
  color: var(--muted);
  font-size: 12.5px;
  font-family: var(--mono);
  word-break: break-all;
  line-height: 1.5;
  user-select: all;
  -webkit-user-select: all;
}

.btn.proceed {
  width: 100%;
  font-size: 16.5px;
}

/* ---------- Форма: подписи и ошибки ---------- */

.field-label {
  display: block;
  text-align: left;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-error {
  min-height: 20px;
  margin: 4px 0 10px;
  color: var(--danger);
  font-size: 14px;
  line-height: 1.4;
}

.hint {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-border);
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.55;
}

/* ---------- Экран ожидания ---------- */

.screen-title {
  margin: 0 0 10px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: 0.05em;
}

.wait-text {
  color: var(--muted);
  min-height: 42px;
  line-height: 1.55;
  font-size: 14.5px;
}

.loader {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
}

.loader span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.1s ease-in-out infinite;
}

.loader span:nth-child(2) {
  animation-delay: 0.18s;
}

.loader span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.7);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.mini-stats {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.03em;
  margin: 8px 0 16px;
}

/* ---------- Игровой экран ---------- */

#screen-game {
  display: block;
  position: relative;
}

.hud-top {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: calc(10px + env(safe-area-inset-left));
  right: calc(10px + env(safe-area-inset-right));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: start;
  pointer-events: none;
}

.player-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 9px 13px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  max-width: 300px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.player-card.right {
  justify-self: end;
  text-align: right;
}

.player-card.active {
  border-color: rgba(255, 205, 120, 0.5);
  box-shadow:
    0 0 22px rgba(255, 190, 100, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.player-card.off {
  opacity: 0.6;
}

.pc-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
}

.player-card.right .pc-name {
  flex-direction: row-reverse;
}

.pc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 8px currentColor;
}

.pc-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(4, 9, 24, 0.8);
  border: 1px solid rgba(148, 178, 255, 0.1);
  overflow: hidden;
  margin: 8px 0 5px;
}

.pc-fill {
  height: 100%;
  width: 100%;
  border-radius: 4px;
  transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pc-sub {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.player-card.right .pc-sub {
  flex-direction: row-reverse;
}

.hud-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 150px;
}

.wind {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.wind-arrow {
  color: var(--text);
  font-size: 15px;
  min-width: 14px;
  text-align: center;
}

.turn-label {
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.turn-timer {
  width: 140px;
  height: 6px;
  border-radius: 3px;
  background: rgba(4, 9, 24, 0.8);
  border: 1px solid var(--panel-border);
  overflow: hidden;
}

#turn-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--ok));
  transition: width 0.25s linear;
}

#turn-timer[data-state='urgent'] #turn-timer-fill {
  background: linear-gradient(90deg, #ff9d5c, var(--danger));
}

.banner {
  position: absolute;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 18, 38, 0.9);
  border: 1px solid rgba(255, 205, 120, 0.35);
  color: #ffe3ae;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.05em;
  padding: 12px 26px;
  border-radius: 12px;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: banner-in 0.25s ease;
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes banner-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.game-notice {
  position: absolute;
  bottom: 132px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(64, 16, 16, 0.85);
  border: 1px solid rgba(255, 120, 120, 0.35);
  color: #ffd9d9;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: 10px;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  max-width: 92vw;
}

.kbd-hint {
  position: absolute;
  top: calc(128px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  color: rgba(147, 164, 200, 0.66);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  pointer-events: none;
  margin: 0;
  white-space: nowrap;
}

.hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: end;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(4, 8, 18, 0) 0%, rgba(4, 8, 18, 0.72) 58%);
  pointer-events: none;
}

.ctrl {
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 10px 14px 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  max-width: 340px;
}

.hud-bottom .ctrl:first-child {
  justify-self: start;
}

.hud-bottom .ctrl:last-child {
  justify-self: end;
}

.ctrl-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.ctrl-val {
  color: var(--text);
  font-weight: 700;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.stepper-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-btn {
  pointer-events: auto;
  flex: none;
  width: 38px;
  height: 38px;
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  background: rgba(30, 45, 90, 0.65);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.12s ease, transform 0.08s ease;
}

.step-btn:hover {
  background: rgba(50, 75, 140, 0.7);
}

.step-btn:active {
  transform: scale(0.94);
}

.step-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* ---------- Слайдеры ---------- */

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 110px;
  height: 34px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(69, 214, 255, 0.3), rgba(255, 176, 84, 0.3));
  border: 1px solid rgba(148, 178, 255, 0.16);
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c9f1ff, var(--accent) 65%);
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 12px rgba(69, 214, 255, 0.5);
}

.slider::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(69, 214, 255, 0.3), rgba(255, 176, 84, 0.3));
  border: 1px solid rgba(148, 178, 255, 0.16);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c9f1ff, var(--accent) 65%);
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.slider:focus-visible {
  outline: none;
}

.slider:focus-visible::-webkit-slider-thumb {
  box-shadow: var(--ring), 0 2px 12px rgba(69, 214, 255, 0.5);
}

/* ---------- Индикатор соединения ---------- */

.conn {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: rgba(11, 18, 38, 0.92);
  border: 1px solid var(--panel-border);
  color: var(--muted);
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 10px;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: banner-in 0.2s ease;
  max-width: 94vw;
}

.conn.bad {
  color: #ffcf87;
  border-color: rgba(255, 170, 90, 0.4);
}

/* ---------- Оверлей результата ---------- */

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 6, 16, 0.6);
  pointer-events: auto;
  z-index: 40;
  animation: fade-in 0.3s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.result-panel {
  min-width: min(440px, calc(100vw - 28px));
}

.result-title {
  margin: 0;
  font-size: 40px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
}

#result-title {
  color: var(--accent);
  text-shadow: 0 0 34px rgba(69, 214, 255, 0.35);
}

.result-sub {
  color: var(--muted);
  margin: 8px 0 18px;
  font-size: 14.5px;
}

.result-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.rs-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 13.5px;
  color: var(--muted);
  background: rgba(4, 9, 24, 0.55);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 13px;
}

.rs-row.me {
  color: var(--text);
  border-color: rgba(69, 214, 255, 0.32);
}

.rs-row span:first-child {
  font-weight: 700;
}

.rematch-status {
  min-height: 20px;
  color: var(--accent-2);
  font-size: 14px;
  margin: 10px 0 0;
}

.result-panel .btn.primary {
  width: 100%;
  font-size: 17px;
}

.result-panel .ghost {
  margin-top: 10px;
  width: 100%;
}

/* ---------- Адаптив ---------- */

/* Крупные тач-цели для слайдеров и степперов на телефонах/планшетах. */
@media (pointer: coarse) {
  .slider {
    height: 44px;
  }
  .slider::-webkit-slider-runnable-track {
    height: 14px;
  }
  .slider::-webkit-slider-thumb {
    width: 30px;
    height: 30px;
    margin-top: -9px;
  }
  .slider::-moz-range-track {
    height: 14px;
  }
  .slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
  }
  .step-btn {
    width: 42px;
    height: 42px;
    font-size: 21px;
  }
}

@media (max-width: 720px) {
  .kbd-hint {
    display: none;
  }
  .logo {
    font-size: 23px;
  }
  .logo span {
    font-size: 30px;
  }
  .panel {
    padding: 22px 18px;
  }
  .auth-actions {
    flex-direction: column;
  }
  .auth-actions .btn {
    flex-basis: auto;
  }
  .code-field {
    font-size: 22px;
  }
  /* Панель управления: вертикальный стек во всю ширину —
     слайдеры длинные, «ОГОНЬ» крупный. */
  .hud-bottom {
    grid-template-columns: 1fr;
    gap: 8px;
    justify-items: center;
    padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
  }
  .hud-bottom .ctrl:first-child,
  .hud-bottom .ctrl:last-child {
    justify-self: center;
  }
  .ctrl {
    width: min(94vw, 420px);
    padding: 6px 12px 10px;
  }
  .btn.fire {
    order: 3; /* ОГОНЬ — в самом низу, под большим пальцем */
    width: min(94vw, 420px);
    min-width: 0;
    font-size: 18px;
    letter-spacing: 0.2em;
    padding: 15px;
  }
  .gesture {
    bottom: 245px;
  }
  .player-card {
    padding: 6px 9px;
    max-width: 40vw;
  }
  .pc-title {
    max-width: 24vw;
  }
  .hud-mid {
    min-width: 110px;
  }
  .turn-timer {
    width: 110px;
  }
  .result-title {
    font-size: 29px;
  }
  .game-notice {
    bottom: 255px;
    font-size: 13px;
  }
}

@media (max-height: 480px) {
  .hud-bottom .ctrl-head {
    display: none;
  }
  .turn-timer {
    display: none;
  }
  .gesture {
    bottom: 190px;
  }
}

/* ---------- Бережный режим анимаций ---------- */

@media (prefers-reduced-motion: reduce) {
  .panel,
  .banner,
  .conn,
  .overlay {
    animation: none;
  }
  .loader span {
    animation-duration: 2.2s;
  }
  .pc-fill,
  #turn-timer-fill {
    transition-duration: 0.1s;
  }
}
