/* ============================================================
   КИНОРУЛЕТКА — визуальная система
   Тёмная тема · кино + колесо фортуны · энергия 10/10
   ============================================================ */

:root {
  /* — фон/поверхности (тёплый near-black) — */
  --bg:          oklch(0.145 0.012 56);
  --bg-2:        oklch(0.175 0.014 56);
  --surface:     oklch(0.215 0.015 55);
  --surface-2:   oklch(0.255 0.016 55);
  --surface-3:   oklch(0.300 0.017 55);
  --line:        oklch(0.32 0.016 55);
  --line-strong: oklch(0.44 0.020 55);

  /* — текст — */
  --text:        oklch(0.965 0.006 80);
  --text-dim:    oklch(0.74 0.012 75);
  --text-faint:  oklch(0.56 0.012 70);

  /* — акценты — */
  --gold:        oklch(0.83 0.145 80);
  --gold-bright: oklch(0.90 0.150 88);
  --gold-deep:   oklch(0.68 0.130 70);
  --magenta:     oklch(0.68 0.250 350);
  --magenta-2:   oklch(0.62 0.255 345);

  /* — радиусы / тени — */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.35);
  --shadow:    0 12px 36px rgba(0,0,0,.45);
  --shadow-lg: 0 30px 80px rgba(0,0,0,.55);

  /* — типографика — */
  --font-display: "Unbounded", system-ui, sans-serif;
  --font-ui: "Onest", system-ui, sans-serif;

  /* — цвета-метки игроков (равная L/C, варьируем тон) — */
  --p-red:    oklch(0.70 0.185 25);
  --p-amber:  oklch(0.80 0.150 72);
  --p-lime:   oklch(0.80 0.165 138);
  --p-teal:   oklch(0.78 0.115 200);
  --p-blue:   oklch(0.70 0.155 250);
  --p-violet: oklch(0.68 0.180 300);
  --p-pink:   oklch(0.74 0.180 350);
  --p-orange: oklch(0.74 0.170 48);
}

* { box-sizing: border-box; }

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

body {
  /* мягкая киношная виньетка + лёгкое золотое свечение сверху */
  background:
    radial-gradient(120% 80% at 50% -10%, oklch(0.24 0.04 70 / 0.5), transparent 60%),
    radial-gradient(90% 70% at 110% 110%, oklch(0.22 0.06 350 / 0.28), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}

#root { min-height: 100vh; }

::selection { background: var(--gold); color: #1a1410; }

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 16px clamp(18px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: oklch(0.155 0.013 56 / 0.78);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg,
      var(--gold) 0deg 30deg,
      oklch(0.30 0.02 55) 30deg 60deg);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line-strong), 0 0 18px oklch(0.83 0.14 80 / .5);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 38%;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 8px rgba(0,0,0,.5);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: .04em;
  font-size: 18px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* демо-навигация по экранам */
.nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.nav button {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: all .18s ease;
  white-space: nowrap;
}
.nav button:hover { color: var(--text); }
.nav button.active {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line-strong);
}
.nav-spacer { flex: 1; }
.nav-hint {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: .02em;
}

.screen {
  flex: 1;
  padding: clamp(20px, 3.2vw, 48px);
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================
   ОБЩИЕ ЭЛЕМЕНТЫ
   ============================================================ */
.eyebrow {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.h-screen {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 40px);
  letter-spacing: -.01em;
  margin: 6px 0 0;
  line-height: 1.05;
}
.sub {
  color: var(--text-dim);
  font-size: 15px;
  margin-top: 8px;
  max-width: 60ch;
}

/* кнопка КРУТИТЬ — главная энергия */
.btn-spin {
  --c1: var(--gold-bright);
  --c2: var(--gold-deep);
  border: 0;
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #221705;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  border-radius: 999px;
  padding: 18px 40px;
  font-size: 18px;
  box-shadow:
    0 0 0 1px oklch(0.95 0.08 90 / .6) inset,
    0 10px 30px oklch(0.70 0.14 70 / .45),
    0 0 40px oklch(0.80 0.16 75 / .35);
  transition: transform .12s ease, box-shadow .2s ease, filter .2s;
}
.btn-spin:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 0 0 1px oklch(0.95 0.08 90 / .7) inset, 0 16px 40px oklch(0.70 0.14 70 / .55), 0 0 60px oklch(0.80 0.16 75 / .5); }
.btn-spin:active { transform: translateY(0) scale(.98); }
.btn-spin:disabled {
  filter: grayscale(.7) brightness(.6);
  cursor: not-allowed;
  box-shadow: none;
}

.btn {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: all .16s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-faint); }
.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--text); border-color: var(--line-strong); }
.btn-magenta {
  border: 0;
  background: linear-gradient(180deg, var(--magenta), var(--magenta-2));
  color: #fff;
  box-shadow: 0 8px 24px oklch(0.55 0.22 350 / .4), 0 0 0 1px oklch(0.78 0.2 350 /.4) inset;
}
.btn-magenta:hover { filter: brightness(1.08); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* чип игрока */
.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: color-mix(in oklch, var(--pc) 16%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--pc) 45%, transparent);
  color: var(--text);
}
.player-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--pc);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--pc) 30%, transparent), 0 0 10px color-mix(in oklch, var(--pc) 60%, transparent);
  flex: none;
}
.player-dot.sm { width: 11px; height: 11px; }

/* постер-заглушка (жанровый градиент + паттерн) */
.poster {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: end stretch;
  isolation: isolate;
}
.poster .poster-grain {
  position: absolute; inset: 0;
  mix-blend-mode: overlay;
  opacity: .5;
  z-index: 1;
  pointer-events: none;
}
.poster .poster-title {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.01em;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0,0,0,.6);
  padding: 12px;
}
.poster .poster-fade {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,.55) 100%);
}
.poster .poster-genre {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.28);
  backdrop-filter: blur(3px);
  padding: 3px 8px; border-radius: 999px;
}

/* ============================================================
   ЛОББИ
   ============================================================ */
.lobby-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 980px) { .lobby-grid { grid-template-columns: 1fr; } }

.search-wrap { position: relative; }
.search-field {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r);
  padding: 14px 16px;
  transition: border-color .15s, box-shadow .15s;
}
.search-field:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px oklch(0.83 0.14 80 / .14);
}
.search-field input {
  flex: 1; border: 0; background: transparent; color: var(--text);
  font-size: 16px; outline: none;
}
.search-field input::placeholder { color: var(--text-faint); }
.search-icon { color: var(--text-faint); flex: none; }

.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  z-index: 30;
  overflow: hidden;
  max-height: 380px; overflow-y: auto;
}
.suggest-row {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.suggest-row:last-child { border-bottom: 0; }
.suggest-row:hover, .suggest-row.active { background: var(--surface-2); }
.suggest-poster { width: 42px; height: 60px; border-radius: 6px; flex: none; }
.suggest-title { font-weight: 600; font-size: 15px; }
.suggest-meta { color: var(--text-faint); font-size: 13px; margin-top: 2px; }

.field-label {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 700; margin-bottom: 10px;
}

/* выбор владельца */
.owner-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.owner-opt {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--bg-2);
  color: var(--text-dim);
  font-weight: 600; font-size: 13.5px;
  transition: all .14s;
}
.owner-opt:hover { color: var(--text); }
.owner-opt.sel {
  border-color: color-mix(in oklch, var(--pc) 70%, transparent);
  background: color-mix(in oklch, var(--pc) 18%, var(--surface));
  color: var(--text);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--pc) 14%, transparent);
}
.owner-opt.add { border-style: dashed; }

/* список фильмов */
.film-list { display: flex; flex-direction: column; gap: 10px; }
.film-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--pc);
  border-radius: var(--r);
  padding: 10px 14px 10px 12px;
  transition: transform .14s, box-shadow .14s;
  animation: rowIn .32s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rowIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.film-row:hover { transform: translateX(2px); box-shadow: var(--shadow-sm); }
.film-row .rp { width: 40px; height: 58px; border-radius: 6px; flex: none; }
.film-row .ft { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.film-row .fm { color: var(--text-faint); font-size: 13px; margin-top: 3px; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.film-row > div { min-width: 0; }
.film-row .rm { margin-left: auto; color: var(--text-faint); background: transparent; border: 0; padding: 8px; border-radius: 8px; }
.film-row .rm:hover { color: var(--p-red); background: oklch(0.70 0.18 25 / .12); }

.count-pill {
  font-family: var(--font-display); font-weight: 700;
  font-size: 13px; color: var(--gold);
}

.limit-row { display: flex; align-items: center; gap: 14px; }
.stepper { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.stepper button { border: 0; background: var(--surface); color: var(--text); width: 38px; height: 38px; font-size: 18px; }
.stepper button:hover { background: var(--surface-2); }
.stepper .val { min-width: 44px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* мини-аватары стопкой */
.avatars { display: flex; }
.avatars .av {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--bg);
  margin-left: -8px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #1a1410;
}
.avatars .av:first-child { margin-left: 0; }

/* ============================================================
   КОЛЕСО
   ============================================================ */
.wheel-screen { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
@media (max-width: 1100px) { .wheel-screen { grid-template-columns: 1fr; } }

.wheel-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 12px;
  min-height: 60vh;
}
.wheel-halo {
  position: absolute; width: min(74vh, 760px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, oklch(0.80 0.16 75 / .12), transparent 62%);
  filter: blur(8px); pointer-events: none;
}
.wheel-holder { position: relative; width: var(--wheel-size, min(70vh, 720px)); max-width: 100%; aspect-ratio: 1; transition: width .6s cubic-bezier(.16,1,.3,1); }
.wheel-svg { width: 100%; height: 100%; display: block; transform: rotate(0deg); will-change: transform; }
.wheel-svg.spinning { transition: transform 5.2s cubic-bezier(.12,.62,.12,1); }

/* лампочки по ободу */
.wheel-bulbs { position: absolute; inset: 0; pointer-events: none; }
.bulb {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 8px 2px oklch(0.85 0.15 82 / .8);
  transform: translate(-50%, -50%);
}
.bulb.off { background: oklch(0.42 0.04 70); box-shadow: none; }

/* указатель */
.wheel-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  z-index: 6; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6));
}
/* центральная ступица */
.wheel-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 17%; height: 17%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--surface-3), var(--bg-2));
  border: 2px solid var(--line-strong);
  box-shadow: 0 0 0 5px var(--bg), 0 0 24px rgba(0,0,0,.6), 0 0 30px oklch(0.83 0.14 80 /.3);
  display: grid; place-items: center; z-index: 5;
  font-family: var(--font-display); font-weight: 700; color: var(--gold);
  font-size: clamp(10px, 1.6vh, 16px);
  text-align: center; line-height: 1;
}

.wheel-side { display: flex; flex-direction: column; gap: 16px; }
.remaining-list { display: flex; flex-direction: column; gap: 7px; max-height: 42vh; overflow-y: auto; padding-right: 4px; }
.remaining-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-left: 3px solid var(--pc);
  font-size: 13.5px;
  transition: opacity .4s, filter .4s, transform .4s;
}
.remaining-row .idx { font-family: var(--font-display); font-weight: 700; color: var(--text-faint); font-size: 12px; width: 18px; }
.remaining-row.out { opacity: .32; filter: grayscale(.8); transform: translateX(6px); }
.remaining-row.out .rname { text-decoration: line-through; }
.rname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* тост выбывания */
.toast-wrap { position: fixed; left: 50%; top: 78px; transform: translateX(-50%); z-index: 80; pointer-events: none; }
.toast-out {
  display: flex; align-items: center; gap: 14px;
  background: oklch(0.20 0.02 350 / .92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--magenta);
  border-radius: 999px;
  padding: 12px 22px 12px 16px;
  box-shadow: 0 16px 50px oklch(0.5 0.2 350 / .4), 0 0 0 1px oklch(0.7 0.2 350 /.3) inset;
  animation: toastIn .5s cubic-bezier(.2,.9,.2,1) both;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.92); } to { opacity: 1; transform: none; } }
.toast-out .tlabel { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--magenta); font-weight: 800; }
.toast-out .tname { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.toast-poster { width: 34px; height: 48px; border-radius: 6px; flex: none; }

/* переключатели вида колеса */
.seg {
  display: inline-flex; gap: 3px; padding: 3px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
}
.seg button {
  border: 0; background: transparent; color: var(--text-dim);
  padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13px;
  transition: all .14s; white-space: nowrap;
}
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button:hover { color: var(--text); }

.control-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.control-card .ctitle { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }

/* ============================================================
   ПОБЕДА
   ============================================================ */
.win-screen { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 48px; align-items: center; min-height: 70vh; }
@media (max-width: 900px) { .win-screen { grid-template-columns: 1fr; gap: 28px; } }
.win-poster {
  aspect-ratio: 2/3; border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--line), 0 0 80px oklch(0.80 0.14 75 / .25);
  animation: winPop .7s cubic-bezier(.16,1,.3,1) both;
}
@keyframes winPop { from { opacity: 0; transform: scale(.9) translateY(20px); } to { opacity: 1; transform: none; } }
.win-meta .eyebrow { animation: winFade .6s .15s both; }
.win-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(36px, 5vw, 68px); line-height: .98; letter-spacing: -.02em;
  margin: 10px 0 4px;
  background: linear-gradient(180deg, var(--text), oklch(0.82 0.05 80));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: winFade .6s .22s both;
}
@keyframes winFade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.win-year { color: var(--text-dim); font-size: 20px; font-weight: 600; }
.win-tagline { color: var(--text-dim); font-size: 16px; max-width: 52ch; margin: 16px 0 24px; line-height: 1.5; animation: winFade .6s .3s both; }
.win-by { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; animation: winFade .6s .36s both; }

.watch-block { animation: winFade .6s .44s both; }
.watch-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.watch-link {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line-strong);
  text-decoration: none; color: var(--text); font-weight: 600; font-size: 14px;
  transition: all .15s;
}
.watch-link:hover { background: var(--surface-2); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.watch-logo { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 13px; font-family: var(--font-display); color: #1a1410; }
.watch-link .price { color: var(--text-faint); font-size: 12.5px; font-weight: 500; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; width: 9px; height: 14px; border-radius: 2px; top: -20px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .2; } }

.win-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; animation: winFade .6s .52s both; }

/* ============================================================
   ИСТОРИЯ
   ============================================================ */
.history-list { display: flex; flex-direction: column; gap: 14px; }
.history-card {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 18px; align-items: center;
  padding: 16px 20px;
}
@media (max-width: 720px) { .history-card { grid-template-columns: 56px 1fr; } .history-card .hc-right { grid-column: 1 / -1; } }
.history-card .hc-poster { width: 56px; height: 80px; border-radius: 8px; }
.hc-date { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
.hc-win { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin: 3px 0 8px; }
.hc-films { display: flex; flex-wrap: wrap; gap: 6px; }
.hc-film {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-left: 3px solid var(--pc); color: var(--text-dim);
  white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.hc-film.winner { color: var(--gold); border-color: var(--gold); background: oklch(0.83 0.14 80 /.08); }
.hc-right { display: flex; align-items: center; gap: 18px; }
.hc-players { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.hc-players span { white-space: nowrap; }

.history-empty { text-align: center; padding: 80px 20px; color: var(--text-faint); }

/* ============================================================
   ДИЗАЙН-СИСТЕМА
   ============================================================ */
.ds-section { margin-bottom: 44px; }
.ds-section h3 { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin: 0 0 4px; }
.ds-section .ds-note { color: var(--text-dim); font-size: 14px; margin: 0 0 20px; }
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.swatch { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.swatch .chip { height: 72px; }
.swatch .info { padding: 10px 12px; background: var(--surface); }
.swatch .sname { font-weight: 600; font-size: 13px; }
.swatch .sval { font-size: 11px; color: var(--text-faint); font-family: ui-monospace, monospace; margin-top: 2px; }

.type-row { padding: 18px 0; border-bottom: 1px solid var(--line); }
.type-row:last-child { border: 0; }
.type-spec { font-size: 12px; color: var(--text-faint); font-family: ui-monospace, monospace; margin-top: 6px; }

.player-legend { display: flex; flex-wrap: wrap; gap: 10px; }

/* ============================================================
   ПРОЧЕЕ
   ============================================================ */
.empty-hint {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r);
  padding: 28px; text-align: center; color: var(--text-faint);
  font-size: 14px;
}
.scrollbars-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scrollbars-thin::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.scrollbars-thin::-webkit-scrollbar-track { background: transparent; }

.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }

/* ============================================================
   ЕДИНЫЙ ЭКРАН «ИГРА» (setup → play)
   ============================================================ */
.game {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}
.game-controls {
  flex: 0 0 460px;
  min-width: 0;
  transition: flex-basis .55s cubic-bezier(.16,1,.3,1), opacity .35s ease, transform .5s cubic-bezier(.16,1,.3,1), margin .55s;
  overflow: hidden;
}
.game[data-phase="play"] .game-controls {
  flex-basis: 0;
  opacity: 0;
  transform: translateX(-40px);
  margin-right: -36px;
  pointer-events: none;
}
.game-stage {
  flex: 1;
  min-width: 0;
  --wheel-size: clamp(280px, 38vw, 440px);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: --wheel-size .6s;
}
.game[data-phase="play"] .game-stage {
  --wheel-size: min(72vh, 760px);
}

.stage-top {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 4px;
}
.stage-back { border-radius: 999px; padding: 9px 16px; font-size: 13px; }
.stage-variants { margin-left: auto; }
.stage-variants button { width: 36px; padding: 7px 0; text-align: center; font-family: var(--font-display); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 17px; display: grid; place-items: center;
  transition: all .15s;
}
.icon-btn:hover { background: var(--surface-2); transform: translateY(-1px); }

.game .wheel-stage { min-height: auto; padding: 8px 0; width: 100%; }
.wheel-empty-hint {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, calc(-50% + 8px));
  color: var(--text-faint); font-size: 14px; font-weight: 600;
  pointer-events: none; text-align: center; max-width: 60%;
}

.stage-cta {
  margin-top: 20px;
  min-height: 64px;
  display: flex; align-items: center; justify-content: center;
}
.start-btn {
  position: relative;
  font-size: 20px;
  padding: 20px 56px;
  animation: ctaGlow 2.6s ease-in-out infinite;
}
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 0 0 1px oklch(0.95 0.08 90 /.6) inset, 0 10px 30px oklch(0.70 0.14 70 /.45), 0 0 40px oklch(0.80 0.16 75 /.30); }
  50% { box-shadow: 0 0 0 1px oklch(0.95 0.08 90 /.7) inset, 0 14px 38px oklch(0.70 0.14 70 /.55), 0 0 64px oklch(0.80 0.16 75 /.55); }
}

@media (max-width: 1080px) {
  .game { flex-direction: column; }
  .game-controls { flex-basis: auto; width: 100%; }
  .game[data-phase="play"] .game-controls { flex-basis: 0; height: 0; margin: 0; }
  .game-stage { width: 100%; --wheel-size: min(64vh, 520px); }
}

/* ——— Реальные постеры (Rails-интеграция): прототип рисовал постеры фоном,
       в приложении внутри .poster лежит настоящий <img> с TMDB ——— */
.poster > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* hidden-атрибут должен работать даже там, где display задан автор-стилем
   (.seg, инлайновый display у кнопок) — иначе setup/play-элементы видны разом */
[hidden] { display: none !important; }

/* в setup панель развёрнута — не клипаем выпадашку поиска
   (overflow:hidden нужен только для анимации сворачивания в play) */
.game[data-phase="setup"] .game-controls { overflow: visible; }

/* play-фаза: всё умещается во вьюпорт, без скролла.
   Колесо сайзится от доступной высоты: вычитаем хром страницы
   (топбар ~70 + паддинги .screen ~92 + stage-top 44 + CTA ~84 ≈ 300). */
.game[data-phase="play"] .game-stage {
  --wheel-size: min(calc(100dvh - 310px), 72vh, 760px);
}
body:has(.game[data-phase="play"]) { overflow: hidden; }
