:root {
  --bg: #16171d;
  --surface: #242633;
  --surface-strong: #303345;
  --text: #ffffff;
  --text-muted: #c8ccda;
  --success: #20d37a;
  --warning: #ffcc33;
  --danger: #ff4f5e;
  --focus: #ffffff;
  --player-1: #ff335f;
  --player-2: #24b8ff;
  --player-3: #ffd23f;
  --player-4: #39d98a;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: #080a10;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(140deg, rgba(255, 51, 95, 0.08), transparent 28%),
    linear-gradient(220deg, rgba(36, 184, 255, 0.08), transparent 30%),
    linear-gradient(180deg, #080a10 0%, var(--bg) 54%, #0b0d14 100%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

.app-shell {
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.start-screen,
.winner-screen,
.reaction-screen {
  height: 100vh;
  overflow: hidden;
}

.start-screen,
.winner-screen {
  display: grid;
  place-items: center;
  padding: 32px;
}

.start-card,
.winner-card {
  width: min(920px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 36px;
  background: rgba(20, 22, 31, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-large {
  justify-content: center;
  margin-bottom: 32px;
}

.brand-main {
  color: #fff;
  font-size: 44px;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.36);
}

.brand-accent {
  color: var(--player-1);
  font-size: 34px;
  font-weight: 1000;
  font-style: italic;
  line-height: 1;
  text-shadow: 0 0 22px rgba(255, 51, 95, 0.42);
  transform: rotate(-2deg);
}

.brand-large .brand-main {
  font-size: 72px;
}

.brand-large .brand-accent {
  font-size: 52px;
}

.name-form {
  display: grid;
  gap: 28px;
}

.name-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.name-field {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 2px solid color-mix(in srgb, var(--player-color), #ffffff 20%);
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--player-color), transparent 72%), rgba(255, 255, 255, 0.05));
}

.name-field span,
.eyebrow {
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.name-field input {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 28px;
  font-weight: 900;
  background: rgba(0, 0, 0, 0.32);
}

.primary-button,
.secondary-button,
.dock-button {
  border: 0;
  border-radius: 8px;
  padding: 16px 22px;
  font-size: 22px;
  font-weight: 1000;
  text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.primary-button {
  color: #fff;
  background: linear-gradient(180deg, #ff4f7b, #f00055);
  border: 2px solid rgba(255, 255, 255, 0.72);
  justify-self: center;
  min-width: 240px;
}

.secondary-button,
.dock-button {
  color: var(--text);
  background: var(--surface-strong);
  border: 2px solid rgba(255, 255, 255, 0.18);
}

.game-screen {
  --active-color: var(--player-1);
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(8px, 1.2vh, 16px);
  overflow: hidden;
  padding: clamp(12px, 2vh, 24px);
}

.top-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, auto) minmax(260px, 1fr);
  align-items: center;
  gap: 18px;
}

.turn-banner {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 86px;
  padding: 14px 62px 14px 40px;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  color: #fff;
  text-transform: uppercase;
  background: linear-gradient(180deg, color-mix(in srgb, var(--active-color), #ffffff 8%), color-mix(in srgb, var(--active-color), #000000 42%));
  box-shadow: 0 0 30px color-mix(in srgb, var(--active-color), transparent 42%);
  clip-path: polygon(0 0, calc(100% - 42px) 0, 100% 50%, calc(100% - 42px) 100%, 0 100%);
}

.turn-banner span {
  font-size: 16px;
  font-weight: 900;
}

.turn-banner strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 36px;
  font-weight: 1000;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-badges {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

.stat-badge {
  min-width: 136px;
  padding: 12px 16px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(18, 20, 29, 0.78);
  text-align: center;
  text-transform: uppercase;
}

.stat-badge span {
  display: block;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 900;
}

.stat-badge strong {
  display: block;
  overflow: hidden;
  color: var(--warning);
  font-size: 32px;
  font-weight: 1000;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-badge.quiet strong {
  color: var(--text);
  font-size: 24px;
}

.main-grid {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(10px, 1.2vw, 18px);
}

.players-grid {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 0.9vw, 12px);
}

.player-card {
  --player-header-height: clamp(42px, 5vh, 52px);
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--player-color), #ffffff 22%);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--player-color), #ffffff 8%) 0 var(--player-header-height), transparent var(--player-header-height)),
    linear-gradient(180deg, color-mix(in srgb, var(--player-color), #000000 24%), color-mix(in srgb, var(--player-color), #000000 62%));
  box-shadow: 0 22px 38px rgba(0, 0, 0, 0.36);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.player-card.is-active {
  border-color: #fff;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--player-color), transparent 18%),
    0 0 34px color-mix(in srgb, var(--player-color), transparent 30%),
    0 24px 42px rgba(0, 0, 0, 0.48);
  transform: translateY(-4px);
}

.player-header {
  flex: 0 0 var(--player-header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--player-header-height);
  padding: 0 12px;
  text-transform: uppercase;
}

.player-header span {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(19px, 2.4vh, 24px);
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-header em {
  flex: 0 0 auto;
  color: #12050a;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  font-style: normal;
  font-weight: 1000;
  background: var(--warning);
}

.total-score {
  flex: 0 0 auto;
  padding: clamp(3px, 0.7vh, 8px) 14px clamp(4px, 0.8vh, 10px);
  font-size: clamp(44px, 7.2vh, 72px);
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
  line-height: 0.95;
  text-align: center;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.28);
}

.bonus-meter {
  flex: 0 0 auto;
  margin: 0 12px clamp(5px, 0.8vh, 8px);
  padding: clamp(5px, 0.7vh, 8px) 10px clamp(6px, 0.8vh, 10px);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.38);
}

.bonus-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: color-mix(in srgb, var(--player-color), #ffffff 34%);
  font-size: clamp(12px, 1.45vh, 15px);
  font-weight: 1000;
  text-transform: uppercase;
}

.bonus-label strong {
  flex: 0 0 auto;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.bonus-meter.is-ready .bonus-label,
.bonus-meter.is-ready .bonus-label strong {
  color: var(--warning);
}

.meter-track {
  height: clamp(8px, 1.2vh, 12px);
  overflow: hidden;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.meter-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--player-color), #fff069);
}

.score-rows {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(14, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  padding: 0 14px clamp(4px, 0.7vh, 10px);
}

.score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 0;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(11px, 1.55vh, 14px);
  font-weight: 900;
}

.score-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-row strong {
  color: rgba(255, 255, 255, 0.52);
  font-size: clamp(12px, 1.7vh, 17px);
  font-variant-numeric: tabular-nums;
}

.score-row.is-filled {
  color: #fff;
}

.score-row.is-open {
  color: #fff;
}

.score-row.is-open span {
  color: color-mix(in srgb, var(--player-color), #ffffff 42%);
}

.score-row.is-open strong {
  color: var(--warning);
  font-size: clamp(10px, 1.35vh, 13px);
  text-transform: uppercase;
}

.score-row.is-filled strong,
.bonus-row strong {
  color: #fff;
}

.bonus-row strong {
  color: var(--warning);
}

.player-footer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: clamp(6px, 0.9vh, 10px) 14px clamp(8px, 1vh, 14px);
  color: #fff;
  font-weight: 1000;
  text-transform: uppercase;
}

.player-footer span {
  font-size: clamp(16px, 2vh, 20px);
}

.player-footer strong {
  font-size: clamp(24px, 3.6vh, 34px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.side-panel,
.choice-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 16px;
  background: rgba(18, 20, 29, 0.74);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.34);
}

.side-panel h2 {
  margin: 0 0 14px;
  font-size: clamp(22px, 2.7vh, 26px);
  font-weight: 1000;
  text-align: center;
  text-transform: uppercase;
}

.choice-panel {
  display: flex;
  flex-direction: column;
}

.leader-list {
  display: grid;
  gap: clamp(6px, 0.8vh, 8px);
}

.leader-row,
.final-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: clamp(38px, 4.8vh, 48px);
  border-left: 8px solid var(--player-color);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.08);
}

.leader-row span,
.final-row span {
  color: var(--warning);
  font-size: 22px;
  font-weight: 1000;
  text-align: center;
}

.leader-row strong,
.final-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: 20px;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-row em,
.final-row em {
  color: #fff;
  font-size: 24px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
}

.mini-card {
  margin-top: clamp(10px, 1.4vh, 16px);
  padding-top: clamp(10px, 1.4vh, 16px);
  border-top: 2px solid rgba(255, 255, 255, 0.14);
}

.mini-card span {
  display: block;
  color: var(--warning);
  font-size: 15px;
  font-weight: 1000;
  text-transform: uppercase;
}

.mini-card strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 24px;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-card p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: clamp(13px, 1.7vh, 16px);
  font-weight: 700;
  line-height: 1.35;
}

.impact-card span {
  color: var(--player-color);
}

.choice-heading {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: clamp(8px, 1.2vh, 14px);
  text-transform: uppercase;
}

.choice-heading span {
  font-size: clamp(20px, 2.3vh, 24px);
  font-weight: 1000;
}

.choice-heading strong {
  color: var(--warning);
  font-size: clamp(30px, 4.2vh, 36px);
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
  line-height: 1;
}

.choices {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(5px, 0.7vh, 10px);
  overflow: hidden;
}

.choice-tile {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 0;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  overflow: hidden;
  padding: clamp(5px, 0.62vh, 10px) 12px;
  color: var(--text);
  text-align: left;
  background: linear-gradient(180deg, #303544, #1b1f2b);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.22);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, background 140ms ease;
}

.choice-tile span {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
}

.choice-tile strong {
  overflow: hidden;
  font-size: clamp(13px, 1.75vh, 20px);
  line-height: 1;
  font-weight: 1000;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.choice-tile em {
  flex: 0 0 auto;
  overflow: hidden;
  color: var(--warning);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: clamp(8px, 0.95vh, 11px);
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
  background: rgba(0, 0, 0, 0.32);
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.choice-tile b {
  min-width: 1.55em;
  font-size: clamp(20px, 2.55vh, 32px);
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
  line-height: 1;
  text-align: right;
}

.choice-panel.is-dense {
  container-type: inline-size;
  padding: clamp(10px, 1.35vh, 16px);
}

.choice-panel.is-dense .choice-heading {
  margin-bottom: clamp(6px, 0.8vh, 10px);
}

.choice-panel.is-dense .choice-heading span {
  font-size: clamp(18px, 2vh, 22px);
}

.choice-panel.is-dense .choice-heading strong {
  font-size: clamp(28px, 3.6vh, 34px);
}

.choice-panel.is-dense .choices {
  gap: clamp(4px, 0.52vh, 7px);
}

.choice-panel.is-dense .choice-tile {
  border-width: 2px;
  padding: clamp(3px, 0.45vh, 6px) 10px;
}

.choice-panel.is-dense .choice-tile strong {
  font-size: clamp(12px, 1.55vh, 17px);
}

.choice-panel.is-dense .choice-tile em {
  font-size: clamp(7px, 0.82vh, 9px);
}

.choice-panel.is-dense .choice-tile b {
  font-size: clamp(18px, 2.25vh, 28px);
}

@container (min-width: 520px) {
  .choice-panel.is-dense .choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.choice-tile.is-selected {
  border-color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--active-color), #ffffff 10%), color-mix(in srgb, var(--active-color), #000000 18%));
  box-shadow: 0 0 28px color-mix(in srgb, var(--active-color), transparent 34%);
  transform: translateX(-10px);
}

.choice-tile.is-selected::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -18px;
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-right: 18px solid #fff;
  transform: translateY(-50%);
}

.choice-tile.is-forced {
  background: linear-gradient(180deg, color-mix(in srgb, var(--danger), #303544 30%), #2a1720);
}

.dice-dock,
.ready-dock {
  min-height: 0;
  height: clamp(98px, 14vh, 140px);
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(18, 20, 29, 0.76);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.36);
}

.dice-dock {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 180px;
  align-items: center;
  gap: 18px;
  padding: clamp(10px, 1.4vh, 16px) 22px;
}

.dice-status {
  display: grid;
  gap: 6px;
  text-align: left;
  text-transform: uppercase;
}

.dice-status span {
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 1000;
}

.dice-status strong {
  overflow: hidden;
  color: #fff;
  font-size: 26px;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dice-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-width: 0;
}

.die {
  display: grid;
  place-items: center;
  width: clamp(70px, 11vh, 112px);
  aspect-ratio: 1;
  border: 3px solid rgba(0, 0, 0, 0.52);
  border-radius: 8px;
  color: #0b0d14;
  background: linear-gradient(145deg, #ffffff, #d9dbe2);
  box-shadow: 0 10px 0 #aeb2bd, 0 22px 28px rgba(0, 0, 0, 0.36);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.die.is-selected {
  border-color: #fff;
  box-shadow:
    0 10px 0 #aeb2bd,
    0 0 0 6px var(--active-color),
    0 0 28px color-mix(in srgb, var(--active-color), transparent 18%),
    0 24px 32px rgba(0, 0, 0, 0.42);
  transform: translateY(-8px);
}

.empty-die {
  color: rgba(0, 0, 0, 0.32);
  font-size: 54px;
  font-weight: 1000;
}

.pip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 7px;
  width: 66%;
  aspect-ratio: 1;
}

.pip-grid i {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  background: #090a0f;
}

.pip-grid i.is-on {
  opacity: 1;
}

.ready-dock {
  position: relative;
  display: grid;
  grid-template-columns: minmax(130px, 0.28fr) minmax(0, 1fr) minmax(180px, 240px) auto;
  align-items: center;
  gap: 24px;
  padding: clamp(12px, 1.5vh, 18px) 24px;
}

.round-block,
.next-block {
  min-width: 0;
}

.round-block strong {
  display: block;
  color: var(--warning);
  font-size: clamp(30px, 4.5vh, 44px);
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
  line-height: 1;
}

.next-block h2 {
  margin: 4px 0 0;
  overflow: hidden;
  font-size: clamp(30px, 4.5vh, 44px);
  font-weight: 1000;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.dock-actions {
  grid-column: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.dock-actions .primary-button,
.dock-actions .secondary-button {
  justify-self: auto;
  min-width: 0;
  white-space: nowrap;
}

.dock-actions .secondary-button {
  padding-inline: 18px;
}

.score-badge {
  grid-column: 3;
  justify-self: end;
  min-width: 220px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  background: linear-gradient(180deg, var(--player-color), color-mix(in srgb, var(--player-color), #000000 45%));
  box-shadow: 0 0 26px color-mix(in srgb, var(--player-color), transparent 32%);
  text-transform: uppercase;
  animation: badge-pop 360ms ease both;
}

.score-badge span {
  display: block;
  font-size: 15px;
  font-weight: 1000;
}

.score-badge strong {
  display: block;
  font-size: 42px;
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
  line-height: 1;
}

.reaction-screen {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #05060a;
}

.reaction-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reaction-overlay {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: min(1100px, 88vw);
  padding: 32px;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.72);
}

.reaction-overlay span {
  color: var(--warning);
  font-size: 44px;
  font-weight: 1000;
}

.reaction-overlay strong {
  font-size: 86px;
  font-weight: 1000;
  line-height: 0.98;
}

.reaction-overlay em {
  color: #fff;
  font-size: 30px;
  font-style: normal;
  font-weight: 1000;
}

.winner-screen {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--active-color), transparent 78%), transparent),
    linear-gradient(180deg, #080a10, #171923);
}

.winner-card {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.winner-card h1 {
  max-width: 100%;
  overflow: hidden;
  margin: 0;
  color: #fff;
  font-size: 76px;
  font-weight: 1000;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 0 28px color-mix(in srgb, var(--active-color), transparent 28%);
}

.winner-score {
  color: var(--warning);
  font-size: 96px;
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
  line-height: 0.9;
}

.final-list {
  width: min(640px, 100%);
  display: grid;
  gap: 10px;
}

.winner-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

@keyframes badge-pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1280px) {
  .game-screen {
    padding: 18px;
  }

  .top-bar {
    grid-template-columns: 1fr;
  }

  .brand,
  .top-badges {
    justify-content: center;
  }

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

  .players-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-panel,
  .choice-panel {
    order: 2;
  }

  .dice-dock,
  .ready-dock {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .dock-actions,
  .score-badge {
    grid-column: auto;
  }

  .score-badge {
    justify-self: center;
  }
}

@media (max-width: 760px) {
  .start-screen,
  .winner-screen {
    padding: 16px;
  }

  .start-card,
  .winner-card {
    padding: 22px;
  }

  .brand,
  .brand-large {
    align-items: center;
    flex-direction: column;
    gap: 4px;
    white-space: normal;
  }

  .brand-main,
  .brand-large .brand-main {
    font-size: 44px;
  }

  .brand-accent,
  .brand-large .brand-accent {
    font-size: 32px;
  }

  .name-grid,
  .players-grid {
    grid-template-columns: 1fr;
  }

  .turn-banner {
    min-height: 78px;
    padding: 12px 48px 12px 22px;
  }

  .turn-banner strong {
    font-size: 28px;
  }

  .total-score {
    font-size: 58px;
  }

  .dice-row {
    flex-wrap: wrap;
  }

  .next-block h2,
  .winner-card h1 {
    font-size: 42px;
    white-space: normal;
  }

  .winner-score {
    font-size: 76px;
  }
}
