/* Dart Scoreboard -- dark, tablet-first. Big touch targets, big numbers. */

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/outfit-var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0a0d13;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eef1f6;
  --muted: #7d8699;
  --green: #2fdd78;
  --green-deep: #16a34a;
  --red: #f4514e;
  --amber: #fcc23c;
  --radius: 18px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(110vmax 60vmax at 85% -15%, rgba(47, 221, 120, 0.08), transparent 55%),
    radial-gradient(90vmax 55vmax at -15% 115%, rgba(59, 130, 246, 0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#app,
.screen {
  height: 100%;
}

button {
  font-family: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
}

button:active:not(:disabled) {
  transform: scale(0.95);
  background: var(--line-2);
}

button:disabled {
  opacity: 0.3;
  cursor: default;
}

button svg {
  width: 22px;
  height: 22px;
  display: block;
  margin: auto;
}

.avatar {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: hsl(var(--hue, 152) 90% 72%);
  background: hsl(var(--hue, 152) 70% 50% / 0.14);
  border: 1px solid hsl(var(--hue, 152) 70% 60% / 0.35);
}

/* ---------- setup screen ---------- */

.setup {
  /* Full-width scroll container so the scrollbar sits at the window edge;
     the content column is centered with padding rather than max-width. */
  --setup-col: 600px;
  padding: max(20px, env(safe-area-inset-top)) max(18px, calc((100% - var(--setup-col)) / 2)) max(28px, env(safe-area-inset-bottom));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setup-head {
  text-align: center;
  padding: 14px 0 4px;
}

.setup-head .logo {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 6px 24px rgba(239, 68, 68, 0.35));
}

.setup-head h1 {
  margin: 10px 0 4px;
  font-size: clamp(1.35rem, 4.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.resume-banner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 16px 20px;
  background: linear-gradient(120deg, rgba(47, 221, 120, 0.16), rgba(47, 221, 120, 0.06));
  border: 1px solid rgba(47, 221, 120, 0.4);
  text-align: left;
}

.resume-title {
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--green);
}

.resume-sub {
  color: var(--muted);
  font-size: 0.86rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.card h2:not(:first-child) {
  margin-top: 22px;
}

.seg {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.seg-btn {
  flex: 1;
  min-height: 52px;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 12px;
}

.seg-btn.on {
  color: #06130b;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  box-shadow: 0 4px 16px rgba(47, 221, 120, 0.35);
  font-weight: 800;
}

.seg-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 14px;
  min-height: 64px;
  border-radius: 14px;
  text-align: left;
}

.mode-card b {
  font-size: 1.02rem;
  font-weight: 700;
}

.mode-card small {
  color: var(--muted);
  font-size: 0.75rem;
}

.mode-card.on {
  border-color: var(--green);
  background: linear-gradient(160deg, rgba(47, 221, 120, 0.16), rgba(47, 221, 120, 0.05));
}

.mode-card.on small {
  color: rgba(187, 247, 208, 0.8);
}

.player-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-row input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--line);
  border-radius: 14px;
  user-select: text;
  -webkit-user-select: text;
}

.player-row input:focus {
  outline: none;
  border-color: var(--green);
}

.row-del {
  flex: none;
  width: 48px;
  height: 48px;
  color: var(--muted);
  border-radius: 14px;
  background: transparent;
}

.row-del svg {
  width: 16px;
  height: 16px;
}

.bot-chip {
  flex: none;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--amber);
  background: rgba(252, 194, 60, 0.08);
  border-color: rgba(252, 194, 60, 0.3);
  white-space: nowrap;
}

.hcap {
  flex: none;
  width: 72px;
  min-height: 50px;
  padding: 0;
  text-align: center;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--amber);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(252, 194, 60, 0.3);
  border-radius: 14px;
  user-select: text;
  -webkit-user-select: text;
}

.hcap:focus {
  outline: none;
  border-color: var(--amber);
}

.add-row {
  display: flex;
  gap: 10px;
}

.btn-add {
  margin-top: 12px;
  flex: 1;
  min-height: 50px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border-style: dashed;
  border-radius: 14px;
}

.btn-start {
  min-height: 66px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #06130b;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  border: none;
  box-shadow: 0 10px 30px rgba(47, 221, 120, 0.3);
}

/* ---------- game screen ---------- */

.game {
  display: flex;
  flex-direction: column;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  gap: 12px;
}

.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.game-info {
  display: flex;
  gap: 6px;
  overflow: hidden;
}

.chip {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.head-right {
  display: flex;
  gap: 8px;
}

.head-btn {
  width: 52px;
  height: 46px;
  color: var(--muted);
  border-radius: 14px;
}

.head-btn:active:not(:disabled) {
  color: var(--text);
}

.game-body {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 12px;
  grid-template-rows: auto 1fr;
}

@media (orientation: landscape) {
  .game-body {
    grid-template-rows: 1fr;
    grid-template-columns: 1fr minmax(330px, 410px);
  }
}

/* player cards */

.players {
  display: grid;
  gap: 12px;
  align-content: start;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  overflow-y: auto;
}

.players.n1,
.players.n2 {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

@media (orientation: landscape) {
  .players.n1,
  .players.n2 {
    grid-template-columns: 1fr;
    align-content: stretch;
  }

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

.pcard {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  text-align: center;
  min-height: 0;
  overflow: hidden;
}

.pcard.active {
  border-color: hsl(var(--hue) 75% 55% / 0.65);
  background:
    radial-gradient(120% 100% at 50% -20%, hsl(var(--hue) 75% 50% / 0.13), transparent 60%),
    var(--panel);
  box-shadow: 0 0 0 1px hsl(var(--hue) 75% 55% / 0.25), 0 14px 44px hsl(var(--hue) 75% 45% / 0.16);
}

.pcard-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pname {
  flex: 1;
  text-align: left;
  font-weight: 700;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legpips {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legpips i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-2);
}

.legpips i.won {
  background: var(--amber);
  box-shadow: 0 0 10px rgba(252, 194, 60, 0.6);
}

.legpips.num {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--amber);
}

.legpips.num small {
  color: var(--muted);
  font-weight: 600;
}

.prem {
  font-size: clamp(3rem, 11vh, 6.2rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.pcard.active .prem {
  color: #fff;
  text-shadow: 0 0 36px hsl(var(--hue) 80% 60% / 0.35);
}

.pchip-row {
  min-height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pchip {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: clamp(0.9rem, 1.8vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.pchip.finish {
  color: #1a1304;
  background: linear-gradient(135deg, #ffd968, var(--amber));
  box-shadow: 0 4px 18px rgba(252, 194, 60, 0.35);
}

.pchip.ghost {
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-weight: 600;
}

.pbar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.pbar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, hsl(var(--hue) 70% 45%), hsl(var(--hue) 85% 60%));
  transition: width 0.4s ease;
}

.pstats {
  display: flex;
  justify-content: space-around;
  padding-top: 4px;
}

.pstats span {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.pstats b {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pstats small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* input panel */

.input-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
}

.entry {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--green);
}

.entry-hint {
  color: rgba(255, 255, 255, 0.14);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.keypad {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
  min-height: 236px;
}

.kbtn {
  font-size: 1.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-height: 52px;
  background: var(--panel-2);
  border-radius: 16px;
}

.kbtn.kok {
  color: #06130b;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  border: none;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 24px rgba(47, 221, 120, 0.25);
}

.kbtn.kbsp {
  font-size: 1.35rem;
  color: var(--muted);
}

.btn-bust {
  min-height: 50px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: var(--red);
  background: rgba(244, 81, 78, 0.07);
  border-color: rgba(244, 81, 78, 0.35);
}

/* ---------- cricket ---------- */

.cricket-board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 10px 14px;
  overflow: auto;
  display: flex;
}

.cricket-table {
  flex: 1;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  align-self: center;
}

.cricket-table th,
.cricket-table td {
  text-align: center;
  padding: clamp(6px, 1.6vh, 14px) 8px;
  border-bottom: 1px solid var(--line);
}

.cricket-table thead th {
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 12px;
}

.cricket-table thead th .avatar {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
  border-radius: 10px;
  vertical-align: middle;
  margin-right: 8px;
}

.ct-name {
  font-weight: 700;
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  vertical-align: middle;
}

.cricket-table thead th.active {
  color: hsl(var(--hue) 90% 70%);
}

.ct-target {
  font-weight: 800;
  font-size: clamp(1.1rem, 2.4vh, 1.5rem);
  color: var(--muted);
  width: 64px;
}

.ct-cell {
  font-size: clamp(1.2rem, 2.6vh, 1.7rem);
  font-weight: 700;
  color: var(--amber);
}

.ct-cell.closed {
  color: var(--green);
}

tr.dead .ct-target,
tr.dead .ct-cell {
  opacity: 0.3;
}

.ct-points td {
  border-bottom: none;
  font-weight: 800;
  font-size: clamp(1.1rem, 2.4vh, 1.5rem);
  padding-top: 14px;
}

.ct-points td:first-child {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.ci-status {
  justify-content: space-between;
  padding: 0 20px;
}

.ci-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

.ci-taps {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.ckeys {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
  min-height: 280px;
}

.ckey.mine {
  color: var(--green);
  border-color: rgba(47, 221, 120, 0.35);
}

/* Bull is the 7th key -- let it fill its row. */
.ckeys .ckey:nth-child(7) {
  grid-column: 1 / -1;
}

.ckey-end {
  grid-column: 1 / -1;
}

/* ---------- around the clock / bob's 27 / halve-it ---------- */

.hitpad {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: 10px;
  min-height: 240px;
}

.hbtn {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--green);
  border-color: rgba(47, 221, 120, 0.3);
}

.hbtn.miss {
  color: var(--muted);
  border-color: var(--line);
}

/* ---------- shanghai ---------- */

.skeys {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
  min-height: 240px;
}

.skey {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 1.9rem;
  font-weight: 800;
}

.skey small {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.skey-end {
  grid-column: 1 / -1;
}

/* ---------- killer ---------- */

.kkeys {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
  min-height: 260px;
}

.kkey {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 1.35rem;
  font-weight: 800;
}

.kkey small {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kkey.own {
  color: var(--amber);
  border-color: rgba(252, 194, 60, 0.3);
}

.kkey.miss {
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.2em;
}

.kkey-end {
  grid-column: 1 / -1;
}

.badge-killer {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #1a0505;
  background: linear-gradient(135deg, #ff7a76, var(--red));
  box-shadow: 0 4px 14px rgba(244, 81, 78, 0.4);
}

.hearts i {
  font-style: normal;
  font-size: 1.25rem;
  margin: 0 3px;
  color: var(--line-2);
}

.hearts i.on {
  color: var(--red);
  text-shadow: 0 0 12px rgba(244, 81, 78, 0.5);
}

.pcard.dead {
  opacity: 0.45;
  filter: saturate(0.3);
}

.ct-legs {
  color: var(--amber);
  font-weight: 800;
}

/* ---------- tournament ---------- */

.standings th,
.standings td {
  font-size: 0.95rem;
}

.fixtures {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fixture {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  font-size: 0.95rem;
}

.fixture span:first-child {
  text-align: right;
}

.fixture b {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.fixture.played {
  opacity: 0.65;
}

.fixture.next {
  border-color: rgba(47, 221, 120, 0.45);
  background: rgba(47, 221, 120, 0.06);
}

.fixture .won {
  color: var(--green);
  font-weight: 700;
}

.champion {
  text-align: center;
}

.champion h3 {
  margin: 8px 0 0;
  font-size: 1.4rem;
}

.input-panel.waiting .keypad,
.input-panel.waiting .btn-bust {
  opacity: 0.35;
  pointer-events: none;
}

.input-panel.waiting .entry-hint {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  animation: pulse 1.4s ease infinite;
}

@keyframes pulse {
  50% { opacity: 0.45; }
}

/* ---------- modals / toast ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 9, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.modal {
  background: #11151d;
  border: 1px solid var(--line-2);
  border-radius: 26px;
  padding: 28px 26px;
  width: min(460px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: modal-in 0.18s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }
}

.modal h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.modal-sub {
  margin: -6px 0 0;
  color: var(--muted);
}

.big-emoji {
  font-size: 3.2rem;
  line-height: 1;
}

.darts-opts {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.dbtn {
  width: 80px;
  height: 80px;
  font-size: 1.9rem;
  font-weight: 800;
  color: #06130b;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  border: none;
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(47, 221, 120, 0.25);
}

.modal-row {
  display: flex;
  gap: 10px;
}

.modal-row button {
  flex: 1;
}

.btn-primary,
.btn-ghost,
.btn-danger {
  min-height: 56px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 16px;
}

.btn-primary {
  color: #06130b;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  border: none;
  font-weight: 800;
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  background: rgba(244, 81, 78, 0.1);
  border-color: rgba(244, 81, 78, 0.45);
  color: var(--red);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}

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

.stats-table td:first-child {
  text-align: left;
  color: var(--muted);
  font-size: 0.86rem;
}

.stats-table th {
  font-size: 0.9rem;
  font-weight: 700;
}

.stats-table tr:last-child td {
  border-bottom: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: #181d27;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 13px 30px;
  font-weight: 800;
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.bad {
  color: var(--red);
  border-color: rgba(244, 81, 78, 0.5);
}

/* ---------- desktop / keyboard ---------- */

/* Keyboard shortcut hints -- only shown where a keyboard is likely. */
.kbd-hint {
  display: none;
}

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

@media (hover: hover) and (pointer: fine) {
  .kbd-hint {
    display: inline;
  }

  button:not(:disabled):hover {
    border-color: var(--line-2);
    background: var(--line-2);
  }

  .seg-btn:not(.on):not(:disabled):hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
  }

  .seg-btn.on:hover,
  .kbtn.kok:not(:disabled):hover,
  .btn-start:hover,
  .btn-primary:hover,
  .dbtn:hover {
    background: linear-gradient(135deg, var(--green), var(--green-deep));
    filter: brightness(1.12);
  }

  .btn-danger:hover {
    background: rgba(244, 81, 78, 0.2);
    border-color: rgba(244, 81, 78, 0.45);
  }

  .btn-bust:not(:disabled):hover {
    background: rgba(244, 81, 78, 0.14);
    border-color: rgba(244, 81, 78, 0.35);
  }

  .mode-card.on:hover {
    border-color: var(--green);
    background: linear-gradient(160deg, rgba(47, 221, 120, 0.2), rgba(47, 221, 120, 0.08));
  }

  .bot-chip:hover {
    background: rgba(252, 194, 60, 0.16);
    border-color: rgba(252, 194, 60, 0.3);
  }
}

/* Cap the game layout on big monitors so cards and keypad stay usable. */
@media (min-width: 1280px) {
  .game {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
  }
}

/* Wide screens: setup goes two-column -- game options left, players +
   start right -- instead of one long skinny mobile column. The wrappers
   are display: contents on small screens so the mobile flow is unchanged. */
.setup-cols,
.setup-right {
  display: contents;
}

@media (min-width: 1000px) {
  .setup {
    --setup-col: 1140px;
  }

  .setup-cols {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 22px;
    align-items: start;
  }

  .setup-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 20px;
  }
}
