/* Шрифты Golos Text и Unbounded (лицензия OFL 1.1) лежат на нашем сервере, без обращений к Google */
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/golos-400-cyr.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/golos-400-lat.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/golos-500-cyr.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/golos-500-lat.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/golos-600-cyr.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/golos-600-lat.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/golos-700-cyr.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/golos-700-lat.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/unbounded-700-cyr.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/unbounded-700-lat.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/unbounded-800-cyr.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/unbounded-800-lat.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- токены ---------- */
:root {
  --night-1: #171A45;
  --night-2: #2C2668;
  --night-3: #5A3A82;
  --night-4: #8C4B7E;
  --ink: #221C4E;
  --ink-2: #2C2668;
  --text: #F4F1FF;
  --muted: #B9B2E3;
  --gold: #FFD27A;
  --gold-deep: #C9933A;
  --gold-text: #FFE4A8;
  --glass: rgba(255, 255, 255, .08);
  --glass-line: rgba(255, 255, 255, .12);
  --good: #3CCB8B;
  --bad: #F0605A;
  --paper: #FFFFFF;
  --paper-2: #F6F5FC;
  --paper-line: #E6E3F5;
  --paper-muted: #6B6596;
  --display: 'Unbounded', 'Golos Text', system-ui, sans-serif;
  --body: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--night-1);
  color: var(--text);
  font: 400 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- небо ---------- */
.sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(70% 40% at 50% 64%, rgba(255, 170, 120, .26), transparent 70%),
    linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 38%, var(--night-3) 70%, var(--night-4) 100%);
}
.sky-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.twinkle { animation: twinkle 3.2s ease-in-out infinite; }
.twinkle:nth-child(3n) { animation-delay: 1.1s; }
.twinkle:nth-child(4n) { animation-delay: 2.2s; }
@keyframes twinkle { 50% { opacity: .15; } }

.app {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 16px);
}
.screen { display: none; }
.screen.is-active { display: flex; flex-direction: column; min-height: calc(100dvh - 30px); }
.screen-center { justify-content: center; align-items: center; text-align: center; gap: 12px; }

/* ---------- типографика ---------- */
.title { font: 800 26px/1.15 var(--display); margin: 6px 0 2px; letter-spacing: -.01em; }
.title.big { font-size: 32px; color: var(--gold-text); text-shadow: 0 3px 0 rgba(20, 12, 60, .55); }
.muted { color: var(--muted); margin: 0; max-width: 34ch; }
.small { font-size: 14px; }
.error { color: #FF9E99; min-height: 1.4em; margin: 2px 0 0; font-size: 14px; }

/* ---------- кнопки ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  border-radius: 16px; padding: 16px 20px;
  font-weight: 700; font-size: 17px; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .1s ease, box-shadow .1s ease, background-color .2s;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn-gold { background: var(--gold); color: var(--ink-2); box-shadow: 0 5px 0 var(--gold-deep), 0 14px 30px rgba(255, 170, 60, .22); }
.btn-gold:hover:not(:disabled) { background: #FFDA8E; }
.btn-gold:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--gold-deep); }
.btn-glass { background: var(--glass); box-shadow: inset 0 0 0 1.5px var(--glass-line); color: var(--text); backdrop-filter: blur(10px); }
.btn-glass:hover:not(:disabled) { background: rgba(255, 255, 255, .13); }
.btn-glass:active:not(:disabled) { transform: translateY(2px); }
.btn-ink { background: var(--ink-2); color: #fff; box-shadow: 0 4px 0 #17143F; }
.btn-ink:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #17143F; }
.btn-text { background: none; color: var(--muted); padding: 10px 14px; font-weight: 600; }
.btn-text:hover { color: var(--text); }
.btn-small { padding: 11px 16px; font-size: 15px; border-radius: 14px; }
.btn-wide { width: 100%; max-width: 360px; }

.back {
  position: absolute; top: calc(env(safe-area-inset-top) + 12px); left: 16px;
  width: 44px; height: 44px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--glass); box-shadow: inset 0 0 0 1.5px var(--glass-line); color: var(--text);
  display: grid; place-items: center;
}
.back svg { width: 22px; height: 22px; }

/* ---------- поля ---------- */
.panel {
  width: 100%; max-width: 380px;
  display: grid; gap: 12px;
  padding: 18px; border-radius: 24px;
  background: rgba(20, 18, 58, .55);
  box-shadow: inset 0 0 0 1px var(--glass-line), 0 24px 50px rgba(10, 8, 40, .35);
  backdrop-filter: blur(14px);
}
.field { display: grid; gap: 6px; text-align: left; }
.field-label { color: var(--muted); font-size: 13.5px; font-weight: 500; }
input[type=text], input[type=number], #numInput {
  width: 100%;
  background: rgba(255, 255, 255, .07);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 17px; font-weight: 500;
  outline: none;
  transition: border-color .2s, background-color .2s;
}
input:focus { border-color: rgba(255, 210, 122, .7); background: rgba(255, 255, 255, .1); }
input::placeholder { color: #8E87BD; }

/* ---------- главный экран ---------- */
.screen-home { justify-content: center; align-items: center; text-align: center; gap: 18px; }
.hero { display: grid; justify-items: center; }
.hero-island { width: min(300px, 78vw); height: auto; overflow: visible; animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.wordmark {
  font: 800 clamp(54px, 16vw, 72px)/1 var(--display);
  letter-spacing: -.02em;
  color: var(--gold-text);
  text-shadow: 0 5px 0 #3B2A78, 0 18px 40px rgba(255, 170, 90, .25);
  margin: 4px 0 10px;
}
.lead { color: var(--muted); font-size: 16.5px; max-width: 32ch; margin: 0; }
.conn { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); margin: 4px 0 0; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: #8E87BD; }
.conn.ok i { background: var(--good); box-shadow: 0 0 0 4px rgba(60, 203, 139, .2); }

/* ---------- поиск соперников ---------- */
.seats { display: flex; gap: 14px; margin-bottom: 18px; }
.seat {
  width: 84px; height: 100px; border-radius: 20px;
  display: grid; place-items: center; align-content: center; gap: 6px;
  background: var(--glass); box-shadow: inset 0 0 0 1.5px var(--glass-line);
  font-size: 12.5px; color: var(--muted);
}
.seat svg { width: 40px; height: 46px; }
.seat.empty .q { width: 40px; height: 46px; display: grid; place-items: center; border-radius: 12px; border: 2px dashed rgba(255, 255, 255, .25); font: 800 18px var(--display); color: rgba(255, 255, 255, .35); animation: breathe 1.6s ease-in-out infinite; }
.seat.empty:nth-child(3) .q { animation-delay: .5s; }
@keyframes breathe { 50% { border-color: rgba(255, 210, 122, .7); color: var(--gold); } }
.seat.me { box-shadow: inset 0 0 0 2px var(--gold); color: var(--text); }

/* ---------- с друзьями ---------- */
.banner-art { width: 120px; height: 96px; margin-bottom: 4px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13.5px; margin: 4px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--glass-line); }
.join { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
#codeInput { text-transform: uppercase; letter-spacing: .35em; font: 800 20px var(--display); text-align: center; padding-left: 24px; }

/* ---------- лобби ---------- */
.code-tiles { display: flex; gap: 10px; margin: 2px 0 8px; }
.code-tiles span {
  width: 58px; height: 68px; border-radius: 16px;
  display: grid; place-items: center;
  font: 800 34px var(--display); color: var(--ink-2);
  background: var(--gold); box-shadow: 0 5px 0 var(--gold-deep);
}
.members { list-style: none; padding: 0; margin: 14px 0 2px; width: 100%; max-width: 360px; display: grid; gap: 10px; }
.members li {
  display: flex; align-items: center; gap: 12px;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line);
  border-radius: 18px; padding: 10px 14px; text-align: left; font-weight: 600;
}
.members li svg { width: 32px; height: 37px; flex: none; }
.members li .grow { flex: 1; }
.members li.empty { background: transparent; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .1); color: var(--muted); font-weight: 500; }
.members li.empty .slot { width: 32px; height: 37px; border-radius: 10px; border: 2px dashed rgba(255, 255, 255, .2); }
.tag { font-size: 11.5px; font-weight: 700; color: var(--ink-2); background: var(--gold); border-radius: 8px; padding: 2px 7px; }
.tag.soft { color: var(--muted); background: rgba(255, 255, 255, .1); }

/* ---------- партия ---------- */
.screen-game.is-active { gap: 6px; }
.hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pc {
  position: relative; min-width: 0;
  display: flex; gap: 8px; align-items: center;
  padding: 8px; border-radius: 16px;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line);
  transition: opacity .3s, box-shadow .3s;
}
.pc.me { background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 2px var(--gold); }
.pc.dead { opacity: .4; }
.pc .crest { width: 30px; height: 35px; flex: none; }
.pc .meta { min-width: 0; }
.pc .nm { font-size: 12.5px; font-weight: 600; color: #D9D4F5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc .sc { font: 800 16px/1.15 var(--display); font-variant-numeric: tabular-nums; }
.pc .tw { display: flex; gap: 3px; margin-top: 3px; align-items: center; }
.pc .tw i { width: 9px; height: 9px; border-radius: 2px 2px 0 0; background: var(--c); }
.pc .tw i.lost { background: rgba(255, 255, 255, .14); }
.pc .tw em { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--muted); margin-left: 4px; }
.pc .done {
  position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--good); display: grid; place-items: center;
  box-shadow: 0 0 0 3px var(--night-1); animation: pop .3s cubic-bezier(.3, 1.6, .5, 1);
}
.pc .done svg { width: 12px; height: 12px; }
.pc.offline .nm::after { content: ' · нет связи'; color: var(--muted); font-weight: 500; }
.pc .score-bump { animation: bump .5s ease; }
@keyframes bump { 30% { transform: scale(1.18); color: var(--gold); } }
@keyframes pop { from { transform: scale(0); } }

.phase { text-align: center; padding-top: 6px; }
.phase b { font: 800 13px var(--display); color: var(--gold); letter-spacing: .02em; }
.phase span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.board-wrap { flex: 1; display: grid; place-items: center; min-height: 0; margin: 0 -8px; }
.board { width: 100%; max-height: 58dvh; overflow: visible; }
.tile { transition: opacity .25s, filter .25s; }
.tile.muted { opacity: .55; filter: saturate(.7); }
.tile.selectable { cursor: pointer; }
.tile.selectable:hover .tile-top, .tile.selectable:focus-visible .tile-top { filter: brightness(1.12); }
.tile:focus { outline: none; }
.sel-ring { fill: none; stroke: var(--gold); stroke-width: 2.6; stroke-dasharray: 7 5; stroke-linecap: round; animation: march 1s linear infinite; }
.tile.selectable:focus-visible .sel-ring { stroke: #fff; stroke-width: 3.5; }
.target-ring { fill: none; stroke: #fff; stroke-width: 3.5; animation: pulse .8s ease-in-out infinite alternate; }
.tile.flash { animation: land .7s cubic-bezier(.3, 1.5, .5, 1); transform-box: fill-box; transform-origin: 50% 70%; }
@keyframes land { 0% { transform: translateY(-14px) scale(1.06); filter: brightness(1.5); } 100% { transform: none; } }
@keyframes march { to { stroke-dashoffset: -24; } }
@keyframes pulse { from { stroke-opacity: 1; } to { stroke-opacity: .25; } }
.price text { font-family: var(--display); font-weight: 800; fill: #fff; }
.sword { pointer-events: none; animation: hover 1.4s ease-in-out infinite; }
@keyframes hover { 50% { translate: 0 -3px; } }

.banner {
  display: flex; align-items: center; gap: 12px;
  border-radius: 20px; padding: 12px 14px; min-height: 66px;
  background: rgba(20, 18, 58, .72);
  box-shadow: inset 0 0 0 1px var(--glass-line), 0 18px 40px rgba(10, 8, 40, .45);
  backdrop-filter: blur(10px);
  transition: box-shadow .3s;
}
.banner.mine { box-shadow: inset 0 0 0 1.5px rgba(255, 210, 122, .55), 0 18px 40px rgba(10, 8, 40, .45); }
.banner-ic { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.banner.mine .banner-ic { background: var(--gold); }
.banner-ic svg { width: 22px; height: 22px; }
.banner .t1 { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.banner.mine .t1 { color: var(--gold-text); }
.banner .t2 { font-size: 13px; color: var(--muted); margin-top: 1px; }
.banner .t2:empty { display: none; }

/* ---------- лист с вопросом ---------- */
.veil { position: fixed; inset: 0; z-index: 4; background: linear-gradient(180deg, rgba(14, 10, 40, .2), rgba(14, 10, 40, .6)); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  max-width: 480px; margin: 0 auto;
  max-height: 86dvh; overflow-y: auto;
  background: var(--paper); color: var(--ink);
  border-radius: 28px 28px 0 0;
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 20px);
  box-shadow: 0 -20px 60px rgba(10, 6, 40, .55);
  animation: rise .32s cubic-bezier(.2, .9, .25, 1);
}
@keyframes rise { from { transform: translateY(100%); } }
.sheet-top { display: flex; align-items: center; gap: 12px; }
.ring { position: relative; width: 56px; height: 56px; flex: none; }
.ring svg { width: 56px; height: 56px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #ECE9F8; stroke-width: 5; }
.ring-fg { fill: none; stroke: var(--ink-2); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 150.8; }
.ring.low .ring-fg { stroke: var(--bad); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 800 17px var(--display); color: var(--ink-2); }
.ring.low b { color: var(--bad); }
.sheet-meta { min-width: 0; display: grid; gap: 5px; justify-items: start; }
.cat { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: #EEEBFF; color: #4A3FA8; }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--paper-muted); }
.who svg { width: 17px; height: 20px; }
.who b { color: var(--ink); font-weight: 600; }
.q-text { font: 700 20px/1.32 var(--body); margin: 16px 0; }
.options { display: grid; gap: 10px; }
.opt {
  appearance: none; border: 0; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 16px;
  font-weight: 600; font-size: 16.5px; color: var(--ink);
  background: var(--paper-2); box-shadow: inset 0 0 0 2px var(--paper-line), 0 4px 0 #E1DEF2;
  transition: transform .1s, background-color .15s, box-shadow .15s;
}
.opt:hover:not(:disabled) { background: #EFEDFA; }
.opt:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--paper-line), 0 1px 0 #E1DEF2; }
.opt:disabled { cursor: default; color: var(--ink); opacity: 1; }
.opt .k { width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center; font: 800 13px var(--display); background: var(--ink-2); color: var(--gold); }
.opt .tx { flex: 1; }
.opt.chosen { background: var(--ink-2); color: #fff; box-shadow: 0 4px 0 #17143F; }
.opt.chosen .k { background: var(--gold); color: var(--ink-2); }
.opt.right { background: #E3F8EE; color: #0F5A3A; box-shadow: inset 0 0 0 2px var(--good), 0 4px 0 #2EA673; }
.opt.right .k { background: var(--good); color: #fff; }
.opt.wrong { background: #FFECEB; color: #8E2A26; box-shadow: inset 0 0 0 2px #F5A3A0, 0 4px 0 #EFC4C2; }
.opt.wrong .k { background: var(--bad); color: #fff; }
.opt.faded { opacity: .55; }
.marks { display: flex; gap: 2px; }
.marks svg { width: 18px; height: 21px; animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }
.num { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.num input { background: var(--paper-2); color: var(--ink); font: 800 22px var(--display); box-shadow: inset 0 0 0 2px var(--paper-line); }
.num input:focus { border-color: var(--ink-2); background: #fff; }
.num input::placeholder { font: 500 17px var(--body); color: #9B95C2; }
.num .btn { padding: 14px 18px; }
.reveal { margin-top: 12px; display: grid; gap: 8px; }
.reveal:empty { display: none; }
.reveal .answer { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.reveal .answer span { font-size: 14px; color: var(--paper-muted); font-weight: 600; }
.reveal .answer b { font: 800 28px var(--display); color: var(--ink-2); }
.reveal .row {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px; background: var(--paper-2); box-shadow: inset 0 0 0 2px var(--paper-line);
  animation: slide .3s ease backwards;
}
.reveal .row:nth-child(3) { animation-delay: .08s; }
.reveal .row:nth-child(4) { animation-delay: .16s; }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } }
.reveal .row svg { width: 20px; height: 23px; }
.reveal .row .nm { font-weight: 600; }
.reveal .row .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.reveal .row .val small { display: block; font-weight: 500; font-size: 12px; color: var(--paper-muted); }
.reveal .row.win { background: #E3F8EE; box-shadow: inset 0 0 0 2px var(--good); }
.spectate { display: flex; gap: 10px; align-items: center; color: var(--paper-muted); font-size: 14.5px; margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--paper-2); }
.spectate svg { width: 20px; height: 20px; flex: none; }

/* ---------- итоги ---------- */
.trophy { width: 190px; height: 142px; overflow: visible; }
.trophy .rays { transform-origin: 80px 62px; animation: spin 24s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ranking { list-style: none; padding: 0; margin: 10px 0 14px; width: 100%; max-width: 380px; display: grid; gap: 10px; }
.ranking li {
  display: grid; grid-template-columns: 34px 34px 1fr auto; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 18px; text-align: left;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line);
  animation: slide .4s ease backwards;
}
.ranking li:nth-child(2) { animation-delay: .1s; }
.ranking li:nth-child(3) { animation-delay: .2s; }
.ranking li.first { background: rgba(255, 210, 122, .14); box-shadow: inset 0 0 0 2px var(--gold); }
.ranking .place { font: 800 22px var(--display); color: var(--muted); text-align: center; }
.ranking li.first .place { color: var(--gold); }
.ranking svg { width: 30px; height: 35px; }
.ranking .nm { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking .nm small { color: var(--muted); font-weight: 500; }
.ranking .pts { font: 800 18px var(--display); font-variant-numeric: tabular-nums; }

@media (min-width: 700px) {
  .board { max-height: 60vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
.price { pointer-events: none; }
body.in-game .moon { display: none; }
.num input::-webkit-outer-spin-button, .num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num input { -moz-appearance: textfield; appearance: textfield; }
.board-wrap { place-items: start center; padding-top: 3vh; }
.wordmark { margin-top: 18px; }

/* ---------- партии на 4–6 игроков ---------- */

.size-pick {
  display: flex; align-items: center; gap: 14px; margin-top: 10px;
  padding: 8px; border-radius: 20px;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line);
}
.size-pick button {
  width: 44px; height: 44px; border-radius: 14px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: var(--text);
  font: 800 22px/1 var(--display);
}
.size-pick button:disabled { opacity: .3; cursor: default; }
.size-pick button:not(:disabled):active { transform: translateY(2px); }
.size-pick .val { min-width: 128px; text-align: center; }
.size-pick .val b { display: block; font: 800 26px/1.1 var(--display); color: var(--gold-text); }
.size-pick .val span { font-size: 13px; color: var(--muted); }
.members li.empty { color: var(--muted); font-weight: 500; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); }
.members li.empty .slot { width: 32px; height: 37px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); font: 800 15px var(--display); color: var(--muted); }
body[data-screen="room"] .moon, body[data-screen="game"] .moon, body[data-screen="leaders"] .moon, body[data-screen="account"] .moon, body[data-screen="howto"] .moon, body[data-screen="over"] .moon { display: none; }

.wordmark { font-size: clamp(46px, 13.5vw, 62px); letter-spacing: -.03em; }

/* ---------- выход из партии ---------- */
.game-bar { position: relative; z-index: 6; }
.game-bar .phase { padding: 6px 44px 0; }
.exit-btn {
  position: absolute; left: 0; top: 2px; width: 36px; height: 36px; border: 0; border-radius: 12px;
  display: grid; place-items: center; cursor: pointer; color: var(--text);
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line);
}
.exit-btn svg { width: 19px; height: 19px; }
.exit-btn:hover { background: rgba(255, 255, 255, .14); }
.exit-btn:active { transform: translateY(1px); }
.pc.left .nm::after { content: ' · вышел'; color: var(--muted); font-weight: 500; }

/* ---------- приглашение ---------- */
.invite {
  padding: 12px 14px; border-radius: 16px; text-align: left;
  background: rgba(255, 210, 122, .12); box-shadow: inset 0 0 0 1.5px rgba(255, 210, 122, .45);
}
.invite-k { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.invite p { margin: 2px 0 0; font-size: 15px; }
.invite b { font: 800 17px var(--display); letter-spacing: .12em; color: var(--gold); }

/* ---------- окно подтверждения ---------- */
.dlg-veil {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px;
  background: rgba(12, 9, 36, .62); backdrop-filter: blur(4px); animation: fade .2s;
}
.dlg {
  width: 100%; max-width: 360px; padding: 22px 20px 18px; border-radius: 24px; text-align: center;
  background: linear-gradient(180deg, #2A2A66, #1E1F52); box-shadow: inset 0 0 0 1px var(--glass-line), 0 24px 60px rgba(5, 3, 25, .6);
  animation: pop .25s cubic-bezier(.3, 1.4, .5, 1);
}
.dlg h3 { margin: 0 0 8px; font: 800 19px/1.25 var(--display); }
.dlg p { margin: 0 0 18px; color: #CFC9EE; font-size: 15px; line-height: 1.45; }
.dlg-btns { display: grid; gap: 10px; }

/* ---------- верхняя панель главного экрана ---------- */
.topbar { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.topbar-right { display: flex; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border: 0; border-radius: 14px; cursor: pointer;
  display: grid; place-items: center; color: var(--text);
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: rgba(255, 255, 255, .14); }
.icon-btn:active { transform: translateY(1px); }
.sound-btn.off { color: var(--muted); }
.screen-home { gap: 14px; justify-content: flex-start; }
.screen-home .hero-island { width: min(240px, 62vw); }
.screen-home .wordmark { margin: 0 0 6px; }

.announce {
  width: 100%; max-width: 380px; padding: 11px 14px; border-radius: 16px; font-size: 14.5px; text-align: left;
  background: rgba(124, 196, 255, .12); box-shadow: inset 0 0 0 1.5px rgba(124, 196, 255, .4);
}
.announce.warn { background: rgba(255, 210, 122, .12); box-shadow: inset 0 0 0 1.5px rgba(255, 210, 122, .5); }

#guestBox { display: grid; gap: 6px; }
.link-btn {
  background: none; border: 0; padding: 4px 2px; cursor: pointer; text-align: left;
  color: var(--gold-text); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 228, 168, .4);
}
.me-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  border: 0; border-radius: 16px; padding: 10px 12px; color: var(--text);
  background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1.5px var(--glass-line);
}
.me-card > svg { width: 20px; height: 20px; color: var(--muted); }
.me-ava {
  width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center;
  font: 800 19px var(--display); color: var(--ink-2); background: linear-gradient(135deg, var(--gold), #FFB86B);
}
.me-ava.big { width: 76px; height: 76px; border-radius: 22px; font-size: 34px; }
.me-tx { flex: 1; min-width: 0; display: grid; }
.me-tx b { font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-tx small { color: var(--muted); font-size: 13px; }

.quick { display: grid; gap: 6px; text-align: left; }
.chips { display: grid; grid-template-columns: repeat(5, 1fr) 1.7fr; gap: 6px; }
.chips button {
  height: 42px; border: 0; border-radius: 12px; cursor: pointer;
  font: 800 16px var(--display); color: var(--muted);
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1.5px var(--glass-line);
  transition: background-color .15s, color .15s;
}
.chips button.wide { font-size: 13px; }
.chips button.on { background: rgba(255, 210, 122, .16); color: var(--gold-text); box-shadow: inset 0 0 0 2px var(--gold); }

.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; font-size: 13px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }

/* ---------- поиск: много мест и команды ---------- */
.seats { flex-wrap: wrap; justify-content: center; align-items: center; max-width: 380px; }
.seats-sm { gap: 10px; }
.seats-sm .seat { width: 66px; height: 84px; border-radius: 16px; font-size: 11.5px; }
.seats-sm .seat svg, .seats-sm .seat .q { width: 32px; height: 37px; }
.seats-sm .seat span { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-team { display: flex; gap: 8px; }
.seats .vs { font: 800 13px var(--display); color: var(--muted); }

/* ---------- настройки комнаты ---------- */
.room-opts { display: grid; gap: 10px; justify-items: center; width: 100%; max-width: 360px; margin-top: 8px; }
.room-opts .size-pick { margin-top: 0; }
.seg {
  display: flex; width: 100%; padding: 4px; gap: 4px; border-radius: 16px;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line);
}
.seg button {
  flex: 1; border: 0; border-radius: 12px; padding: 10px 8px; cursor: pointer;
  background: transparent; color: var(--muted); font-weight: 700; font-size: 14.5px;
}
.seg button.on { background: var(--gold); color: var(--ink-2); }
.seg-small button { padding: 7px 6px; font-size: 13px; }
.seg.readonly button { cursor: default; }
.seg.readonly button:disabled { opacity: .5; }
.room-opts .muted:empty { display: none; }
.teams-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 380px; margin-top: 12px; }
.team-col { display: grid; gap: 8px; align-content: start; justify-items: stretch; }
.team-col .members { margin: 0; gap: 8px; }
.team-col .members li { padding: 8px 10px; gap: 8px; font-size: 14px; }
.team-col .members li svg { width: 26px; height: 30px; }
.team-col .members li .slot { width: 26px !important; height: 30px !important; font-size: 10px !important; }
.team-col .tag { display: none; }
.team-name {
  font: 800 14px var(--display); padding: 8px; border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, var(--t1), var(--t2)); text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}

/* ---------- партия 2 на 2 ---------- */
.teambar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.team-pill {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 12px; font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, color-mix(in srgb, var(--t1) 30%, transparent), color-mix(in srgb, var(--t2) 30%, transparent));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--t1) 70%, transparent);
}
.team-pill b { font: 800 15px var(--display); }
.team-pill.mine { box-shadow: inset 0 0 0 2px var(--gold); }
.team-pill.big { padding: 12px 16px; font-size: 15px; border-radius: 16px; }
.team-pill.big b { font-size: 20px; }
.team-pill.win { box-shadow: inset 0 0 0 2.5px var(--gold), 0 10px 30px rgba(255, 190, 90, .25); }
.team-result { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 380px; }
.hud.teams .pc.team-0 { background: rgba(240, 96, 90, .12); }
.hud.teams .pc.team-1 { background: rgba(76, 141, 246, .12); }
.hud.teams .pc:nth-child(2) { margin-right: 6px; }
.exit-btn.right { left: auto; right: 0; }

/* ---------- жалоба на вопрос ---------- */
.report-link {
  display: block; margin: 12px auto 0; background: none; border: 0; cursor: pointer;
  color: var(--paper-muted); font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.dlg-report { text-align: left; }
.dlg-report h3 { text-align: center; }
.report-q { font-weight: 600; color: var(--text) !important; font-size: 14.5px !important; margin-bottom: 12px !important; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.reasons label { cursor: pointer; }
.reasons input { position: absolute; opacity: 0; pointer-events: none; }
.reasons span {
  display: inline-block; padding: 7px 11px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1.5px var(--glass-line); color: var(--muted);
}
.reasons input:checked + span { background: rgba(255, 210, 122, .16); color: var(--gold-text); box-shadow: inset 0 0 0 2px var(--gold); }
.reasons input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
textarea {
  width: 100%; resize: vertical; min-height: 70px; margin-bottom: 14px;
  background: rgba(255, 255, 255, .07); border: 2px solid transparent; border-radius: 14px;
  padding: 10px 12px; color: var(--text); font: 500 15px/1.4 var(--body); outline: none;
}
textarea:focus { border-color: rgba(255, 210, 122, .7); }

/* ---------- итоги: рейтинг, вопросы, Mindtown ---------- */
.rating-delta { margin: 0; color: var(--muted); font-size: 15px; }
.rating-delta b { color: var(--text); font-family: var(--display); }
.rating-delta .up { color: var(--good); font-weight: 800; }
.rating-delta .down { color: #FF9E99; font-weight: 800; }
.screen-over { padding-bottom: 10px; }
.ranking li .place:empty { display: none; }
.ranking li:has(.place:empty) { grid-template-columns: 34px 1fr auto; }
.qlist { width: 100%; max-width: 380px; text-align: left; margin-top: 4px; }
.qlist summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14.5px; text-align: center; padding: 6px; }
.qlist ol { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.qlist li {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: start;
  padding: 10px 12px; border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line);
}
.qlist .qt { font-size: 14px; grid-column: 1 / -1; }
.qlist b { font-size: 14px; color: var(--gold-text); }
.report-mini {
  background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px; padding: 0;
}
.report-mini:disabled { text-decoration: none; cursor: default; }
.promo {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 380px; margin-top: 8px;
  padding: 12px 14px; border-radius: 18px; text-decoration: none; color: var(--text); text-align: left;
  background: linear-gradient(135deg, rgba(143, 227, 191, .14), rgba(124, 196, 255, .1));
  box-shadow: inset 0 0 0 1.5px rgba(143, 227, 191, .35);
}
.promo svg { width: 44px; height: 44px; flex: none; }
.promo span { display: grid; }
.promo b { font-size: 14.5px; }
.promo small { color: var(--muted); font-size: 13px; }

/* ---------- аккаунт ---------- */
.auth, .profile { width: 100%; display: grid; justify-items: center; gap: 12px; }
.auth .seg { max-width: 380px; }
input[type=password] {
  width: 100%; background: rgba(255, 255, 255, .07); border: 2px solid transparent; border-radius: 14px;
  padding: 14px 16px; font-size: 17px; font-weight: 500; outline: none;
}
.check { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--gold); flex: none; }
.check a, .hint a { color: var(--gold-text); }
.hint { margin: 0; color: var(--muted); text-align: left; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 380px; margin: 6px 0 8px; }
.stats div { display: grid; padding: 12px 6px; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); }
.stats b { font: 800 19px var(--display); color: var(--gold-text); }
.stats span { font-size: 12.5px; color: var(--muted); }

/* ---------- таблица лидеров ---------- */
.screen-list.is-active { padding-top: 54px; gap: 8px; }
.center { text-align: center; }
.screen-list .muted.center { margin: 0 auto; }
.my-rank {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 4px 10px;
  padding: 12px 14px; border-radius: 18px; margin: 6px 0;
  background: rgba(255, 210, 122, .12); box-shadow: inset 0 0 0 2px var(--gold);
}
.my-rank .btn { grid-column: 1 / -1; }
.my-rank .place { font: 800 20px var(--display); color: var(--gold); text-align: center; }
.my-rank .nm { font-weight: 700; }
.my-rank b { font: 800 18px var(--display); }
.my-rank small { grid-column: 2 / -1; color: var(--muted); font-size: 12.5px; }
.leaders { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.leaders li {
  display: grid; grid-template-columns: 36px 1fr auto; grid-template-areas: 'p n r' 'p s r'; align-items: center; column-gap: 10px;
  padding: 9px 14px; border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line);
}
.leaders li.loading { display: block; text-align: center; color: var(--muted); }
.leaders .place { grid-area: p; font: 800 16px var(--display); color: var(--muted); text-align: center; }
.leaders .nm { grid-area: n; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaders .st { grid-area: s; font-size: 12px; color: var(--muted); }
.leaders .rt { grid-area: r; font: 800 17px var(--display); }
.leaders li.top1 .place { color: #FFD27A; }
.leaders li.top2 .place { color: #DCE3F2; }
.leaders li.top3 .place { color: #E8A774; }
.leaders li.me { box-shadow: inset 0 0 0 2px var(--gold); }

/* ---------- как играть ---------- */
.screen-howto.is-active { gap: 14px; }
.slides { width: 100%; max-width: 380px; min-height: 430px; display: grid; }
.slide { display: grid; justify-items: center; align-content: start; gap: 8px; animation: fade .3s; }
.slide-map { width: 100%; max-width: 330px; height: 230px; overflow: visible; }
.slide .muted { max-width: 36ch; font-size: 15.5px; }
.dots { display: flex; gap: 8px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .22); transition: width .2s, background-color .2s; }
.dots i.on { width: 22px; border-radius: 6px; background: var(--gold); }

/* ---------- всплывающее сообщение ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 22px); z-index: 30; transform: translateX(-50%);
  max-width: min(92vw, 420px); padding: 12px 16px; border-radius: 14px; font-size: 14.5px; font-weight: 600; text-align: center;
  background: #2A2A66; color: var(--text); box-shadow: inset 0 0 0 1px var(--glass-line), 0 16px 40px rgba(5, 3, 25, .55);
  animation: rise-in .25s ease;
}
@keyframes rise-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- экран не двигается и не приближается (0.3) ---------- */
html, body { overscroll-behavior: none; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.in-game { position: fixed; inset: 0; overflow: hidden; touch-action: none; }
body.in-game, body.in-game * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.in-game input, body.in-game textarea { -webkit-user-select: text; user-select: text; }
body.in-game .sheet { touch-action: pan-y; }
/* меньше 16px iPhone приближает поле при фокусе */
input, textarea, select { font-size: max(16px, 1em); }

/* ---------- иконки тем (0.3.1) ---------- */
.ti { --ti-a: #6C5CE0; --ti-b: #F2A23C; --ti-w: #fff; --ti-k: #2C2668; }
.ti .a { fill: var(--ti-a); }
.ti .b { fill: var(--ti-b); }
.ti .bf { fill: var(--ti-b); }
.ti .kf { fill: var(--ti-k); }
.ti .wf { fill: var(--ti-w); }
.ti .w2 { fill: var(--ti-w); opacity: .85; }
.ti .w, .ti .ws { fill: none; stroke: var(--ti-w); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ti .ws { stroke-width: 3.6; }
.ti .w { opacity: .8; }
.ti .k { fill: none; stroke: var(--ti-k); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ti .bs, .ti .as { fill: none; stroke: var(--ti-b); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.ti .as { stroke: var(--ti-a); }
.ti .bt { fill: none; stroke: var(--ti-b); stroke-width: 2.2; stroke-linecap: round; }
.ti.dark { --ti-a: #9C8CFF; --ti-b: #FFD27A; --ti-w: #221C4E; --ti-k: #221C4E; }

/* ---------- лист вопроса: тема, строка атаки, пружина (0.3.1) ---------- */
.sheet { bottom: -14px; padding-bottom: calc(env(safe-area-inset-bottom) + 34px); animation: rise-spring .5s cubic-bezier(.2, .9, .3, 1); }
@keyframes rise-spring { 0% { transform: translateY(100%); } 62% { transform: translateY(-9px); } 82% { transform: translateY(2px); } 100% { transform: none; } }
.cat { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 4px; }
.cat .ti { width: 24px; height: 24px; flex: none; }
.who { gap: 6px; line-height: 1.25; }
.who .w-p { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.who .w-p b { max-width: 9.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .w-p.me b { color: var(--ink-2); }
.who .w-v { color: var(--paper-muted); }
.who.all svg { width: 16px; height: 19px; margin-right: -2px; }
.who.all span { margin-left: 6px; }

/* ---------- раскрытие ответа (0.3.1) ---------- */
.opt { position: relative; }
.opt .marks { display: flex; gap: 6px; margin-left: auto; }
.opt .mk { display: inline-flex; align-items: center; gap: 3px; animation: pop .3s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.opt .mk:nth-child(2) { animation-delay: .08s; }
.opt .mk svg { width: 19px; height: 22px; animation: none; }
.opt .mk small { font-size: 11.5px; font-weight: 600; opacity: .75; font-variant-numeric: tabular-nums; }
.opt.mine::before {
  content: 'вы'; position: absolute; top: -8px; left: 10px; z-index: 1;
  font: 800 10px/1 var(--display); padding: 3px 6px 3px; border-radius: 7px;
  background: var(--ink-2); color: var(--gold);
}
.outcome { margin: 2px 0 0; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.reveal .rows { display: grid; gap: 8px; }
.reveal .row { animation: slide .3s ease both; }
.reveal .row:nth-child(2) { animation-delay: .06s; }
.reveal .row:nth-child(3) { animation-delay: .12s; }
.reveal .row:nth-child(4) { animation-delay: .18s; }
.reveal .row:nth-child(5) { animation-delay: .24s; }
.reveal .row:nth-child(6) { animation-delay: .3s; }
.reveal .row.me .nm { color: var(--ink-2); font-weight: 800; }

/* ---------- шапка игроков (0.3.1) ---------- */
.hud { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.hud[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hud[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pc {
  display: grid; grid-template-rows: auto auto auto; align-content: start; gap: 2px;
  padding: 7px 8px 7px; border-radius: 15px; min-width: 0;
  background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.pc .top { display: flex; align-items: center; gap: 5px; min-width: 0; }
.pc .crest { width: 20px; height: 23px; flex: none; }
.pc .sc { font: 800 16px/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pc .sc.long { font-size: 13px; }
.pc .nm { font-size: 12px; font-weight: 600; color: #DCD7F7; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc .tw { margin-top: 1px; gap: 2.5px; }
.pc .tw i { width: 8px; height: 7px; }
.pc.me { background: rgba(255, 210, 122, .1); box-shadow: inset 0 0 0 1px rgba(255, 210, 122, .38); }
.pc.me .nm { color: var(--gold-text); }
.pc.turn { box-shadow: inset 0 0 0 2px var(--gold), 0 0 14px rgba(255, 210, 122, .28); }
.pc.dead { opacity: .45; }
.pc .done { top: 6px; right: 6px; width: 16px; height: 16px; box-shadow: none; }
.pc .done svg { width: 10px; height: 10px; }
.pc .meta { display: contents; }
.hud[data-n="2"] .pc .crest, .hud[data-n="3"] .pc .crest { width: 24px; height: 28px; }
.hud[data-n="2"] .pc .sc, .hud[data-n="3"] .pc .sc { font-size: 18px; }
.hud[data-n="2"] .pc .nm, .hud[data-n="3"] .pc .nm { font-size: 13px; }
@media (max-width: 370px) {
  .hud[data-n="4"] .pc { padding: 6px 6px; }
  .hud[data-n="4"] .pc .sc { font-size: 14px; }
  .hud[data-n="4"] .pc .sc.long { font-size: 11.5px; }
  .hud[data-n="4"] .pc .crest { width: 17px; height: 20px; }
  .hud[data-n="4"] .pc .nm { font-size: 11px; }
}
.pc.offline .nm::after, .pc.left .nm::after { content: none; }
.pc .st { font-size: 10.5px; font-weight: 700; color: var(--muted); }

/* ---------- игровой экран: карта, полоса земель, лента (0.3.1) ---------- */
.screen-game.is-active { gap: 8px; }
.board-wrap { flex: none; display: block; margin: 0 -12px; padding-top: clamp(4px, calc((100dvh - 700px) * .4 + 6px), 48px); }
.board-box { position: relative; width: 100%; }
/* Новые Chrome применяют выравнивание place-items и к обычным блокам: коробка
   карты сжималась до 300 px (размер SVG по умолчанию). Отсюда «маленькая карта». */
.board-wrap { place-items: normal; justify-items: stretch; }
.board { display: block; width: 100%; max-height: 54dvh; }
.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.lands { display: grid; gap: 6px; padding: 0 2px; }
.lands:empty { display: none; }
.lands .bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 2px; background: rgba(255, 255, 255, .06); }
.lands .bar i { display: block; height: 100%; transition: flex-grow .5s ease; min-width: 0; }
.lands .bar i.free { background: rgba(154, 153, 207, .35); }
.lands .cap { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; font-weight: 700; color: #DCD7F7; }
.lands .cap span { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.lands .cap svg { width: 13px; height: 15px; }
.lands .cap .free { color: var(--muted); font-weight: 600; margin-left: auto; }
.feed { flex: 1 1 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 5px; }
.feed .ev {
  flex: none; display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 6px 10px; border-radius: 12px; font-size: 13px; color: #E4E0FA;
  background: rgba(20, 16, 56, .45); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
  animation: ev-in .35s ease;
}
.feed .ev.old { opacity: .55; }
.feed .ev svg { width: 15px; height: 18px; flex: none; }
.feed .ev span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .ev b { flex: none; font: 800 12px var(--display); color: var(--gold); }
.feed .ev b.bad { color: #FF9E99; }
@keyframes ev-in { from { opacity: 0; transform: translateY(8px); } }
.banner { flex: none; }
.banner-ic.crest-ic { background: rgba(255, 255, 255, .08); }
.banner-ic.crest-ic svg { width: 24px; height: 28px; }

/* ---------- эффекты захвата и штурма (0.3.1) ---------- */
.fx .fx-wave { fill: none; stroke-width: 3.2; transform-box: fill-box; transform-origin: center; animation: fx-wave .8s ease-out both; }
.fx .fx-wave.soft { stroke-width: 2.4; }
.fx .fx-wave.big { stroke-width: 4.5; animation-duration: 1.1s; }
@keyframes fx-wave { 0% { transform: scale(.7); opacity: 1; } 100% { transform: scale(1.55); opacity: 0; } }
.fx .fx-burst path { stroke: #FFD27A; stroke-width: 2.6; stroke-linecap: round; }
.fx .fx-burst { transform-box: fill-box; transform-origin: center; animation: fx-burst .6s .25s ease-out both; }
@keyframes fx-burst { 0% { transform: scale(.4); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }
.fx .fx-flag { animation: fx-flag 1.3s cubic-bezier(.3, .8, .4, 1) both; }
@keyframes fx-flag {
  0% { transform: translateY(-44px); opacity: 0; } 12% { opacity: 1; }
  34% { transform: translateY(0); } 46% { transform: translateY(-5px); } 56% { transform: translateY(0); }
  82% { opacity: 1; } 100% { transform: translateY(0); opacity: 0; }
}
.fx .fx-up { animation: fx-up 1.3s .2s ease-out both; }
.fx .fx-up rect { fill: rgba(20, 16, 56, .9); stroke: rgba(255, 210, 122, .7); stroke-width: 1.2; }
.fx .fx-up text { font: 800 11px var(--display); fill: #FFE4A8; }
.fx .fx-up.bad rect { stroke: rgba(255, 140, 130, .8); }
.fx .fx-up.bad text { fill: #FFB3AE; }
.fx .fx-up.gold rect { fill: #FFD27A; stroke: #C9933A; }
.fx .fx-up.gold text { fill: #2C2668; }
@keyframes fx-up { 0% { transform: translateY(8px); opacity: 0; } 18% { transform: translateY(0); opacity: 1; } 75% { opacity: 1; } 100% { transform: translateY(-12px); opacity: 0; } }
.fx .fx-shield { transform-box: fill-box; transform-origin: center; animation: fx-shield 1.1s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes fx-shield { 0% { transform: scale(.2); opacity: 0; } 30% { transform: scale(1.1); opacity: 1; } 45% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.fx .fx-dust circle { fill: #E6E2F0; }
.fx .fx-dust { transform-box: fill-box; transform-origin: center; animation: fx-dust 1.2s ease-out both; }
@keyframes fx-dust { 0% { transform: scale(.3); opacity: .95; } 100% { transform: scale(1.6); opacity: 0; } }
.fx .fx-crack { fill: none; stroke: #3A335F; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; animation: fx-crack 1.2s ease-out both; }
@keyframes fx-crack { 0% { stroke-dashoffset: 40; opacity: 1; } 30% { stroke-dashoffset: 0; } 70% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.fx .fx-stone { transform-box: fill-box; transform-origin: center; fill: #CFC9E6; animation: fx-stone 1s cubic-bezier(.5, 0, .9, .6) both; }
.fx .fx-stone.s1 { animation-delay: .08s; }
.fx .fx-stone.s2 { animation-delay: .16s; }
@keyframes fx-stone { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx, 6px), 30px) rotate(160deg); opacity: 0; } }
.fx .fx-stone.s0 { --dx: -9px; }
.fx .fx-stone.s2 { --dx: 4px; }

/* ---------- главный экран: плашка беты, карточка гостя (0.3.1) ---------- */
.beta-pill {
  flex: 0 1 auto; min-width: 0; margin: 0 8px; padding: 6px 12px; border-radius: 99px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 12.5px; font-weight: 700; color: var(--gold-text);
  background: rgba(255, 210, 122, .12); box-shadow: inset 0 0 0 1px rgba(255, 210, 122, .35);
}
@media (max-width: 410px) { .beta-pill .beta-more { display: none; } }
.guest-card .me-ava { background: linear-gradient(135deg, #B9B2E3, #8E87BD); }
.guest-card > svg { width: 20px; height: 20px; }

/* ---------- итоги (0.3.1) ---------- */
.screen-over.is-active { gap: 10px; }
.over-head { display: grid; justify-items: center; gap: 4px; }
.over-head .trophy { width: 160px; height: 120px; }
.over-crest { position: relative; width: 76px; height: 88px; margin: 6px 0 4px; }
.over-crest svg { width: 76px; height: 88px; filter: drop-shadow(0 8px 18px rgba(10, 8, 40, .5)); }
.over-crest .place-badge {
  position: absolute; right: -20px; bottom: -2px; font: 800 14px var(--display); padding: 4px 9px; border-radius: 11px;
  background: var(--gold); color: var(--ink-2); box-shadow: 0 3px 0 var(--gold-deep);
}
.over-head .title.big { margin: 2px 0 0; }
.over-head .muted { max-width: 36ch; }
.over-stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; width: 100%; max-width: 380px; }
.over-stats[hidden] { display: none; }
.ost { display: grid; gap: 2px; padding: 10px 6px; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); }
.ost b { font: 800 18px/1.1 var(--display); color: var(--gold-text); white-space: nowrap; }
.ost span { font-size: 12px; color: var(--muted); line-height: 1.2; }
.over-map { width: min(300px, 80vw); height: auto; overflow: visible; margin: 2px 0 -4px; }
.ranking { margin: 4px 0 6px; gap: 7px; }
.ranking li { padding: 9px 14px; }
.ranking li.me:not(.first) { box-shadow: inset 0 0 0 1.5px rgba(255, 210, 122, .5); }
.over-btns { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; width: 100%; max-width: 380px; }
.over-btns .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding-left: 10px; padding-right: 10px; }
.over-btns .btn svg { width: 20px; height: 20px; flex: none; }
.over-btns #shareBtn[hidden] + .btn { grid-column: 1 / -1; }
.over-btns #shareBtn[hidden] { display: none; }

/* лист вопроса выше панели партии, чтобы на низких экранах её не было видно сквозь лист */
.sheet { z-index: 7; }
.game-bar .phase b { white-space: nowrap; }
@media (max-width: 380px) { .game-bar .phase b { font-size: 11.5px; letter-spacing: 0; } .game-bar .phase { padding: 8px 40px 0; } }
.feed { flex-direction: column-reverse; flex-wrap: wrap; justify-content: flex-start; align-content: flex-start; }
.feed .ev { width: 100%; }

/* ---------- раскрытие числового ответа: таблица с полосками (0.3.2) ---------- */
.reveal .nrow { grid-template-columns: 20px 22px minmax(0, 1fr) auto; gap: 9px; padding: 9px 12px; }
.reveal .nrow .pl { font: 800 13px var(--display); color: var(--paper-muted); text-align: center; font-variant-numeric: tabular-nums; }
.reveal .nrow.win .pl { color: #1E8E5E; }
.reveal .nrow.none { opacity: .7; }
.reveal .nrow .mid { min-width: 0; display: grid; gap: 6px; }
.reveal .nrow .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reveal .nrow .val { white-space: nowrap; }
.reveal .with-bars .nrow .mid { gap: 5px; }
.reveal .track { display: block; height: 6px; border-radius: 3px; background: #E4E1F3; overflow: hidden; }
.reveal .track i { display: block; height: 100%; width: var(--w); border-radius: 3px; animation: grow .6s cubic-bezier(.2, .8, .3, 1) backwards; }
@keyframes grow { from { width: 0; } }

/* ---------- партия на широких экранах (0.3.2) ----------
   Включается по форме экрана, а не по конкретным размерам: ширина от 760 px
   и экран шире, чем выше (компьютер, ноутбук, планшет боком).
   Слева игроки, земли и лента, справа карта. Карта вписывается в свою
   ячейку целиком при любом размере окна: SVG растягивается на всю ячейку
   и сам сохраняет пропорции, поэтому вылезти за край или стать
   крошечной она не может. */
@media (min-width: 760px) and (min-aspect-ratio: 5/4) and (min-height: 380px) {
  /* ширина привязана к высоте: на сверхшироких мониторах игра не растягивается в нитку */
  body.in-game .app { max-width: max(1100px, calc(100dvh * 1.9)); padding: 16px 24px; }
  .screen-game.is-active {
    display: grid; height: calc(100dvh - 32px); min-height: 0;
    grid-template-columns: clamp(232px, 24vw, 340px) minmax(0, 1fr);
    grid-template-rows: 44px auto auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "hud   bar"
      "hud   board"
      "team  board"
      "lands board"
      "feed  board"
      "feed  banner";
    gap: 12px 28px;
  }
  .screen-game .hud { grid-area: hud; align-self: start; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .screen-game .hud[data-n="2"], .screen-game .hud[data-n="3"] { grid-template-columns: minmax(0, 1fr); }
  .screen-game .hud[data-n="4"], .screen-game .hud[data-n="5"], .screen-game .hud[data-n="6"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .screen-game .hud[data-n="2"] .pc, .screen-game .hud[data-n="3"] .pc { padding: 10px 12px; }
  .screen-game .teambar { grid-area: team; }
  .screen-game .game-bar { grid-area: bar; align-self: center; }
  .screen-game .board-wrap { grid-area: board; min-height: 0; margin: 0; padding: 0; display: block; }
  .screen-game .board-box { height: 100%; }
  .screen-game .board { width: 100%; height: 100%; max-height: none; }
  .screen-game .lands { grid-area: lands; }
  .screen-game .feed { grid-area: feed; align-self: stretch; }
  .screen-game .banner { grid-area: banner; justify-self: center; width: 100%; max-width: 560px; margin: 0; }
  .sheet { max-width: 600px; padding-left: 24px; padding-right: 24px; }
  .q-text { font-size: 22px; }
}
/* узкое окно на компьютере, планшет стоя: колонка шире телефонной */
@media (min-width: 700px) and (max-aspect-ratio: 5/4) {
  body.in-game .app { max-width: 680px; }
  .screen-game .board { max-height: 60dvh; }
}
/* низкий экран при широком (телефон боком, маленькое окно): лента прячется, карточки плотнее */
@media (min-width: 760px) and (min-aspect-ratio: 5/4) and (min-height: 380px) and (max-height: 560px) {
  body.in-game .app { padding: 10px 18px; }
  .screen-game.is-active { height: calc(100dvh - 20px); gap: 8px 20px; grid-template-rows: 38px auto auto auto minmax(0, 1fr) auto; }
  .screen-game .feed { display: none; }
  .screen-game .hud { gap: 6px; }
  .screen-game .hud .pc { padding: 5px 8px; }
  .screen-game .hud .pc .tw { display: none; }
  .screen-game .banner { min-height: 0; padding: 8px 12px; }
  .screen-game .banner-ic { width: 34px; height: 34px; }
}
