/* ─────────────────────────────────────────────────────────── шрифты */
@font-face {
  font-family: 'Unbounded';
  src: url('/fonts/unbounded-latin.woff2') format('woff2');
  font-weight: 600 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122, U+2212;
}
@font-face {
  font-family: 'Unbounded';
  src: url('/fonts/unbounded-cyrillic.woff2') format('woff2');
  font-weight: 600 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JBMono';
  src: url('/fonts/jbmono-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: 'JBMono';
  src: url('/fonts/jbmono-cyrillic.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ─────────────────────────────────────────────────────────── токены */
:root {
  --bg: #100f0d;
  --bg-2: #191713;
  --bg-3: #221f1a;
  --line: rgba(245, 241, 232, 0.09);
  --line-2: rgba(245, 241, 232, 0.16);

  --tx: #f5f1e8;
  --tx-2: rgba(245, 241, 232, 0.6);
  --tx-3: rgba(245, 241, 232, 0.34);

  --acc: #e0a32e;
  --acc-dim: rgba(224, 163, 46, 0.16);
  --acc-line: rgba(224, 163, 46, 0.42);
  --bad: #d8503e;
  --ok: #7bab5c;

  --r-s: 10px;
  --r-m: 18px;
  --r-l: 26px;

  --sp: clamp(14px, 4vw, 20px);
  --ease: cubic-bezier(0.2, 0.8, 0.25, 1);
  --dur: 0.28s;

  --display: 'Unbounded', system-ui, sans-serif;
  --mono: 'JBMono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

/* display в классах перебивает браузерное правило для [hidden] — возвращаем приоритет */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  min-height: 100dvh;
  /* тёплое свечение сверху — единственный фирменный эффект фона */
  background-image: radial-gradient(120% 70% at 50% -10%, rgba(224, 163, 46, 0.11), transparent 62%);
  background-attachment: fixed;
}

input, button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }

.label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tx-3);
  margin: 0;
}

.num { font-variant-numeric: tabular-nums; }

/* ─────────────────────────────────────────────────────────── экраны */
.screen { display: none; }
.screen[data-active] { display: block; }

.screen--pad {
  width: min(560px, 100%);
  margin-inline: auto;
  padding: calc(var(--sp) + env(safe-area-inset-top)) var(--sp) calc(var(--sp) + env(safe-area-inset-bottom));
}

/* ─────────────────────────────────────────────────────────── загрузка */
.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
}
.boot__chip {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px dashed var(--acc-line);
  border-top-color: var(--acc);
  animation: spin 1.6s linear infinite;
}
.boot__text { color: var(--tx-2); font-size: 13px; margin: 0; text-align: center; padding-inline: 24px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────────────────── старт */
.intro { padding: 6vh 0 clamp(24px, 6vh, 44px); }
.intro__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(38px, 13vw, 62px);
  line-height: 0.88;
  letter-spacing: -0.03em;
  margin: 10px 0 0;
}
.intro__title span { color: var(--acc); }
.intro__sub { color: var(--tx-2); font-size: 13.5px; margin: 16px 0 0; max-width: 30ch; }

.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: clamp(18px, 5vw, 24px);
  margin-bottom: 14px;
}
.panel--quiet { background: transparent; }
.panel__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

.field-row { display: flex; gap: 10px; margin-bottom: 12px; }
.field-row--2 > * { flex: 1 1 0; min-width: 0; }
.field { display: block; flex: 1; }
.field > span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tx-3);
  margin-bottom: 7px;
}
.field input,
.code-input,
.sheet input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  padding: 12px 14px;
  font-size: 17px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color var(--dur) var(--ease);
}
.field input:focus,
.code-input:focus,
.sheet input:focus { border-color: var(--acc-line); }

.join-row { display: flex; gap: 10px; }
.code-input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  text-align: center;
  font-family: var(--display);
  font-weight: 600;
}

.hint { color: var(--tx-3); font-size: 11.5px; margin: 12px 0 0; }

/* ─────────────────────────────────────────────────────────── кнопки */
.btn {
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--tx);
  border-radius: var(--r-s);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform 0.12s var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease), opacity var(--dur);
}
.btn:active { transform: scale(0.975); }
.btn:disabled { opacity: 0.38; pointer-events: none; }
.btn--big { width: 100%; padding: 15px 18px; font-size: 15px; }
.btn--primary {
  background: var(--acc);
  border-color: var(--acc);
  color: #14110a;
  font-weight: 700;
}
.btn--ghost { background: transparent; }
.btn--danger { color: var(--bad); border-color: rgba(216, 80, 62, 0.35); background: rgba(216, 80, 62, 0.08); }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--tx-2);
  padding: 0;
  transition: color var(--dur), border-color var(--dur), transform 0.12s var(--ease);
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 19px; height: 19px; stroke-linecap: round; stroke-linejoin: round; }

/* ─────────────────────────────────────────────────────────── топбар */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(16px, 5vw, 26px);
}
.topbar__id { min-width: 0; }
.topbar__id .code {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.14em;
  margin: 3px 0 0;
}
.topbar__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────── банк */
.pot { text-align: center; padding: clamp(6px, 3vw, 18px) 0 clamp(14px, 4vw, 22px); }
.pot__label { font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--acc); margin: 0 0 10px; }
.pot__value {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(46px, 17vw, 76px);
  line-height: 0.9;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  margin: 0;
  transition: color var(--dur) var(--ease);
}
.pot__value.is-bump { animation: bump 0.42s var(--ease); }
@keyframes bump {
  0% { transform: scale(1); }
  38% { transform: scale(1.055); color: var(--acc); }
  100% { transform: scale(1); }
}
.pot__meta { font-size: 11px; color: var(--tx-3); margin: 10px 0 0; letter-spacing: 0.06em; }

.turnline {
  text-align: center;
  font-size: 12px;
  color: var(--tx-2);
  border: 1px dashed var(--line-2);
  border-radius: 999px;
  padding: 8px 14px;
  margin-bottom: 14px;
}
.turnline--mine {
  color: var(--acc);
  border-color: var(--acc-line);
  border-style: solid;
  background: var(--acc-dim);
}

/* ─────────────────────────────────────────────────────────── игроки */
.players-wrap { position: relative; }
.players { display: flex; flex-direction: column; gap: 7px; }

/* маркер хода — единственный элемент, который «ездит» по столу */
.turn-dot {
  position: absolute;
  left: -7px;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 0 4px rgba(224, 163, 46, 0.16), 0 0 18px rgba(224, 163, 46, 0.55);
  transition: transform 0.46s var(--ease), opacity 0.24s var(--ease);
  pointer-events: none;
  z-index: 2;
}
.turn-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--acc-line);
  animation: dot-pulse 1.9s ease-out infinite;
}
@keyframes dot-pulse {
  0% { transform: scale(0.8); opacity: 0.9; }
  70% { transform: scale(2.1); opacity: 0; }
  100% { transform: scale(2.1); opacity: 0; }
}

/* фишка, улетающая в банк */
.chip-fly {
  position: fixed;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 12px rgba(224, 163, 46, 0.6);
  z-index: 45;
  pointer-events: none;
  will-change: transform, opacity;
}

/* вспышка на карточке при изменении банка игрока */
.pl.is-up { animation: flash-up 0.7s var(--ease); }
.pl.is-down { animation: flash-down 0.7s var(--ease); }
@keyframes flash-up {
  0% { box-shadow: inset 0 0 0 1px transparent; background-color: rgba(123, 171, 92, 0.16); }
  100% { background-color: transparent; }
}
@keyframes flash-down {
  0% { background-color: rgba(216, 80, 62, 0.14); }
  100% { background-color: transparent; }
}
.pl__delta {
  position: absolute;
  right: 14px;
  top: 4px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ok);
  animation: delta-rise 1.1s var(--ease) forwards;
  pointer-events: none;
}
.pl__delta--minus { color: var(--bad); }
@keyframes delta-rise {
  0% { opacity: 0; transform: translateY(6px); }
  22% { opacity: 1; transform: translateY(0); }
  75% { opacity: 1; transform: translateY(-6px); }
  100% { opacity: 0; transform: translateY(-12px); }
}

.pl {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px 11px 11px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  position: relative;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), opacity var(--dur);
}
.pl--turn {
  border-color: var(--acc-line);
  background: linear-gradient(90deg, var(--acc-dim), transparent 55%), var(--bg-2);
}
.pl--turn::before {
  content: '';
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--acc);
}
.pl--folded { opacity: 0.42; }
.pl--out { opacity: 0.3; }

.ava {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  color: var(--tx-2);
  overflow: hidden;
  flex-shrink: 0;
}
.ava img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: var(--bg-3);
}
.ava--s { width: 26px; height: 26px; font-size: 11px; }
.ava--m { width: 30px; height: 30px; font-size: 12px; }
.ava--xl {
  width: 78px; height: 78px;
  font-family: var(--display);
  font-size: 27px;
  border-color: var(--acc-line);
  color: var(--acc);
}

.pl__mid { min-width: 0; }
.pl__name {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pl__sub { font-size: 10.5px; color: var(--tx-3); margin-top: 2px; letter-spacing: 0.04em; }
.pl__sub b { color: var(--acc); font-weight: 500; }

.pl__right { text-align: right; }
.pl__stack {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.pl__bet {
  font-size: 11px;
  color: var(--acc);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  min-height: 15px;
}

.tag {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  color: var(--tx-3);
  flex-shrink: 0;
}
.tag--d { color: var(--tx); border-color: var(--line-2); background: var(--bg-3); }
.tag--me { color: var(--acc); border-color: var(--acc-line); }
.tag--off { color: var(--tx-3); }

/* ─────────────────────────────────────────────────────────── вскрытие */
.showdown {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--acc-line);
  border-radius: var(--r-l);
  background: var(--acc-dim);
}
.showdown__title { font-family: var(--display); font-weight: 600; font-size: 15px; margin: 0; }
.showdown__hint { font-size: 11.5px; color: var(--tx-2); margin: 6px 0 14px; }
.showdown__list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.showdown__item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-s);
  background: var(--bg-2);
  font-size: 13.5px;
  transition: border-color var(--dur), background var(--dur);
}
.showdown__item[aria-pressed='true'] { border-color: var(--acc); background: var(--bg-3); color: var(--acc); }
.showdown__item--win { border-color: var(--acc); color: var(--acc); }

/* ─────────────────────────────────────────────────────────── история */
.logbox { margin-top: 18px; }
.logbox__toggle {
  background: none; border: none; padding: 4px 0;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--tx-3);
}
.logbox__list { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.logbox__list li { font-size: 11.5px; color: var(--tx-2); display: flex; gap: 8px; }
.logbox__list li span { color: var(--tx-3); flex-shrink: 0; font-variant-numeric: tabular-nums; }

.spacer { height: 130px; }

/* ─────────────────────────────────────────────────────────── док */
.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: min(560px, 100%);
  margin-inline: auto;
  padding: 12px var(--sp) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 62%, rgba(16, 15, 13, 0));
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.dock:empty { display: none; }
.dock__row { display: flex; gap: 8px; }
.dock__row > * { flex: 1 1 0; min-width: 0; }
.dock__note { text-align: center; font-size: 11.5px; color: var(--tx-3); }

.act {
  padding: 15px 8px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.12s var(--ease), background var(--dur), border-color var(--dur);
}
.act:active { transform: scale(0.97); }
.act small { font-size: 10.5px; color: var(--tx-3); font-variant-numeric: tabular-nums; }
.act--fold { color: var(--bad); border-color: rgba(216, 80, 62, 0.3); }
.act--call { border-color: var(--line-2); }
.act--call small { color: var(--tx-2); }
.act--raise { background: var(--acc); border-color: var(--acc); color: #14110a; font-weight: 700; }
.act--raise small { color: rgba(20, 17, 10, 0.6); }
.act:disabled { opacity: 0.35; pointer-events: none; }

/* ─────────────────────────────────────────────────────────── шторка */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; }
.sheet__scrim {
  position: absolute; inset: 0;
  background: rgba(8, 7, 6, 0.72);
  backdrop-filter: blur(3px);
  animation: fade var(--dur) var(--ease);
}
.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: min(560px, 100%);
  margin-inline: auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r-l) var(--r-l) 0 0;
  padding: 10px var(--sp) calc(var(--sp) + env(safe-area-inset-bottom));
  max-height: 88dvh;
  overflow-y: auto;
  animation: rise 0.32s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(14%); opacity: 0; } }
.sheet__grip {
  width: 34px; height: 4px; border-radius: 2px;
  background: var(--line-2);
  margin: 0 auto 16px;
}
.sheet h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.sheet p.sub { font-size: 12px; color: var(--tx-2); margin: 0 0 18px; }
.sheet p.sub.is-bump { animation: sub-bump 0.4s var(--ease); }
@keyframes sub-bump {
  0% { color: var(--acc); transform: scale(1.04); transform-origin: left center; }
  100% { color: var(--tx-2); transform: scale(1); }
}
.sheet .row { display: flex; gap: 8px; margin-bottom: 8px; }
.sheet .row > * { flex: 1 1 0; min-width: 0; }
.sheet .stack-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 8px; }

.invite {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-3);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-s);
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 11.5px;
  color: var(--tx-2);
  word-break: break-all;
}
.big-code {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 12vw, 48px);
  letter-spacing: 0.16em;
  text-align: center;
  color: var(--acc);
  margin: 4px 0 16px;
}

.slider-wrap { margin: 4px 0 14px; }
.slider-val {
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  margin: 0 0 12px;
}
input[type='range'] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 28px;
  background: transparent;
  outline: none;
  padding: 0;
  margin: 0;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--acc) var(--fill, 0%), var(--line-2) var(--fill, 0%));
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--acc);
  border: 4px solid var(--bg-2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
input[type='range']::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--acc) var(--fill, 0%), var(--line-2) var(--fill, 0%));
}
input[type='range']::-moz-range-thumb {
  width: 20px; height: 20px; border: 4px solid var(--bg-2);
  border-radius: 50%; background: var(--acc);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.stepper .slider-val { flex: 1; margin: 0; }
.stepper__btn {
  width: 46px; height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--tx);
  font-size: 22px;
  line-height: 1;
  padding: 0;
  transition: transform 0.12s var(--ease), border-color var(--dur);
}
.stepper__btn:active { transform: scale(0.92); border-color: var(--acc-line); }

.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.chips button {
  flex: 1 1 66px;
  padding: 8px 6px;
  font-size: 11px;
  line-height: 1.35;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--tx-2);
}
.chips button span { color: var(--tx); font-size: 12px; font-weight: 500; }
.chips button:active { background: var(--bg-3); }
.chips button[data-allin] { border-color: var(--acc-line); color: var(--acc); }
.chips button[data-allin] span { color: var(--acc); }

.menu-list { display: flex; flex-direction: column; gap: 6px; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: var(--bg-3);
  font-size: 13.5px;
  text-align: left;
  transition: border-color var(--dur), transform 0.12s var(--ease);
}
.menu-item:active { transform: scale(0.985); }
.menu-item em { font-style: normal; color: var(--tx-3); font-size: 11.5px; }
.menu-item--danger { color: var(--bad); }

/* ─────────────────────────────────────────────────────────── лобби */
.teaser {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}
.teaser li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--tx-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
}
.teaser__icon { font-size: 13px; }

.crew { margin-bottom: 16px; }
.crew__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.linkbtn {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--acc);
}
.crew__list { display: flex; flex-direction: column; gap: 6px; }
.crew__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 13.5px;
}
.crew__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.adult-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--bg-2);
}
.adult-row__title { margin: 0; font-size: 13.5px; font-weight: 500; }
.adult-row__sub { margin: 3px 0 0; font-size: 11px; color: var(--tx-3); }
.switch {
  width: 50px; height: 29px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  padding: 3px;
  flex-shrink: 0;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.switch span {
  display: block;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--tx-3);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.switch--on { background: var(--acc-dim); border-color: var(--acc-line); }
.switch--on span { transform: translateX(21px); background: var(--acc); }

.games { display: flex; flex-direction: column; gap: 8px; }
.gamecard {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  text-align: left;
  transition: border-color var(--dur) var(--ease), transform 0.12s var(--ease), background var(--dur);
}
.gamecard:active { transform: scale(0.985); border-color: var(--acc-line); }
.gamecard--off { opacity: 0.45; }
.gamecard__icon {
  font-size: 24px;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.gamecard__body { display: block; min-width: 0; }
.gamecard__title { display: block; font-family: var(--display); font-weight: 600; font-size: 14px; }
.gamecard__title em { font-style: normal; color: var(--acc); font-size: 11px; }
.gamecard__tag { display: block; font-size: 12px; color: var(--tx-2); margin-top: 3px; }
.gamecard__meta { display: block; font-size: 10.5px; color: var(--tx-3); margin-top: 4px; letter-spacing: 0.04em; }

/* ─────────────────────────────────────────────────────────── карты */
.card {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  padding: 7px 6px;
  border-radius: 8px;
  background: #f4f1e8;
  color: #16130f;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}
.card--red { color: #b8302a; }
.card--back {
  background: linear-gradient(135deg, #2a2620, #191712);
  border: 1px solid var(--line-2);
  color: transparent;
  min-height: 29px;
}
.card--xs { min-width: 24px; font-size: 11px; padding: 4px 4px; border-radius: 6px; }
.card--lg { min-width: 52px; font-size: 24px; padding: 14px 10px; border-radius: 12px; }

.board {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-bottom: 16px;
  animation: fade 0.4s var(--ease);
}
.mini-cards { display: inline-flex; gap: 4px; margin-top: 6px; }

.myhand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--acc-line);
  border-radius: var(--r-m);
  background: var(--acc-dim);
}
.myhand__cards { display: flex; gap: 8px; }
.myhand__name { font-family: var(--display); font-weight: 600; font-size: 15px; margin: 4px 0 0; }
.myhand__name--dim { color: var(--tx-3); font-weight: 500; }

/* ─────────────────────────────────────────────── правда или действие */
.td { text-align: center; padding: 10px 0 4px; }
.td__who { display: grid; justify-items: center; gap: 10px; margin: 14px 0 18px; }
.td__name { font-family: var(--display); font-weight: 600; font-size: 17px; margin: 0; }
.td__card {
  border: 1px solid var(--line-2);
  border-radius: var(--r-l);
  background: var(--bg-2);
  padding: 24px 20px;
  min-height: 148px;
  display: grid;
  align-content: center;
  gap: 12px;
  animation: card-in 0.4s var(--ease);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}
.td__card--truth { border-color: var(--acc-line); background: linear-gradient(180deg, var(--acc-dim), var(--bg-2)); }
.td__card--dare { border-color: rgba(216, 80, 62, 0.4); background: linear-gradient(180deg, rgba(216, 80, 62, 0.12), var(--bg-2)); }
.td__card--empty { border-style: dashed; }
.td__kind { font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--acc); margin: 0; }
.td__card--dare .td__kind { color: #e8836f; }
.td__text { font-size: 17px; line-height: 1.4; margin: 0; }
.td__text--dim { color: var(--tx-3); font-size: 14px; }

.scoreline { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.scoreline__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12.5px;
}
.scoreline__item--now { border-color: var(--acc-line); background: var(--acc-dim); }
.scoreline__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoreline__val { color: var(--tx-2); font-variant-numeric: tabular-nums; }

.act--truth { background: var(--acc); border-color: var(--acc); color: #14110a; font-weight: 700; }
.act--dare { background: #c14b3a; border-color: #c14b3a; color: #fff5f2; font-weight: 700; }

/* ─────────────────────────────────────────────────────────── алиас */
.teams { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.team {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--bg-2);
}
.team--now { border-color: var(--acc-line); background: linear-gradient(90deg, var(--acc-dim), var(--bg-2) 60%); }
.team--win { border-color: var(--acc); }
.team__name { margin: 0; font-family: var(--display); font-weight: 600; font-size: 14px; }
.team__people { margin: 3px 0 0; font-size: 11px; color: var(--tx-3); }
.team__score { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -0.03em; }

.alias-play { text-align: center; padding: 12px 0 6px; }
.alias-timer {
  font-family: var(--display);
  font-weight: 800;
  font-size: 42px;
  letter-spacing: -0.03em;
  margin: 0;
  transition: color var(--dur);
}
.alias-timer.is-hot { color: var(--bad); animation: pulse-hot 1s infinite; }
@keyframes pulse-hot { 50% { opacity: 0.55; } }
.alias-word {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 9vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 14px 0 8px;
  animation: card-in 0.3s var(--ease);
}
.alias-word--hidden { color: var(--tx-3); font-size: 15px; font-weight: 500; font-family: var(--mono); letter-spacing: 0; }
.alias-round { font-size: 12px; color: var(--tx-3); margin: 0; }
.alias-ready { text-align: center; padding: 6px 0; }

.wordlist { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }
.wordlist li { font-size: 12.5px; color: var(--tx-2); }
.wordlist li.miss { color: var(--tx-3); text-decoration: line-through; }

/* ─────────────────────────────────────────────────────────── бункер */
.bunker-head {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--bg-2);
  margin-bottom: 12px;
}
.bunker-text { margin: 6px 0 0; font-size: 13px; line-height: 1.45; }

.phase-line {
  text-align: center;
  font-size: 12.5px;
  color: var(--tx-2);
  border: 1px dashed var(--line-2);
  border-radius: 999px;
  padding: 9px 14px;
  margin-bottom: 14px;
}

.bunker-list { display: flex; flex-direction: column; gap: 8px; }
.bcard {
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--bg-2);
  padding: 12px 14px;
  transition: border-color var(--dur), opacity var(--dur);
}
.bcard--turn { border-color: var(--acc-line); }
.bcard--out { opacity: 0.42; }
.bcard__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13.5px; }
.bcard__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.traits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 5px; }
.trait {
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--bg-3);
  border: 1px solid transparent;
  font-size: 11.5px;
}
.trait--open { border-color: var(--line); }
.trait--mine-hidden { border: 1px dashed var(--acc-line); cursor: pointer; }
.trait--mine-hidden:active { background: var(--acc-dim); }
.trait__title { display: block; font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--tx-3); }
.trait__val { display: block; margin-top: 3px; color: var(--tx); line-height: 1.35; }
.trait:not(.trait--open) .trait__val { color: var(--tx-3); letter-spacing: 0.2em; }

/* ─────────────────────────────────────────────────────────── мафия */
.mafia-phase {
  text-align: center;
  padding: 18px 16px;
  border-radius: var(--r-l);
  border: 1px solid var(--line);
  background: var(--bg-2);
  margin-bottom: 14px;
}
.mafia-phase--night { background: linear-gradient(180deg, #14161f, var(--bg-2)); border-color: rgba(120, 140, 200, 0.22); }
.mafia-phase--day { background: linear-gradient(180deg, rgba(224, 163, 46, 0.1), var(--bg-2)); border-color: var(--acc-line); }
.mafia-title { font-family: var(--display); font-weight: 700; font-size: 20px; margin: 8px 0 0; letter-spacing: -0.02em; }
.mafia-sub { font-size: 12.5px; color: var(--tx-2); margin: 8px 0 0; }

.myrole {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--acc-line);
  border-radius: var(--r-m);
  background: var(--acc-dim);
  margin-bottom: 14px;
}
.myrole--dead { opacity: 0.5; border-color: var(--line); background: var(--bg-2); }
.myrole__icon { font-size: 26px; }
.myrole__title { margin: 0; font-family: var(--display); font-weight: 600; font-size: 15px; }
.myrole__hint { margin: 3px 0 0; font-size: 11.5px; color: var(--tx-2); }

/* ─────────────────────────────────────────────────────────── экран победы */
.win {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: var(--sp);
  background: radial-gradient(90% 60% at 50% 40%, rgba(224, 163, 46, 0.14), rgba(8, 7, 6, 0.92) 70%), rgba(8, 7, 6, 0.9);
  backdrop-filter: blur(6px);
  animation: fade 0.3s var(--ease);
  overflow: hidden;
}
.win[data-tone='dark'] {
  background: radial-gradient(90% 60% at 50% 40%, rgba(120, 140, 200, 0.12), rgba(6, 6, 8, 0.95) 70%), rgba(6, 6, 8, 0.93);
}
.win[data-tone='dark'] .win__card { border-color: rgba(140, 160, 210, 0.35); }
.win[data-tone='dark'] .win__label { color: rgba(170, 185, 225, 0.9); }
.win[data-tone='dark'] .win__sum { color: #dfe4f2; }
.win[data-tone='dark'] .win__ava { border-color: rgba(140, 160, 210, 0.6); color: #dfe4f2; }
.win[data-tone='dark'] .spark { background: #93a4cc; }

.win__card {
  position: relative;
  z-index: 2;
  width: min(360px, 100%);
  text-align: center;
  background: var(--bg-2);
  border: 1px solid var(--acc-line);
  border-radius: var(--r-l);
  padding: 28px 24px 22px;
  animation: win-in 0.5s var(--ease);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
@keyframes win-in {
  0% { opacity: 0; transform: translateY(18px) scale(0.94); }
  100% { opacity: 1; transform: none; }
}
.win__label {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--acc);
  margin: 0 0 18px;
}
.win__ava {
  width: 74px; height: 74px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 2px solid var(--acc);
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  color: var(--acc);
  overflow: hidden;
  position: relative;
  animation: ava-pop 0.6s var(--ease) 0.1s backwards;
}
.win__ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@keyframes ava-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
.win__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.win__sum {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 14vw, 56px);
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--acc);
  margin: 0 0 6px;
  animation: sum-pop 0.55s var(--ease) 0.18s backwards;
}
@keyframes sum-pop {
  0% { transform: scale(0.7); opacity: 0; }
  70% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}
.win__extra { font-size: 12px; color: var(--tx-2); margin: 0 0 20px; min-height: 18px; }

.win__sparks { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.spark {
  position: absolute;
  top: 42%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--acc);
  opacity: 0;
  animation: spark-fly 1.5s var(--ease) forwards;
}
@keyframes spark-fly {
  0% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
}

/* ─────────────────────────────────────────────────────────── тост */
.toast {
  position: fixed;
  left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 12.5px;
  max-width: min(92vw, 420px);
  text-align: center;
  animation: toast-in 0.26s var(--ease);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.toast--bad { border-color: rgba(216, 80, 62, 0.5); color: #f0a396; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
