/* Шрифты 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 игроков ---------- */
.hud[data-n="4"] { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hud[data-n="4"] .pc { flex-direction: column; align-items: flex-start; gap: 4px; padding: 7px 8px; }
.hud[data-n="4"] .pc .crest { width: 22px; height: 26px; position: absolute; top: 7px; right: 7px; }
.hud[data-n="4"] .pc .nm { padding-right: 24px; }
.hud[data-n="5"], .hud[data-n="6"] { gap: 6px; }
.hud[data-n="5"] .pc, .hud[data-n="6"] .pc { padding: 6px 8px; }
.hud[data-n="5"] .pc .crest, .hud[data-n="6"] .pc .crest { width: 24px; height: 28px; }
.hud[data-n="5"] .pc .sc, .hud[data-n="6"] .pc .sc { font-size: 14px; }

.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.bot { 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.bot .slot { width: 32px; height: 37px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); font: 800 12px var(--display); color: var(--muted); }
.hud[data-n="2"] { grid-template-columns: repeat(2, 1fr); }
.hud[data-n="4"] .pc .meta { width: 100%; }
.hud[data-n="4"] .pc .nm { padding-right: 26px; }
body[data-screen="room"] .moon, body[data-screen="game"] .moon { display: none; }

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