/* theme.css — фирменный стиль Burrowstorm: палитра, шрифты, меню, кнопки
   Подключается после style.css и переопределяет оформление панелей. */

:root {
  /* палитра: ночная земля + янтарь заката */
  --ink-950: #040c12;
  --ink-900: #071720;
  --ink-800: #0b2231;
  --ink-700: #123040;
  --soil-800: #1a0f0a;
  --soil-600: #3a2417;

  --amber-300: #ffe08a;
  --amber-400: #ffc44d;
  --amber-500: #ffb020;
  --amber-600: #e8912a;
  --ember-500: #ff7a3d;

  --rose-500: #ff5c72;
  --sky-400: #6ec1ff;
  --mint-400: #57d9a3;
  --cream: #fdf4e3;

  --stroke: rgba(255, 255, 255, .10);
  --stroke-strong: rgba(255, 255, 255, .20);

  --shadow-1: 0 10px 24px rgba(0, 0, 0, .35);
  --shadow-2: 0 24px 64px rgba(0, 0, 0, .55);

  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;

  --font-display: 'Unbounded', 'Trebuchet MS', system-ui, sans-serif;
  --font-ui: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html, body { font-family: var(--font-ui); }
button, input, select, textarea { font-family: var(--font-ui); }

/* ─────────────────────────── экран меню ─────────────────────────── */

.menu-screen {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ink-950);
}
.menu-screen.hidden { display: none; }

.scene { position: absolute; inset: 0; overflow: hidden; }
.scene-svg { width: 100%; height: 100%; display: block; }
.scene-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(88% 56% at 50% 44%, rgba(4, 12, 18, .74) 0%, rgba(4, 12, 18, .34) 52%, rgba(4, 12, 18, 0) 76%),
    linear-gradient(to bottom, rgba(4, 12, 18, .62) 0%, rgba(4, 12, 18, .06) 18%, rgba(4, 12, 18, 0) 58%, rgba(4, 12, 18, .70) 90%, rgba(4, 12, 18, .95) 100%);
}

.motes { position: absolute; inset: 0; pointer-events: none; }
.motes i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 205, 140, .95), rgba(255, 150, 60, 0));
  animation: mote 11s linear infinite;
  opacity: 0;
}
.motes i:nth-child(1) { left: 12%; bottom: 18%; animation-delay: 0s; }
.motes i:nth-child(2) { left: 26%; bottom: 8%; animation-delay: 1.6s; }
.motes i:nth-child(3) { left: 41%; bottom: 22%; animation-delay: 3.4s; }
.motes i:nth-child(4) { left: 58%; bottom: 12%; animation-delay: 5.1s; }
.motes i:nth-child(5) { left: 72%; bottom: 26%; animation-delay: 2.2s; }
.motes i:nth-child(6) { left: 84%; bottom: 10%; animation-delay: 6.4s; }
.motes i:nth-child(7) { left: 92%; bottom: 30%; animation-delay: 4.3s; }
.motes i:nth-child(8) { left: 34%; bottom: 34%; animation-delay: 7.8s; }
@keyframes mote {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(.7); }
  18% { opacity: .85; }
  100% { opacity: 0; transform: translate3d(18px, -170px, 0) scale(1.15); }
}
@media (prefers-reduced-motion: reduce) { .motes i { animation: none; } }

.menu-shell {
  position: relative; z-index: 2;
  width: min(600px, 100%); max-width: 100%; overflow-x: hidden;
  max-height: 100%;
  overflow-y: auto;
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
  scrollbar-width: none;
}
.menu-shell::-webkit-scrollbar { display: none; }

.menu-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.menu-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-weight: 700; font-size: 10.5px; letter-spacing: .22em;
  color: rgba(253, 244, 227, .58); text-transform: uppercase;
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber-500); box-shadow: 0 0 12px rgba(255, 176, 32, .9);
}
.chip-btn {
  min-width: 46px; height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--stroke-strong);
  background: rgba(8, 24, 34, .62); color: var(--cream);
  font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: .1em;
  cursor: pointer; backdrop-filter: blur(8px);
  transition: border-color .18s ease, background .18s ease;
}
.chip-btn:hover { border-color: rgba(255, 196, 77, .55); background: rgba(20, 44, 60, .75); }

.brand { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.brand-mark {
  width: 62px; height: 62px; margin-bottom: 2px;
  display: grid; place-items: center; color: var(--amber-400);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(255, 176, 32, .20), rgba(255, 176, 32, 0) 68%);
  filter: drop-shadow(0 8px 22px rgba(255, 140, 40, .28));
}
.brand-mark svg { width: 62px; height: 62px; }
.brand-title {
  margin: 0;
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(25px, 7.6vw, 36px); line-height: 1;
  letter-spacing: .01em; text-transform: uppercase;
  background: linear-gradient(180deg, #fffaf0 8%, var(--amber-300) 46%, var(--amber-500) 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 18px rgba(255, 150, 40, .28));
}
.brand-tag {
  margin: 0; font-size: 12px; line-height: 1.45; color: rgba(253, 244, 227, .58);
  max-width: 44ch;
}

.menu-cta { display: flex; flex-direction: column; gap: 9px; }
.menu-grid { display: flex; flex-direction: column; gap: 10px; }

/* ─────────────────────────── кнопки ─────────────────────────── */

.bs-btn {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 13px 15px;
  border: 0; border-radius: var(--r-md); cursor: pointer;
  color: var(--cream); text-align: left;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease, border-color .2s ease;
}
.bs-btn:active { transform: translateY(1px) scale(.994); }
.bs-btn__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.bs-btn__body b {
  font-family: var(--font-display); font-weight: 700; font-size: 14.5px;
  letter-spacing: .005em; line-height: 1.25;
}
.bs-btn__body em {
  font-style: normal; font-size: 11.5px; line-height: 1.35; letter-spacing: .01em;
  color: rgba(253, 244, 227, .58);
}
.bs-btn__ic {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
}
.bs-btn__ic svg { width: 20px; height: 20px; }
.bs-btn__arrow {
  font-family: var(--font-display); font-size: 20px; line-height: 1;
  opacity: .55; margin-left: 2px;
}

.bs-btn--primary {
  background: linear-gradient(180deg, #ffdd85 0%, var(--amber-400) 42%, var(--amber-500) 74%, var(--amber-600) 100%);
  color: #2a1a06;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .70),
    inset 0 -2px 0 rgba(120, 64, 0, .22),
    0 14px 30px rgba(255, 150, 32, .30);
}
.bs-btn--primary .bs-btn__body b { color: #241504; }
.bs-btn--primary .bs-btn__body em { color: rgba(42, 26, 6, .62); }
.bs-btn--primary .bs-btn__ic { background: rgba(42, 26, 6, .12); color: #3a2408; }
.bs-btn--primary:hover { filter: brightness(1.04); }

.bs-btn--hero { padding: 16px; border-radius: 18px; }
.bs-btn--hero .bs-btn__body b { font-size: 18px; }
.bs-btn--hero .bs-btn__body em { font-size: 12px; }
.bs-btn--hero .bs-btn__ic { flex-basis: 44px; width: 44px; height: 44px; border-radius: 14px; }
.bs-btn--hero .bs-btn__ic svg { width: 23px; height: 23px; }

.bs-btn--soft {
  background: linear-gradient(180deg, rgba(30, 62, 86, .92), rgba(11, 30, 43, .94));
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), var(--shadow-1);
}
.bs-btn--soft .bs-btn__ic { background: rgba(110, 193, 255, .13); color: #a6d6ff; }
.bs-btn--soft:hover { border-color: rgba(110, 193, 255, .34); }

.bs-btn--ghost {
  background: rgba(9, 26, 38, .55); border: 1px dashed var(--stroke-strong);
  justify-content: center; font-family: var(--font-display); font-size: 13px;
}
.bs-btn--amber-sm {
  width: auto; height: 48px; padding: 0 20px; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; color: #2a1a06;
  background: linear-gradient(180deg, var(--amber-300), var(--amber-500));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 10px 22px rgba(255, 150, 32, .25);
}

/* поле кода комнаты */
.join-card {
  margin-top: 2px; padding: 12px 14px 13px;
  border-radius: var(--r-md);
  background: rgba(7, 23, 32, .66);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(10px);
}
.join-label {
  display: block; margin-bottom: 8px;
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(253, 244, 227, .48);
}
.join-row { display: flex; gap: 8px; align-items: stretch; }
.join-row input {
  flex: 1; min-width: 0; height: 48px; padding: 0 14px;
  border-radius: 13px; border: 1px solid var(--stroke-strong);
  background: rgba(3, 10, 15, .72); color: var(--cream);
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  outline: none; transition: border-color .18s ease, box-shadow .18s ease;
}
.join-row input::placeholder {
  font-family: var(--font-ui); font-weight: 400; font-size: 13px;
  letter-spacing: .02em; text-transform: none; color: rgba(253, 244, 227, .35);
}
.join-row input:focus { border-color: rgba(255, 196, 77, .6); box-shadow: 0 0 0 3px rgba(255, 176, 32, .14); }

.menu-foot { margin-top: auto; padding-top: 4px; }
.menu-foot .rules { font-size: 10.5px; line-height: 1.55; color: rgba(253, 244, 227, .52); max-width: 62ch; margin: 0 auto; }

/* ─────────────────────────── панели и экраны ─────────────────────────── */

.panel {
  background: linear-gradient(180deg, rgba(13, 34, 48, .96), rgba(6, 18, 26, .97));
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(16px) saturate(1.05);
}
.panel h1, .panel h2, #overTitle, .sheetHead {
  font-family: var(--font-display); letter-spacing: .005em;
}
.panel h1 { font-weight: 900; }
.panel h2 { font-weight: 700; }
.sub { color: rgba(253, 244, 227, .62); }

/* старые классы кнопок — приводим к фирменному виду */
.big {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  border-radius: 14px; border: 0; color: #2a1a06;
  background: linear-gradient(180deg, var(--amber-300), var(--amber-500));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 12px 26px rgba(255, 150, 32, .24);
  transition: transform .12s ease, filter .18s ease;
}
.big:active { transform: translateY(1px); }
.big.alt {
  color: var(--cream);
  background: linear-gradient(180deg, rgba(30, 62, 86, .92), rgba(11, 30, 43, .94));
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), var(--shadow-1);
}
.big.ghost { background: rgba(9, 26, 38, .5); border: 1px dashed var(--stroke-strong); color: rgba(253, 244, 227, .8); box-shadow: none; }
.ghostbtn {
  font-family: var(--font-ui); font-weight: 500;
  border-radius: 12px; border: 1px solid var(--stroke-strong);
  background: rgba(9, 26, 38, .6); color: var(--cream);
}
.small { font-family: var(--font-ui); color: rgba(253, 244, 227, .55); }

/* код комнаты и заголовки */
#roomCode {
  font-family: var(--font-display); font-weight: 900;
  letter-spacing: .18em; color: var(--amber-300);
  text-shadow: 0 6px 20px rgba(255, 160, 40, .3);
}
#overTitle { font-size: clamp(20px, 6.2vw, 28px); }

/* HUD: подписи новым шрифтом */
#turnBanner, .hint, #hint { font-family: var(--font-ui); }

/* компактные экраны */
@media (max-height: 700px) {
  .brand-mark { display: none; }
  .menu-shell { gap: 12px; }
  .bs-btn--hero { padding: 14px; }
}
@media (max-width: 380px) {
  .menu-shell { padding-left: 14px; padding-right: 14px; }
  .bs-btn__body em { font-size: 11px; }
  .bs-btn--hero .bs-btn__body b { font-size: 16.5px; }
}

/* недоступные кнопки — читаемо, но явно неактивно */
.big:disabled, .bs-btn:disabled, button:disabled {
  opacity: .45; cursor: not-allowed; filter: saturate(.5);
  box-shadow: none;
}
.gap-note { color: rgba(253, 244, 227, .5); }

/* ─────────────────────────── HUD в фирменном стиле ─────────────────────────── */

#topbar {
  background: linear-gradient(180deg, rgba(9, 26, 38, .84), rgba(4, 13, 20, .88));
  border-color: var(--stroke);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(14px) saturate(1.1);
}
#topbar .tname { font-weight: 500; letter-spacing: .015em; color: rgba(253, 244, 227, .9); }
#topbar .alive {
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  background: rgba(255, 255, 255, .07); color: rgba(253, 244, 227, .9);
}
#topbar .chip { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .13); }
#topbar .dot { box-shadow: 0 0 12px currentColor; }

#timer {
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  color: var(--amber-300); text-shadow: 0 4px 14px rgba(255, 170, 40, .35);
}
#wind { color: rgba(253, 244, 227, .82); font-weight: 500; }
#windArrow { color: var(--sky-400); }

.snd {
  border-radius: 10px; background: rgba(255, 255, 255, .06);
  border: 1px solid var(--stroke); color: rgba(253, 244, 227, .85);
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.snd:hover { border-color: rgba(255, 196, 77, .5); color: var(--amber-300); background: rgba(255, 176, 32, .12); }

#wormbar {
  border-radius: 13px; padding: 7px 10px;
  background: rgba(7, 23, 32, .72); border: 1px solid var(--stroke);
  backdrop-filter: blur(10px); box-shadow: var(--shadow-1);
}
#wormbar .wname { font-weight: 600; letter-spacing: .02em; color: var(--cream); }
#hpwrap { height: 7px; border-radius: 5px; background: rgba(255, 255, 255, .12); }
#hpbar { transition: width .18s ease; box-shadow: 0 0 12px rgba(87, 217, 163, .35); }

.pad, .endbtn {
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(24, 54, 74, .92), rgba(8, 22, 32, .94));
  border: 1px solid var(--stroke); color: var(--cream);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 18px rgba(0, 0, 0, .32);
  transition: transform .12s ease, border-color .16s ease, background .16s ease;
}
.pad:active, .endbtn:active { transform: translateY(1px); }
.pad.on {
  background: rgba(255, 176, 32, .22); border-color: rgba(255, 196, 77, .72);
  color: var(--amber-300);
}
.endbtn {
  font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .02em;
  color: #2a1a06; border-color: transparent;
  background: linear-gradient(180deg, #ffd97d, var(--amber-500) 70%, var(--amber-600));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 8px 18px rgba(255, 150, 32, .28);
}

.wcur {
  border-radius: 13px;
  background: rgba(255, 176, 32, .14); border: 1px solid rgba(255, 196, 77, .55);
  color: var(--amber-300);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.wcur .tx { font-weight: 600; }

#hint {
  background: rgba(7, 23, 32, .70); border: 1px solid var(--stroke);
  border-radius: 14px; padding: 6px 14px;
  color: rgba(253, 244, 227, .82); backdrop-filter: blur(10px);
}

.recenter {
  border-radius: 999px; background: rgba(7, 23, 32, .78); border: 1px solid var(--stroke-strong);
  color: var(--cream); backdrop-filter: blur(10px); font-weight: 500;
}

/* лист оружия и карточки */
.sheet {
  background: linear-gradient(180deg, rgba(12, 32, 45, .98), rgba(5, 15, 22, .99));
  border-top: 1px solid var(--stroke);
}
.sheetHead { font-family: var(--font-display); font-weight: 700; }
.wcard {
  border-radius: 14px; border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(22, 48, 66, .85), rgba(8, 22, 32, .9));
}
.wcard.active {
  background: rgba(255, 176, 32, .18);
  border-color: rgba(255, 196, 77, .8);
  box-shadow: 0 0 0 1px rgba(255, 196, 77, .25), 0 10px 22px rgba(255, 150, 32, .18);
}
.wcard .wname, .wcard .wkey { font-family: var(--font-ui); }

.cards .card {
  border-radius: var(--r-md); border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(22, 48, 66, .9), rgba(8, 22, 32, .94));
  box-shadow: var(--shadow-1);
}


/* ─────────────────────────── композиция меню v2 ─────────────────────────── */

.menu-shell { gap: 12px; }
.menu-body { display: flex; flex-direction: column; gap: 11px; }

.brand-col {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
}

.hero-art {
  width: min(238px, 56vw);
  margin-bottom: -6px;
  filter: drop-shadow(0 20px 34px rgba(0, 0, 0, .5));
  animation: heroFloat 7s ease-in-out infinite;
}
.hero-art svg { width: 100%; height: auto; display: block; }
@keyframes heroFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -7px, 0); }
}
@media (prefers-reduced-motion: reduce) { .hero-art { animation: none; } }

.feat-chips {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  list-style: none; margin: 2px 0 0; padding: 0;
}
.feat-chips li {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(253, 244, 227, .66);
  padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--stroke); background: rgba(8, 24, 34, .55);
  backdrop-filter: blur(6px);
}
.feat-chips li::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--amber-500); box-shadow: 0 0 8px rgba(255, 176, 32, .85);
}

.tile-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  padding: 12px 13px; border-radius: var(--r-md); cursor: pointer; text-align: left;
  color: var(--cream); font: inherit;
  background: linear-gradient(180deg, rgba(30, 62, 86, .92), rgba(11, 30, 43, .94));
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), var(--shadow-1);
  transition: transform .12s ease, border-color .18s ease, background .18s ease;
}
.mode-tile:active { transform: translateY(1px) scale(.995); }
.mode-tile:hover { border-color: rgba(110, 193, 255, .36); background: linear-gradient(180deg, rgba(34, 70, 96, .94), rgba(13, 34, 48, .95)); }
.mode-tile__ic {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(110, 193, 255, .13); color: #a6d6ff; margin-bottom: 2px;
}
.mode-tile__ic svg { width: 17px; height: 17px; }
.mode-tile b {
  font-family: var(--font-display); font-weight: 700; font-size: 12px; line-height: 1.25;
}
.mode-tile em {
  font-style: normal; font-size: 10px; line-height: 1.3; color: rgba(253, 244, 227, .55);
}

/* блик по главной кнопке */
.bs-btn--primary { overflow: hidden; isolation: isolate; }
.bs-btn--primary::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(104deg, transparent 34%, rgba(255, 255, 255, .62) 48%, transparent 62%);
  background-size: 250% 100%;
  opacity: 0;
  animation: gloss 6s ease-in-out infinite;
}
@keyframes gloss {
  0%, 66% { opacity: 0; background-position: 130% 0; }
  74% { opacity: .5; background-position: 60% 0; }
  88% { opacity: 0; background-position: -40% 0; }
  100% { opacity: 0; background-position: -40% 0; }
}
@media (prefers-reduced-motion: reduce) { .bs-btn--primary::after { animation: none; } }

/* зерно на сцене — убирает «пластиковую» плоскость */
.scene::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  opacity: .055; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* широкие экраны: персонаж слева, действия справа */
@media (min-width: 900px) {
  .menu-shell { width: min(1060px, 100%); gap: 8px; }
  .menu-body { display: grid; grid-template-columns: 1.02fr .98fr; column-gap: 48px; align-items: center; }
  .brand-col { align-items: flex-start; text-align: left; gap: 10px; }
  .hero-art { width: min(400px, 100%); }
  .brand-title { font-size: clamp(34px, 3.7vw, 52px); }
  .feat-chips { justify-content: flex-start; }
  .brand-tag { max-width: 38ch; }
  .menu-foot { text-align: center; }
  .tile-row { gap: 12px; }
  .mode-tile { padding: 14px 15px; }
  .mode-tile b { font-size: 13.5px; }
}

/* альбомная ориентация телефона: компактно, без прокрутки */
@media (orientation: landscape) and (max-height: 620px) {
  .menu-shell { width: min(960px, 100%); padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .menu-body { display: grid; grid-template-columns: .92fr 1.08fr; column-gap: 26px; align-items: center; gap: 0; }
  .brand-col { align-items: flex-start; text-align: left; }
  .hero-art { display: none; }
  .brand-title { font-size: clamp(22px, 4.4vw, 34px); }
  .brand-tag { font-size: 11.5px; }
  .feat-chips { display: none; }
  .menu-foot { display: none; }
  .menu-cta { gap: 8px; }
  .bs-btn { padding: 10px 13px; }
  .bs-btn--hero { padding: 12px 14px; }
  .bs-btn--hero .bs-btn__body b { font-size: 15.5px; }
  .bs-btn__body em { display: none; }
  .mode-tile em { display: none; }
  .mode-tile { padding: 10px 12px; }
  .join-card { padding: 8px 12px 9px; }
  .join-label { display: none; }
  .join-row input, .bs-btn--amber-sm { height: 42px; }
}

/* выход из партии */
.snd.exitbtn {
  font-size: 14px; font-weight: 700; color: rgba(253, 244, 227, .72);
}
.snd.exitbtn:hover {
  color: var(--rose-500); border-color: rgba(255, 92, 114, .55);
  background: rgba(255, 92, 114, .14);
}
#quit .panel.narrow { max-width: 420px; }
#quit .panel { padding: 22px 20px 18px; }
#quit h2 { margin: 0 0 6px; }
#quit .sub { margin: 0 0 16px; font-size: 13px; line-height: 1.45; }
#quit .big { width: 100%; margin-top: 8px; }

/* на узких экранах центр верхней панели компактнее, чтобы кнопка выхода влезала */
@media (max-width: 560px) {
  #topbar { gap: 6px; padding: 6px 8px; }
  #topbar .center { gap: 7px; }
  .snd { width: 24px; height: 24px; font-size: 12px; }
  #timer { font-size: 18px; min-width: 28px; }
}

/* перебиваем старые синие варианты кнопок (style.css использует button.big.alt) */
button.big, button.big.alt, button.big.ghost {
  font-family: var(--font-display); font-weight: 700;
}
button.big.alt {
  color: var(--cream);
  background: linear-gradient(180deg, rgba(30, 62, 86, .92), rgba(11, 30, 43, .94));
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), var(--shadow-1);
}
#quit #btnQuitNo {
  color: #2a1a06; border: 0;
  background: linear-gradient(180deg, #ffdd85, var(--amber-400) 45%, var(--amber-500) 82%, var(--amber-600));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 12px 26px rgba(255, 150, 32, .26);
}
#quit #btnQuitYes {
  color: #ffd9de; background: rgba(255, 92, 114, .14);
  border: 1px solid rgba(255, 92, 114, .5);
  box-shadow: none;
}
#quit #btnQuitYes:hover { background: rgba(255, 92, 114, .22); border-color: rgba(255, 92, 114, .75); }

/* диалог выхода: не замыливаем поле — игрок должен видеть партию */
#quit { background: rgba(4, 12, 18, .62); backdrop-filter: blur(4px) saturate(1.05); }

/* ─────────────────────────── сплэш загрузки ─────────────────────────── */
.splash {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 90% at 50% 6%, rgba(255, 176, 32, .10), rgba(4, 12, 18, 0) 58%),
    linear-gradient(180deg, #071c29, #030a0f 72%);
  transition: opacity .5s ease, visibility .5s ease;
}
.splash.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.splash-mark { width: 104px; height: 104px; filter: drop-shadow(0 10px 24px rgba(255, 140, 40, .35)); animation: splashPulse 1.8s ease-in-out infinite; }
.splash-mark svg { width: 100%; height: 100%; }
.splash-title {
  font-family: var(--font-display); font-weight: 900; font-size: 15px;
  letter-spacing: .34em; color: rgba(253, 244, 227, .78); text-indent: .38em;
}
.splash-bar { width: 168px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .14); overflow: hidden; box-shadow: 0 0 18px rgba(255, 150, 40, .25); }
.splash-bar i {
  display: block; height: 100%; width: 42%; border-radius: 3px;
  background: linear-gradient(90deg, var(--amber-400), var(--ember-500));
  animation: splashRun 1.15s ease-in-out infinite;
}
@keyframes splashRun { 0% { transform: translateX(-110%); } 100% { transform: translateX(330%); } }
@keyframes splashPulse { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.05); } }
@media (prefers-reduced-motion: reduce) {
  .splash-mark, .splash-bar i { animation: none; }
}

/* ─────────────────────────── hero-композиция ─────────────────────────── */
.menu-body {
  display: grid; grid-template-columns: 1fr;
  grid-template-areas: "copy" "art" "cta";
  gap: 12px; min-width: 0;
}
.hero-copy, .menu-cta { min-width: 0; }
.hero-copy { grid-area: copy; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.hero-art { grid-area: art; justify-self: center; }
.menu-cta { grid-area: cta; }

.hero-eyebrow {
  margin: 0; font-family: var(--font-ui); font-weight: 500;
  font-size: 9.5px; letter-spacing: .3em; text-transform: uppercase;
  color: rgba(255, 196, 77, .82);
  display: inline-flex; align-items: center; gap: 10px;
}
.hero-eyebrow::before, .hero-eyebrow::after {
  content: ''; width: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 196, 77, .7));
}
.hero-eyebrow::after { background: linear-gradient(90deg, rgba(255, 196, 77, .7), transparent); }

.brand-title {
  font-size: clamp(34px, 12.2vw, 62px);
  line-height: .9; letter-spacing: -.015em; max-width: 100%; white-space: normal;
  filter: drop-shadow(0 10px 26px rgba(255, 140, 40, .30)) drop-shadow(0 2px 0 rgba(0, 0, 0, .35));
}
.brand-tag { font-size: 12.5px; line-height: 1.4; max-width: 34ch; }
.brand-title .t2 { display: block; }
.hero-art { width: min(228px, 58vw); }
.cta-row { display: flex; flex-direction: column; gap: 9px; }

@media (min-width: 900px) {
  .menu-body {
    grid-template-columns: 1.05fr 1fr;
    grid-template-areas: "copy art" "cta art";
    column-gap: 40px; row-gap: 18px; align-items: center;
  }
  .hero-copy { align-items: flex-start; text-align: left; gap: 10px; }
  .brand-title { font-size: clamp(40px, 4.9vw, 66px); }
  .brand-tag { max-width: 40ch; font-size: 13.5px; }
  .hero-art { width: min(470px, 100%); align-self: center; }
  .menu-cta { align-self: start; }
  .feat-chips { justify-content: flex-start; }
  .cta-row { flex-direction: row; }
  .cta-row .bs-btn--hero { flex: 1 1 auto; }
}

@media (min-width: 900px) and (max-height: 720px) {
  .brand-title { font-size: clamp(34px, 3.6vw, 48px); }
  .hero-art { width: min(360px, 100%); }
}

/* на телефоне подсказка про клавиши не нужна — она для десктопа */
@media (max-width: 700px) {
  .menu-foot { display: none; }
}

/* подсказка про установку — компактно, чтобы не съедала hero */
.installHint {
  margin: 4px 0 0; padding: 8px 10px; border-radius: 12px;
  font-size: 11px; line-height: 1.4; color: rgba(253, 244, 227, .62);
  background: rgba(110, 193, 255, .07); border: 1px solid rgba(110, 193, 255, .18);
}

/* ── альбомная ориентация на телефоне: финальные переопределения ────────── */
@media (orientation: landscape) and (max-height: 620px) {
  .menu-body {
    grid-template-columns: .88fr 1.12fr;
    grid-template-areas: "copy cta";
    column-gap: 24px; row-gap: 0; align-items: center;
  }
  .hero-art { display: none; }
  .hero-copy { align-items: flex-start; text-align: left; gap: 6px; }
  .hero-eyebrow { font-size: 8.5px; letter-spacing: .24em; }
  .brand-title { font-size: clamp(24px, 3.3vw, 34px); line-height: .95; }
  .brand-title .t2 { display: inline; }
  .brand-tag { font-size: 11px; }
  .feat-chips { display: none; }
  .menu-cta { gap: 8px; }
  .bs-btn { padding: 9px 12px; }
  .bs-btn--hero { padding: 11px 13px; }
  .bs-btn--hero .bs-btn__body b { font-size: 15px; }
  .bs-btn__body em, .mode-tile em, .join-label { display: none; }
  .mode-tile { padding: 9px 11px; }
  .join-row input, .bs-btn--amber-sm { height: 40px; }
  .installHint { display: none; }
}

/* ── нижние кнопки не должны прятаться под панелью браузера ─────────────── */
:root { --vv-gap: 0px; --ui-chrome: 0px; --hud-base: 70px; }

/* на тач-устройствах в браузере снизу висит панель (адресная строка/вкладки);
   iOS не всегда уменьшает visualViewport под неё, поэтому даём запас */
@media (pointer: coarse) {
  :root { --hud-base: 24px; }
}
@media (display-mode: browser) and (pointer: coarse) {
  :root { --ui-chrome: 56px; }
}

#bottom {
  bottom: calc(var(--hud-base) + var(--ui-chrome) + var(--vv-gap) + env(safe-area-inset-bottom, 0px));
}
#wormbar {
  bottom: calc(var(--hud-base) + 62px + var(--ui-chrome) + var(--vv-gap) + env(safe-area-inset-bottom, 0px));
}
.recenter {
  bottom: calc(var(--hud-base) + 126px + var(--ui-chrome) + var(--vv-gap) + env(safe-area-inset-bottom, 0px)) !important;
}
#weapons {
  bottom: calc(6px + var(--ui-chrome) + var(--vv-gap) + env(safe-area-inset-bottom, 0px));
}

@media (max-height: 700px) {
  #bottom {
    bottom: calc(var(--hud-base) + var(--ui-chrome) + var(--vv-gap) + env(safe-area-inset-bottom, 0px));
  }
  #wormbar {
    bottom: calc(var(--hud-base) + 58px + var(--ui-chrome) + var(--vv-gap) + env(safe-area-inset-bottom, 0px));
  }
}

/* на тач-экранах кнопки движения — крупные, под палец */
@media (pointer: coarse) {
  #bottom .pad, #bottom .endbtn, #bottom .wcur { min-height: 52px; }
  #bottom .pad { min-width: 58px; font-size: 17px; }
  #bottom .endbtn { min-width: 74px; font-size: 13px; }
  #bottom .wcur { padding: 6px 12px; }
}

@media (min-width: 901px) {
  #bottom { bottom: calc(10px + var(--vv-gap) + env(safe-area-inset-bottom, 0px)); }
}

/* нижняя панель: на телефоне — ряд с разбросом, на десктопе — ◀ ▶ слева, 👁 и «Ход» справа */
#bottom { display: flex; }
@media (min-width: 901px) {
  #bottom {
    display: flex; align-items: center; justify-content: flex-start;
    gap: 8px; left: 16px; right: 16px;
  }
  #bottom > * { position: static !important; }

  #btnWeapon { display: none; }
}

/* «Ход» больше не растягивается на всю ширину планшета */
@media (max-width: 900px) {
  .endbtn { flex: 1 1 auto; max-width: 148px; }
  #bottom { gap: 10px; }
}

/* узкие экраны: нижняя панель не должна вылезать за край */
@media (max-width: 430px) {
  #bottom { gap: 6px; left: 8px; right: 8px; }
  #bottom .pad { min-width: 50px; }
  #bottom .wcur { min-width: 0; flex: 0 1 auto; }
  #bottom .wcur .tx { max-width: 62px; }
  #bottom .endbtn { min-width: 62px; max-width: 92px; padding: 0 10px; }
}

/* страховка: нижняя панель всегда в один ряд и не вылезает за экран */
#bottom { box-sizing: border-box; }
#bottom > * { flex: 0 0 auto; }


.wcard .stat {
  display: block; margin-top: 1px;
  font-size: 9.5px; letter-spacing: .02em; color: rgba(253, 244, 227, .45);
  font-variant-numeric: tabular-nums;
}
.wcard.active .stat { color: rgba(255, 222, 140, .8); }

/* компактный селект языка */
.lang-select {
  appearance: none; -webkit-appearance: none;
  padding: 0 26px 0 12px; height: 32px; min-width: 84px;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255,196,77,.85) 50%),
                    linear-gradient(135deg, rgba(255,196,77,.85) 50%, transparent 50%);
  background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  cursor: pointer;
}
.lang-select option { background: #0b1a28; color: #fdf4e3; }

/* экран ошибки загрузки */
#loadErr {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 20px;
  background: linear-gradient(180deg, #071720, #040c12);
}
#loadErr.hidden { display: none; }
.le-card {
  max-width: 420px; padding: 22px 20px; text-align: center;
  border-radius: 20px; border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(13,34,48,.96), rgba(6,18,26,.97));
  box-shadow: var(--shadow-2);
}
.le-card h2 { margin: 0 0 8px; font-family: var(--font-display); font-size: 19px; color: var(--cream); }
.le-card p { margin: 0 0 10px; font-size: 13px; line-height: 1.5; color: rgba(253,244,227,.72); }
.le-card .le-reason { font-size: 11px; color: rgba(255,140,140,.75); word-break: break-word; }
.le-card .bs-btn { margin-top: 6px; justify-content: center; }

/* кнопка «Огонь» — только на тач-устройствах, крупная и янтарная */
#btnFire { display: none; }
#btnFire.hidden { display: none !important; }
@media (pointer: coarse) {
  #bottom #btnFire {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 64px; max-width: 74px; height: 52px; padding: 0 10px;
    border-radius: 14px; border: 0; cursor: pointer;
    font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .02em;
    color: #2a1a06;
    background: linear-gradient(180deg, #ffe08a, var(--amber-400) 45%, var(--amber-500) 85%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 8px 18px rgba(255,150,32,.35);
  }
  #bottom #btnFire:active { transform: translateY(1px); }
}
@media (max-width: 430px) {
  #bottom #btnFire { min-width: 58px; max-width: 64px; font-size: 11px; }
}

/* «Огонь» — главное действие на тач-экранах, «Ход» — второстепенное */
@media (pointer: coarse) {
  #bottom .endbtn {
    color: var(--amber-300);
    background: linear-gradient(180deg, rgba(24,54,74,.92), rgba(8,22,32,.94));
    border: 1px solid rgba(255,196,77,.45);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  }
  #bottom #btnFire {
    font-size: 13px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 10px 22px rgba(255,150,32,.45);
  }
}
#bottom .wcur .tx { max-width: 58px; }


/* порядок кнопок: движение рядом, действия справа — одинаково на телефоне и планшете */
#bottom { display: flex; align-items: center; }
#bottom > #btnLeft  { order: 1; }
#bottom > #btnRight { order: 2; margin-right: 8px; }
#bottom > #btnWeapon { order: 3; }
#bottom > #btnFire  { order: 4; }
#bottom > #btnLook  { order: 5; margin-left: auto; }
#bottom > #btnEnd   { order: 6; margin-left: 6px; }
