/* BowlSight's pages on kindlymadeapps.com (/bowlsight/...). Loaded after /assets/site.css, on these pages
   only, so the other apps' pages never see it.
   The site's own structure, fonts and pieces, in BowlSight's colours: the app's palette (BowlColors in
   app/src/main/kotlin/app/kindlymade/bowlsight/ui/theme/Color.kt), dark only like the app, with the
   ball's Glow as the accent and Spare's amber for breakpoints. Every text colour keeps at least 4.5:1 on
   the surfaces it sits on. No inline styles anywhere: the site's CSP allows only this file and site.css. */

:root {
  color-scheme: dark;
  --bg: #0A0E15;            /* Night */
  --bg-deep: #05070B;       /* Ink */
  --surface: #111823;       /* Slate */
  --surface-hero: #111823;
  --surface-line: #243041;  /* Line */
  --hairline: #1A2230;
  --sunken: #070A10;
  --control: #8592A3;       /* Mist */
  --text: #F2F5F9;          /* Chalk */
  --text-2: #C3CCD8;        /* Fog */
  --text-3: #8592A3;        /* Mist */
  --accent: #36E2D4;        /* Glow */
  --accent-hi: #9BFBF5;     /* Glow soft */
  --accent-pressed: #0FB3B8;/* Glow deep */
  --accent-edge: #0A6F73;
  --accent-ink: #5FEADF;
  --accent-tint: #0D2A2D;
  --on-accent: #05070B;
  --raised: #19212E;        /* Graphite */
  --raised-hi: #222C3B;
  --raised-edge: #020305;
  --piece-line: #2A3648;
  --success-ink: #46E39A;   /* Strike */
  --success-tint: #0E2A1E;
  --gold-tint: #2E2410;
  --gold-ink: #FFC34D;      /* Spare */
  --gold-edge: #8A6418;
  --focus: #FFC34D;
  --shadow-card: 0 0 0 1px var(--surface-line), 0 18px 36px -24px rgba(0, 0, 0, 0.9);
  --shadow-shot: 0 0 0 1.5px var(--surface-line), 0 24px 48px -22px rgba(0, 0, 0, 0.95);
  --grain-opacity: 0;
  --bs-maple: #EBCB9E;      /* the lane's wood */
  --bs-maple-deep: #D3A774;
  --bs-gutter: #151B24;
  --bs-spare: #FFC34D;
}

/* No linen grain: BowlSight's board is a lane under the lights, not paper. */
body::before { display: none; }

/* ---- Pieces in BowlSight's inks -------------------------------------------------------------- */

.chip { background: var(--raised); }
.soon-badge { background: var(--raised); box-shadow: inset 0 0 0 1.5px var(--piece-line); }
.soon-badge svg { color: var(--accent); }
.get .note { max-width: 30rem; }

/* Ticks: a tick beside a normal text block (the site's grid version splits an item with bold words into
   cells), in the ball's Glow. */
.ticks li { display: block; position: relative; padding-left: 44px; min-height: 30px; }
.ticks li::before {
  position: absolute;
  left: 0;
  top: 0.08em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2336E2D4' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

.faq summary::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C3CCD8' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
}
.faq details[open] { box-shadow: var(--shadow-card), inset 0 0 0 1.5px var(--piece-line); }

.private .lock svg { color: var(--accent); }

/* ---- The landing page ------------------------------------------------------------------------ */

/* The hero: a lane at night, with the ball's glow behind the phones. */
.bs-hero { background: radial-gradient(56rem 30rem at 82% 0%, rgba(54, 226, 212, 0.13), transparent 65%), var(--bg); }
.bs-hero h1 { max-width: 16ch; }
.bs-sight { color: var(--accent); }
.bs-hero .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; margin-inline: auto; width: 100%; }
.bs-hero .shots li:nth-child(2) { margin-top: 36px; }
.shots img { aspect-ratio: 1 / 2; }

/* What each shot gives: the numbers as a list of tiles. */
.bs-numbers { display: grid; gap: 14px; list-style: none; padding: 0; margin: 0; }
.bs-numbers > li { margin: 0; padding: 18px 20px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-card); }
.bs-numbers h3 { margin: 0 0 6px; font-size: 1.2rem; }
.bs-numbers p { margin: 0; color: var(--text-2); }
.bs-numbers .bs-amber { color: var(--bs-spare); }

/* How it works: four steps, each a phone and its words. */
.bs-steps { display: grid; gap: 28px; list-style: none; padding: 0; margin: 0; }
.bs-steps > li { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 18px; align-items: start; align-content: start; margin: 0; }
.bs-steps img { width: 100%; height: auto; aspect-ratio: 1 / 2; border-radius: 14px; box-shadow: var(--shadow-shot); background: var(--bg-deep); }
.bs-steps h3 { display: flex; align-items: center; gap: 12px; margin: 2px 0 8px; font-size: 1.35rem; }
.bs-num { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-ink); font: 800 1.1rem/1 var(--font-display); }
.bs-steps p { margin: 0; color: var(--text-2); font-size: 1.125rem; }
.bs-note { margin: 26px 0 0; color: var(--text-3); font-size: 1.0625rem; max-width: var(--measure); }

/* The free tools, as cards that are links. */
.bs-tools { display: grid; gap: 16px; list-style: none; padding: 0; margin: 0; }
.bs-tools > li { margin: 0; }
.bs-tool {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 6px 16px;
  height: 100%;
  padding: 20px;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--text);
  text-decoration: none;
}
.bs-tool:hover { background: var(--raised); }
.bs-tools-head { margin: 0 0 14px; font-size: 1.25rem; color: var(--text-2); }
.bs-tools + .bs-tools-head { margin-top: 32px; }
.bs-tool .icon-tile { grid-row: span 2; }
.bs-tool b { font: 700 1.25rem/1.2 var(--font-display); align-self: end; }
.bs-tool span { color: var(--text-2); }

/* Made by Kindly Made: the Play feature graphic beside the words. */
.bs-about { display: grid; gap: 28px; align-items: center; }
.bs-feature { width: 100%; height: auto; aspect-ratio: 1024 / 500; border-radius: 22px; box-shadow: var(--shadow-shot); background: var(--bg-deep); }
.bs-about .get { margin-top: 18px; }

/* ---- The tool pages -------------------------------------------------------------------------- */

.bs-tool-hero { padding-block: clamp(28px, 6vw, 64px) clamp(20px, 4vw, 40px); background: radial-gradient(48rem 24rem at 85% 0%, rgba(54, 226, 212, 0.1), transparent 65%), var(--bg); }
.bs-tool-hero h1 { max-width: 20ch; }
.bs-tool-hero .lead { max-width: var(--measure); }

/* A calculator: a card with its fields, and the answer below them. */
/* minmax(0, 1fr): the columns may shrink below their fields' natural width (a number input without a
   max is wide by default), so a phone never scrolls sideways. */
.calc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 46rem; }
.calc fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.calc legend { padding: 0; margin-bottom: 10px; font-weight: 700; color: var(--text); }
.calc-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; }
.input-unit input { width: 100%; }
.field label { font-weight: 700; color: var(--text); }
.field .hint { margin: 0; color: var(--text-3); font-size: 1rem; }
.input-unit { display: flex; align-items: stretch; border-radius: 14px; background: var(--sunken); box-shadow: inset 0 0 0 1.5px var(--piece-line); }
.input-unit:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.input-unit input,
.calc select {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: 700 1.25rem/1.2 var(--font-body);
  font-variant-numeric: tabular-nums;
}
.input-unit input:focus,
.calc select:focus { outline: none; }
.input-unit .unit { display: flex; align-items: center; padding: 0 14px 0 4px; color: var(--text-3); font-weight: 700; }
.calc select { width: 100%; background: var(--sunken); box-shadow: inset 0 0 0 1.5px var(--piece-line); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C3CCD8' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 20px; padding-right: 44px; }
.calc select:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }

/* Choices as a row of pills (radio buttons underneath, so they work with a keyboard and a reader). */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; display: inline-flex; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: 999px; background: var(--raised); color: var(--text-2); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--piece-line); }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.calc > .hint { margin: 0; color: var(--text-3); font-size: 1rem; }
.calc textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--sunken);
  box-shadow: inset 0 0 0 1.5px var(--piece-line);
  color: var(--text);
  font: 700 1.2rem/1.4 var(--font-body);
  font-variant-numeric: tabular-nums;
  resize: vertical;
}
.calc textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }

/* The score sheet: ten frames, two rows of five on a phone, one row on wider screens. */
.scorecard { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.frame { display: grid; grid-template-rows: auto auto auto; border-radius: 10px; background: var(--sunken); box-shadow: inset 0 0 0 1.5px var(--piece-line); overflow: hidden; }
.frame.is-current { box-shadow: inset 0 0 0 2px var(--accent); }
.frame-no { padding: 4px 0 2px; text-align: center; color: var(--text-3); font-size: 0.8rem; font-weight: 700; }
.boxes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-top: 1px solid var(--hairline); }
.box { display: grid; place-items: center; min-height: 32px; font: 800 1.05rem/1 var(--font-display); color: var(--text); }
.box + .box { border-left: 1px solid var(--hairline); }
.total { display: grid; place-items: center; min-height: 36px; border-top: 1px solid var(--hairline); font: 800 1.15rem/1 var(--font-display); color: var(--accent-hi); font-variant-numeric: tabular-nums; }
.scorecard.is-example .total { color: var(--text); }

/* The keypad: the pins knocked down by each ball. */
.keypad { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.keypad-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.key {
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--raised);
  color: var(--text);
  font: 800 1.25rem/1 var(--font-display);
  box-shadow: inset 0 0 0 1.5px var(--piece-line), 0 4px 0 var(--raised-edge);
  cursor: pointer;
}
.key:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 0 0 1.5px var(--piece-line), 0 1px 0 var(--raised-edge); }
.key:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.key:disabled { opacity: 0.35; cursor: default; box-shadow: inset 0 0 0 1.5px var(--piece-line); }
.key-mark { color: var(--accent-hi); }
.key-wide { font: 700 1.05rem/1 var(--font-body); }
.score-calc:not(.is-ready) .keypad,
.score-calc:not(.is-ready) .keypad-actions { display: none; }

/* The answer. */
.answer-box { display: grid; gap: 6px; padding: 20px; border-radius: 18px; background: var(--accent-tint); box-shadow: inset 0 0 0 1.5px rgba(54, 226, 212, 0.35); }
.answer-box .label { margin: 0; color: var(--text-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.9rem; }
.answer-box .big { margin: 0; font: 800 clamp(2.4rem, 2rem + 2vw, 3.2rem)/1 var(--font-display); color: var(--accent-hi); font-variant-numeric: tabular-nums; }
.answer-box .big small { font-size: 0.45em; font-weight: 700; color: var(--text-2); margin-left: 6px; }
.answer-box .more { margin: 4px 0 0; color: var(--text-2); }
.answer-box.is-error { background: var(--gold-tint); box-shadow: inset 0 0 0 1.5px var(--gold-edge); }
.answer-box.is-error .big { color: var(--gold-ink); font-size: 1.35rem; line-height: 1.3; }
[hidden] { display: none !important; }

/* Tables: the speed chart and the like, scrolling sideways on their own if a phone is too narrow. */
.table-wrap { overflow-x: auto; max-width: 100%; border-radius: 16px; box-shadow: var(--shadow-card); }
.bs-table { width: 100%; border-collapse: collapse; background: var(--surface); font-variant-numeric: tabular-nums; }
.bs-table th, .bs-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
.bs-table th { color: var(--text-2); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; white-space: normal; vertical-align: bottom; }
@media (max-width: 479px) {
  .bs-table th, .bs-table td { padding: 10px 9px; }
  .bs-table th { font-size: 0.85rem; letter-spacing: 0.04em; }
}
.bs-table tr:last-child td { border-bottom: 0; }
.bs-table tr.is-match td { background: var(--accent-tint); color: var(--accent-hi); font-weight: 700; }
.bs-table caption { caption-side: bottom; padding: 10px 4px 0; text-align: left; color: var(--text-3); font-size: 1rem; }
/* The full handicap chart: small numbers in a grid, a row for each ten and a column for each last digit. */
.bs-table.bs-grid th, .bs-table.bs-grid td { padding: 9px 6px; text-align: center; }
.bs-table.bs-grid tbody th { color: var(--text); text-transform: none; letter-spacing: 0; text-align: left; vertical-align: middle; white-space: nowrap; }
@media (max-width: 479px) {
  .bs-table.bs-grid th, .bs-table.bs-grid td { padding: 8px 2px; font-size: 0.85rem; letter-spacing: 0; }
}

/* The lane diagram (the entry angle page): drawn by tools.js into an <svg>. */
.lane-figure { margin: 0; display: grid; gap: 10px; justify-items: center; }
.lane-figure svg { width: min(100%, 240px); height: auto; }
.lane-figure figcaption { color: var(--text-3); font-size: 1rem; text-align: center; max-width: 30rem; }
.calc-split { display: grid; gap: 24px; align-items: start; }

/* A worked formula, set apart. */
.formula { padding: 16px 20px; border-radius: 16px; background: var(--sunken); box-shadow: inset 0 0 0 1.5px var(--piece-line); font-weight: 700; color: var(--text); }
.formula p { margin: 0; }
.formula p + p { margin-top: 6px; color: var(--text-2); font-weight: 400; }

/* "Measure it from a video": the pointer to BowlSight on each tool page. */
.bs-cta { display: grid; gap: 20px; align-items: center; }
.bs-cta img { width: 160px; height: auto; aspect-ratio: 1 / 2; border-radius: 18px; box-shadow: var(--shadow-shot); background: var(--bg-deep); justify-self: center; }
.bs-cta h2 { margin-bottom: 0.4em; }
.bs-cta p { color: var(--text-2); }

.sources { color: var(--text-3); font-size: 1rem; }
.sources li { margin-bottom: 0.3em; }

@media (min-width: 640px) {
  .bs-hero .shots { gap: 22px; }
  .bs-numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bs-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-fields.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bs-cta { grid-template-columns: 160px minmax(0, 1fr); gap: 32px; }
}
@media (min-width: 760px) {
  .scorecard { grid-template-columns: repeat(9, minmax(0, 1fr)) minmax(0, 1.4fr); }
  .keypad { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .bs-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 40px; }
  .bs-steps > li { grid-template-columns: 128px minmax(0, 1fr); }
  .calc-split { grid-template-columns: minmax(0, 1fr) 220px; }
}
@media (min-width: 960px) {
  .bs-hero .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .bs-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bs-about { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
}
@media (min-width: 1040px) {
  .bs-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
  .bs-steps > li { grid-template-columns: minmax(0, 1fr); }
  .bs-steps img { width: min(100%, 200px); border-radius: 20px; }
}
