:root {
  --bg: #0a0e14;
  --panel: rgba(20, 27, 37, 0.92);
  --panel-solid: #141b25;
  --line: rgba(148, 176, 208, 0.16);
  --text: #e8eef6;
  --muted: #8fa2b8;
  --amber: #ffb020;
  --amber-soft: rgba(255, 176, 32, 0.14);
  --green: #35d07f;
  --red: #ff5f56;
  --blue: #4aa8ff;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);

  /* бетонные соты */
  --hex: polygon(25% 2%, 75% 2%, 100% 50%, 75% 98%, 25% 98%, 0% 50%);
  --chamfer: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  --chamfer-sm: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  --concrete: linear-gradient(158deg, #333d4c 0%, #242d39 52%, #1b222c 100%);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  --hexgrid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='110.8' viewBox='0 0 72 110.8'%3E%3Cdefs%3E%3Cpath id='h' d='M0 -27.7 24 -13.85 24 13.85 0 27.7 -24 13.85 -24 -13.85Z' fill='none' stroke='%23aab8cc' stroke-opacity='0.16' stroke-width='1.1'/%3E%3C/defs%3E%3Cg%3E%3Cuse href='%23h' x='0' y='0'/%3E%3Cuse href='%23h' x='0' y='55.4'/%3E%3Cuse href='%23h' x='0' y='110.8'/%3E%3Cuse href='%23h' x='36' y='27.7'/%3E%3Cuse href='%23h' x='36' y='83.1'/%3E%3Cuse href='%23h' x='72' y='0'/%3E%3Cuse href='%23h' x='72' y='55.4'/%3E%3Cuse href='%23h' x='72' y='110.8'/%3E%3C/g%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(120rem 60rem at 50% -25%, #1a222d 0%, #0d1218 55%, #0a0e14 100%) fixed,
    var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60rem 30rem at 15% -10%, rgba(255, 176, 32, 0.13), transparent 60%),
    radial-gradient(50rem 26rem at 90% 0%, rgba(74, 168, 255, 0.1), transparent 60%);
}

.glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--hexgrid);
  background-size: 108px 166.2px;
  opacity: 0.45;
}

.glow::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--noise);
  background-size: 180px 180px;
  opacity: 0.3;
  mix-blend-mode: overlay;
}

/* ------------------------------------------------------------------ соты */

.comb {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  perspective: 900px;
}

.cell {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: calc(var(--w) * 1.1547);
  clip-path: var(--hex);
  rotate: var(--r);
  translate: calc(var(--px, 0px) * var(--d)) calc(var(--py, 0px) * var(--d));
  background: var(--concrete);
  animation: comb-float var(--dur, 12s) ease-in-out var(--delay, 0s) infinite;
  will-change: transform;
}

.cell::before,
.cell::after {
  content: '';
  position: absolute;
  inset: 0;
}

.cell::before {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 40%, rgba(0, 0, 0, 0.28) 80%);
}

.cell::after {
  background-image: var(--noise);
  background-size: 180px 180px;
  opacity: 0.45;
  mix-blend-mode: overlay;
}

/* выступает над сеткой */
.cell--out {
  background: linear-gradient(158deg, #3b4658 0%, #29323f 48%, #1d2531 100%);
  filter: drop-shadow(0 20px 24px rgba(0, 0, 0, 0.62));
}

.cell--out::before {
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.16),
    inset -10px -16px 26px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* средний уровень */
.cell--mid {
  background: linear-gradient(158deg, #2e3744 0%, #212934 55%, #1a212a 100%);
  filter: drop-shadow(0 11px 16px rgba(0, 0, 0, 0.52));
}

.cell--mid::before {
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.09),
    inset -6px -10px 16px rgba(0, 0, 0, 0.45);
}

/* утоплен вглубь */
.cell--deep {
  background: linear-gradient(158deg, #1a2029 0%, #141a22 60%, #10151c 100%);
  opacity: 0.8;
  filter: blur(0.6px) drop-shadow(0 3px 5px rgba(0, 0, 0, 0.55));
}

.cell--deep::before {
  background: linear-gradient(160deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.12) 48%, rgba(255, 255, 255, 0.04) 100%);
  box-shadow: inset 0 12px 20px rgba(0, 0, 0, 0.62);
}

.cell--deep::after {
  opacity: 0.28;
}

/* почти на дне */
.cell--far {
  background: linear-gradient(158deg, #131920 0%, #0f141a 100%);
  opacity: 0.55;
  filter: blur(1.4px);
}

.cell--far::before {
  background: linear-gradient(160deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.25));
}

.cell--far::after {
  opacity: 0.18;
}

@keyframes comb-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, calc(var(--amp, 8px) * -1), 0);
  }
}

.app {
  position: relative;
  z-index: 2;
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.panel {
  position: relative;
  background: linear-gradient(158deg, rgba(35, 44, 57, 0.95), rgba(17, 22, 30, 0.95) 62%);
  border: 1px solid var(--line);
  clip-path: var(--chamfer);
  box-shadow: var(--shadow);
  padding: 28px;
  backdrop-filter: blur(6px);
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--noise);
  background-size: 180px 180px;
  opacity: 0.22;
  mix-blend-mode: overlay;
}

.panel--hero {
  text-align: left;
  border-top: 4px solid var(--amber);
}

.eyebrow {
  margin: 0;
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0 12px;
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

h1 span {
  color: var(--amber);
}

h2 {
  margin: 6px 0 16px;
  font-size: clamp(24px, 4vw, 32px);
}

h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.lead {
  margin: 0 0 22px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 17px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  max-width: 420px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field--inline {
  display: flex;
  gap: 10px;
  max-width: 420px;
  align-items: stretch;
}

input,
select {
  flex: 1 1 auto;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  clip-path: var(--chamfer-sm);
  background: rgba(6, 10, 16, 0.7);
  color: var(--text);
  font: inherit;
  letter-spacing: 0.02em;
}

select {
  cursor: pointer;
  appearance: none;
}

.field--inline select {
  flex: 1 1 auto;
}

input::placeholder {
  color: rgba(143, 162, 184, 0.65);
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.is-hidden {
  display: none !important;
}

.modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 520px;
  margin-bottom: 10px;
}

.hint--mode {
  margin-bottom: 16px;
  max-width: 52ch;
}


.mode {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  clip-path: var(--chamfer-sm);
  background: rgba(6, 10, 16, 0.6);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.mode:hover {
  color: var(--text);
}

.mode.is-active {
  border-color: var(--amber);
  background: rgba(255, 176, 32, 0.12);
  color: var(--text);
}

.mode input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border: 1px solid rgba(143, 162, 184, 0.35);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--bot {
  border-color: rgba(255, 176, 32, 0.5);
  background: rgba(255, 176, 32, 0.12);
  color: var(--amber);
}

#code {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-weight: 700;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  clip-path: var(--chamfer-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.09);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  border-color: transparent;
  background: linear-gradient(180deg, #ffc24d, #f79c00);
  color: #1b1204;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(247, 156, 0, 0.28);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffcd6a, #ffa411);
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.rules {
  display: grid;
  gap: 8px;
  margin: 26px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  color: var(--muted);
  font-size: 15px;
}

.rules b {
  color: var(--text);
}

.codebox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 8px 0 20px;
  padding: 16px 18px;
  border: 1px dashed rgba(255, 176, 32, 0.45);
  border-radius: 14px;
  clip-path: var(--chamfer-sm);
  background: var(--amber-soft);
}

.codebox__value {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 800;
  letter-spacing: 0.24em;
  color: var(--amber);
}

.codebox__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.codebox .hint {
  margin: 0;
  flex: 1 1 100%;
}

/* ---- экран подбора случайного соперника ---- */

.search {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 8px 0 24px;
  text-align: center;
}

.search__radar {
  position: relative;
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
}

.search__ring {
  position: absolute;
  border: 1px solid rgba(255, 176, 32, 0.28);
  border-radius: 50%;
  animation: search-pulse 2.6s ease-out infinite;
}

.search__ring:nth-child(1) {
  inset: 0;
}

.search__ring:nth-child(2) {
  inset: 26px;
  animation-delay: 0.85s;
}

.search__ring:nth-child(3) {
  inset: 52px;
  animation-delay: 1.7s;
}

.search__sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255, 176, 32, 0.34), transparent 62%);
  animation: search-spin 2.4s linear infinite;
}

.search__core {
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffd27a, #f79c00 70%);
  box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.2), 0 0 30px rgba(255, 176, 32, 0.45);
  color: #1b1204;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.search__note,
.search__meta {
  margin: 0;
  color: var(--muted);
}

.search__clock {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.search__clock b {
  font-size: 26px;
}

@keyframes search-pulse {
  0% {
    transform: scale(0.82);
    opacity: 0;
  }
  35% {
    opacity: 0.85;
  }
  100% {
    transform: scale(1.06);
    opacity: 0;
  }
}

@keyframes search-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .search__ring,
  .search__sweep {
    animation: none;
  }
}


.players {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.player {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  clip-path: var(--chamfer-sm);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
}

.player--wait {
  color: var(--muted);
  font-weight: 500;
  border-style: dashed;
  justify-content: center;
}

.player__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(53, 208, 127, 0.16);
}

.player--wait .player__dot {
  background: var(--muted);
  box-shadow: none;
}

.player em {
  color: var(--amber);
  font-size: 12px;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hint {
  margin: 0 0 16px;
  color: var(--muted);
}

.game {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.game__top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.scorecard {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  clip-path: var(--chamfer-sm);
  background: rgba(255, 255, 255, 0.03);
}

.scorecard__name {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.scorecard__value {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.scorecard--you .scorecard__value {
  color: var(--amber);
}

.scorecard--empty {
  color: var(--muted);
  text-align: center;
  opacity: 0.5;
}

.roundinfo {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.roundinfo__round {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chip {
  padding: 4px 10px;
  border: 1px solid rgba(74, 168, 255, 0.35);
  border-radius: 999px;
  background: rgba(74, 168, 255, 0.12);
  color: #bcdcff;
  font-size: 12px;
  white-space: nowrap;
}

.timer {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.timer__bar {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--green), #7ee7a8);
  transition: background 0.3s ease;
}

.timer__bar[data-level='warn'] {
  background: linear-gradient(90deg, var(--amber), #ffd06a);
}

.timer__bar[data-level='danger'] {
  background: linear-gradient(90deg, var(--red), #ff9a94);
}

.timerline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.timerline__value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.question {
  margin: 0 0 18px;
  font-size: clamp(19px, 3vw, 25px);
  line-height: 1.3;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  clip-path: var(--chamfer-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

.option:hover:not(:disabled) {
  transform: translateX(2px);
  border-color: rgba(255, 176, 32, 0.5);
  background: rgba(255, 176, 32, 0.08);
}

.option:disabled {
  cursor: default;
}

.option__key {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.option__mark {
  font-weight: 800;
  font-size: 18px;
}

.option--picked {
  border-color: rgba(255, 176, 32, 0.6);
  background: rgba(255, 176, 32, 0.12);
}

.option--picked .option__key {
  border-color: var(--amber);
  color: var(--amber);
}

.option--muted {
  opacity: 0.45;
}

.option--correct {
  border-color: rgba(53, 208, 127, 0.7);
  background: rgba(53, 208, 127, 0.14);
}

.option--correct .option__mark {
  color: var(--green);
}

.option--wrong {
  border-color: rgba(255, 95, 86, 0.7);
  background: rgba(255, 95, 86, 0.13);
}

.option--wrong .option__mark {
  color: var(--red);
}

.status {
  margin: 18px 0 0;
  color: var(--muted);
}

.reveal {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 14px;
  background: rgba(53, 208, 127, 0.08);
}

.reveal--bad {
  border-left-color: var(--red);
  background: rgba(255, 95, 86, 0.08);
}

.reveal__points {
  font-size: 22px;
  font-weight: 800;
  color: var(--green);
}

.reveal--bad .reveal__points {
  color: var(--red);
}

.reveal__explanation {
  margin: 0 0 12px;
  color: var(--text);
}

.reactions {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
}

.reactions__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.reactions__name {
  color: var(--text);
  font-weight: 600;
}

.table {
  position: relative;
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 22px;
  font-size: 15px;
  clip-path: var(--chamfer-sm);
}

.table th,
.table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.table td:last-child,
.table th:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table tr.is-you td {
  background: rgba(255, 176, 32, 0.08);
}

.table tr.is-winner td {
  color: var(--amber);
  font-weight: 700;
}

.winner {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid rgba(255, 176, 32, 0.4);
  border-radius: 14px;
  clip-path: var(--chamfer);
  background: var(--amber-soft);
  text-align: center;
  margin-bottom: 4px;
}

.winner__label {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.12em;
}

.winner__name {
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 800;
  color: var(--amber);
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 20;
  max-width: min(92vw, 460px);
  padding: 13px 18px;
  border: 1px solid rgba(255, 95, 86, 0.5);
  border-radius: 12px;
  background: rgba(28, 12, 14, 0.96);
  color: #ffd7d4;
  box-shadow: var(--shadow);
  font-size: 15px;
}

.toast[data-tone='info'] {
  border-color: rgba(74, 168, 255, 0.5);
  background: rgba(10, 22, 36, 0.96);
  color: #cfe6ff;
}

.offline {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 15;
  padding: 10px 16px;
  background: rgba(120, 30, 20, 0.95);
  color: #ffe3e0;
  text-align: center;
  font-size: 14px;
}

@media (max-width: 640px) {
  .panel,
  .game {
    padding: 18px;
  }

  .game__top {
    grid-template-columns: 1fr 1fr;
  }

  .roundinfo {
    grid-column: 1 / -1;
    order: -1;
  }

  .btn {
    width: 100%;
  }

  .field--inline {
    flex-direction: column;
  }

  .modes {
    grid-template-columns: 1fr;
  }

  .cell--far,
  .cell--deep {
    opacity: 0.4;
  }

  .comb {
    opacity: 0.75;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cell {
    animation: none;
  }
}

/* ---- экран создания боя: игроки лицом к лицу ---- */

.versus {
  display: grid;
  grid-template-columns: 1fr 96px 1fr;
  align-items: center;
  gap: 8px;
  margin: 10px 0 22px;
}

.versus__side {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 0;
}

.versus__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 176, 32, 0.35);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
}

.versus__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.versus__fallback {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--amber);
  user-select: none;
}

.versus__fallback--bot {
  font-size: 44px;
  filter: drop-shadow(0 4px 10px rgba(255, 176, 32, 0.35));
}

.versus__avatar.versus__empty {
  border-color: rgba(255, 255, 255, 0.18);
  border-style: dashed;
  color: rgba(255, 255, 255, 0.35);
  font-size: 30px;
  font-weight: 700;
  animation: versus-breathe 2.2s ease-in-out infinite;
}

@keyframes versus-breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.versus__name {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.versus__name--wait {
  color: var(--muted);
  font-weight: 500;
}

/* ---- центр: анимированное противостояние ---- */

.versus__vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4px;
}

.versus__strike {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 176, 32, 0.85), transparent);
  box-shadow: 0 0 12px rgba(255, 176, 32, 0.5);
  opacity: 0;
  transform-origin: center;
  animation: versus-strike 1.7s ease-in-out infinite;
}

.versus__strike--right {
  animation-name: versus-strike-r;
  animation-delay: 0.85s;
}

@keyframes versus-strike {
  0% {
    opacity: 0;
    transform: scaleX(0.08);
  }
  32% {
    opacity: 1;
    transform: scaleX(1);
  }
  68%,
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes versus-strike-r {
  0% {
    opacity: 0;
    transform: scaleX(-0.08);
  }
  32% {
    opacity: 1;
    transform: scaleX(-1);
  }
  68%,
  100% {
    opacity: 0;
    transform: scaleX(-1);
  }
}

.versus__badge {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #1b1204;
  background: radial-gradient(circle at 32% 28%, #ffd27a, #f79c00 68%);
  box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.22), 0 0 24px rgba(255, 176, 32, 0.4);
  transform: rotate(-8deg);
  animation: versus-pulse 1.7s ease-in-out infinite;
}

.versus__badge::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 176, 32, 0.55);
  animation: versus-orbit 6s linear infinite;
}

@keyframes versus-orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes versus-pulse {
  0%, 100% {
    transform: rotate(-8deg) scale(1);
    box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.22), 0 0 20px rgba(255, 176, 32, 0.35);
  }
  50% {
    transform: rotate(-8deg) scale(1.16);
    box-shadow: 0 0 0 7px rgba(255, 176, 32, 0.14), 0 0 38px rgba(255, 176, 32, 0.65);
  }
}

@media (prefers-reduced-motion: reduce) {
  .versus__strike,
  .versus__badge,
  .versus__badge::before,
  .versus__empty {
    animation: none;
  }
}

/* ------------------------------------------------------------------ аккаунт */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px clamp(14px, 4vw, 32px) 0;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 18, 26, 0.72);
  backdrop-filter: blur(12px);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 15px;
}

.brand span {
  color: var(--accent);
}

.topbar__account {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  font: inherit;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.chip:hover {
  border-color: rgba(255, 176, 32, 0.6);
  background: rgba(255, 176, 32, 0.12);
}

.chip--accent {
  border-color: rgba(255, 176, 32, 0.55);
  color: var(--accent);
}

.chip--danger:hover {
  border-color: rgba(255, 90, 90, 0.7);
  background: rgba(255, 90, 90, 0.14);
  color: #ff9d9d;
}

.panel--narrow {
  max-width: 460px;
}

.panel--wide {
  max-width: 940px;
}

.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.panel__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- шапка профиля: фото слева, ФИО и имя в игре справа ---- */

.profile-top {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.profile-photo {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.profile-photo .field__hint {
  max-width: 30ch;
}

.profile-photo__actions {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.avatar {
  width: 152px;
  height: 152px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
}

.avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar__fallback {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--amber);
}

.profile-fields {
  margin: 0;
}

.profile-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.profile-toolbar {
  display: flex;
  justify-content: flex-end;
}

.profile-password {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.profile-password .field {
  margin-bottom: 0;
}

.profile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .profile-top {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .profile-fields {
    width: 100%;
  }
}

.title-sm {

  font-size: clamp(22px, 4vw, 30px);
  margin: 0 0 6px;
}

.lead--sm {
  font-size: 14px;
  margin-bottom: 18px;
}

.subtitle {
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  margin: 26px 0 12px;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.tab {
  flex: 1;
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.tab.is-active {
  background: rgba(255, 176, 32, 0.16);
  color: var(--accent);
}

.form {
  display: grid;
  gap: 14px;
  margin: 0 0 16px;
}

.form--row {
  grid-template-columns: 1fr auto;
  align-items: end;
}

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

.form-legend {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.form-error,
.form-ok {
  margin: 0;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 10px;
}

.form-error {
  background: rgba(255, 90, 90, 0.12);
  border: 1px solid rgba(255, 90, 90, 0.35);
  color: #ffb4b4;
}

.form-ok {
  background: rgba(90, 220, 150, 0.12);
  border: 1px solid rgba(90, 220, 150, 0.35);
  color: #9ff0c4;
}

.link-btn {
  font: inherit;
  font-size: 13px;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 4px 0;
  text-align: left;
}

.link-btn:hover {
  color: var(--accent);
}

.field__hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.stats--compact {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.stat {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.stat__label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.stat__value {
  font-size: 24px;
  line-height: 1.1;
}

.stat__hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.bars {
  display: grid;
  gap: 8px;
}

.bar {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.bar__label {
  color: rgba(255, 255, 255, 0.7);
}

.bar__track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ffd27a);
}

.bar__value {
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

.topics {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.topics li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.topics li span:last-child {
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.table--questions td {
  vertical-align: top;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
}

.outcome--win {
  color: #7fe0a8;
}

.outcome--loss,
.outcome--forfeit {
  color: #ff9d9d;
}

.outcome--draw {
  color: #ffd27a;
}

.empty {
  padding: 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  text-align: center;
}

.details {
  margin: 14px 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
}

.details summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--accent);
}

.details[open] summary {
  margin-bottom: 14px;
}

.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin: 18px 0;
}

.options {
  display: grid;
  gap: 10px;
}

.field--option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
}

.field--option label:first-child {
  grid-column: 1 / -1;
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

textarea {
  font: inherit;
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  resize: vertical;
}

@media (max-width: 720px) {
  .filters,
  .form--row {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .topbar__inner {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==================================================== телефон: вертикальный экран
   Задача — вопрос и четыре варианта ответа помещаются в экран целиком.
   Стратегия: всё, что должно быть видно всегда (счёт, таймер, варианты
   ответа, кнопки), не сжимается; длинный текст вопроса и разбор раунда
   прокручиваются внутри своей области. Шапка и кнопки уменьшены.        */

@media (max-width: 760px) {

  /* ------------------------------------------------------------- общее */

  .app {
    padding: 12px 10px calc(24px + env(safe-area-inset-bottom));
  }

  /* убираем двойной тап-зум и серую подсветку нажатия */
  .btn,
  .chip,
  .mode,
  .tab,
  .option,
  .player,
  input,
  select {
    touch-action: manipulation;
  }

  .btn,
  .chip,
  .mode,
  .tab,
  .option {
    -webkit-tap-highlight-color: transparent;
  }

  /* 16px в полях ввода: иначе iOS увеличивает страницу при фокусе */
  input,
  select,
  textarea {
    padding: 11px 12px;
    font-size: 16px;
  }

  /* --------------------------------------------------------- шапка */

  .topbar {
    padding: 7px 7px 0;
  }

  .topbar__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 9px;
    border-radius: 12px;
  }

  .brand {
    flex: 0 0 auto;
    font-size: 12px;
    letter-spacing: 0.1em;
  }

  /* кнопки шапки не переносятся, а прокручиваются по горизонтали */
  .topbar__account {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .topbar__account::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 5px 9px;
    font-size: 12px;
    line-height: 1.2;
  }

  /* ------------------------------------------------------ панели */

  .panel {
    padding: 16px;
    border-radius: 14px;
  }

  /* игровой блок на телефоне экономим по высоте в первую очередь */
  .game {
    padding: 12px;
    border-radius: 14px;
  }

  .eyebrow {
    font-size: 11px;
  }

  h1 {
    margin: 4px 0 8px;
    font-size: 30px;
  }

  h2,
  .title-sm {
    margin: 4px 0 10px;
    font-size: 22px;
  }

  .lead,
  .lead--sm {
    margin-bottom: 14px;
    font-size: 14px;
  }

  .subtitle {
    margin: 18px 0 10px;
    font-size: 13px;
  }

  .divider {
    margin: 14px 0 10px;
    font-size: 11px;
  }

  .field {
    gap: 4px;
    margin-bottom: 10px;
  }

  .field label {
    font-size: 11px;
  }

  /* ----------------------------------------------------- кнопки */

  .btn {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
  }

  .actions {
    gap: 8px;
  }

  .actions--tight {
    margin-top: 10px;
  }

  .codebox__actions .btn,
  .form__actions .btn,
  .panel__actions .btn {
    width: auto;
    flex: 1 1 auto;
    padding: 10px 12px;
    font-size: 13px;
  }

  .row-actions .chip {
    padding: 6px 8px;
    font-size: 11px;
  }

  /* ------------------------------------------------- главный экран */

  .modes {
    grid-template-columns: 1fr;
    gap: 6px;
    max-width: none;
  }

  .mode {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .hint,
  .hint--mode {
    margin-bottom: 12px;
    font-size: 13px;
  }

  .hint--tight {
    margin-bottom: 10px;
    font-size: 12px;
  }

  .rules {
    margin: 16px 0 0;
    padding: 12px 0 0;
    font-size: 13px;
  }

  .codebox {
    gap: 10px;
    margin: 6px 0 14px;
    padding: 12px 14px;
  }

  .codebox__value {
    font-size: 26px;
    letter-spacing: 0.2em;
  }

  /* ------------------------------------------------------- лобби */

  .versus {
    grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
    gap: 6px;
    margin: 6px 0 16px;
  }

  .versus__avatar {
    width: 68px;
    height: 68px;
  }

  .versus__fallback {
    font-size: 26px;
  }

  .versus__fallback--bot {
    font-size: 32px;
  }

  .versus__avatar.versus__empty {
    font-size: 24px;
  }

  .versus__name {
    font-size: 13px;
  }

  .versus__badge {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }

  .players {
    margin-bottom: 16px;
  }

  .player {
    padding: 10px 12px;
  }

  /* ------------------------------------------- поиск соперника */

  .search {
    gap: 10px;
    margin: 4px 0 16px;
  }

  .search__radar {
    width: 132px;
    height: 132px;
  }

  .search__ring:nth-child(2) {
    inset: 18px;
  }

  .search__ring:nth-child(3) {
    inset: 36px;
  }

  .search__core {
    width: 58px;
    height: 58px;
    font-size: 17px;
  }

  .search__clock b {
    font-size: 22px;
  }

  /* ---------------------------------------------------- итоги боя */

  .winner {
    padding: 12px;
  }

  .winner__name {
    font-size: 24px;
  }

  .table {
    min-width: 360px;
    margin: 12px 0 16px;
    font-size: 13px;
  }

  .table th,
  .table td {
    padding: 8px 6px;
  }

  .table th {
    font-size: 10px;
  }

  /* -------------------------------------------- аккаунт и админка */

  .tabs {
    margin-bottom: 12px;
  }

  .tab {
    padding: 10px 8px;
    font-size: 13px;
  }

  .stats {
    gap: 8px;
    margin: 12px 0;
  }

  .stat {
    gap: 2px;
    padding: 10px;
  }

  .stat__value {
    font-size: 20px;
  }

  .stat__hint,
  .topics,
  .mono {
    font-size: 11px;
  }

  .bar {
    grid-template-columns: 68px 1fr auto;
    gap: 8px;
    font-size: 12px;
  }

  .topics li {
    padding: 8px 10px;
  }

  .avatar {
    width: 116px;
    height: 116px;
    border-radius: 18px;
  }

  .avatar__fallback {
    font-size: 38px;
  }

  .profile-photo .field__hint {
    max-width: none;
  }

  .profile-main {
    gap: 14px;
  }

  .profile-password,
  .profile-foot {
    margin-top: 18px;
    padding-top: 14px;
  }

  .panel__head {
    gap: 10px;
  }

  .details {
    padding: 10px 12px;
  }

  .filters {
    margin: 12px 0;
  }

  .form {
    gap: 10px;
  }

  .pager {
    flex-wrap: wrap;
  }

  .empty {
    padding: 14px;
    font-size: 13px;
  }

  /* ------------------------------------------------- всплывашки */

  .toast {
    bottom: calc(12px + env(safe-area-inset-bottom));
    padding: 11px 14px;
    font-size: 14px;
  }

  .offline {
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    font-size: 13px;
  }
}

/* подсказка про клавиши бессмысленна на сенсорном экране */
@media (hover: none) {
  .timerline__hint {
    display: none;
  }
}

/* ------------------------------------------------ экран раунда на телефоне */

@media (max-width: 760px) {

  .game__top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px 8px;
    margin-bottom: 8px;
  }

  .roundinfo {
    grid-column: 1 / -1;
    order: -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    text-align: left;
  }

  .roundinfo__round {
    font-size: 12px;
  }

  /* счёт в одну строку: подпись и имя слева, очки справа */
  .scorecard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'label value'
      'name value';
    align-items: center;
    column-gap: 8px;
    padding: 5px 10px;
    border-radius: 11px;
  }

  .scorecard > .scorecard__name:nth-of-type(1) {
    grid-area: label;
  }

  .scorecard > .scorecard__value {
    grid-area: value;
    font-size: 22px;
  }

  .scorecard > .scorecard__name:nth-of-type(3) {
    grid-area: name;
    font-size: 11px;
    letter-spacing: 0;
    text-transform: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .timer {
    height: 6px;
  }

  .timerline {
    margin: 6px 0 8px;
    font-size: 11px;
  }

  .timerline__value {
    font-size: 14px;
  }

  .question {
    margin-bottom: 8px;
    font-size: clamp(17px, 4.6vw, 21px);
    line-height: 1.24;
  }

  .options {
    gap: 7px;
  }

  .option {
    padding: 10px 11px;
    gap: 9px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.25;
  }

  .option__key {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: 12px;
  }

  .option__mark {
    font-size: 16px;
  }

  .status {
    margin: 8px 0 0;
    font-size: 12px;
  }

  .reveal {
    margin-top: 8px;
    padding: 10px 12px;
  }

  .reveal__points {
    font-size: 19px;
  }

  .reveal__explanation {
    margin-bottom: 10px;
    font-size: 14px;
  }

  .reactions {
    font-size: 12px;
  }

  /* Кнопка выхода из боя — редкое действие, поэтому она не занимает строку,
     а закреплена в углу, а место под неё зарезервировано внизу панели.
     Так она не может вытеснить варианты ответа за пределы экрана.      */
  body.is-game .game {
    position: relative;
    padding-bottom: 44px;
  }

  body.is-game .actions--tight {
    position: absolute;
    right: 12px;
    bottom: 10px;
    margin-top: 0;
  }

  body.is-game .actions--tight .btn {
    width: auto;
    padding: 7px 12px;
    font-size: 13px;
  }
}

/* Вертикальная ориентация: страница раунда не прокручивается, а подгоняется
   под экран — варианты ответа и кнопки остаются на виду целиком.         */

@media (orientation: portrait) {
  /* Шапка и страница — две строки колонки, чтобы .app занял ровно
     оставшуюся высоту. Иначе height: 100% отсчитывался от верха body
     и содержимое уходило под нижний край экрана ровно на высоту шапки. */
  body.is-game {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.is-game .topbar {
    flex: 0 0 auto;
  }

  body.is-game .app {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.is-game .game {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 0;
  }

  /* всегда видны и никогда не сжимаются */
  body.is-game .game__top,
  body.is-game .timer,
  body.is-game .timerline,
  body.is-game .options,
  body.is-game .status,
  body.is-game .actions {
    flex: 0 0 auto;
  }

  /* длинный текст прокручивается внутри своей области: рамка по содержимому,
     но при нехватке места текст сжимается и уезжает в прокрутку */
  body.is-game .question,
  body.is-game .reveal {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.is-game .question {
    min-height: 2.1em;
  }

  /* Разбор раунда уступает место первым (shrink 4 против 1 у вопроса):
     так кнопка «Покинуть бой» и все варианты остаются на экране. */
  body.is-game .reveal {
    flex-shrink: 4;
    min-height: 2.8em;
  }

  /* отсчёт до следующего вопроса остаётся виден при прокрутке разбора */
  body.is-game .reveal .status {
    position: sticky;
    bottom: -10px;
    margin: 10px 0 0;
    padding: 4px 0;
    background: linear-gradient(180deg, rgba(17, 22, 30, 0), rgba(17, 22, 30, 0.95) 40%);
  }
}
