/* Rockbro: quiet, typography-led. Colour is kept for data (make / miss); the camera screen is dark. */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --ink: #111113;
  --ink-2: #4a4a50;
  --muted: #76767d;
  --line: #e6e5e2;
  --btn: #111113;
  --btn-ink: #ffffff;
  --make: #1a9f62;
  --miss: #d64545;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0d; --surface: #151517; --ink: #f2f2f3; --ink-2: #c4c4c9; --muted: #8b8b92; --line: #26262a;
    --btn: #f2f2f3; --btn-ink: #0c0c0d; --make: #3ecf8e; --miss: #f07070;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, select, label.btn { font: inherit; }
h1, h2 { margin: 0; text-wrap: balance; letter-spacing: -0.022em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.screen {
  min-height: 100vh;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}
.nav {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: 18px;
}
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; color: inherit; text-decoration: none; }
.wordmark img { border-radius: 9px; width: 34px; height: 34px; }
.navlink { background: none; border: 0; color: var(--ink-2); font-size: 15px; font-weight: 500; cursor: pointer; padding: 8px 4px; }
.navlink:hover { color: var(--ink); }
.navlinks { display: flex; align-items: center; gap: 18px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.navlinks::-webkit-scrollbar { display: none; }
.navlinks a.navlink { text-decoration: none; white-space: nowrap; }
.navlinks .navlink[aria-current="page"] { color: var(--ink); }
.navlinks .btn { flex: none; }
.who { display: inline-flex; align-items: center; gap: 8px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12.5px; font-weight: 700; color: #fff; flex: none; }
.who.has-player { padding: 0 12px 0 5px; }
@media (max-width: 560px) { .navlinks { gap: 12px; } .navlink { font-size: 14px; } .hide-sm { display: none; } }
@media (max-width: 420px) { .who-name { display: none; } .who.has-player { padding: 0 5px; } .wordmark { font-size: 17px; } }
.status { flex: 1; min-width: 0; text-align: center; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
a.btn { text-decoration: none; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-primary { background: var(--btn); color: var(--btn-ink); }
.btn-primary:hover { opacity: .88; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-text, .btn-text.danger { background: none; border: 0; padding: 0 6px; height: auto; color: var(--ink-2); font-weight: 500; cursor: pointer; font: inherit; }
.btn-text.danger { color: var(--miss); }
.btn-light { background: #f2f2f3; color: #0c0c0d; }
.btn-light:hover { background: #fff; }
.btn-ghost-dark { background: rgba(255,255,255,.07); color: #e9e9ec; border-color: rgba(255,255,255,.12); }
.btn-ghost-dark:hover { background: rgba(255,255,255,.12); }
.btn:disabled { opacity: .4; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fine { font-size: 13.5px; color: var(--muted); }

/* home */
.hero {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center;
  padding: 56px 0 72px;
}
.hero-copy { display: grid; gap: 22px; }
.hero h1 { font-size: clamp(38px, 5.4vw, 60px); line-height: 1.04; font-weight: 700; }
.lede { font-size: 18px; color: var(--ink-2); max-width: 46ch; }
.device { margin: 0; border-radius: 22px; padding: 10px; background: #0b0c0e; box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 24px 60px -24px rgba(0,0,0,.35); min-width: 0; }
.device svg { display: block; width: 100%; height: auto; border-radius: 14px; }
.hero-photo { margin: 0; min-width: 0; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 60px -24px rgba(0,0,0,.45); }
.hero-photo img { display: block; width: 100%; height: auto; }
.features {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px;
  padding: 40px 0; border-top: 1px solid var(--line);
}
.features h2 { font-size: 17px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em; }
.features p { color: var(--ink-2); font-size: 15px; }
.setup-guide { max-width: 1080px; margin: 0 auto; padding: 40px 0 48px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px 40px; }
.setup-guide h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.setup-guide ol { margin: 0; padding-left: 1.2em; display: grid; gap: 12px; color: var(--ink-2); max-width: 62ch; }
.setup-guide ol strong { color: var(--ink); font-weight: 600; }
.setup-guide .fine { grid-column: 2; }
.foot { max-width: 1080px; margin: 0 auto; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 24px 0 48px; }
  .features { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .setup-guide { grid-template-columns: minmax(0, 1fr); }
  .setup-guide .fine { grid-column: 1; }
}

/* tracking: always dark, like a camera app */
.screen.dark { background: #0b0b0c; color: #ededf0; }
.screen.dark .navlink { color: #b6b6bd; }
.screen.dark .navlink:hover { color: #fff; }
.screen.dark .status { color: #8f8f96; }
.stage-wrap { max-width: 1080px; margin: 0 auto; display: flex; justify-content: center; }
.stage { position: relative; width: 100%; max-width: calc(64vh * var(--ar, 1.7778)); aspect-ratio: var(--ar, 1.7778); background: #000; border-radius: 14px; overflow: hidden; }
.stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#overlay { touch-action: manipulation; cursor: crosshair; }
.banner { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: rgba(12,12,13,.78); backdrop-filter: blur(8px); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap; max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; }
.flash { position: absolute; top: 14px; left: 14px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .06em; pointer-events: none; animation: fade 1.2s ease-out forwards; }
.flash.make { background: #3ecf8e; color: #06281a; }
.flash.miss { background: rgba(255,255,255,.14); color: #fff; }
@keyframes fade { 0% { opacity: 0; transform: translateY(-4px); } 12% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }
.setup { max-width: 1080px; margin: 16px auto 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.setup select { background: rgba(255,255,255,.07); color: #ededf0; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 0 14px; height: 46px; }
.hud { max-width: 1080px; margin: 16px auto 0; display: grid; gap: 14px; }
.score { display: flex; justify-content: center; gap: 44px; flex-wrap: wrap; }
.stat { display: grid; justify-items: center; gap: 2px; }
.stat .v { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12.5px; color: #8f8f96; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 26px; }
.chip { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #3a3a40; background: transparent; cursor: pointer; padding: 0; }
.chip.make { background: #3ecf8e; border-color: #3ecf8e; }
.chip.manual { border-style: dashed; }
.fix { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 7px; color: #b6b6bd; font-size: 14px; padding: 0 8px; }

/* summary */
.sum { max-width: 1080px; margin: 24px auto 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 56px; align-items: start; }
.sum-main { display: grid; gap: 28px; }
.sum-title { font-size: 34px; font-weight: 700; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line); }
.kv div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.kv dt { font-size: 13px; color: var(--muted); }
.kv dd { margin: 2px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.coach h2 { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 600; margin-bottom: 10px; letter-spacing: -0.01em; }
.coach h2 img { border-radius: 6px; }
.tips { margin: 0 0 10px; padding-left: 1.1em; display: grid; gap: 8px; color: var(--ink-2); }
.tips li { max-width: 60ch; }
.sum-card canvas { width: 100%; height: auto; border-radius: 18px; display: block; box-shadow: 0 24px 60px -28px rgba(0,0,0,.35); }
@media (max-width: 820px) {
  .sum { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* history */
.hist { max-width: 720px; margin: 24px auto 0; display: grid; gap: 20px; }
.hist svg { width: 100%; height: auto; display: block; }
.hist-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.hist-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.hist-list .d { color: var(--ink-2); font-size: 15px; }
.hist-list .m { color: var(--muted); font-size: 15px; }
.hist-list .p { font-weight: 600; text-align: right; }

/* info pages (about, faq, terms, privacy) */
.doc { max-width: 720px; margin: 24px auto 56px; display: grid; gap: 18px; }
.doc h1 { font-size: clamp(32px, 4.6vw, 44px); line-height: 1.08; font-weight: 700; }
.doc h2 { font-size: 20px; font-weight: 600; margin-top: 18px; letter-spacing: -0.015em; }
.doc h3 { font-size: 16px; font-weight: 600; margin: 6px 0 -8px; }
.doc p, .doc li { color: var(--ink-2); max-width: 66ch; }
.doc ul, .doc ol { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.doc a { color: var(--ink); }
.doc .updated { font-size: 13.5px; color: var(--muted); }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; }
.doc th, .doc td { text-align: left; padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.doc th { color: var(--ink); font-weight: 600; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 500; }
.faq details[open] summary::after { content: "–"; }
.faq details p, .faq details ul { margin-top: 10px; }
.foot a { color: inherit; }
.foot nav { display: flex; flex-wrap: wrap; gap: 16px; }

/* players ("Sign in") */
.players { max-width: 560px; margin: 24px auto 0; display: grid; gap: 22px; }
.player-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.player-list button.pick { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.player-list button.pick:hover { border-color: var(--muted); }
.player-list button.pick[aria-pressed="true"] { border-color: var(--ink); }
.player-list .avatar { width: 38px; height: 38px; font-size: 16px; }
.player-list .meta { margin-left: auto; font-weight: 500; color: var(--muted); font-size: 14px; }
.player-row { display: flex; align-items: center; gap: 8px; }
.player-row .pick { flex: 1; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.input { height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 14px; font: inherit; min-width: 0; flex: 1; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatches button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--bg); }

/* camera sources */
.sources { max-width: 720px; margin: 24px auto 0; display: grid; gap: 14px; }
.source { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.source h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.source p { color: var(--ink-2); font-size: 14.5px; grid-column: 1; }
.source .btn { grid-row: 1 / span 2; grid-column: 2; }
@media (max-width: 560px) { .source { grid-template-columns: minmax(0, 1fr); } .source .btn { grid-row: auto; grid-column: 1; justify-self: start; margin-top: 8px; } }
.pair { max-width: 720px; margin: 8px auto 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.pair .qr { background: #fff; padding: 12px; border-radius: 14px; width: 220px; height: 220px; }
.pair .qr svg, .pair .qr img { width: 100%; height: 100%; display: block; }
.pair .code { font-size: 30px; font-weight: 700; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.pair ol { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; color: #b6b6bd; }
.cam-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cam-list button { width: 100%; text-align: left; display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid #34343a; background: #1a1a1d; color: #fff; font: inherit; cursor: pointer; }
.cam-list button:hover:not(:disabled) { border-color: #6b6b73; }
.cam-list button:disabled { cursor: default; opacity: .75; }
.cam-list .meta { color: #9a9aa2; font-size: 13px; }
@media (max-width: 560px) { .pair { grid-template-columns: minmax(0, 1fr); justify-items: center; } }
.challenge { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #111113; color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; max-width: calc(100% - 40px); z-index: 20; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); }

/* The Cave family strip */
.cave-strip { max-width: 1080px; margin: 40px auto 0; padding: 18px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: 14px; color: var(--muted); }
.cave-badge { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: .02em; }
.cave-badge img { width: 34px; height: auto; }
.cave-badge:hover { text-decoration: underline; text-underline-offset: 4px; }
.cave-strip nav { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.cave-strip nav a { color: var(--ink-2, var(--ink)); }
.cave-strip + .foot { margin-top: 0; }
@media (prefers-color-scheme: dark) { .cave-badge img { filter: invert(1) brightness(1.6); } }
