/* Hyzer Line Disc Golf — matches thehyzerline.net palette (deep woodland, lime, gold). System fonts only. */
:root {
  --bg: #0b130e; --panel: rgba(11, 19, 14, 0.86); --panel-solid: #111b13;
  --border: rgba(255, 255, 255, 0.12); --border-strong: rgba(183, 242, 109, 0.35);
  --text: #f4f7f2; --muted: #c8d5c2; --lime: #b7f26d; --lime-soft: rgba(183, 242, 109, 0.14);
  --gold: #f2d16d; --sky: #5ba8ff; --red: #ff7a59;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --r: 18px; --r-sm: 12px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.hidden { display: none !important; }

.game { position: fixed; inset: 0; overflow: hidden; background: var(--bg); user-select: none; -webkit-user-select: none; touch-action: none; }
#c { position: absolute; inset: 0; display: block; touch-action: none; cursor: crosshair; }

/* ── HUD ── */
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-top { position: absolute; top: calc(10px + var(--safe-t)); left: 10px; right: 10px; display: flex; gap: 8px; align-items: stretch; }
.pill { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-sm); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 6px 20px rgba(0,0,0,.28); }
.hole-pill { display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 6px; min-width: 0; }
.hole-pill img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.hp-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.hp-text b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-text span { font-size: .75rem; color: var(--muted); }
.hole-n { margin-left: 6px; font-weight: 800; color: var(--bg); background: var(--lime); border-radius: 999px; padding: 2px 9px; font-size: .78rem; }
.stats { display: flex; gap: 8px; flex: 1; justify-content: center; }
.stat { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 12px; min-width: 78px; line-height: 1.1; }
.stat .lbl { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stat b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .66rem; color: var(--lime); white-space: nowrap; }
.stat.wind { flex-direction: row; gap: 6px; }
.stat.wind .lbl { display: none; }
#hud-wind-arrow { width: 22px; height: 22px; fill: var(--sky); transition: transform .25s ease; }
.hud-btns { display: flex; gap: 6px; align-items: center; }
.btn-s { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-size: .82rem; font-weight: 600; min-height: 38px; }
.btn-s:hover { border-color: var(--border-strong); }
.btn-s.icon { width: 38px; padding: 0; display: grid; place-items: center; }
.btn-s.icon svg { width: 18px; height: 18px; }
#btn-mute .slash { display: none; } #btn-mute.off .slash { display: inline; } #btn-mute.off .wave { display: none; }
.btn-s.danger { background: rgba(255,122,89,.18); border-color: rgba(255,122,89,.5); }
.quit { position: absolute; top: calc(64px + var(--safe-t)); right: 10px; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 8px 10px; display: flex; gap: 8px; align-items: center; font-size: .85rem; }

.hint { position: absolute; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 10px); opacity: 0; pointer-events: none !important; transition: opacity .35s, transform .35s; text-align: center; background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 8px 14px; font-size: .86rem; max-width: min(92vw, 560px); }
.hint small { display: block; color: var(--muted); font-size: .72rem; margin-top: 3px; }
.hint.show { opacity: 1; transform: translate(-50%, 0); }

.controls { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100% - 20px); }
.seg { display: flex; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px; gap: 3px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.seg button { background: transparent; border: 0; border-radius: 9px; padding: 7px 11px; font-size: .82rem; font-weight: 600; color: var(--muted); min-height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.seg button small { font-size: .62rem; font-weight: 500; opacity: .8; font-variant-numeric: tabular-nums; margin-top: 2px; }
.seg button.on { background: var(--lime); color: #0b130e; }
.seg button:not(.on):hover { background: rgba(255,255,255,.06); color: var(--text); }
.discs button { flex-direction: row; gap: 6px; flex-wrap: wrap; max-width: 120px; }
.discs button small { width: 100%; text-align: center; margin: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.35); }
.dot.drv { background: var(--gold); } .dot.mid { background: var(--sky); } .dot.put { background: #f4f7f2; }
.putt-note { display: none; background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 9px 14px; font-size: .85rem; max-width: 520px; text-align: center; }
.putting .controls .seg { display: none; }
.putting .putt-note { display: block; }

.toast { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%) scale(.9); opacity: 0; pointer-events: none; font-weight: 800; font-size: clamp(1.4rem, 4vw, 2.3rem); letter-spacing: .01em; color: var(--text); text-shadow: 0 3px 18px rgba(0,0,0,.65), 0 1px 2px rgba(0,0,0,.8); transition: opacity .25s, transform .25s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast.lime { color: var(--lime); } .toast.gold { color: var(--gold); font-size: clamp(2rem, 7vw, 3.6rem); } .toast.red { color: #ffc2b0; }

/* ── Screens & cards ── */
.screen { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; display: flex; justify-content: center; align-items: flex-start; padding: calc(24px + var(--safe-t)) 16px calc(24px + var(--safe-b));
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(11,19,14,.55), rgba(11,19,14,.92) 70%), linear-gradient(180deg, rgba(11,19,14,.35), rgba(11,19,14,.9)); }
.title-inner { width: 100%; max-width: 620px; margin: auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.logo { width: 112px; height: 112px; border-radius: 50%; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.logo.small { width: 72px; height: 72px; }
.eyebrow { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
h1 { margin: 0; font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1; font-weight: 800; letter-spacing: -.02em; }
h1 span { color: var(--lime); }
.lede { margin: 2px 0 6px; color: var(--muted); font-size: 1rem; line-height: 1.55; max-width: 520px; }
.btn-primary { background: var(--lime); color: #0b130e; border: 0; border-radius: 999px; padding: 13px 30px; font-size: 1.05rem; font-weight: 800; box-shadow: 0 8px 28px rgba(183,242,109,.25); transition: transform .15s, box-shadow .15s; min-height: 48px; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 34px rgba(183,242,109,.35); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); border-radius: 999px; padding: 12px 22px; font-weight: 700; min-height: 48px; }
.best { margin: 0; font-size: .85rem; color: var(--muted); }
.hole-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.hole-list li { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 10px; padding: 7px 9px; text-align: left; font-size: .8rem; }
.hole-list b { color: var(--bg); background: var(--lime); border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; font-size: .7rem; flex: none; }
.hole-list span { flex: 1; min-width: 0; line-height: 1.15; }
.hole-list em { display: block; font-style: normal; color: var(--muted); font-size: .7rem; }
.hole-list i { font-style: normal; color: var(--gold); font-size: .7rem; white-space: nowrap; }
.how { width: 100%; text-align: left; background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 14px; }
.how summary { cursor: pointer; font-weight: 700; color: var(--lime); }
.how ul { margin: 8px 0 4px; padding-left: 18px; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.how li { margin-bottom: 4px; } .how b { color: var(--text); }
.fine { margin: 4px 0 0; font-size: .72rem; color: rgba(200,213,194,.7); }

.card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow-y: auto; background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--r); padding: 20px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); text-align: center; animation: pop .3s ease; touch-action: pan-y; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.card h2 { margin: 4px 0 0; font-size: 1.5rem; line-height: 1.15; }
.card .city { margin: 2px 0 12px; color: var(--muted); font-size: .9rem; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.facts div { background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 12px; padding: 8px 4px; }
.facts span { display: block; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts b { font-size: 1.35rem; color: var(--lime); }
.tag { display: inline-block; margin: 0 0 8px; padding: 3px 10px; border-radius: 999px; background: var(--lime-soft); color: var(--lime); font-size: .75rem; font-weight: 700; }
.desc { margin: 0 0 8px; color: var(--text); font-size: .95rem; line-height: 1.5; }
.wind-line { margin: 0 0 4px; color: var(--sky); font-size: .85rem; font-weight: 600; }
.mini { margin: 0 0 8px; color: var(--muted); font-size: .82rem; } .mini.strong { color: var(--text); font-weight: 600; }
.card .btn-primary { margin-top: 6px; width: 100%; }
.card.intro { top: auto; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
.big { margin: 6px 0; font-size: 2.4rem; font-weight: 800; }
.big.ace { color: var(--gold); } .big.eagle, .big.birdie { color: var(--lime); } .big.bogey { color: #ffd2a6; } .big.dbl { color: #ffb4a0; }
.row { display: flex; gap: 10px; justify-content: center; width: 100%; margin-top: 8px; }
.row > * { flex: 1; } .row .btn-primary { margin-top: 0; }

.scorecard { width: min(520px, calc(100% - 20px)); z-index: 5; text-align: left; }
.sc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sc-head h2 { margin: 0; }
.sc-table { width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; }
.sc-table th { font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 6px 4px; border-bottom: 1px solid var(--border); text-align: center; }
.sc-table td { padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: center; }
.sc-table .crs { text-align: left; }
.sc-table td.crs small { display: block; color: var(--muted); font-size: .7rem; }
.sc-table tr.cur td { background: rgba(183,242,109,.07); }
.sc-table tfoot td { border-bottom: 0; font-weight: 700; padding-top: 9px; }
.sc { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; font-weight: 800; }
.sc.ace { background: var(--gold); color: #0b130e; border-radius: 50%; }
.sc.eagle { background: var(--lime); color: #0b130e; border-radius: 50%; box-shadow: 0 0 0 3px rgba(183,242,109,.35); }
.sc.birdie { border: 2px solid var(--lime); color: var(--lime); border-radius: 50%; }
.sc.par { color: var(--text); }
.sc.bogey { border: 2px solid #ffd2a6; color: #ffd2a6; }
.sc.dbl { background: rgba(255,122,89,.25); border: 2px solid #ff9f85; color: #ffc2b0; }

.summary .sc-table { background: rgba(11,19,14,.7); border: 1px solid var(--border); border-radius: var(--r-sm); text-align: left; }
.sum-score { display: flex; align-items: baseline; gap: 12px; }
.sum-score b { font-size: 4.2rem; line-height: 1; font-weight: 800; }
.sum-score span { font-size: 1.8rem; font-weight: 800; color: var(--lime); }
.pb { margin: 0; color: var(--muted); font-weight: 600; } .pb.new { color: var(--gold); }

/* ── compact / mobile ── */
.compact .hud-top { flex-wrap: wrap; gap: 6px; left: 6px; right: 6px; top: calc(6px + var(--safe-t)); }
.compact .hole-pill { flex: 1; padding: 3px 10px 3px 4px; }
.compact .hole-pill img { width: 28px; height: 28px; }
.compact .stats { order: 3; flex-basis: 100%; gap: 6px; }
.compact .stat { flex: 1; min-width: 0; padding: 3px 6px; }
.compact .stat b { font-size: .92rem; }
.compact .btn-s { min-height: 34px; padding: 6px 9px; }
.compact .btn-s.icon { width: 34px; }
.compact .controls { gap: 5px; bottom: calc(6px + var(--safe-b)); max-width: calc(100% - 12px); }
.compact .seg button { padding: 5px 8px; font-size: .74rem; min-height: 36px; }
.compact .discs { flex-basis: 100%; justify-content: center; }
.compact .discs button { flex: 1; max-width: none; }
.compact .hint { bottom: calc(112px + var(--safe-b)); font-size: .78rem; }
.compact .hint small { display: none; }
.compact .hole-list { grid-template-columns: repeat(2, 1fr); }
.compact .card { padding: 16px; }
.compact .card.intro { bottom: calc(8px + var(--safe-b)); }
.compact .facts b { font-size: 1.15rem; }
.short .logo { width: 72px; height: 72px; }
.short .card.intro .desc { font-size: .86rem; }
@media (prefers-reduced-motion: reduce) { .card, .card.intro { animation: none; } .toast, .hint { transition: none; } }
.summary .title-inner { gap: 8px; }
.summary .sc-table td { padding: 4px; }
.summary .sc { min-width: 24px; height: 24px; }
.summary .sum-score b { font-size: 3.4rem; }
.summary .logo.small { width: 60px; height: 60px; }

/* ── hole preview (flyover + map) ── */
.map-btn { display: inline-flex; align-items: center; gap: 6px; }
.map-btn svg { width: 17px; height: 17px; flex: none; }
.map-btn[aria-pressed="true"] { background: var(--lime); color: var(--bg); border-color: var(--lime); }
.map-btn:disabled { opacity: .45; cursor: default; }
.compact .map-btn span { display: none; }
.compact .map-btn { width: 34px; padding: 0; justify-content: center; }
.mapview .controls, .mapview .hint, .flying .controls, .flying .hint { display: none !important; }
.mapview #c { cursor: grab; }
.mapview #c:active { cursor: grabbing; }
.flying #c { cursor: pointer; }
.opt { display: inline-flex; align-items: center; gap: 8px; margin: 10px auto 0; font-size: .85rem; color: var(--muted); cursor: pointer; }
.opt input { width: 18px; height: 18px; accent-color: var(--lime); cursor: pointer; margin: 0; }
@media (max-width: 440px) { .compact #btn-fs { display: none; } }

/* rethrow (undo last throw) + accidental-throw hints */
.rethrow-btn { position: absolute; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(84px + var(--safe-b)); display: flex; align-items: center; gap: 7px; min-height: 46px; padding: 8px 14px 8px 11px; border-radius: 999px; border: 1.5px solid var(--gold); background: rgba(24, 22, 10, 0.88); color: var(--gold); font: 800 .9rem/1 var(--font); letter-spacing: .01em; box-shadow: 0 6px 22px rgba(0,0,0,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); touch-action: manipulation; opacity: 0; transform: translateY(8px) scale(.96); pointer-events: none !important; transition: opacity .2s, transform .2s; cursor: pointer; }
.rethrow-btn.show { opacity: 1; transform: none; pointer-events: auto !important; }
.rethrow-btn:hover { background: rgba(48, 42, 14, 0.94); }
.rethrow-btn:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.rethrow-btn svg { width: 20px; height: 20px; }
.rethrow-btn kbd { font: 700 .66rem/1 var(--font); border: 1px solid rgba(242,209,109,.5); border-radius: 5px; padding: 3px 5px; opacity: .8; }
.compact .rethrow-btn { bottom: calc(118px + var(--safe-b)); right: 10px; min-height: 44px; padding: 7px 13px 7px 10px; font-size: .84rem; }
.compact .rethrow-btn kbd { display: none; }
.mapview .rethrow-btn, .flying .rethrow-btn { display: none !important; }
.rt-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--gold); border-color: rgba(242,209,109,.55); }
.rt-ghost svg { width: 18px; height: 18px; }
.rt-note { margin: 8px 0 0; font-size: .76rem; color: var(--muted); text-align: center; }
.rt-note:empty { display: none; }
.rt-note.used { color: var(--gold); }
.rt-mark { font-style: normal; font-size: .66rem; color: var(--gold); margin-left: 4px; vertical-align: super; }
.toast.soft { top: 64%; font-size: clamp(.9rem, 2.4vw, 1.05rem); font-weight: 650; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; text-shadow: none; }
.done .row { flex-wrap: wrap; }
.done .row .btn-primary { flex-basis: 100%; }
