@font-face { font-family: 'Anton'; src: url(fonts/anton.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Oswald'; src: url(fonts/oswald.woff2) format('woff2'); font-weight: 200 700; font-display: swap; }
:root { --gold: #ffcf5a; --gold2: #ffe7a6; --acc: #8fd3ff; --ink: #eef2fb; --mut: #9aa6c2; --red: #ff4a3d; --blue: #6fc3ff;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #05060a; color: var(--ink); font-family: 'Oswald', system-ui, sans-serif; overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#app { position: absolute; inset: 0; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- HUD: TV-style score sheet ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
#hud::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--st) + 110px); background: linear-gradient(rgba(3,4,8,.78), rgba(3,4,8,0)); }
.hud-top { position: absolute; top: calc(var(--st) + 8px); left: calc(var(--sl) + 8px); right: calc(var(--sr) + 8px); display: flex; gap: 6px; align-items: stretch; }
.icon-btn { pointer-events: auto; flex: none; width: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(8,10,18,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: 13px; letter-spacing: -2px; }
.sheet-wrap { flex: 1; min-width: 0; }
.sheet-row { display: flex; align-items: stretch; border-radius: 10px; overflow: hidden; background: linear-gradient(#141a2c, #070a13); border: 1px solid rgba(255,207,90,.35); box-shadow: 0 6px 20px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08); }
.sh-name { display: none; }
.fr { flex: 2 1 0; min-width: 0; border-left: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; }
.fr:first-of-type { border-left: 0; }
.fr.f10 { flex: 3 1 0; }
.fr.tot { flex: 2.6 1 0; background: rgba(255,207,90,.12); }
.fr .fn { font-size: 9px; letter-spacing: .08em; text-align: center; color: var(--mut); line-height: 13px; background: rgba(255,255,255,.04); }
.fr.cur .fn { background: var(--gold); color: #1a1205; font-weight: 600; }
.fr .mks { display: flex; justify-content: flex-end; height: 16px; }
.fr .mk { flex: 1; max-width: 15px; text-align: center; font-size: 12px; line-height: 16px; font-weight: 600; border-left: 1px solid rgba(255,255,255,.08); }
.fr .mk.x { color: var(--gold); }
.fr .mk.sp { color: var(--blue); }
.fr .fs { text-align: center; font-family: 'Anton', sans-serif; font-size: 15px; line-height: 20px; font-variant-numeric: tabular-nums; min-height: 20px; }
.fr .fs.big { font-size: 22px; line-height: 33px; color: var(--gold); }
.prac-bar { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 10px; background: linear-gradient(#141a2c, #070a13); border: 1px solid rgba(255,207,90,.35); font-size: 12px; letter-spacing: .12em; }
.prac-bar span:last-child { color: var(--gold); }
.hud-row2 { position: absolute; top: calc(var(--st) + 66px); left: calc(var(--sl) + 12px); right: calc(var(--sr) + 12px); display: flex; justify-content: space-between; align-items: flex-start; }
.tags { font-size: 12px; letter-spacing: .16em; text-shadow: 0 1px 3px #000, 0 0 10px #000; line-height: 1.5; }
#frameTag { color: #fff; font-weight: 600; }
#patTag { color: var(--gold); font-size: 10.5px; }
#maxTag { color: var(--mut); font-size: 10.5px; }
.rack { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 8px; border-radius: 10px; background: rgba(6,8,15,.6); border: 1px solid rgba(255,255,255,.1); }
.rack .rr { display: flex; gap: 4px; }
.rack i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); }
.rack i.on { background: #fff; border-color: #fff; box-shadow: 0 0 6px rgba(255,255,255,.7); }
#aimbar { position: absolute; left: calc(var(--sl) + 10px); right: calc(var(--sr) + 10px); bottom: calc(var(--sb) + 10px); z-index: 3; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
#aimInfo { font-size: 13px; letter-spacing: .14em; color: #e6ecf8; text-shadow: 0 1px 4px #000, 0 0 10px #000; min-height: 18px; }
#aimInfo b { color: var(--gold); font-weight: 600; }
.aim-ctl { display: flex; gap: 8px; align-items: center; justify-content: space-between; width: 100%; max-width: 420px; }
.aim-ctl > * { pointer-events: auto; }
.mini { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.2); background: rgba(8,10,18,.72); font-size: 20px; line-height: 1; }
.hook { display: flex; align-items: center; gap: 6px; padding: 3px; border-radius: 14px; background: rgba(8,10,18,.6); border: 1px solid rgba(255,207,90,.35); }
.hk { display: flex; flex-direction: column; align-items: center; min-width: 44px; }
.hk span { font-size: 9px; letter-spacing: .2em; color: var(--mut); }
.hk b { font-family: 'Anton', sans-serif; font-size: 20px; font-weight: 400; color: var(--gold); line-height: 1; }
.chip { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px 0 6px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(8,10,18,.72); font-size: 13px; letter-spacing: .1em; }
.chip i { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset -3px -4px 6px rgba(0,0,0,.5); }
.hint { position: absolute; left: 0; right: 0; bottom: calc(var(--sb) + 104px); text-align: center; font-size: 15px; letter-spacing: .12em; color: #fff; text-shadow: 0 2px 6px #000, 0 0 12px #000; pointer-events: none; z-index: 3; line-height: 1.45; padding: 0 18px; animation: hintPulse 2s ease-in-out infinite; }
.hint b { color: var(--gold); font-weight: 600; }
.hint span { font-size: 12px; color: #cfd8ea; }
@keyframes hintPulse { 0%,100% { opacity: .6; } 50% { opacity: 1; } }
#readout { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--sb) + 22px); padding: 6px 14px; border-radius: 999px; background: rgba(6,8,15,.7); border: 1px solid rgba(255,255,255,.14); font-size: 13px; letter-spacing: .14em; z-index: 3; white-space: nowrap; }
#readout b { font-family: 'Anton', sans-serif; font-weight: 400; font-size: 18px; color: var(--gold); }
#ff { position: absolute; right: calc(var(--sr) + 12px); top: calc(var(--st) + 128px); font-size: 10px; letter-spacing: .18em; color: rgba(255,255,255,.55); text-shadow: 0 1px 4px #000; z-index: 3; pointer-events: none; }
#ff.on { color: #1a1205; background: var(--gold); padding: 4px 9px; border-radius: 999px; font-size: 14px; font-weight: 600; text-shadow: none; }
#callout { position: absolute; left: 0; right: 0; top: 36%; text-align: center; pointer-events: none; z-index: 4; opacity: 0; padding: 0 10px; }
#callout .c-main { font-family: 'Anton', sans-serif; font-size: clamp(34px, 11vw, 64px); letter-spacing: .03em; color: #fff; line-height: 1.02; text-shadow: 0 4px 0 rgba(0,0,0,.6), 0 8px 24px #000; }
#callout .c-sub { margin-top: 6px; font-size: 14px; letter-spacing: .14em; color: #e9eefb; text-shadow: 0 2px 8px #000; text-transform: uppercase; }
#callout.big .c-main { font-size: clamp(48px, 16vw, 96px); }
#callout.gold .c-main { color: var(--gold2); background: linear-gradient(#fff6d6, #ffcf5a 55%, #d8901a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 4px 0 #4a2f00) drop-shadow(0 0 22px rgba(255,190,60,.6)); text-shadow: none; }
#callout.blue .c-main { color: #dff2ff; text-shadow: 0 0 20px rgba(111,195,255,.8), 0 4px 0 #0b2a44, 0 8px 22px #000; }
#callout.warn .c-main { color: #ffd2b8; text-shadow: 0 0 18px rgba(255,120,60,.6), 0 4px 0 #3a1406, 0 8px 22px #000; }
#callout.bad .c-main { color: #c9d0de; }
#callout.show { animation: callIn .45s cubic-bezier(.2,.9,.3,1.25) both; opacity: 1; }
@keyframes callIn { 0% { opacity: 0; transform: scale(.5) translateY(10px); } 60% { opacity: 1; transform: scale(1.06); } 100% { opacity: 1; transform: none; } }
#fx { position: absolute; left: 50%; top: 40%; width: 0; height: 0; z-index: 4; pointer-events: none; }
#fx i { position: absolute; width: 7px; height: 12px; border-radius: 2px; opacity: 0; animation: spark 1.3s cubic-bezier(.15,.7,.3,1) forwards; }
@keyframes spark { 0% { opacity: 1; transform: translate(0,0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 160px)) rotate(540deg); } }
#loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #05060a; letter-spacing: .14em; color: var(--mut); z-index: 50; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; z-index: 10; }
#title { background: linear-gradient(180deg, rgba(5,6,10,.15) 0%, rgba(5,6,10,.35) 40%, rgba(5,6,10,.88) 100%); display: flex; align-items: flex-end; justify-content: center; padding: calc(var(--st) + 58px) calc(var(--sr) + 18px) calc(var(--sb) + 18px) calc(var(--sl) + 18px); overflow: auto; touch-action: pan-y; }
.title-wrap { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.logo { width: min(84vw, 360px); }
.logo img { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 28px rgba(0,0,0,.8)); animation: logoIn .9s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes logoIn { from { opacity: 0; transform: translateY(-14px) scale(.94); } }
.menu { width: 100%; display: flex; flex-direction: column; gap: 9px; }
.row { display: flex; gap: 9px; }
.row > * { flex: 1; }
.btn { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 50px; padding: 7px 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,.2); background: linear-gradient(#1c2034, #0c0f1b); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 6px 18px rgba(0,0,0,.5); font-size: 16px; letter-spacing: .1em; text-decoration: none; color: var(--ink); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { min-height: 62px; border-color: #fff1c9; background: linear-gradient(#fff0bf, #ffcf5a 50%, #d48f16); color: #221502; box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 8px 26px rgba(255,180,50,.35); }
.btn.daily { border-color: rgba(143,211,255,.55); background: linear-gradient(#13243a, #0a1220); }
.btn.daily .b-main em { font-style: normal; font-size: 13px; letter-spacing: .14em; color: var(--acc); margin-left: 6px; vertical-align: middle; }
.btn.small { min-height: 44px; font-size: 14px; }
.btn.ghost { background: transparent; box-shadow: none; }
.b-main { font-family: 'Anton', sans-serif; font-size: 22px; letter-spacing: .06em; line-height: 1.1; }
.btn:not(.primary) .b-main { font-size: 19px; }
.b-sub { font-size: 12px; letter-spacing: .1em; opacity: .82; }
.toggles { gap: 5px; flex-wrap: wrap; }
.toggles .tog { flex: 1 1 auto; }
.tog { white-space: nowrap; min-width: 0; min-height: 38px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: rgba(10,12,22,.66); font-size: 12px; letter-spacing: .04em; padding: 0 9px; }
.toggles .tog[aria-pressed="false"] { opacity: .5; }
.toggles #glowTog[aria-pressed="true"] { border-color: #b98cff; box-shadow: 0 0 14px rgba(150,100,255,.6); }
.best { text-align: center; font-size: 13px; letter-spacing: .12em; color: var(--gold); min-height: 18px; }
.best #qualNote { color: var(--mut); }
.gdg-back { position: absolute; z-index: 20; top: calc(var(--st) + 10px); left: calc(var(--sl) + 10px); display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px 0 5px; border-radius: 999px; background: rgba(8,10,18,.72); border: 1px solid rgba(255,255,255,.22); color: #e9eefb; text-decoration: none; font-size: 13px; letter-spacing: .12em; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.gdg-back img { width: 28px; height: 28px; object-fit: contain; }
.gdg-back.inline { position: static; align-self: center; margin-top: 4px; }
.gdg-back.inline.top { align-self: flex-start; margin: 0 0 2px; }
.sheet { background: rgba(3,4,8,.62); display: flex; align-items: center; justify-content: center; padding: calc(var(--st) + 12px) calc(var(--sr) + 12px) calc(var(--sb) + 12px) calc(var(--sl) + 12px); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet-card { width: 100%; max-width: 410px; max-height: 100%; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 20px; background: linear-gradient(#171a2c, #090b14); border: 1px solid rgba(255,207,90,.22); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.sheet-card.wide { max-width: 520px; }
.sheet-card h2 { margin: 0; font-family: 'Anton', sans-serif; font-weight: 400; letter-spacing: .06em; font-size: 26px; text-align: center; }
.sheet-card p { margin: 0; color: #c9d2e8; font-size: 15px; line-height: 1.4; text-align: center; }
.setup-lbl { font-size: 11px; letter-spacing: .24em; color: var(--mut); margin-top: 2px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; }
.stepper .btn { width: 56px; font-size: 24px; }
#pCount { font-family: 'Anton', sans-serif; font-size: 34px; min-width: 40px; text-align: center; }
.inits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.inits input { width: 100%; height: 44px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: #0b0e1a; color: #fff; font-family: 'Anton', sans-serif; font-size: 22px; letter-spacing: .12em; text-align: center; text-transform: uppercase; -webkit-user-select: text; user-select: text; touch-action: manipulation; }
.diffs { display: flex; gap: 7px; }
.diffs .tog { flex: 1; min-height: 42px; font-size: 13px; letter-spacing: .1em; }
.diffs.wrap { flex-wrap: wrap; }
.diffs.wrap .tog { flex: 1 1 28%; }
.diffs .tog.on { background: var(--gold); color: #1a1205; border-color: var(--gold); font-weight: 600; }
.diff-note { font-size: 13px; color: #c9d2e8; text-align: center; min-height: 36px; line-height: 1.35; }
.d-date { text-align: center; font-size: 12px; letter-spacing: .3em; color: var(--gold); }
.d-chart { width: 100%; height: 70px; border-radius: 10px; background: #0b0e1a; border: 1px solid rgba(255,255,255,.1); }
.d-legend { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: .16em; color: var(--mut); margin-top: -6px; }
.d-status { text-align: center; font-size: 14px; letter-spacing: .06em; color: var(--acc); min-height: 18px; }
.d-top ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.d-top li { display: flex; gap: 8px; padding: 4px 10px; border-radius: 8px; background: rgba(255,255,255,.04); font-size: 15px; }
.d-top .r { width: 2em; color: var(--mut); } .d-top .n { flex: 1; letter-spacing: .18em; } .d-top .s { color: var(--gold); }
.d-top .empty { text-align: center; color: var(--mut); font-size: 14px; padding: 8px; }
.d-next { text-align: center; font-size: 12px; letter-spacing: .14em; color: var(--mut); }
.ball-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bcard { display: flex; gap: 10px; align-items: center; text-align: left; padding: 9px; border-radius: 14px; border: 1px solid rgba(255,255,255,.14); background: linear-gradient(#161a2b, #0b0e19); }
.bcard i { flex: none; width: 46px; height: 46px; border-radius: 50%; box-shadow: inset -5px -7px 10px rgba(0,0,0,.55), 0 4px 10px rgba(0,0,0,.5); }
.bcard .bn { font-family: 'Anton', sans-serif; font-size: 16px; letter-spacing: .04em; }
.bcard .bc { font-size: 11px; letter-spacing: .12em; color: var(--gold); text-transform: uppercase; }
.bcard .bd { font-size: 11.5px; color: var(--mut); line-height: 1.25; }
.bcard.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(255,207,90,.25); }
.u-round { text-align: center; font-size: 13px; letter-spacing: .3em; color: var(--gold); }
.u-name { text-align: center; font-family: 'Anton', sans-serif; font-size: 64px; letter-spacing: .1em; line-height: 1; }
.u-note { text-align: center; color: #c9d2e8; }
.u-scores { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.u-scores span { padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.07); font-size: 14px; letter-spacing: .1em; }
.u-scores span.on { background: var(--gold); color: #1a1205; }
.res-head { text-align: center; font-size: 13px; letter-spacing: .3em; color: var(--gold); }
.res-big { text-align: center; font-family: 'Anton', sans-serif; font-size: 76px; line-height: 1; background: linear-gradient(#fff6d6, #ffcf5a 55%, #d8901a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 4px 0 #4a2f00); }
.res-sub { text-align: center; font-size: 14px; letter-spacing: .12em; color: #dfe6f6; }
.res-table { display: flex; flex-direction: column; gap: 8px; }
.res-sheet .sheet-row { border-color: rgba(255,255,255,.18); }
.res-sheet .sh-name { display: flex; align-items: center; justify-content: center; flex: 2.4 1 0; font-family: 'Anton', sans-serif; font-size: 13px; letter-spacing: .06em; background: rgba(255,255,255,.06); }
.res-sheet .fr .fs { font-size: 13px; }
.pb { text-align: center; color: var(--gold); letter-spacing: .2em; font-size: 14px; animation: hintPulse 1.2s infinite; }
.coach ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.4; color: #dfe6f6; }
.coach b { color: var(--gold); font-weight: 600; }
.small-p { font-size: 13px !important; color: var(--mut) !important; }

/* ---------- landscape phones ---------- */
@media (orientation: landscape) and (max-height: 520px) {
  .hud-top { left: calc(var(--sl) + 8px); right: calc(var(--sr) + 8px); top: calc(var(--st) + 6px); }
  .sheet-row { max-width: 560px; margin: 0 auto; }
  .hud-row2 { top: calc(var(--st) + 62px); }
  .hint { bottom: calc(var(--sb) + 64px); font-size: 13px; }
  #aimbar { flex-direction: row; justify-content: space-between; align-items: flex-end; }
  #aimInfo { order: 2; flex: 1; text-align: center; padding-bottom: 10px; }
  .aim-ctl { display: contents; }
  #helpIn { order: 1; } .hook { order: 3; } #ballChip { order: 4; }
  #title { align-items: center; padding-top: calc(var(--st) + 52px); }
  .title-wrap { max-width: 760px; flex-direction: row; align-items: center; gap: 22px; }
  .logo { width: 42%; flex: none; }
  .menu { gap: 7px; }
  .btn { min-height: 42px; } .btn.primary { min-height: 52px; } .btn.small { min-height: 38px; }
  .b-main { font-size: 19px; } .btn:not(.primary) .b-main { font-size: 17px; }
  .sheet-card { max-width: 640px; padding: 12px 16px; gap: 8px; }
  .sheet-card h2 { font-size: 22px; }
  .ball-grid { grid-template-columns: repeat(3, 1fr); }
  .u-name { font-size: 44px; }
  .res-big { font-size: 54px; }
  #callout { top: 30%; }
  #ff { top: calc(var(--st) + 112px); }
}
@media (prefers-reduced-motion: reduce) { #callout.show, .logo img, .hint { animation: none; } }

#aimbar.rolling .aim-ctl, #aimbar.rolling #aimInfo { visibility: hidden; }

/* garage achievements button (gdg-achievements.js fills the count) */
.btn.ach { flex-direction: row; gap: 8px; }
.btn.ach .gdgach-n { opacity: .75; font-variant-numeric: tabular-nums; }
