@font-face {
  font-family: 'Outfit';
  src: url('fonts/outfit-var.woff?v=8') format('woff');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --teal: #1E4B57;
  --teal-deep: #143640;
  --green: #12B886;
  --green-deep: #0C8F68;
  --red: #E03131;
  --yellow: #F5C518;
  --bg: #F3F6F5;
  --card: #FFFFFF;
  --ink: #15262B;
  --muted: #5F7378;
  --line: #DCE5E3;
  --soft: #EAF1EF;
  --shadow: 0 1px 2px rgba(20, 54, 64, .06), 0 8px 24px rgba(20, 54, 64, .08);
  --on-strong: #FFFFFF;
  --on-strong-dim: rgba(255,255,255,.75);
  --on-green: #FFFFFF;
  --mark-filter: none;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --teal: #7FC4D2;
    --teal-deep: #0E2328;
    --green: #2BD09E;
    --green-deep: #1FAE83;
    --bg: #0C1719;
    --card: #132225;
    --ink: #E8F1EF;
    --muted: #94AAAE;
    --line: #24393D;
    --soft: #1A2D31;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    --on-strong: #0C1719;
    --on-strong-dim: rgba(0,0,0,.6);
    --on-green: #062019;
    --mark-filter: brightness(0) invert(.85) sepia(.3) hue-rotate(140deg);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --teal: #7FC4D2;
    --teal-deep: #0E2328;
    --green: #2BD09E;
    --green-deep: #1FAE83;
    --bg: #0C1719;
    --card: #132225;
    --ink: #E8F1EF;
    --muted: #94AAAE;
    --line: #24393D;
    --soft: #1A2D31;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    --on-strong: #0C1719;
    --on-strong-dim: rgba(0,0,0,.6);
    --on-green: #062019;
    --mark-filter: brightness(0) invert(.85) sepia(.3) hue-rotate(140deg);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Outfit', system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100vh;
  display: flex; flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
a { color: var(--green-deep); }
h2 { font-size: 1.55rem; line-height: 1.15; margin: .1rem 0 .9rem; letter-spacing: -.01em; color: var(--teal); }
h3 { margin: 0; font-size: 1.15rem; }
h4 { margin: 0 0 .4rem; color: var(--teal); }

/* header */
/* pinned header: full-width bar that stays at the top while scrolling */
.top-wrap {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding-top: env(safe-area-inset-top, 0px);
  transition: box-shadow .2s, border-color .2s;
  border-bottom: 1px solid transparent;
}
.top-wrap.scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 14px rgba(20, 54, 64, .06); }
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 560px; width: 100%; margin: 0 auto; padding: 10px 16px 8px;
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.brand img { height: 42px; width: auto; filter: var(--mark-filter); }
.brand-name { display: block; font-weight: 800; font-size: 1.35rem; color: var(--teal); letter-spacing: -.01em; line-height: 1.05; }
.brand-tag { display: block; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
  font-weight: 700; color: var(--teal); cursor: pointer; box-shadow: var(--shadow);
}

main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 16px 24px; }
.loading { text-align: center; color: var(--muted); padding: 3rem 0; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 18px; border-top: 5px solid var(--green);
}
.eyebrow {
  display: inline-block; margin: 0 0 .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--green-deep); background: color-mix(in srgb, var(--green) 14%, transparent); padding: 3px 10px; border-radius: 999px;
}
.hint { color: var(--muted); font-size: .9rem; margin: .3rem 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.error { color: var(--red); font-weight: 600; margin: .4rem 0; }

/* setup */
.field { display: block; margin: 0 0 14px; }
.label { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--soft); padding: 5px; border-radius: 14px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg-btn { border: 0; background: transparent; padding: 10px 8px; border-radius: 10px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg-btn.on { background: var(--teal); color: var(--on-strong); box-shadow: 0 2px 6px rgba(20,54,64,.25); }
.seg-btn.num { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .names { grid-template-columns: 1fr; } }
.text {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  font-size: 1.05rem; outline: none; transition: border-color .15s;
}
.text:focus { border-color: var(--green); }
.season-range { display: flex; align-items: center; gap: 8px; }
.season-range select { flex: 1; padding: 11px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); }
.season-range span { color: var(--muted); }

.btn { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; cursor: pointer; transition: transform .08s, background .15s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--green); color: var(--on-green); }
.btn.primary:hover:not(:disabled) { background: var(--green-deep); }
.btn.big { width: 100%; padding: 15px; font-size: 1.1rem; margin-top: 6px; }
.btn.ghost { background: var(--soft); color: var(--teal); }
.btn.danger { background: var(--red); color: #fff; }
.btn.link { background: none; color: var(--muted); width: 100%; margin-top: 6px; font-weight: 600; }

/* scoreboard */
.board { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.board.solo { grid-template-columns: 1fr; }
.pl {
  background: var(--teal-deep); color: #fff; border-radius: 16px; padding: 12px 14px; text-align: center;
  opacity: .62; transition: opacity .2s, transform .2s; position: relative; overflow: hidden;
}
.pl.active { opacity: 1; box-shadow: 0 0 0 3px var(--green), var(--shadow); }
.pl-name { font-weight: 600; font-size: .95rem; display: flex; justify-content: center; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legs { background: var(--green); color: #062019; border-radius: 6px; font-size: .75rem; font-weight: 800; padding: 0 6px; }
.pl-score { font-size: 3rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pl-sub { font-size: .75rem; opacity: .7; }
.pulse { animation: pulse .6s ease; }
@keyframes pulse { 0% { transform: scale(1); color: #fff; } 35% { transform: scale(1.14); color: var(--yellow); } 100% { transform: scale(1); color: #fff; } }

/* match */
.match { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; text-align: center; background: var(--soft); margin-bottom: 14px; }
.match-meta { display: flex; justify-content: space-between; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 8px 0 4px; }
.team { font-weight: 800; font-size: 1.15rem; color: var(--teal); line-height: 1.15; }
.teams .team:first-child { text-align: right; }
.teams .team:last-child { text-align: left; }
.vs { font-weight: 700; color: var(--muted); font-size: .9rem; }
.match-date { font-size: .88rem; color: var(--muted); }

/* handover */
.handover { text-align: center; }
.handover .match { margin-top: 12px; }
.prev { background: var(--soft); border-radius: 10px; padding: 8px 12px; margin: 0 0 14px; }

/* play */
.turn-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.darts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.dart { border: 1.5px dashed var(--line); border-radius: 12px; padding: 8px 6px; text-align: center; min-height: 58px; display: flex; flex-direction: column; justify-content: center; }
.dart.next { border-color: var(--green); border-style: solid; }
.dart.hit { background: color-mix(in srgb, var(--green) 16%, transparent); border: 1.5px solid var(--green); }
.dart.miss { background: color-mix(in srgb, var(--red) 9%, transparent); border: 1.5px solid color-mix(in srgb, var(--red) 40%, transparent); }
.dart-n { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.dart-v { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.dart.hit .dart-v { color: var(--green-deep); }
.dart.miss .dart-v { color: var(--red); }
.result { border-radius: 10px; padding: 9px 12px; margin: 0 0 12px; font-weight: 600; }
.result.ok { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green-deep); }
.result.bad { background: color-mix(in srgb, var(--red) 9%, transparent); color: var(--red); }
.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
@media (max-width: 420px) { .chips { grid-template-columns: repeat(3, 1fr); } }
.chip {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px; transition: border-color .12s, background .12s;
}
.chip-i { font-size: 1.15rem; }
.chip-l { font-size: .78rem; font-weight: 700; }
.chip-p { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.chip.on { border-color: var(--teal); background: var(--teal); color: var(--on-strong); }
.chip.on .chip-p { color: var(--on-strong-dim); }
.answer { margin-bottom: 4px; }
.scoreline { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; margin-bottom: 4px; }
.scoreline label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); text-align: center; }
.scoreline input { width: 100%; text-align: center; font-size: 1.6rem; font-weight: 800; padding: 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); }
.scoreline input:focus { outline: none; border-color: var(--green); }
.dash { font-size: 1.6rem; font-weight: 800; color: var(--muted); padding-bottom: 8px; }
.play-foot { display: flex; gap: 8px; margin-top: 14px; }
.play-foot .btn { flex: 1; font-size: .9rem; }

/* modal */
#modal[hidden] { display: none; }
.overlay { position: fixed; inset: 0; background: rgba(8, 22, 26, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 50; animation: fade .15s; }
@media (min-width: 600px) { .overlay { align-items: center; } }
.sheet {
  background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .2s ease;
}
@media (min-width: 600px) { .sheet { border-radius: 22px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: .5; } }
.row { display: flex; gap: 10px; margin-top: 12px; }
.row .btn { flex: 1; padding: 14px; }
.big-score { font-size: 3.4rem; font-weight: 800; color: var(--green-deep); margin: 0; font-variant-numeric: tabular-nums; }
.legs-line { font-size: 1.05rem; }
.rules { padding-left: 1.2rem; margin: 0 0 10px; }
.rules li { margin-bottom: .6rem; }
.tiers { width: 100%; border-collapse: collapse; margin-top: .5rem; font-size: .95rem; }
.tiers td { padding: 5px 2px; border-bottom: 1px solid var(--line); }
.tiers td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--teal); }
.key-score { text-align: center; font-size: 1.15rem; font-weight: 700; }
.key-score b { font-size: 1.5rem; margin: 0 .3rem; color: var(--teal); }
.key-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 12px 0; }
@media (max-width: 480px) { .key-grid { grid-template-columns: 1fr; } }
.key-col { background: var(--soft); border-radius: 12px; padding: 12px; font-size: .9rem; }
.key-col p { margin: 0 0 .45rem; }
.key-col .k { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 10px 16px 22px; }
.foot p { margin: .2rem 0; }

.clubs { display: grid; gap: 8px; }
.clubs select { width: 100%; padding: 11px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); }
.opt { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.top-actions { display: flex; gap: 8px; }
.icon-btn { font-size: 1.05rem; line-height: 1; }
.social { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: .5rem !important; }
.social a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--teal); font-weight: 600; text-decoration: none; }
.social a:hover { border-color: var(--teal); }


/* game picker */
.hub h2 { margin-bottom: .8rem; }
.games { display: grid; gap: 12px; }
.game-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; text-align: left;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer;
  box-shadow: var(--shadow); transition: border-color .15s, transform .1s;
}
.game-card:hover { border-color: var(--green); }
.game-card:active { transform: scale(.99); }
.game-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.7rem; background: var(--soft); }
.game-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.game-title { font-weight: 800; font-size: 1.15rem; color: var(--teal); }
.game-blurb { font-size: .9rem; color: var(--muted); line-height: 1.35; }
.game-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.game-tags span { font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--green-deep); background: color-mix(in srgb, var(--green) 13%, transparent); padding: 2px 8px; border-radius: 999px; }
.game-go { font-size: 1.8rem; color: var(--muted); font-weight: 300; }
.back { background: none; border: 0; color: var(--muted); font-weight: 600; padding: 0 0 8px; cursor: pointer; }
.gamebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.gamebar .back { padding: 6px 0; font-size: .9rem; }
.gamebar .back:hover { color: var(--teal); }
.gamebar-t { font-size: .8rem; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reroll-row { display: flex; justify-content: flex-end; margin: -4px 0 10px; }
.reroll { background: none; border: 1px solid var(--line, color-mix(in srgb, var(--muted) 35%, transparent)); color: var(--muted); font: inherit; font-size: .8rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.reroll:hover { color: var(--teal); border-color: var(--teal); }
.setup-blurb { margin: -.4rem 0 1rem; }
.seg.count { grid-template-columns: repeat(4, 1fr); }
.seg.count.c3 { grid-template-columns: repeat(3, 1fr); }
.seg.count.c2 { grid-template-columns: repeat(2, 1fr); }
.names.n1 { grid-template-columns: 1fr; }

/* scoreboard extras */
.board.many .pl-score { font-size: 2.3rem; }
.pl.is-out { opacity: .35; }
.pl-lives { font-size: 1.6rem; line-height: 1.6; letter-spacing: 2px; }
.heart.lost { opacity: .5; }
.out-tag { font-weight: 800; letter-spacing: .1em; font-size: 1.3rem; color: var(--red); }
.pl-target { font-size: 1.15rem; font-weight: 800; margin: 6px 0 4px; }
.track { display: flex; justify-content: center; gap: 5px; margin-bottom: 4px; }
.track span { width: 16px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); }
.track span.done { background: var(--green); }
.track span.now { background: var(--yellow); }
.chips.single { grid-template-columns: 1fr; }
.chips.single .chip { flex-direction: row; justify-content: center; gap: 10px; padding: 12px; }
.chips.single .chip-l { font-size: 1rem; }
.result .extra { display: block; font-weight: 500; margin-top: 2px; }
.victims { display: grid; gap: 10px; margin-top: 6px; }
.victim { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--soft); cursor: pointer; font-weight: 700; font-size: 1.05rem; }
.victim:hover { border-color: var(--red); }
.big-hearts { font-size: 2.2rem; margin: 0; }

/* how it works panel */
.how { background: var(--soft); border-radius: 14px; padding: 12px 14px 8px; margin: 0 0 16px; }
.how-head { display: flex; justify-content: space-between; align-items: center; }
.how-head .label { margin: 0; }
.how-hide { background: none; border: 0; color: var(--muted); font-weight: 700; font-size: .8rem; cursor: pointer; padding: 4px 0 4px 8px; }
.how-list { margin: 8px 0 4px; padding-left: 1.1rem; font-size: .93rem; }
.how-list li { margin-bottom: .45rem; }
.how-list .tiers { font-size: .9rem; }
.show-rules { margin: -6px 0 10px; text-align: left; padding-left: 0; width: auto; color: var(--green-deep); }

/* leagues & history */
.league-card .game-icon { background: color-mix(in srgb, var(--yellow) 22%, var(--soft)); }
.leagues h3.sec { margin: 22px 0 8px; font-size: 1rem; color: var(--teal); }
.league-list, .results { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.league-row { width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--soft); cursor: pointer; }
.league-row:hover { border-color: var(--green); }
.lr-name { font-weight: 800; color: var(--teal); font-size: 1.05rem; }
.lr-meta { grid-row: 2; font-size: .85rem; color: var(--muted); }
.league-row .game-go { grid-row: 1 / span 2; grid-column: 2; }
.new-league { display: grid; gap: 8px; margin: 6px 0 4px; }
.new-league .row { margin-top: 0; }
.table-wrap { overflow-x: auto; margin: 4px 0 12px; }
.ltable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .95rem; }
.ltable th { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 6px 4px; border-bottom: 1.5px solid var(--line); text-align: center; }
.ltable td { padding: 9px 4px; border-bottom: 1px solid var(--line); text-align: center; }
.ltable .l { text-align: left; }
.ltable tbody tr:first-child td { background: color-mix(in srgb, var(--green) 9%, transparent); }
.form { white-space: nowrap; }
.f { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; font-size: .65rem; font-weight: 800; margin-right: 2px; color: #fff; background: var(--muted); }
.f.W { background: var(--green-deep); }
.f.L { background: color-mix(in srgb, var(--red) 75%, var(--muted)); }
.res { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--soft); }
.res-icon { font-size: 1.2rem; }
.res-body { display: flex; flex-direction: column; min-width: 0; }
.res-who { font-size: .95rem; overflow-wrap: anywhere; }
.res-meta { font-size: .78rem; color: var(--muted); }
.res-win { font-size: .8rem; font-weight: 700; color: var(--green-deep); white-space: nowrap; }
.h2h-pick { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.h2h-pick select { width: 100%; padding: 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); min-width: 0; }
.h2h-pick span { color: var(--muted); font-weight: 700; }
.h2h-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; margin: 12px 0 4px; padding: 14px 8px; border-radius: 14px; background: var(--teal-deep); color: #fff; }
.h2h-n { display: block; font-size: 2.4rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.h2h-l { display: block; font-size: .85rem; opacity: .85; margin-top: 4px; overflow-wrap: anywhere; }
.h2h-mid { font-size: .75rem; opacity: .7; padding: 0 6px; }
.league-tools { margin-top: 18px; }
.row.wrap { flex-wrap: wrap; }
.row.wrap .btn { flex: 1 1 auto; }
.danger-text { color: var(--red) !important; }
.btn.link.inline { display: inline; width: auto; padding: 0; margin: 0; color: var(--green-deep); text-decoration: underline; }
.hint.small { font-size: .8rem; margin-top: 16px; }
/* footer legal */
.linkish { background: none; border: 0; padding: 0; color: var(--green-deep); text-decoration: underline; cursor: pointer; font-size: inherit; }
.disclaimer { opacity: .8; font-size: .75rem; }
.legal h3 { font-size: 1rem; margin: 16px 0 4px; color: var(--teal); }
.legal p { margin: 0 0 8px; }
#league { width: 100%; padding: 11px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); }

/* Sent Off */
.fouls { display: flex; justify-content: center; gap: 4px; margin: 8px 0 6px; }
.foul { width: 22px; height: 26px; border-radius: 5px; border: 1.5px solid rgba(255,255,255,.25); display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: rgba(255,255,255,.9); }
.foul.yc:not(.on), .foul.rc:not(.on) { opacity: .35; }
.foul.on { background: rgba(224,49,49,.35); border-color: rgba(255,255,255,.5); }
.foul.yc.on { background: var(--yellow); border-color: var(--yellow); }
.foul.rc.on { background: var(--red); border-color: var(--red); }
.board.many .foul { width: 17px; height: 21px; font-size: .62rem; }
.so-board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 0 0 14px; padding: 14px 10px; border-radius: 16px; background: var(--teal-deep); color: #fff; text-align: center; }
.so-board.solved { box-shadow: 0 0 0 3px var(--green); }
.so-team { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.so-name { font-size: .78rem; font-weight: 700; opacity: .8; overflow-wrap: anywhere; }
.so-digit { font-size: 3.2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.so-range { font-size: .8rem; font-weight: 700; color: var(--yellow); min-height: 1.1em; }
.so-dash { font-size: 2.2rem; font-weight: 800; opacity: .6; }
.so-guesses { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.so-guesses li { padding: 8px 12px; border-radius: 10px; background: var(--soft); font-size: .92rem; }
.so-guesses li.ok { background: color-mix(in srgb, var(--green) 16%, transparent); }
.so-guesses li span { display: block; font-size: .8rem; color: var(--muted); }

/* ---------- Daily Match banner ---------- */
.daily { display: flex; align-items: center; gap: 8px; width: 100%;
  background: linear-gradient(120deg, #143640, #1E4B57); color: #fff; border: 1px solid rgba(255,255,255,.06); border-radius: 14px; padding: 11px 14px; margin: 0 0 2px; box-shadow: var(--shadow); }
.daily-i { font-size: 1.35rem; }
.daily-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.daily-t { font-weight: 800; font-size: .98rem; }
.daily-s { font-size: .8rem; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-streak { font-size: .78rem; font-weight: 700; margin-left: 4px; }
.daily-go { font-size: .8rem; font-weight: 800; background: #12B886; color: #fff; padding: 6px 12px; border-radius: 999px; }
.daily.done .daily-go { background: rgba(255,255,255,.16); }
.daily-emoji { text-align: center; font-size: 1.35rem; letter-spacing: 4px; margin: 0 0 4px; }
.big-score.center { text-align: center; margin-bottom: 4px; }

/* six slim dart slots for the Daily Match */
.darts.six { grid-template-columns: repeat(6, 1fr); gap: 6px; }
.darts.six .dart { min-height: 48px; padding: 6px 2px; }
.darts.six .dart-v { font-size: .85rem; }

/* ---------- Easy mode ---------- */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; font: inherit; color: inherit; text-align: left;
  background: none; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 2px 0 14px; cursor: pointer; }
.toggle-row .hint { display: block; font-size: .8rem; margin: 1px 0 0; }
.switch { flex: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(16px); }
.chip.none { opacity: .38; cursor: not-allowed; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { font: inherit; font-weight: 700; font-size: .95rem; color: var(--ink); background: var(--soft); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 8px; cursor: pointer; line-height: 1.2; }
.choice:hover { border-color: var(--teal); }
.choice:active { transform: scale(.98); }

/* ---------- share ---------- */
.share-btn { color: var(--green-deep); }
.row.slim { margin-top: 2px; gap: 0; }
.row.slim .btn { padding: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100;
  background: var(--ink); color: var(--bg); font-weight: 700; font-size: .9rem; padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow); transition: opacity .4s; }
.toast.out { opacity: 0; }

/* ---------- add to home screen ---------- */
.install { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40; max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 8px 10px; box-shadow: var(--shadow); font-size: .86rem; font-weight: 600; }
.install img { border-radius: 7px; flex: none; }
.install span { flex: 1; line-height: 1.25; }
.install-add { font: inherit; font-weight: 800; background: var(--green); color: var(--on-green); border: 0; border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.install-x { font: inherit; background: none; border: 0; color: var(--muted); padding: 6px 8px; cursor: pointer; }
.steps { padding-left: 1.2rem; line-height: 1.6; }

/* ---------- wide screens (laptop, PC, iPad landscape). Phones never see this. ---------- */
.match-side { display: none; }
@media (min-width: 900px) {
  .top { max-width: 1120px; padding-left: 32px; padding-right: 32px; }
  main { max-width: 1120px; padding-left: 32px; padding-right: 32px; }

  /* hub: games side by side */
  .games { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .game-card { align-items: flex-start; }
  .game-go { display: none; }

  /* game screens: scores and match on the left, darts on the right */
  .stage { display: grid; grid-template-columns: minmax(300px, 360px) 1fr; column-gap: 28px; align-items: start; }
  .stage > .gamebar { grid-column: 1 / -1; }
  .stage-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 14px; }
  .stage-side .board { grid-template-columns: 1fr; margin: 0; }
  .stage-side .board.many { grid-template-columns: 1fr 1fr; }
  .match-side { display: block; margin: 0; background: var(--card); box-shadow: var(--shadow); padding: 18px 16px; }
  .match-side .teams { font-size: 1.15rem; }
  .stage > section .match:not(.match-side) { display: none; }
  .stage > section { margin-top: 0; }
  .choices { grid-template-columns: repeat(4, 1fr); }

  /* setup: how it works on the left, the options on the right */
  .setup-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; align-items: start; }
  .setup-side { position: sticky; top: 88px; }
  .setup-side .setup-blurb { margin-top: 0; }
}
@media (min-width: 900px) {
  .setup-main { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; align-items: start; }
  .setup-main > * { grid-column: 1 / -1; }
  .setup-main > .f-half { grid-column: auto; }
  .setup-main .season-range select { min-width: 0; }
}

.daily-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.daily-invite { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.18); cursor: pointer; }
.daily-invite:hover { background: rgba(255,255,255,.2); }
.gamebar .invite { display: inline-flex; align-items: center; gap: 6px; color: var(--green-deep); font-weight: 700; }

.daily-blurb { display: none; }
@media (min-width: 900px) {
  /* the Daily Match becomes the first tile in the games grid */
  .games .daily { position: relative; align-items: stretch; margin: 0; padding: 18px; border-radius: var(--radius); }
  .games .daily-main { display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; align-items: start; align-content: start; }
  .games .daily-i { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.7rem; background: rgba(255,255,255,.1); }
  .games .daily-t { font-size: 1.15rem; padding-right: 40px; }
  .games .daily-s { white-space: normal; font-size: .82rem; margin-top: 2px; }
  .games .daily-blurb { display: block; font-size: .9rem; line-height: 1.35; opacity: .85; margin-top: 6px; }
  .games .daily-go { grid-column: 2; justify-self: start; margin-top: 10px; padding: 7px 18px; }
  .games .daily-invite { position: absolute; top: 16px; right: 16px; }
}

/* share buttons on laptops / PCs */
.share-opts { display: flex; gap: 8px; justify-content: center; margin: 10px 0 2px; animation: fade .15s; }
.so-btn { font: inherit; font-weight: 800; font-size: .9rem; text-decoration: none; border: 0; border-radius: 999px; padding: 9px 18px; cursor: pointer; color: #fff; }
.so-btn.wa { background: #1FA855; }
.so-btn.x { background: #111; }
:root[data-theme="dark"] .so-btn.x { background: #000; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.so-btn.copy { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.games > .share-opts, .stage > .share-opts { grid-column: 1 / -1; justify-content: flex-start; margin: -4px 0 4px; }
.row.three-up .btn { padding: 14px 6px; }
.row.three-up .btn.primary { flex: 1.2; }
.btn.story-btn { background: linear-gradient(45deg, #f9a03f, #e1306c 55%, #8a3ab9); color: #fff; border: 0; }
.btn.story-btn:hover { filter: brightness(1.05); }

/* back links: same size as before, just easier to spot */
.back { color: var(--green-deep); font-weight: 700; }
.back:hover { color: var(--teal); }
.gamebar .back:hover { color: var(--teal); }

/* pop-ups stay above the phone keyboard */
.overlay { top: var(--vvt, 0); bottom: auto; height: var(--vvh, 100%); }
.sheet { max-height: calc(var(--vvh, 100vh) * .92); }
