/* Darts Scorekeeper site. Palette from the app's PremiumPaywallView:
   near-black surround, board red, board cream. Dark by default; light via
   prefers-color-scheme. No web fonts. */

:root {
  --bg: #0e0e0f;
  --surface: #1a1a1c;
  --surface-2: #242427;
  --line: #34343a;
  --text: #ede3c7;          /* board cream, rgb(237,227,199) */
  --muted: #b9b09a;
  --red: #cc2926;           /* board red, rgb(204,41,38) */
  --red-strong: #cc2926;
  --on-red: #ffffff;
  --green: #2e9a63;
  --link: #ede3c7;
  --link-line: #cc2926;
  --focus: #ffd34d;
  --chip-t: #cc2926;
  --chip-d: #17734a;
  --chip-s: #3a3a40;
  --radius: 14px;
  --max: 68rem;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf6ec;
    --surface: #ffffff;
    --surface-2: #f1ead8;
    --line: #ddd3bb;
    --text: #17161a;
    --muted: #57534a;
    --red-strong: #b3221f;
    --link: #a01e1b;
    --link-line: #a01e1b;
    --focus: #1b5fd1;
    --chip-s: #5b5850;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

img { max-width: 100%; height: auto; }

a { color: var(--link); text-decoration-color: var(--link-line); text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
a:hover { text-decoration-thickness: 3px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.1rem; }
.narrow { max-width: 44rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.2rem; padding-top: .7rem; padding-bottom: .7rem; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.nav { display: flex; flex-wrap: wrap; gap: .2rem .9rem; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; padding: .35rem 0; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--red); }
@media (max-width: 40rem) {
  .site-header .wrap { padding-top: .5rem; padding-bottom: .3rem; }
  .nav { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 1rem; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { font-size: .92rem; white-space: nowrap; }
  main { padding-top: 1rem; }
  .calc-lede { font-size: 1rem; margin-bottom: .8rem; }
  #score { font-size: 2.8rem; }
}

main { padding: 1.6rem 0 3rem; }

h1 { font-size: clamp(1.9rem, 5.5vw, 3rem); line-height: 1.12; margin: .2rem 0 .7rem; letter-spacing: -0.01em; }
h2 { font-size: 1.45rem; line-height: 1.25; margin: 2.2rem 0 .6rem; }
h3 { font-size: 1.12rem; margin: 1.5rem 0 .4rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: .35rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 52px; padding: .75rem 1.4rem; border-radius: 999px;
  background: var(--red-strong); color: var(--on-red); font-weight: 700; font-size: 1.05rem;
  text-decoration: none; border: 0;
}
.btn:hover { filter: brightness(1.08); }
.btn svg { width: 1.2em; height: 1.2em; fill: currentColor; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }

/* Cards and callouts */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.callout { background: var(--surface); border-left: 4px solid var(--red); border-radius: 8px; padding: .9rem 1.1rem; margin: 1.2rem 0; }
.callout p:last-child { margin-bottom: 0; }

.app-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; margin: 2.5rem 0 0; }
.app-cta img { width: 64px; height: 64px; border-radius: 14px; }
.app-cta .txt { flex: 1 1 16rem; }
.app-cta .txt strong { display: block; font-size: 1.1rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin: .4rem 0 1.2rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .9rem; }

/* Home */
.hero { display: grid; gap: 1.6rem; align-items: center; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.3rem; }
@media (min-width: 56rem) { .hero { grid-template-columns: 1.1fr .9fr; } }
.hero-shot { justify-self: center; width: min(100%, 320px); }
.hero-shot img, .shots img { border-radius: 22px; display: block; }
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: min(70%, 260px); gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .3rem 0 1rem; margin: 0; list-style: none; }
.shots li { scroll-snap-align: start; margin: 0; }
@media (min-width: 64rem) { .shots { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); overflow: visible; } }
.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); padding: 0; list-style: none; }
@media (min-width: 56rem) { .features { grid-template-columns: repeat(3, 1fr); } }
.features li { margin: 0; }
.features h3 { margin-top: 0; }
.features p { margin: 0; color: var(--muted); }
.tools { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.tools a.card { text-decoration: none; color: var(--text); display: block; }
.tools a.card:hover { border-color: var(--red); }
.tools a.card span { display: block; color: var(--muted); font-size: .95rem; margin-top: .25rem; }

/* Checkout chips */
.route { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.route li { margin: 0; }
.chip { display: inline-block; min-width: 4.2rem; text-align: center; padding: .45rem .8rem; border-radius: 12px; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; background: var(--chip-s); }
.chip.t { background: var(--chip-t); }
.chip.d { background: var(--chip-d); }
.chip.b { background: var(--chip-d); }

/* Calculator */
.calc { display: grid; gap: .8rem; max-width: 30rem; }
.calc-display { display: grid; gap: .35rem; }
.calc-display label { font-weight: 600; color: var(--muted); }
#score {
  width: 100%; font: inherit; font-size: 3.4rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums;
  text-align: center; padding: .4rem .6rem; border-radius: var(--radius); border: 2px solid var(--line);
  background: var(--surface); color: var(--text);
}
#score:focus-visible { border-color: var(--focus); outline: none; }
.result { min-height: 7.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.result .route .chip { font-size: 1.7rem; padding: .5rem .9rem; min-width: 5.4rem; border-radius: 14px; }
.result .headline { font-weight: 700; margin: 0 0 .6rem; }
.result .note { margin: .7rem 0 0; color: var(--muted); font-size: .95rem; }
.controls { display: grid; gap: .8rem; grid-template-columns: 1fr 1.25fr; }
.seg { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg legend { font-weight: 600; color: var(--muted); padding: 0; margin-bottom: .3rem; font-size: .95rem; }
.seg-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.seg-opts.two { grid-template-columns: repeat(2, 1fr); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 0 .3rem; border-radius: 12px; background: var(--surface-2); font-weight: 700; font-size: 1.05rem; line-height: 1.15; cursor: pointer; border: 2px solid transparent; }
.seg-opts.two label { font-size: .95rem; }
.seg input:checked + label { background: var(--red-strong); color: var(--on-red); }
.seg input:focus-visible + label { border-color: var(--focus); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.keypad button {
  min-height: 64px; font: inherit; font-size: 1.6rem; font-weight: 700; border-radius: 14px; border: 0;
  background: var(--surface-2); color: var(--text); cursor: pointer; touch-action: manipulation;
}
.keypad button:active { filter: brightness(1.25); }
.keypad .fn { font-size: 1.1rem; color: var(--muted); }
.quick { display: flex; flex-wrap: wrap; gap: .4rem; }
.quick button { font: inherit; font-weight: 600; min-height: 44px; padding: 0 .9rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.calc-layout { display: grid; gap: 2rem; }
@media (min-width: 60rem) { .calc-layout { grid-template-columns: 30rem 1fr; } }

/* Chart */
.chart-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin: 0 0 1rem; font-size: .95rem; color: var(--muted); }
.chart-legend .chip { min-width: 0; padding: .15rem .5rem; font-size: .85rem; }
.chart { list-style: none; padding: 0; margin: 0; display: grid; gap: 0 1.6rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); font-variant-numeric: tabular-nums; }
.chart li { display: grid; grid-template-columns: 3.2rem 1fr; align-items: center; gap: .6rem; padding: .32rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.chart .n { font-weight: 800; font-size: 1.05rem; text-align: right; }
.chart .n a { color: inherit; text-decoration: none; }
.chart .r { display: flex; gap: .3rem; }
.chart .chip { min-width: 3.1rem; padding: .15rem .4rem; font-size: .92rem; border-radius: 8px; }
.chart .bogey .r { color: var(--muted); font-style: italic; }
.chart-group { margin: 1.6rem 0 .4rem; font-size: 1.05rem; color: var(--muted); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: .3rem 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: .6rem 0; min-height: 44px; }
.faq details > div { padding: 0 0 .8rem; }
.faq details > div p:last-child { margin-bottom: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 1.6rem 0 2.4rem; color: var(--muted); font-size: .93rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.site-footer a { color: var(--muted); }

/* Print: the checkout chart becomes a clean, ink-light 1-2 page sheet. */
@media print {
  :root { --bg: #fff; --surface: #fff; --line: #bbb; --text: #000; --muted: #333; }
  body { font-size: 10pt; background: #fff; color: #000; }
  .site-header, .site-footer, .no-print, .app-cta, .faq, .skip { display: none !important; }
  main { padding: 0; }
  a { color: #000; text-decoration: none; }
  h1 { font-size: 15pt; margin: 0 0 4pt; }
  .print-only { display: block !important; }
  .chart-page .lede, .chart-page .chart-legend { font-size: 8.5pt; margin: 0 0 4pt; }
  .chart-group { display: none; }
  .chart-all { columns: 4; column-gap: 12pt; }
  .chart { display: block; font-size: 8.4pt; }
  .chip { background: none !important; color: #000 !important; }
  .chart-legend .chip { border: .6pt solid #000; padding: 0 3pt; }
  .chart li { break-inside: avoid; display: flex; gap: 4pt; padding: .4pt 0; border-bottom: .4pt solid #ccc; }
  .chart .n { width: 2.2em; flex: none; font-size: 8.4pt; }
  .chart .chip { background: none !important; color: #000; min-width: 0; padding: 0; font-weight: 600; font-size: 8.4pt; }
  .chart .chip.t { font-weight: 800; }
  .chart .bogey .r { color: #555; }
  .chart-notes { break-before: avoid; font-size: 8pt; margin-top: 6pt; }
  .chart-notes h2 { font-size: 9.5pt; margin: 6pt 0 2pt; }
  @page { margin: 12mm; }
}
.print-only { display: none; }
