:root {
  --ink: #0d1412; --panel: #16211d; --panel-2: #1f2e28; --line: #2f4239;
  --text: #f4efe2; --muted: #a2ae9f; --gold: #f5c542; --red: #e0402f; --green: #2fae66;
  --font: 'Baloo 2', ui-rounded, 'Trebuchet MS', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--text); font-family: var(--font); }
a { color: var(--gold); }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 22px; letter-spacing: .3px; color: var(--text); text-decoration: none; }
.brand b { color: var(--red); }
.nav nav { display: flex; gap: 16px; font-weight: 600; }
.nav nav a { color: var(--muted); text-decoration: none; }
.nav nav a:hover, .nav nav a[aria-current] { color: var(--text); }

.btn { border: 0; border-radius: 12px; padding: 12px 22px; font-weight: 800; font-size: 18px; color: #2a1d00; background: var(--gold); box-shadow: 0 4px 0 #a9811a; text-decoration: none; display: inline-block; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #a9811a; }
.btn.ghost { background: var(--panel-2); color: var(--text); box-shadow: 0 4px 0 #0a0f0d; }
.btn.small { padding: 6px 12px; font-size: 14px; box-shadow: 0 2px 0 #0a0f0d; }

.wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 48px; }
.face { width: 44px; height: 44px; border-radius: 10px; background: var(--panel-2); object-fit: cover; flex: none; image-rendering: pixelated; }

/* Landing: the chessingo hero */
.hero { position: relative; min-height: 100dvh; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; padding: 72px 16px 40px; }
.hero-bg { position: absolute; inset: 0; background: url('https://prodmedia.tyga.host/public/tyga.cloud/landing/dartshowdown.com/dartshowdown_splash.jpg') center 62% / cover no-repeat; }
.hero-overlay { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 42%, rgba(13, 20, 18, .28), rgba(13, 20, 18, .66) 75%), linear-gradient(to bottom, rgba(13, 20, 18, .45), transparent 26%, transparent 58%, var(--ink)); }
.hero-content { position: relative; max-width: 720px; }
.hero-logo { font-family: 'Bangers', 'Baloo 2', sans-serif; font-size: clamp(56px, 13vw, 124px); line-height: .95; letter-spacing: 1.5px; text-shadow: 0 4px 0 #000, 0 0 34px rgba(0, 0, 0, .75); }
.hero-logo b { font-weight: 400; color: var(--gold); }
.hero-sub { font-size: clamp(20px, 4vw, 30px); font-weight: 800; margin: 10px 0 0; text-shadow: 0 2px 10px #000; }
.hero-proof { font-size: 18px; font-weight: 600; margin: 8px 0 0; text-shadow: 0 2px 8px #000; }
.hero-proof b { color: var(--gold); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 22px; }
.hero-cta .btn { font-size: 21px; padding: 14px 30px; }
.hero-note { margin: 16px 0 0; font-size: 15px; text-shadow: 0 2px 6px #000; }
.nav.over { position: absolute; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 3; border-bottom: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, .6), transparent); }
.nav.over nav a { color: var(--text); }
.about { max-width: 860px; margin: 0 auto; padding: 16px 16px 40px; }
.about h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.12; margin: 0 0 8px; }
.about h2 { font-size: 24px; margin: 28px 0 10px; }
.about > h3 { font-size: 18px; margin: 16px 0 2px; }
.about p { color: var(--muted); margin: 0 0 8px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.steps h3 { margin: 0 0 4px; font-size: 19px; }
.steps p { margin: 0; }
.site-foot { border-top: 1px solid var(--line); padding: 16px; text-align: center; color: var(--muted); font-size: 14px; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }

/* Boards */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.table-scroll { overflow-x: auto; }
table.board { width: 100%; border-collapse: collapse; }
table.board th { text-align: left; color: var(--muted); font-weight: 600; font-size: 14px; padding: 6px 8px; }
table.board td { padding: 7px 8px; border-top: 1px solid var(--line); }
table.board tr.you td { background: rgba(245, 197, 66, .13); font-weight: 700; }
table.board .num { text-align: right; font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 10px; }
.who .face { width: 32px; height: 32px; border-radius: 7px; }

/* Lobby */
.lobby-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.lobby-head h1 { margin: 0; font-size: 30px; }
.me-chip { color: var(--muted); font-weight: 600; }
.me-chip b { color: var(--gold); }
.rival-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.rival { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.rival:hover { border-color: var(--gold); }
.rival .face { width: 56px; height: 56px; }
.rival strong { display: block; font-size: 18px; line-height: 1.15; }
.rival span { color: var(--muted); font-size: 14px; display: block; }
.rival.nemesis { border-color: var(--red); }
.rival .tag { color: var(--red); font-weight: 800; }

/* Game cards */
.cards { display: flex; gap: 12px; overflow-x: auto; padding-block: 6px 12px; scroll-snap-type: x proximity; }
.card { flex: 0 0 150px; min-height: 196px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; text-align: left; color: var(--text); background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 12px; }
.card:hover { border-color: var(--muted); }
.card.on { border-color: var(--gold); background: var(--panel-2); box-shadow: 0 0 0 1px var(--gold); }
.card .pip { font-size: 34px; font-weight: 800; line-height: 1; color: var(--gold); }
.card strong { font-size: 18px; line-height: 1.1; margin-top: 4px; }
.card small { color: var(--muted); font-size: 13px; line-height: 1.25; }
.rival-head { margin: 10px 0 10px; font-size: 22px; }

/* The table: rival left, board centre, you right; stacked on a phone (GDD s9.2). */
.table { display: grid; grid-template-columns: 190px minmax(0, 1fr) 190px; gap: 12px; height: calc(100dvh - 54px); padding: 10px 16px; max-width: 1100px; margin: 0 auto; }
.seat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; align-self: start; }
.seat.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.seat .top { display: flex; align-items: center; gap: 10px; }
.seat .name { font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.seat .sub { color: var(--muted); font-size: 13px; }
.seat .remaining { font-size: 46px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pips { display: flex; gap: 5px; }
.pips i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--muted); }
.pips i.on { background: var(--gold); border-color: var(--gold); }
.seat .record { color: var(--muted); font-size: 13px; }
.seat .forfeit { margin-top: 6px; align-self: flex-start; }
.stage-box { position: relative; min-height: 0; min-width: 0; }
#stage, #hud { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }

@media (max-width: 760px) {
  .nav { padding: 6px 16px; }
  .table { grid-template-columns: 1fr 1fr; grid-template-rows: auto minmax(0, 1fr); height: calc(100dvh - 48px); padding: 6px 16px; gap: 6px; }
  .stage-box { grid-column: 1 / -1; grid-row: 2; }
  .seat { padding: 6px 8px; gap: 2px; align-self: stretch; }
  .seat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 6px; row-gap: 0; }
  .seat .top { gap: 6px; min-width: 0; }
  .seat .face { width: 28px; height: 28px; }
  .seat .name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .seat .top > div { min-width: 0; }
  .seat .remaining { font-size: 26px; grid-column: 2; grid-row: 1; }
  .seat .sub, .seat .record { font-size: 11px; }
  .seat .record { grid-column: 1 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .seat #record, .seat #venue { display: none; }
  .seat .forfeit { display: none; }
}

/* Result */
.overlay { position: fixed; inset: 0; background: rgba(6, 10, 9, .8); display: flex; padding: 16px; z-index: 5; overflow-y: auto; }
.result { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; max-width: 420px; width: 100%; text-align: center; margin: auto; }
.result h2 { margin: 0; font-size: clamp(26px, 7vw, 40px); line-height: 1.05; overflow-wrap: anywhere; }
.result h2.won { color: var(--gold); }
.result h2.lost { color: var(--red); }
.result .big { font-size: 30px; font-weight: 800; margin: 10px 0 0; font-variant-numeric: tabular-nums; }
.result p { color: var(--muted); margin: 4px 0; }
.result .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.claim { display: grid; gap: 8px; margin-top: 14px; text-align: left; border-top: 1px solid var(--line); padding-top: 12px; }
.claim input, .claim select { font: inherit; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--ink); color: var(--text); width: 100%; }
.err { color: var(--red); font-weight: 600; min-height: 1.2em; }
.err:empty { display: none; }
.rings { position: absolute; left: 6px; bottom: 30px; display: grid; gap: 4px; z-index: 2; width: 68px; }
.rings button { padding: 5px 4px; border-radius: 9px; border: 2px solid var(--line); background: rgba(22, 33, 29, .9); color: var(--text); font-weight: 700; font-size: 13px; line-height: 1.1; }
.rings button.on { border-color: #ffe05a; background: #ffe05a; color: #2a1d00; }

/* The globe */
.cgl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-top: 6px; }
.cgl canvas { width: 100%; height: 280px; display: block; }
.cgl-kicker { color: var(--gold); font-weight: 700; }
.cgl-count { font-size: 24px; font-weight: 800; line-height: 1.15; }
.cgl-live { color: var(--green); font-weight: 700; min-height: 1.3em; margin-bottom: 8px; }
.cgl-ticker { font-size: 20px; font-weight: 700; min-height: 1.4em; }
.cgl-card { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.cgl-card .face { width: 64px; height: 64px; }
.cgl-card strong { display: block; font-size: 20px; line-height: 1.15; }
.cgl-badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 6px; background: var(--panel-2); color: var(--muted); }
.cgl-badge.live { background: var(--green); color: #05140c; }
.cgl-actions { display: flex; gap: 10px; align-items: center; }
.board-globe { width: 100%; height: 300px; display: block; margin-bottom: 12px; }
@media (max-width: 720px) { .cgl { grid-template-columns: 1fr; } .cgl canvas { height: 210px; } }

.cgl-record { display: block; color: var(--gold); font-weight: 700; font-size: 14px; }
.cgl-flat { font-size: 20px; line-height: 1.4; margin-bottom: 8px; }
.vs { position: fixed; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; gap: clamp(16px, 6vw, 64px); padding: 16px; background: radial-gradient(ellipse at center, #1f2e28, var(--ink) 70%); }
.vs-side { display: grid; justify-items: center; gap: 10px; max-width: 34vw; text-align: center; overflow-wrap: anywhere; font-size: clamp(16px, 3vw, 24px); }
.vs-side .face { width: clamp(84px, 18vw, 150px); height: clamp(84px, 18vw, 150px); border-radius: 18px; }
.vs-word { font-family: 'Bangers', 'Baloo 2', sans-serif; font-size: clamp(56px, 12vw, 110px); color: var(--gold); }
