:root {
  --bg: #0a0c10;
  --panel: #141821;
  --panel-2: #1a1f2b;
  --panel-3: #222838;
  --line: #262d3d;
  --line-2: #364056;
  --text: #ece8e1;
  --muted: #8d93a3;
  --red: #d8432f;
  --red-hi: #ee5a43;
  --red-deep: #6e1a0f;
  --gold: #e3b35c;
  --gold-hi: #f3cd7e;
  --gold-deep: #8a6628;
  --green: #52b56d;
  --green-hi: #74d18e;
  --green-deep: #1b5230;
  --radius: 16px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(216, 67, 47, 0.16), transparent 60%),
    radial-gradient(900px 520px at 110% 0%, rgba(227, 179, 92, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
b { font-weight: 700; }
.hidden { display: none !important; }

/* ---------- кнопки и поля ---------- */

.btn {
  appearance: none;
  border: 1px solid var(--line-2);
  background: var(--panel-3);
  color: var(--text);
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s, border-color 0.15s, filter 0.15s;
  white-space: nowrap;
}
.btn:hover { border-color: #4a5570; background: #283047; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible, .buzzer:focus-visible, .room-code:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-lg { padding: 13px 22px; font-size: 16px; font-weight: 700; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--panel-3); border-color: var(--line); }
.btn-icon { padding: 6px 8px; font-size: 16px; line-height: 1; }
.btn-primary {
  background: linear-gradient(180deg, var(--red-hi), #b3321f);
  border-color: var(--red-hi);
  color: #fff;
  box-shadow: 0 4px 0 var(--red-deep);
}
.btn-primary:hover { background: linear-gradient(180deg, #f56b55, #c13a26); border-color: #f56b55; }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-hi), #c08c35);
  border-color: var(--gold-hi);
  color: #1d1406;
  font-weight: 700;
}
.btn-gold:hover { background: linear-gradient(180deg, #f8d894, #cc9840); border-color: #f8d894; }
.btn-green {
  background: linear-gradient(180deg, var(--green-hi), #2f8a4a);
  border-color: var(--green-hi);
  color: #06140a;
  font-weight: 700;
  box-shadow: 0 4px 0 var(--green-deep);
}
.btn-green:hover { filter: brightness(1.08); background: linear-gradient(180deg, var(--green-hi), #2f8a4a); border-color: var(--green-hi); }
.btn-red {
  background: linear-gradient(180deg, var(--red-hi), #a82c1a);
  border-color: var(--red-hi);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 0 var(--red-deep);
}
.btn-red:hover { filter: brightness(1.08); background: linear-gradient(180deg, var(--red-hi), #a82c1a); border-color: var(--red-hi); }

input, select {
  background: #0e1117;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  min-width: 0;
  font: inherit;
  color: inherit;
}
input:focus, select:focus { border-color: var(--gold-deep); box-shadow: 0 0 0 3px rgba(227, 179, 92, 0.15); }
.muted { color: var(--muted); }

/* ---------- вход ---------- */

.home { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.home-card {
  width: min(100%, 460px);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px 28px;
  box-shadow: var(--shadow);
}
.logo {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 30%, var(--red-hi), #8f2418);
  color: var(--gold-hi);
  font: 900 44px/1 'Rubik', sans-serif;
  box-shadow: 0 6px 0 var(--red-deep), 0 0 40px rgba(216, 67, 47, 0.35);
}
h1 { font: 900 30px/1.1 'Rubik', sans-serif; margin: 18px 0 8px; letter-spacing: -0.01em; }
h1 span, .brand span { color: var(--red-hi); }
.tagline { color: var(--muted); margin: 0 0 6px; }
.tagline b { color: var(--gold); font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 20px 0 14px; }
.field > span { font-size: 13px; color: var(--muted); }

/* выбор игры */
.picker { display: flex; flex-direction: column; gap: 8px; }
.pick {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0e1117;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pick:hover { border-color: var(--line-2); }
.pick.on { border-color: var(--gold-deep); background: linear-gradient(90deg, rgba(227, 179, 92, 0.12), #0e1117 80%); }
.pick:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick-icon { font-size: 24px; width: 32px; text-align: center; }
.pick-text { display: flex; flex-direction: column; min-width: 0; }
.pick-text b { font-weight: 700; }
.pick-text small { color: var(--muted); font-size: 12.5px; }
.pick-players { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pick.on .pick-players { color: var(--gold); }
.home-actions { display: flex; flex-direction: column; gap: 12px; }
.home-actions > .btn { width: 100%; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.join-row { display: flex; gap: 8px; }
.join-row .btn { flex: 1; }
.code-input { width: 140px; text-transform: uppercase; letter-spacing: 0.3em; text-align: center; font-weight: 700; font-size: 18px; }
.error { color: #ff7a66; min-height: 20px; margin: 12px 0 0; font-size: 14px; }
.rules-home { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.rules-home summary { cursor: pointer; color: var(--gold); font-weight: 500; }
.rules-list { margin: 10px 0 0; padding-left: 20px; color: #cfcac1; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.rules-list b { color: var(--gold); }

/* ---------- шапка ---------- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 16, 0.78);
  backdrop-filter: blur(10px);
}
.brand { font: 900 18px/1 'Rubik', sans-serif; white-space: nowrap; }
.room-code {
  display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: center;
  background: var(--panel-2);
  border: 1px dashed var(--gold-deep);
  border-radius: 12px;
  padding: 6px 12px;
  cursor: pointer;
  text-align: left;
}
.room-code:hover { border-style: solid; border-color: var(--gold); }
.room-label { grid-row: 1 / 3; font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
#roomCodeText { font: 700 20px/1 'Rubik', sans-serif; letter-spacing: 0.22em; color: var(--gold); }
.room-copy { font-size: 11px; color: var(--muted); }
.me { display: flex; align-items: center; gap: 6px; min-width: 0; }
.me-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }

/* ---------- раскладка ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  align-items: start;
}
.stage { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.panel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin: 0 0 12px; font-weight: 500; }
.panel > summary { cursor: pointer; list-style: none; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary h2 { display: inline; margin: 0; }
.panel > summary::after { content: '▾'; float: right; color: var(--muted); }
.panel[open] > summary::after { content: '▴'; }
.panel[open] > summary { margin-bottom: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.step { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.step input { width: 72px; padding: 4px 8px; font-size: 13px; }

/* ---------- табло с героем ---------- */

.board {
  position: relative;
  background:
    radial-gradient(600px 240px at 50% 0%, rgba(227, 179, 92, 0.07), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 22px 22px;
  box-shadow: var(--shadow);
}
.board-top {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  color: var(--muted); font-size: 14px; margin-bottom: 18px;
}
.board-top b { color: var(--text); }
.round-no {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em;
  padding: 4px 10px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line);
}
.badge { padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.badge-good { background: rgba(82, 181, 109, 0.15); color: var(--green-hi); border: 1px solid rgba(82, 181, 109, 0.4); }
.badge-bad { background: rgba(216, 67, 47, 0.14); color: #ff8a76; border: 1px solid rgba(216, 67, 47, 0.4); }
.badge-muted { background: var(--panel-3); color: var(--muted); border: 1px solid var(--line); }
.badge-secret { background: rgba(227, 179, 92, 0.14); color: var(--gold); border: 1px solid var(--gold-deep); }

.board-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; }

.letter-tile {
  width: 164px; aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 35%, #2b2433, #12141c 75%);
  border: 2px solid var(--gold);
  box-shadow: inset 0 0 36px rgba(227, 179, 92, 0.16), 0 0 36px rgba(227, 179, 92, 0.12);
}
.letter-tile.dim { border-color: var(--gold-deep); box-shadow: none; opacity: 0.8; }
.lt-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--gold); }
.lt-letter { font: 900 104px/1 'Rubik', sans-serif; color: var(--gold-hi); text-shadow: 0 0 26px rgba(227, 179, 92, 0.45); }
.letter-tile.pop { animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }

.hero-card { margin: 0; min-width: 0; max-width: 460px; width: 100%; justify-self: center; }
.hero-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--line-2);
  background: #0d0f15;
  display: grid; place-items: center;
}
.hero-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-frame .ph { display: none; font: 900 72px/1 'Rubik', sans-serif; color: var(--muted); }
.hero-card.noimg img { display: none; }
.hero-card.noimg .ph { display: block; }
.hero-card figcaption { margin-top: 10px; text-align: center; font: 700 24px/1.2 'Rubik', sans-serif; }
.hero-card.secret .hero-frame { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(227, 179, 92, 0.12), 0 0 40px rgba(227, 179, 92, 0.18); }
.hero-card.revealed .hero-frame { border-color: var(--line-2); }
.hero-card.mystery .hero-frame {
  background:
    radial-gradient(circle at 50% 50%, rgba(216, 67, 47, 0.18), transparent 60%),
    repeating-linear-gradient(45deg, #141821 0 14px, #10131a 14px 28px);
  border-color: rgba(216, 67, 47, 0.5);
}
.hero-card.mystery .q { font: 900 120px/1 'Rubik', sans-serif; color: var(--red-hi); text-shadow: 0 0 34px rgba(216, 67, 47, 0.6); }
.hero-card.mystery figcaption { color: var(--muted); letter-spacing: 0.3em; }
.hero-card.idle .hero-frame { border-color: var(--line-2); }
.hero-card.idle .q { color: var(--muted); text-shadow: none; }

.board-caption { margin-top: 18px; text-align: center; color: var(--muted); font-size: 15px; }
.board-caption b { color: var(--text); }
.board-caption .hl { color: var(--gold); font-weight: 700; }

/* ---------- управление ---------- */

.controls {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
}
.controls .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.status { color: var(--muted); font-size: 15px; }
.status b { color: var(--text); }
.hint { color: var(--muted); font-size: 13px; }
kbd {
  font: 500 12px/1 'Rubik', sans-serif;
  padding: 3px 7px; border-radius: 6px;
  border: 1px solid var(--line-2); border-bottom-width: 2px;
  background: var(--panel-3); color: var(--text);
}
.answering-box {
  width: 100%;
  border: 1px solid rgba(82, 181, 109, 0.5);
  background: linear-gradient(180deg, rgba(82, 181, 109, 0.12), transparent);
  border-radius: 14px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.answering-box .who { font: 700 22px/1.2 'Rubik', sans-serif; }
.answering-box .who span { color: var(--green-hi); }

.buzzer {
  width: min(100%, 380px);
  height: 92px;
  border: 0;
  border-radius: 999px;
  font: 900 28px/1 'Rubik', sans-serif;
  letter-spacing: 0.08em;
  color: #fff;
  background: radial-gradient(circle at 50% 28%, #f5735b, #b52d1a 70%);
  box-shadow: 0 7px 0 var(--red-deep), 0 16px 34px rgba(216, 67, 47, 0.35);
  cursor: pointer;
  transition: transform 0.06s, box-shadow 0.06s, filter 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.buzzer:hover:not(:disabled) { filter: brightness(1.08); }
.buzzer:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 2px 0 var(--red-deep), 0 8px 18px rgba(216, 67, 47, 0.3); }
.buzzer:disabled {
  cursor: default;
  background: #262b38;
  color: var(--muted);
  font-size: 20px;
  letter-spacing: 0.02em;
  box-shadow: 0 7px 0 #141821;
}
.buzzer.mine, .buzzer.mine:disabled {
  background: radial-gradient(circle at 50% 28%, var(--green-hi), #2c8446 70%);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 7px 0 var(--green-deep), 0 0 0 8px rgba(82, 181, 109, 0.2);
  animation: pulse 1.1s infinite;
}

/* ---------- табло очков ---------- */

.scoreboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.scoreboard li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.scoreboard li.me { border-color: var(--line-2); }
.scoreboard li.is-leader { border-color: var(--gold-deep); background: linear-gradient(90deg, rgba(227, 179, 92, 0.13), var(--panel-2) 70%); }
.scoreboard li.is-answering { border-color: var(--green); background: linear-gradient(90deg, rgba(82, 181, 109, 0.16), var(--panel-2) 70%); }
.scoreboard li.offline { opacity: 0.45; }
.rank { color: var(--muted); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.pname { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pname .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tag { flex: none; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 6px; border-radius: 6px; }
.tag-admin { background: rgba(227, 179, 92, 0.18); color: var(--gold); }
.tag-host { background: var(--panel-3); color: var(--muted); }
.tag-me { background: var(--panel-3); color: #b9c3d9; }
.tag-off { background: var(--panel-3); color: var(--muted); }
.score { font: 700 17px/1 'Rubik', sans-serif; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.score.neg { color: #ff8a76; }
.score.bump { animation: bump 0.5s; }
.actions { display: flex; gap: 3px; }
.mini {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: var(--panel-3);
  cursor: pointer;
  font-size: 14px; line-height: 1;
  padding: 0;
}
.mini:hover { border-color: #4a5570; background: #2c344a; }
.mini.plus:hover { border-color: var(--green); color: var(--green-hi); }
.mini.minus:hover { border-color: var(--red); color: #ff8a76; }

/* ---------- лог ---------- */

.log { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.log li { color: #cfcac1; overflow-wrap: anywhere; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; font-size: 12px; }
.log .empty { color: var(--muted); }

/* ---------- настройки ---------- */

.settings-form { display: flex; flex-direction: column; gap: 10px; }
.settings-form label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: #cfcac1; }
.settings-form input { width: 96px; padding: 6px 10px; }
.settings-form select { width: 150px; padding: 6px 10px; }
#settingsPanel > div.settings-form { margin-bottom: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.settings-actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 4px; }

/* ---------- отметки в табло ---------- */

.mark {
  flex: none;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.mark-done { background: rgba(82, 181, 109, 0.2); color: var(--green-hi); }
.mark-wait { background: var(--panel-3); color: var(--muted); animation: blink 1.4s infinite; }
.mark-away { font-size: 12px; }
@keyframes blink { 50% { opacity: 0.4; } }

.chip {
  display: inline-block;
  font-size: 12px; font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  white-space: nowrap;
}
.chip.good { border-color: rgba(82, 181, 109, 0.5); color: var(--green-hi); }
.chip.bad { border-color: rgba(216, 67, 47, 0.5); color: #ff8a76; }
.chip.empty { color: var(--muted); border-style: dashed; background: transparent; }

.controls:empty { display: none; }

/* ---------- Имбажинариум ---------- */

.icard {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--line-2);
  background: radial-gradient(120% 80% at 50% 18%, #33294a 0%, #171b28 58%, #0d0f15 100%);
  color: #fff;
  font: inherit;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
button.icard { cursor: pointer; }
button.icard:hover { transform: translateY(-4px); border-color: #5a6684; box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45); }
.icard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.icard img.fallback { object-position: center 20%; }
.icard-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 8px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  font-weight: 700; font-size: 13px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icard-no {
  position: absolute; top: 7px; left: 7px;
  min-width: 26px; height: 26px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.78);
  border: 1px solid var(--line-2);
  font: 700 13px/1 'Rubik', sans-serif;
}
.icard-zoom {
  position: absolute; top: 7px; right: 7px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: rgba(10, 12, 16, 0.72);
  border: 1px solid var(--line-2);
  font-size: 15px;
  cursor: zoom-in;
  opacity: 0;
  transition: opacity 0.15s;
}
.icard:hover .icard-zoom, .icard:focus-visible .icard-zoom { opacity: 1; }
@media (hover: none) { .icard-zoom { opacity: 0.85; } }
.icard-tag {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--panel-3); border: 1px solid var(--line-2);
  white-space: nowrap;
}
.icard.selected { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 179, 92, 0.35), 0 12px 26px rgba(0, 0, 0, 0.45); transform: translateY(-6px); }
.icard.mine { border-color: #4b7fc4; }
.icard.mine .icard-tag { background: #1d3558; border-color: #4b7fc4; color: #cfe0ff; }
.icard.voted { border-color: var(--green); }
.icard.voted .icard-tag { background: #173a24; border-color: var(--green); color: var(--green-hi); }
.icard.story { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 179, 92, 0.3), 0 0 34px rgba(227, 179, 92, 0.3); }
.icard.story .icard-tag { background: #3a2c10; border-color: var(--gold); color: var(--gold-hi); }
.icard.back {
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(216, 67, 47, 0.22), transparent 60%),
    repeating-linear-gradient(45deg, #1d1420 0 10px, #170f19 10px 20px);
  border-color: rgba(216, 67, 47, 0.55);
}
.icard.back span { font: 900 54px/1 'Rubik', sans-serif; color: var(--red-hi); text-shadow: 0 0 24px rgba(216, 67, 47, 0.6); }
.icard.back.in { animation: deal 0.35s ease-out; }
.icard.placeholder { background: transparent; border-style: dashed; border-color: var(--line-2); }
.icard.placeholder span { display: none; }
@keyframes deal { from { transform: translateY(-16px) rotate(-6deg); opacity: 0; } }

.im-clue:empty, .im-status:empty, .im-actions:empty { display: none; }
.im-clue { text-align: center; margin: 4px 0 18px; }
.clue { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.clue-by { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.clue q { font: 700 26px/1.25 'Rubik', sans-serif; color: var(--gold-hi); quotes: '«' '»'; overflow-wrap: anywhere; }
.clue.voice { font: 700 20px/1.3 'Rubik', sans-serif; color: var(--gold); }
.clue-prompt { font: 700 20px/1.3 'Rubik', sans-serif; }
.clue-prompt.muted { font-weight: 500; }
.phase-label { font-size: 13px; color: var(--gold); }

.im-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 172px));
  justify-content: center;
  gap: 14px;
}
.im-grid.reveal { grid-template-columns: repeat(auto-fill, minmax(128px, 172px)); row-gap: 18px; }
.im-slot { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.im-owner { text-align: center; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-owner.story { color: var(--gold); font-weight: 700; }
.im-voters { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }

.im-intro { display: grid; place-items: center; padding: 12px 0 4px; }
.fan { position: relative; width: 240px; height: 190px; }
.fan .icard { position: absolute; width: 120px; left: 60px; top: 10px; }
.fan .icard:nth-child(1) { transform: rotate(-14deg) translateX(-54px); }
.fan .icard:nth-child(3) { transform: rotate(14deg) translateX(54px); }
.fan.thinking .icard:nth-child(2) { animation: think 1.6s ease-in-out infinite; }
@keyframes think { 50% { transform: translateY(-10px); } }

.im-status { margin-top: 18px; text-align: center; color: #cfcac1; }
.im-status > * + * { margin-top: 10px; }
.im-status b { color: var(--text); }
.deltas { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.im-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }

.im-over { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; }
.im-over .trophy { font-size: 64px; line-height: 1; filter: drop-shadow(0 0 24px rgba(227, 179, 92, 0.5)); }
.im-over .winner { font: 900 30px/1.2 'Rubik', sans-serif; color: var(--gold-hi); text-align: center; }

#stage[data-game='imaginarium'] .controls { align-items: stretch; text-align: left; }
.im-hand-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.im-hand-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin: 0; font-weight: 500; }
.im-hand-head .muted { font-size: 13px; }
.im-hand {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px;
  padding-top: 6px;
}
.im-hand-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.im-hand-actions:empty { display: none; }
.im-hand-actions input { flex: 1 1 260px; max-width: 480px; }

/* ---------- Рисовалка ---------- */

#stage[data-game='draw'] .board { padding: 16px; }
.dr-head { display: grid; grid-template-columns: minmax(90px, auto) minmax(0, 1fr) minmax(90px, auto); align-items: center; gap: 12px; margin-bottom: 10px; }
.dr-round { justify-self: start; white-space: nowrap; }
.dr-word { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; text-align: center; min-height: 44px; justify-content: center; }
.dr-answer { font: 900 24px/1.1 'Rubik', sans-serif; color: var(--gold-hi); }
.dr-hint { font-size: 12.5px; color: var(--muted); }
.dr-guess { font: 900 24px/1.1 'Rubik', sans-serif; color: var(--text); }
.dr-timer {
  justify-self: end;
  width: 50px; height: 50px;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 3px solid var(--gold-deep);
  font: 900 19px/1 'Rubik', sans-serif; color: var(--gold-hi);
}
.dr-timer.off { visibility: hidden; }
.dr-timer.low { border-color: var(--red-hi); color: #ff8a76; animation: blink 1s infinite; }
.dr-bar { height: 4px; border-radius: 999px; background: var(--panel-3); overflow: hidden; margin-bottom: 12px; }
.dr-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--red-hi)); transition: width 0.25s linear; }

.dr-main { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 12px; }
.dr-canvas-wrap { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; border: 2px solid var(--line-2); background: #fff; }
.dr-canvas { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; }
.dr-canvas.can-draw { cursor: crosshair; }
.dr-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 16px;
  overflow: auto;
  background: rgba(10, 12, 16, 0.84);
  backdrop-filter: blur(2px);
}
.dr-card { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 460px; text-align: center; }
.dr-card.wide { max-width: 100%; }
.dr-card h3 { margin: 0; font: 900 22px/1.2 'Rubik', sans-serif; }
.dr-card p { margin: 0; }
.dr-big { font-size: 54px; line-height: 1; }
.dr-big.pulse { animation: think 1.4s ease-in-out infinite; }
.dr-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.dr-option {
  width: 128px; padding: 0;
  border: 2px solid var(--line-2); border-radius: 12px;
  background: var(--panel-2); color: inherit; font: inherit;
  overflow: hidden; cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.dr-option:hover { transform: translateY(-4px); border-color: var(--gold); }
.dr-hero { margin: 0; }
.dr-hero img {
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  background: radial-gradient(120% 80% at 50% 18%, #33294a 0%, #171b28 58%, #0d0f15 100%);
}
.dr-hero figcaption { padding: 6px 8px 8px; font-weight: 700; font-size: 14px; }
.dr-hero.big { width: 150px; border-radius: 12px; overflow: hidden; border: 2px solid var(--gold); background: var(--panel-2); }

.dr-chat {
  display: flex; flex-direction: column;
  contain: size; /* высота — как у холста, сообщения прокручиваются внутри */
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden;
}
.dr-msgs { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 10px; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.dr-msgs li { overflow-wrap: anywhere; line-height: 1.35; }
.dr-msgs .sys { color: var(--muted); font-size: 12.5px; }
.dr-msgs .ok { color: var(--green-hi); }
.dr-msgs .close { color: var(--gold); }
.dr-msgs .secret { color: #9fd3ae; background: rgba(82, 181, 109, 0.08); border-radius: 6px; padding: 1px 5px; }
.dr-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.dr-form input { flex: 1; padding: 9px 10px; }
.dr-send { padding: 8px 12px; box-shadow: none; }

.dr-tools { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.dr-tools:empty { display: none; }
.dr-tool-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.dr-tool-row.right { justify-content: flex-end; }
.dr-color {
  width: 30px; height: 30px; padding: 0;
  border-radius: 999px; border: 2px solid var(--line-2);
  background: var(--c); color: #444; font-size: 14px;
  cursor: pointer;
}
.dr-color.on { outline: 3px solid var(--gold); outline-offset: 2px; }
.dr-size {
  width: 38px; height: 38px; padding: 0;
  display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-3); cursor: pointer;
}
.dr-size span { display: block; width: var(--w); height: var(--w); border-radius: 999px; background: var(--text); }
.dr-size.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(227, 179, 92, 0.35); }
.dr-sep { width: 1px; height: 26px; margin: 0 4px; background: var(--line-2); }

@media (max-width: 760px) {
  /* порядок на телефоне: холст → инструменты → чат, чтобы рисовать без прокрутки */
  #stage[data-game='draw'] .board { display: flex; flex-direction: column; }
  .dr-main { display: contents; }
  .dr-tools { order: 1; margin-top: 10px; }
  .dr-chat { order: 2; margin-top: 10px; contain: none; height: 240px; }
  .dr-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .dr-answer { font-size: 20px; }
  /* поверх маленького холста всё должно влезть без прокрутки */
  .dr-overlay { padding: 8px; }
  .dr-card { gap: 6px; }
  .dr-card h3 { font-size: 16px; }
  .dr-card p { font-size: 12.5px; }
  .dr-big { font-size: 36px; }
  .dr-options { gap: 8px; }
  .dr-option { width: 82px; }
  .dr-hero figcaption { padding: 3px 4px 5px; font-size: 11.5px; }
  .dr-hero.big { width: 84px; }
  .dr-card .btn-lg { padding: 9px 16px; font-size: 14px; }
}

/* ---------- Испорченный курьер ---------- */

#stage[data-game='phone'] .board { padding: 16px; }
.ph-body { display: flex; flex-direction: column; gap: 12px; }
.ph-body.locked .ph-canvas-wrap, .ph-body.locked .ph-write { opacity: 0.6; }
.ph-intro { margin: 24px auto; }
.ph-prompt { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.ph-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.ph-prompt q { font: 700 24px/1.25 'Rubik', sans-serif; color: var(--gold-hi); quotes: '«' '»'; overflow-wrap: anywhere; }
.ph-prompt q.empty { font-size: 18px; color: var(--muted); }
.ph-canvas-wrap {
  position: relative;
  width: 100%; max-width: 560px; margin: 0 auto;
  aspect-ratio: 4 / 3;
  border-radius: 14px; border: 2px solid var(--line-2);
  overflow: hidden; background: #fff;
}
.ph-canvas-wrap canvas { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; }
.ph-canvas.can-draw { cursor: crosshair; }
.ph-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #9a9a9a; font-size: 14px; }
.ph-write { display: flex; gap: 8px; width: 100%; max-width: 560px; margin: 0 auto; }
.ph-write input { flex: 1; font-size: 17px; }
.ph-actions { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.ph-actions:empty { display: none; }
.ph-status { color: var(--green-hi); font-weight: 500; }
.ph-album-head { text-align: center; color: var(--muted); }
.ph-album-head b { color: var(--text); }
.ph-feed { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 560px; max-height: 68vh; margin: 0 auto; padding: 4px; overflow-y: auto; }
.ph-entry { display: flex; flex-direction: column; gap: 6px; }
.ph-entry.new { animation: deal 0.35s ease-out; }
.ph-entry .ph-canvas-wrap { max-width: 420px; margin: 0; }
.ph-who { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.ph-who b { color: var(--text); }
.ph-bubble {
  align-self: flex-start; max-width: 100%;
  padding: 10px 14px;
  border-radius: 14px 14px 14px 4px;
  background: var(--panel-3); border: 1px solid var(--line-2);
  font: 700 18px/1.3 'Rubik', sans-serif; color: var(--gold-hi);
  overflow-wrap: anywhere;
}
.ph-bubble.empty { font-weight: 500; color: var(--muted); }
.ph-like {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--panel-3); color: var(--text);
  font: inherit; font-size: 13px;
  cursor: pointer;
}
.ph-like.on { border-color: var(--gold); background: rgba(227, 179, 92, 0.15); }
.ph-like.static { cursor: default; }

@media (max-width: 600px) {
  .dr-head { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
  .dr-guess { font-size: 18px; }
  .ph-prompt q { font-size: 20px; }
  .ph-bubble { font-size: 16px; }
  .ph-feed { max-height: none; }
}

/* ---------- Бункер ---------- */

#stage[data-game='bunker'] .board { padding: 16px; }
#stage[data-game='bunker'] .controls { align-items: stretch; text-align: left; }
.mark-out { font-size: 12px; }
.scoreboard li:has(.mark-out) .n { text-decoration: line-through; text-decoration-color: rgba(255, 138, 118, 0.6); }

.bk-scenario:empty, .bk-grid:empty { display: none; }
.bk-scn {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(216, 67, 47, 0.45);
  background:
    repeating-linear-gradient(135deg, rgba(227, 179, 92, 0.05) 0 12px, transparent 12px 24px),
    linear-gradient(180deg, rgba(216, 67, 47, 0.12), transparent);
}
.bk-scn summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; }
.bk-scn summary::-webkit-details-marker { display: none; }
.bk-scn-title { font-size: 18px; }
.bk-scn-title b { color: var(--gold-hi); }
.bk-seats { font-size: 13px; color: var(--gold); font-weight: 500; }
.bk-scn p { margin: 8px 0; color: #d9d4ca; }
.bk-bunker { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: #cfcac1; }
.bk-features { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.bk-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.bk-status:empty { display: none; }
.bk-msg { flex: 1 1 320px; display: flex; flex-direction: column; gap: 8px; color: #d9d4ca; }
.bk-msg b { color: var(--text); }
.bk-you { color: var(--gold-hi) !important; }
.bk-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bk-verdict { font: 700 20px/1.3 'Rubik', sans-serif; }
.bk-intro { margin: 12px auto; }

.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.bk-dos {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  transition: border-color 0.2s, opacity 0.2s, box-shadow 0.2s;
}
.bk-dos.me { border-color: var(--line-2); }
.bk-dos.speaking { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 179, 92, 0.18); }
.bk-dos.out { opacity: 0.55; }
.bk-dos.exiled-now { opacity: 1; border-color: var(--red-hi); box-shadow: 0 0 0 3px rgba(216, 67, 47, 0.25); animation: flashBad 0.7s; }
.bk-dos.survivor { border-color: var(--green); box-shadow: 0 0 0 3px rgba(82, 181, 109, 0.18); }
.bk-dos-head { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.bk-ava {
  width: 48px; height: 48px;
  border-radius: 12px;
  border: 2px solid var(--line-2);
  background: radial-gradient(120% 80% at 50% 18%, #33294a 0%, #171b28 58%, #0d0f15 100%) center / cover;
  background-size: cover;
  background-position: center 18%;
}
.bk-ava.secret { opacity: 0.55; filter: grayscale(0.4); }
.bk-ava.empty { display: grid; place-items: center; font: 900 22px/1 'Rubik', sans-serif; color: var(--muted); }
.bk-who { min-width: 0; }
.bk-name { display: flex; align-items: center; gap: 6px; }
.bk-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }
.bk-hero { font-weight: 700; color: var(--gold-hi); }
.bk-hero.secret { color: var(--muted); font-weight: 500; }
.bk-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.bk-badges .badge { font-size: 12px; padding: 2px 8px; }
.bk-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bk-rows li {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 5px 6px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.3;
}
.bk-rows li.open { background: rgba(227, 179, 92, 0.08); }
.bk-rows .ic { text-align: center; }
.bk-rows .txt { display: flex; flex-direction: column; min-width: 0; }
.bk-rows li.closed .txt { flex-direction: row; align-items: baseline; gap: 10px; }
.bk-rows .lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.bk-rows li.closed .lbl { font-size: 12px; text-transform: none; letter-spacing: 0; }
.bk-rows .val { overflow-wrap: anywhere; }
.bk-rows li.open .val { color: var(--text); font-weight: 500; }
.bk-rows li.secret .val { color: #8f97aa; font-style: italic; }
.bk-rows li.closed .val { color: var(--muted); letter-spacing: 0.2em; }
.bk-open { padding: 3px 9px; font-size: 12px; align-self: center; }
.bk-dos-sp { font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line-2); padding-top: 6px; }
.bk-vote { white-space: nowrap; }
.bk-vote.on { box-shadow: none; }
.bk-side { font-size: 18px; }
.bk-tally { font: 700 16px/1 'Rubik', sans-serif; color: #ff8a76; white-space: nowrap; }

.bk-sp { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.bk-sp.used { opacity: 0.6; }
.bk-sp-card { display: flex; gap: 12px; align-items: flex-start; flex: 1 1 300px; }
.bk-sp-icon {
  flex: none;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  font-size: 28px;
  border-radius: 14px;
  border: 1px solid var(--gold-deep);
  background: radial-gradient(circle at 50% 30%, rgba(227, 179, 92, 0.25), transparent 70%), var(--panel-3);
}
.bk-sp-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.bk-sp-card b { font-size: 17px; color: var(--gold-hi); }
.bk-sp-card p { margin: 2px 0 0; color: #cfcac1; font-size: 14px; }
.bk-sp-use { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bk-sp-use select { padding: 8px 10px; }

@media (max-width: 600px) {
  .bk-grid { grid-template-columns: minmax(0, 1fr); }
  .bk-verdict { font-size: 17px; }
}

/* ---------- Дотадл ---------- */

#stage[data-game='dotadle'] .board { padding: 16px; }
#stage[data-game='dotadle'] .controls { align-items: stretch; text-align: left; }
:root { --dl-hit: #2f8a4a; --dl-part: #b8862b; --dl-miss: #8e2e22; }
.dl-intro { margin: 16px auto; }
.dl-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; }
.dl-search { position: relative; flex: 1 1 320px; }
.dl-input { width: 100%; font-size: 17px; }
.dl-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  list-style: none; margin: 0; padding: 4px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
}
.dl-suggest.open { display: block; }
.dl-suggest button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.dl-suggest button:hover, .dl-suggest button.on { background: var(--panel-3); }
.dl-suggest img { width: 48px; height: 27px; object-fit: cover; border-radius: 4px; }
.dl-left { color: var(--muted); white-space: nowrap; }
.dl-left b { color: var(--text); }
.dl-banner { flex: 1; padding: 12px 14px; border-radius: 12px; font-size: 17px; font-weight: 500; }
.dl-banner.ok { background: rgba(82, 181, 109, 0.14); border: 1px solid rgba(82, 181, 109, 0.5); }
.dl-banner.fail { background: rgba(216, 67, 47, 0.12); border: 1px solid rgba(216, 67, 47, 0.45); }

.dl-table-wrap { overflow-x: auto; padding-bottom: 4px; }
.dl-table { min-width: 660px; display: flex; flex-direction: column; gap: 6px; }
.dl-rows { display: flex; flex-direction: column; gap: 6px; }
.dl-row { display: grid; grid-template-columns: 1.35fr repeat(7, 1fr); gap: 5px; }
.dl-row.head .dl-cell { min-height: 0; padding: 2px 4px; background: none; border: 0; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.dl-cell {
  position: relative;
  min-height: 62px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 6px 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--panel-3);
  font-size: 12.5px; font-weight: 500; line-height: 1.25; text-align: center;
}
.dl-cell.hit { background: var(--dl-hit); }
.dl-cell.part { background: var(--dl-part); }
.dl-cell.miss, .dl-cell.up, .dl-cell.down { background: var(--dl-miss); }
.dl-cell.hero { padding: 4px; gap: 4px; font-weight: 700; }
.dl-cell.hero img { width: 100%; max-width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.dl-arrow { font: 900 18px/1 'Rubik', sans-serif; opacity: 0.9; }
.dl-dim { opacity: 0.3; }
.dl-attr { display: inline-block; width: 10px; height: 10px; border-radius: 999px; margin-right: 4px; vertical-align: 0; }
.dl-attr.str { background: #e5533d; }
.dl-attr.agi { background: #4fcf6b; }
.dl-attr.int { background: #3fa8f5; }
.dl-attr.all { background: linear-gradient(135deg, #e5533d, #4fcf6b, #3fa8f5); }
.dl-row.fresh .dl-cell { animation: dlFlip 0.45s ease-out both; animation-delay: calc(var(--i) * 0.12s); }
@keyframes dlFlip { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }

.dl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.dl-legend i, .dl-mini i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.dl-legend i.hit, .dl-mini i.hit { background: var(--dl-hit); }
.dl-legend i.part, .dl-mini i.part { background: var(--dl-part); }
.dl-legend i.miss, .dl-mini i.miss, .dl-mini i.up, .dl-mini i.down { background: var(--dl-miss); }
.dl-host { margin-top: 10px; justify-content: flex-end; }

.dl-others h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin: 0 0 10px; font-weight: 500; }
.dl-others-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dl-opp { padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.dl-opp.ok { border-color: var(--green); }
.dl-opp.fail { opacity: 0.6; }
.dl-opp-name { font-size: 13px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-mini { display: flex; flex-direction: column; gap: 3px; }
.dl-mini div { display: flex; gap: 3px; }

.dl-reveal { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: start; }
.dl-answer { margin: 0; border-radius: 14px; overflow: hidden; border: 2px solid var(--gold); background: radial-gradient(120% 80% at 50% 18%, #33294a 0%, #171b28 58%, #0d0f15 100%); }
.dl-answer img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.dl-answer figcaption { padding: 8px; text-align: center; font: 900 20px/1.2 'Rubik', sans-serif; color: var(--gold-hi); }
.dl-reveal-side { display: flex; flex-direction: column; gap: 12px; }
.dl-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.dl-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dl-results li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); }
.dl-results li.ok { border-left: 3px solid var(--green); }
.dl-results li.fail { border-left: 3px solid var(--red); opacity: 0.8; }
.dl-pts { font: 700 16px/1 'Rubik', sans-serif; }

.dl-lbl { display: none; }

/* телефон: попытка — карточка: герой сверху, подсказки в две строки с подписями */
@media (max-width: 600px) {
  .dl-table { min-width: 0; }
  .dl-row.head { display: none; }
  .dl-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
  .dl-rows { gap: 8px; }
  .dl-cell { min-height: 50px; padding: 4px 3px; font-size: 11.5px; }
  .dl-cell.hero { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; min-height: 0; background: none; border: 0; font-size: 14px; }
  .dl-cell.hero img { width: 64px; }
  .dl-lbl { display: block; font-size: 9.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.75; }
  .dl-arrow { font-size: 14px; }
  .dl-reveal { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .dl-answer { width: 170px; }
  .dl-reveal-side { width: 100%; }
}

/* ---------- Доджкин ---------- */

#stage[data-game='munchkin'] .board { padding: 16px; }
#stage[data-game='munchkin'] .controls { align-items: stretch; text-align: left; gap: 16px; }
.mk-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 12px; }
.mk-head:empty { display: none; }
.mk-title { text-align: center; font-size: 16px; color: #d9d4ca; }
.mk-title b { color: var(--gold-hi); }
.mk-decks { font-size: 13px; color: var(--muted); white-space: nowrap; }

.mk-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 14px; }
.mk-players:empty { display: none; }
.mk-pl { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 10px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.mk-pl.me { border-color: var(--line-2); }
.mk-pl.active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 179, 92, 0.15); }
.mk-pl.fighting { border-color: var(--red-hi); }
.mk-pl.dead { opacity: 0.6; }
.mk-pl.winner { border-color: var(--green); box-shadow: 0 0 0 3px rgba(82, 181, 109, 0.2); }
.mk-lvl {
  width: 52px; height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 999px;
  background:
    radial-gradient(circle, var(--panel-2) 58%, transparent 60%),
    conic-gradient(var(--gold) var(--p), var(--panel-3) 0);
  line-height: 1;
}
.mk-lvl b { font: 900 20px/1 'Rubik', sans-serif; color: var(--gold-hi); }
.mk-lvl small { font-size: 9px; color: var(--muted); }
.mk-pl-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mk-pl-name { display: flex; align-items: center; gap: 6px; }
.mk-pl-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-pl-stats { display: flex; gap: 10px; font-size: 13px; color: #d9d4ca; }
.mk-pl-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.mk-pl-tags .chip { font-size: 11px; padding: 1px 7px; }
.mk-pl-gear { display: flex; flex-wrap: wrap; gap: 3px; }
.mk-gear img { width: 26px; height: 19px; object-fit: cover; border-radius: 3px; display: block; }

.mk-table { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.mk-intro { margin: 12px auto; }
.mk-door {
  align-self: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 34px;
  border-radius: 18px;
  border: 2px solid var(--gold-deep);
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 3px, transparent 3px 26px),
    linear-gradient(180deg, #5a3a1c, #3a2412);
  color: var(--text); font: inherit; cursor: pointer;
  box-shadow: 0 8px 0 #22150a, var(--shadow);
  transition: transform 0.1s;
}
.mk-door:hover { transform: translateY(-2px); }
.mk-door:active { transform: translateY(4px); box-shadow: 0 3px 0 #22150a; }
.mk-door span { font-size: 54px; line-height: 1; }
.mk-door b { font: 900 22px/1 'Rubik', sans-serif; color: var(--gold-hi); }
.mk-door small { color: #cdbb9a; font-size: 12.5px; }
.mk-wait { text-align: center; color: var(--muted); padding: 20px 0; font-size: 16px; }
.mk-door-card { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mk-door-card .mk-card { width: 210px; }
.mk-last { padding: 10px 12px; border-radius: 12px; font-size: 14.5px; }
.mk-last.win { background: rgba(82, 181, 109, 0.12); border: 1px solid rgba(82, 181, 109, 0.4); }
.mk-last.lose { background: rgba(216, 67, 47, 0.1); border: 1px solid rgba(216, 67, 47, 0.4); }
.mk-choice { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.mk-hint { font-size: 12.5px; color: var(--muted); }
.mk-hint.center { text-align: center; }
.mk-host { justify-content: flex-end; }

.mk-battle { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr); gap: 12px; align-items: stretch; }
.mk-side { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; }
.mk-side.heroes { background: linear-gradient(180deg, rgba(82, 181, 109, 0.12), transparent); border: 1px solid rgba(82, 181, 109, 0.35); }
.mk-side.monsters { background: linear-gradient(180deg, rgba(216, 67, 47, 0.14), transparent); border: 1px solid rgba(216, 67, 47, 0.4); }
.mk-side-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.mk-fighters, .mk-mods, .mk-enh { display: flex; flex-wrap: wrap; gap: 5px; }
.mk-total { margin-top: auto; font: 900 38px/1 'Rubik', sans-serif; text-align: center; }
.mk-side.heroes .mk-total { color: var(--green-hi); }
.mk-side.monsters .mk-total { color: #ff8a76; }
.mk-vs { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; min-width: 110px; }
.mk-vs b { font: 900 30px/1 'Rubik', sans-serif; color: var(--muted); }
.mk-state { font-weight: 700; padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.mk-state.win { background: rgba(82, 181, 109, 0.2); color: var(--green-hi); }
.mk-state.lose { background: rgba(216, 67, 47, 0.2); color: #ff8a76; }
.mk-closing { font-size: 13px; color: var(--gold); min-height: 18px; }
.mk-mons { display: flex; flex-wrap: wrap; gap: 10px; }
.mk-mon { position: relative; display: flex; flex-direction: column; gap: 6px; width: 190px; }
.mk-mon-lvl { position: absolute; top: -8px; right: -6px; padding: 3px 9px; border-radius: 999px; background: var(--red); color: #fff; font: 900 15px/1.2 'Rubik', sans-serif; box-shadow: var(--shadow); }
.mk-battle-acts { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }

.mk-card {
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  font-size: 12.5px;
  min-width: 0;
}
.mk-card.door { border-top: 3px solid #a0613a; background: linear-gradient(180deg, rgba(160, 97, 58, 0.14), var(--panel-2) 45%); }
.mk-card.treasure { border-top: 3px solid var(--gold); background: linear-gradient(180deg, rgba(227, 179, 92, 0.12), var(--panel-2) 45%); }
.mk-card.k-curse { border-top-color: #8e4dd6; }
.mk-card.k-monster { border-top-color: var(--red); }
.mk-card.selling { outline: 2px solid var(--gold); outline-offset: 1px; }
.mk-card-top { display: flex; align-items: center; gap: 8px; }
.mk-art { width: 44px; height: 32px; object-fit: cover; border-radius: 6px; flex: none; }
.mk-art.hero { height: 44px; object-position: center 20%; background: radial-gradient(120% 80% at 50% 18%, #33294a 0%, #171b28 58%, #0d0f15 100%); }
.mk-emoji { width: 44px; text-align: center; font-size: 26px; line-height: 32px; flex: none; }
.mk-kind { font-size: 11px; color: var(--muted); font-weight: 500; line-height: 1.2; }
.mk-card-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.mk-card-text { color: #cfcac1; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.mk-bad { color: #ff9d8c; }
.mk-gold { color: var(--gold); }
.mk-card-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 4px; }
.mk-card-acts .btn { padding: 4px 8px; font-size: 12px; box-shadow: none; }
.mk-sell.on { border-color: var(--gold); color: var(--gold-hi); }
.mk-menu { padding: 4px 6px; font-size: 12px; border-radius: 8px; max-width: 150px; }

.mk-zone { display: flex; flex-direction: column; gap: 8px; }
.mk-zone-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mk-zone-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin: 0; font-weight: 500; }
.mk-zone-head .muted { font-size: 13px; }
.mk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; align-items: stretch; }
.mk-tray {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--gold-deep); background: rgba(227, 179, 92, 0.08);
}

@media (max-width: 700px) {
  .mk-battle { grid-template-columns: minmax(0, 1fr); }
  .mk-vs { flex-direction: row; min-width: 0; }
  .mk-mon { width: calc(50% - 5px); }
  .mk-players { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-pl { grid-template-columns: 40px minmax(0, 1fr); padding: 8px; gap: 8px; }
  .mk-lvl { width: 40px; height: 40px; }
  .mk-lvl b { font-size: 16px; }
  .mk-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-head { grid-template-columns: auto minmax(0, 1fr); }
  .mk-decks { display: none; }
}

/* ---------- Взрывные Течисы ---------- */

#stage[data-game='techies'] .board { padding: 16px; }
#stage[data-game='techies'] .controls { align-items: stretch; text-align: left; gap: 14px; }
.tc-players { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tc-players:empty { display: none; }
.tc-pl { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; }
.tc-pl.me { border-color: var(--line-2); }
.tc-pl.active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 179, 92, 0.15); }
.tc-pl.dead { opacity: 0.5; text-decoration: line-through; text-decoration-color: rgba(255, 138, 118, 0.6); }
.tc-pl.winner { border-color: var(--green); }
.tc-table { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.tc-intro { margin: 12px auto; }
.tc-piles { display: flex; justify-content: center; align-items: center; gap: 28px; }
.tc-deck {
  width: 120px; aspect-ratio: 3 / 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 14px;
  border: 2px solid rgba(216, 67, 47, 0.6);
  background:
    radial-gradient(circle at 50% 40%, rgba(216, 67, 47, 0.28), transparent 65%),
    repeating-linear-gradient(45deg, #1d1420 0 10px, #170f19 10px 20px);
  box-shadow: 4px 4px 0 #120c14, 8px 8px 0 #0d090f, var(--shadow);
}
.tc-deck-n { font: 900 40px/1 'Rubik', sans-serif; color: var(--gold-hi); }
.tc-deck small { color: var(--muted); font-size: 12px; }
.tc-deck .tc-mines { color: #ff8a76; font-weight: 700; }
.tc-discard { width: 120px; display: grid; place-items: center; }
.tc-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px;
  border-radius: 12px;
  border: 2px solid var(--line-2);
  background: var(--panel-2);
  text-align: center;
  height: 100%;
}
.tc-card.small { padding: 6px; width: 110px; }
.tc-card.small .tc-art, .tc-card.small .tc-emoji { width: 52px; height: 40px; }
.tc-art { width: 72px; height: 52px; object-fit: cover; border-radius: 8px; }
.tc-art.hero { object-position: center 20%; background: radial-gradient(120% 80% at 50% 18%, #33294a 0%, #171b28 58%, #0d0f15 100%); }
.tc-emoji { width: 72px; height: 52px; display: grid; place-items: center; font-size: 34px; }
.tc-name { font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.tc-text { font-size: 11.5px; color: #cfcac1; line-height: 1.3; }
.tc-note { font-size: 11px; color: var(--muted); margin-top: auto; }
.tc-card.k-mine { border-color: var(--red); background: linear-gradient(180deg, rgba(216, 67, 47, 0.25), var(--panel-2)); }
.tc-card.k-defuse { border-color: var(--green); }
.tc-card.k-attack { border-color: #e08a3a; }
.tc-card.k-skip { border-color: #4b8bd6; }
.tc-card.k-favor { border-color: #a06cd5; }
.tc-card.k-shuffle { border-color: #3fb8a8; }
.tc-card.k-future { border-color: #4fc3f7; }
.tc-card.k-nope { border-color: var(--gold); }
.tc-card.k-cat { border-color: #7a6a5a; }
.tc-card.selected { outline: 3px solid var(--gold); outline-offset: 2px; transform: translateY(-6px); }
.tc-hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; align-items: stretch; }
.tc-slot { border-radius: 12px; transition: transform 0.12s; }
.tc-slot.selectable { cursor: pointer; }
.tc-slot.selectable:hover .tc-card { border-color: #7a86a4; }
.tc-play {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--gold-deep); background: rgba(227, 179, 92, 0.07);
}
.tc-play select { padding: 7px 10px; }
.tc-pending {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px; border-radius: 14px; text-align: center;
  border: 1px solid rgba(227, 179, 92, 0.5); background: rgba(227, 179, 92, 0.08);
}
.tc-pending.blocked { border-color: rgba(75, 139, 214, 0.6); background: rgba(75, 139, 214, 0.1); }
.tc-pending-title { font-size: 17px; }
.tc-pending-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tc-pending-state { color: var(--muted); font-size: 13px; }
.tc-wait { text-align: center; color: #d9d4ca; padding: 10px; }
.tc-wait.me { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid rgba(82, 181, 109, 0.5); background: rgba(82, 181, 109, 0.1); }
.tc-wait select { padding: 8px 10px; }
.tc-big { font: 900 22px/1.2 'Rubik', sans-serif; }
.tc-turn { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: #d9d4ca; }
.tc-draw {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 40px; border-radius: 16px;
  border: 2px solid var(--red-hi);
  background: linear-gradient(180deg, #3a1a18, #22100f);
  color: var(--text); font: inherit; cursor: pointer;
  box-shadow: 0 6px 0 #150909, var(--shadow);
}
.tc-draw:hover { filter: brightness(1.12); }
.tc-draw:active { transform: translateY(4px); box-shadow: 0 2px 0 #150909; }
.tc-draw span { font-size: 36px; line-height: 1; }
.tc-draw b { font: 900 20px/1 'Rubik', sans-serif; color: var(--gold-hi); }
.tc-future { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; border-radius: 14px; border: 1px dashed #4fc3f7; }
.tc-future-cards { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tc-future-slot { position: relative; }
.tc-future-slot > span { position: absolute; top: -8px; left: -8px; z-index: 1; width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; background: #4fc3f7; color: #0b1a22; font-weight: 900; font-size: 12px; }

@media (max-width: 600px) {
  .tc-hand { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tc-piles { gap: 16px; }
  .tc-deck, .tc-discard { width: 100px; }
}

/* карта крупно */
.zoom {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(5, 6, 9, 0.86);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
}
.zoom figure { margin: 0; width: min(440px, 88vw, calc((100vh - 80px) * 0.75)); }
.zoom img {
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 18px;
  border: 2px solid var(--gold-deep);
  background: radial-gradient(120% 80% at 50% 18%, #33294a 0%, #171b28 58%, #0d0f15 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.zoom figcaption { margin-top: 12px; text-align: center; font: 700 22px/1.2 'Rubik', sans-serif; }

/* ---------- уведомления ---------- */

.conn, .toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 50;
  box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
}
.conn { background: #3a1812; border: 1px solid var(--red); }
.toast {
  background: var(--panel-3); border: 1px solid var(--line-2);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  transform: translate(-50%, 8px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- анимации ---------- */

.stage.flash-good .board { animation: flashGood 0.9s; }
.stage.flash-bad .board { animation: flashBad 0.7s; }
@keyframes flashGood { 0% { box-shadow: 0 0 0 0 rgba(82, 181, 109, 0.9), var(--shadow); } 100% { box-shadow: 0 0 0 28px rgba(82, 181, 109, 0), var(--shadow); } }
@keyframes flashBad {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); box-shadow: 0 0 0 3px rgba(216, 67, 47, 0.8), var(--shadow); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}
@keyframes pulse { 0%, 100% { box-shadow: 0 7px 0 var(--green-deep), 0 0 0 6px rgba(82, 181, 109, 0.25); } 50% { box-shadow: 0 7px 0 var(--green-deep), 0 0 0 16px rgba(82, 181, 109, 0.05); } }
@keyframes pop { 0% { transform: scale(0.6) rotate(-8deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }

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

/* ---------- адаптив ---------- */

@media (max-width: 920px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .brand { display: none; }
  .topbar { padding: 8px 12px; }
  .room-copy { display: none; }
  .room-label { grid-row: auto; }
  .layout { padding: 14px 12px 40px; gap: 14px; }
  .board { padding: 16px; }
  .board-main { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 16px; }
  .letter-tile { width: 120px; }
  .lt-letter { font-size: 76px; }
  .hero-card.mystery .q { font-size: 90px; }
  .hero-card figcaption { font-size: 20px; }
  .controls { padding: 16px; }
  .buzzer { height: 80px; font-size: 24px; }
  .home-card { padding: 24px 20px; }
  .code-input { width: 110px; }
  .im-grid, .im-grid.reveal { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .im-hand { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .icard-name { font-size: 12px; padding: 18px 6px 6px; }
  .clue q { font-size: 22px; }
}
