:root{--g:#1fb47a;--g2:#16996a;--ink:#1b2733;--card:#ffffffee;--blue:#14b4e0;--orange:#ff8f3a;--sa-t:env(safe-area-inset-top);--sa-b:env(safe-area-inset-bottom)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
html,body{margin:0;height:100%;overflow:hidden;background:#8fd3f0;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Rounded","Nunito","Segoe UI",Roboto,sans-serif;color:var(--ink);touch-action:none;overscroll-behavior:none}
#gl{position:fixed;inset:0;width:100%;height:100%;display:block}
#touch{position:fixed;inset:0;z-index:2;touch-action:none}
.hidden{display:none!important}
#hud{position:fixed;inset:0;z-index:3;pointer-events:none}
#hud button,#hud .pill{pointer-events:auto}
#hud-left{position:absolute;left:8px;top:calc(var(--sa-t) + 10px);display:flex;flex-direction:column;gap:6px}
.chip{display:flex;align-items:center;gap:8px;background:var(--card);border-radius:4px;padding:6px 12px 6px 8px;font-weight:700;font-size:15px;min-width:150px;box-shadow:0 2px 0 #0002;border-left:6px solid var(--g)}
.c-pin{border-left-color:#ff4b4b}.c-wind{border-left-color:#3d7cff}
.chip .ico{width:22px;text-align:center}
#h-wind-arrow{display:inline-flex;align-items:center;justify-content:center;width:20px;height:18px;transition:transform .3s;filter:drop-shadow(0 0 1.5px #000a)} /* v2.7.1: bold yellow SVG arrow, dark outline (was a small blue ➤ glyph) */
#h-wind-arrow svg{display:block;margin:-1px 0;flex:none} /* 20 px arrow in the pill's 18 px line: pill height and the HUD below don't move */
#hud-right{position:absolute;right:8px;top:calc(var(--sa-t) + 10px);display:flex;box-shadow:0 2px 0 #0002}
.hole-box{background:var(--g2);color:#fff;font-weight:800;padding:6px 10px;font-size:14px;line-height:1.25}
.score-box{background:#e9fbf4;padding:6px 12px;text-align:center;min-width:76px}
#h-score{font-size:24px;font-weight:900}#h-shot{font-size:12px;font-weight:800;color:var(--g2)}
#hud-bottom{position:absolute;left:0;right:0;bottom:calc(var(--sa-b) + 14px);display:flex;justify-content:center;align-items:center;gap:8px}
.club-btn{width:96px;height:96px;border-radius:50%;border:none;background:var(--blue);color:#fff;font-weight:900;display:flex;flex-direction:column;align-items:center;justify-content:center;box-shadow:0 5px 0 #0a7fa3;font-family:inherit}
.club-btn #club-name{font-size:34px;line-height:1}.club-btn #club-yds{font-size:13px;opacity:.95}
.round-btn{width:54px;height:54px;border-radius:50%;border:none;background:var(--orange);color:#fff;font-weight:900;font-size:20px;box-shadow:0 4px 0 #c4621a;font-family:inherit}
.round-btn.small{width:46px;height:46px;font-size:19px;background:#ffffffe6;color:var(--ink);box-shadow:0 3px 0 #0002}
.arrow-btn{width:34px;height:54px;border:none;background:#ffffffb0;border-radius:10px;font-size:30px;font-weight:900;color:var(--ink);font-family:inherit}
.pill{position:absolute;right:12px;bottom:calc(var(--sa-b) + 130px);border:none;background:#fff;border-radius:20px;padding:10px 14px;font-weight:800;box-shadow:0 3px 0 #0002;font-family:inherit}
.pill.on{background:var(--g);color:#fff}
#aim-label{position:absolute;transform:translate(-50%,-140%);color:#fff;font-weight:900;font-size:17px;text-shadow:0 1px 3px #000a}
#power{position:absolute;left:50%;bottom:calc(var(--sa-b) + 130px);transform:translateX(-50%);text-align:center;color:#fff;text-shadow:0 2px 4px #0008}
#power-pct{font-size:44px;font-weight:900}#power-yds{font-size:15px;font-weight:800}
#shot-stats{position:absolute;left:8px;right:8px;top:calc(var(--sa-t) + 128px);display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
#shot-stats .s{background:#fff;border-radius:4px;overflow:hidden;text-align:center;box-shadow:0 2px 0 #0002}
#shot-stats .s b{display:block;background:var(--g);color:#fff;font-size:11px;padding:3px 2px}#shot-stats .s span{display:block;font-weight:800;font-size:15px;padding:4px 2px}
#putt-read{position:absolute;left:50%;transform:translateX(-50%);top:calc(var(--sa-t) + 130px);background:#000a;color:#fff;border-radius:10px;padding:8px 12px;font-weight:700;font-size:14px;text-align:center;white-space:nowrap}
#toast{position:absolute;left:50%;top:42%;transform:translate(-50%,-50%);background:#fff;padding:10px 18px;border-radius:24px;font-weight:900;font-size:18px;box-shadow:0 4px 0 #0002;white-space:nowrap}
#toast.good{background:var(--g);color:#fff}#toast.bad{background:#ff5a4b;color:#fff}
.overlay{position:fixed;inset:0;z-index:10;background:#0008;display:flex;align-items:center;justify-content:center;padding:16px}
.overlay.clickthru{background:transparent;pointer-events:none}
.panel{background:#fff;border-radius:16px;padding:18px;width:100%;max-width:420px;max-height:90vh;overflow:auto;text-align:center}
.panel.wide{max-width:640px}
.panel h2{margin:0 0 12px}
.big{font-size:34px;font-weight:900;margin:4px 0}
.intro-card{background:#ffffffee;border-radius:14px;padding:14px 26px;text-align:center;box-shadow:0 4px 0 #0002;margin-bottom:40vh}
#i-hole{font-size:30px;font-weight:900}#i-par{font-size:18px;font-weight:800;color:var(--g2)}#i-sub{font-size:13px;opacity:.7}.tap{margin-top:6px;font-size:12px;font-weight:800;color:var(--orange)}
.btn{display:block;width:100%;max-width:340px;margin:8px auto;border:none;border-radius:12px;padding:14px;font-weight:900;font-size:18px;background:var(--g);color:#fff;box-shadow:0 4px 0 var(--g2);font-family:inherit}
.btn.big{font-size:24px;padding:18px}.btn.ghost{background:#fff;color:var(--ink);box-shadow:0 4px 0 #0002}.btn.danger{background:#ff5a4b;box-shadow:0 4px 0 #c8382b}
.btn:disabled{opacity:.45}
.screen{position:fixed;inset:0;z-index:20;background:linear-gradient(#59c3ef,#b9ecf8 45%,#9fd65a 46%,#7fbf45);overflow:auto;padding:calc(var(--sa-t) + 10px) 14px calc(var(--sa-b) + 20px);touch-action:pan-y}
#home{display:flex;flex-direction:column;align-items:center;justify-content:center}
.logo{text-align:center;margin-bottom:14px}.logo h1{font-size:46px;line-height:.95;margin:8px 0 4px;color:#fff;text-shadow:0 4px 0 #0a7fa3;font-weight:900;letter-spacing:-1px}
.logo .sub{color:#fff;font-weight:800;opacity:.95}.logo .ball{width:64px;height:64px;border-radius:50%;margin:0 auto;background:radial-gradient(circle at 35% 30%,#fff,#e5eef2 60%,#b8c7cf);box-shadow:0 6px 0 #0002}
.coins{font-weight:900;font-size:18px;background:#fff;border-radius:20px;padding:6px 12px;box-shadow:0 3px 0 #0002;display:inline-block;margin:6px}
.foot{font-size:12px;opacity:.85;text-align:center;margin-top:14px;max-width:360px;color:#123}
.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.topbar h2{margin:0;color:#fff;text-shadow:0 2px 0 #0a7fa3}
.back{border:none;background:#fff;border-radius:10px;padding:8px 12px;font-weight:900;font-family:inherit}
.course-card{background:#fff;border-radius:14px;padding:12px;margin:10px 0;display:flex;gap:12px;align-items:center;box-shadow:0 4px 0 #0002}
.course-card canvas{width:96px;height:96px;border-radius:10px;background:#7fbf45;flex:none}
.course-card h3{margin:0 0 2px}.course-card .meta{font-size:13px;font-weight:700;color:var(--g2)}.course-card p{margin:4px 0 0;font-size:13px}

/* v2.1 course list: Easy / Medium / Hard, green / yellow / red shade, easiest first */
.course-tier{margin:2px 0 16px}
.course-tier-head{margin:10px 0 8px;font-size:13px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;display:inline-block;padding:5px 12px;border-radius:999px;color:#fff}
.course-tier.easy .course-tier-head{background:#22c55e;box-shadow:0 3px 0 #15803d}
.course-tier.medium .course-tier-head{background:#eab308;color:#3a2a00;box-shadow:0 3px 0 #a16207}
.course-tier.hard .course-tier-head{background:#ef4444;box-shadow:0 3px 0 #b91c1c}
.course-card.easy{background:#ecfdf3;box-shadow:0 4px 0 #22c55e88;border-left:6px solid #22c55e}
.course-card.medium{background:#fffbeb;box-shadow:0 4px 0 #eab30888;border-left:6px solid #eab308}
.course-card.hard{background:#fef2f2;box-shadow:0 4px 0 #ef444488;border-left:6px solid #ef4444}
.course-tier .course-card{margin:8px 0}
#setup-map{width:100%;height:36vh;border-radius:14px;background:#7fbf45;display:block}
.field{background:#fff;border-radius:12px;padding:10px;margin:10px 0}.field label{display:block;font-weight:900;margin-bottom:6px}
.seg{display:flex;flex-wrap:wrap;gap:6px}.seg button{flex:1;min-width:70px;border:2px solid #e2e8ee;background:#f6f9fb;border-radius:10px;padding:9px 6px;font-weight:800;font-family:inherit;font-size:14px}
.seg button.on{background:var(--g);border-color:var(--g);color:#fff}
select{width:100%;padding:10px;border-radius:10px;font-size:16px;font-weight:700}
.small-info{font-size:13px;background:#fffc;border-radius:10px;padding:8px;line-height:1.4}
#bag-slots{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.slot{background:#fff;border-radius:10px;padding:6px 2px;text-align:center;font-weight:900;border:3px solid transparent;box-shadow:0 3px 0 #0002}.slot small{display:block;font-size:10px;font-weight:700;opacity:.7}
.slot.sel{border-color:var(--blue)}
#bag-detail{margin-top:10px}
.cl-card{background:#fff;border-radius:14px;padding:12px;margin:8px 0;box-shadow:0 3px 0 #0002;border-left:8px solid #9aa7b4;text-align:left}
.cl-card h3{margin:0}.cl-card .tier{font-size:12px;font-weight:800;opacity:.75}
.bars{margin:8px 0}.bar{display:grid;grid-template-columns:92px 1fr 30px;align-items:center;gap:6px;font-size:13px;font-weight:700;margin:3px 0}
.bar .tr{height:9px;background:#e6ebef;border-radius:5px;overflow:hidden;position:relative}.bar .tr i{position:absolute;left:0;top:0;bottom:0;background:#4a5a6a;border-radius:5px}.bar .tr em{position:absolute;top:0;bottom:0;background:#38d36b}
.cl-actions{display:flex;gap:8px}.cl-actions .btn{margin:4px 0;font-size:15px;padding:10px}
.carry{font-weight:800;font-size:13px;color:var(--g2)}
table.sc{width:100%;border-collapse:collapse;font-weight:800;font-size:13px;margin:8px 0}
table.sc th,table.sc td{padding:5px 2px;text-align:center}
table.sc tr.par{background:#22c98a;color:#fff}table.sc tr.hd{background:#2a3644;color:#fff}
.sc .bird{display:inline-block;min-width:22px;border:2px solid #222;border-radius:50%}.sc .eagle{display:inline-block;min-width:22px;border:4px double #222;border-radius:50%}
.sc .bog{display:inline-block;min-width:22px;border:2px solid #222}.sc .dbl{display:inline-block;min-width:22px;border:4px double #222}
.coins-line{font-weight:900;font-size:18px;margin:8px 0}
.help{text-align:left;line-height:1.45;font-size:15px;padding-left:20px}
#ov-map{background:#000c;flex-direction:column}#map{width:100%;height:calc(100% - 40px);touch-action:none}.map-hint{color:#fff;font-weight:700;padding:8px}
#club-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:10px}
#club-grid button{border:none;border-radius:12px;padding:10px 4px;background:#f1f5f8;font-weight:900;font-size:18px;font-family:inherit}#club-grid button small{display:block;font-size:11px;font-weight:700;opacity:.7}
#club-grid button.on{background:var(--blue);color:#fff}
#loading{position:fixed;inset:0;z-index:30;background:#59c3efee;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;font-weight:900;font-size:18px}
.spin{width:54px;height:54px;border:6px solid #fff6;border-top-color:#fff;border-radius:50%;animation:sp 0.9s linear infinite;margin-bottom:12px}@keyframes sp{to{transform:rotate(360deg)}}
.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.stat-grid div{background:#fff;border-radius:12px;padding:10px;text-align:center;font-weight:800}.stat-grid b{display:block;font-size:24px}
@media (min-aspect-ratio: 1/1){ #shot-stats{left:auto;width:420px;top:calc(var(--sa-t) + 10px);right:150px} .club-btn{width:84px;height:84px} }

/* ---- v1.1 minimal HUD: small corner widgets only ---- */
#hud-tl{position:absolute;left:8px;top:calc(var(--sa-t) + 8px);display:flex;flex-direction:column;gap:4px}
.mini{display:flex;align-items:center;gap:5px;background:#0d2a1f8c;color:#fff;border-radius:12px;padding:3px 9px 3px 6px;font-size:13px;line-height:18px;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);width:max-content}
.mini b{font-weight:800}.mini small{font-weight:700;opacity:.85;font-size:11px}
.warr{display:inline-block;color:#8fe3ff;font-size:13px;width:14px;text-align:center;transition:transform .3s}
.pin-dot{width:8px;height:8px;border-radius:50%;background:#ff4a3d;box-shadow:0 0 0 2px #fff8}
#hud-tr{position:absolute;right:8px;top:calc(var(--sa-t) + 8px);display:flex;flex-direction:column;gap:6px;align-items:flex-end}
#hud-bl{position:absolute;left:8px;bottom:calc(var(--sa-b) + 10px)}
#hud-br{position:absolute;right:8px;bottom:calc(var(--sa-b) + 10px);display:flex;align-items:center;gap:4px}
.cbtn{width:38px;height:38px;border-radius:50%;border:0;background:#0d2a1f8c;color:#fff;font-size:17px;font-weight:800;display:flex;align-items:center;justify-content:center;position:relative;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);padding:0}
.cbtn.on{background:#1f9e6ee6}
.cbtn small{position:absolute;right:-3px;bottom:-3px;background:#fff;color:#0d2a1f;border-radius:8px;font-size:10px;padding:0 4px;line-height:14px}
.abtn{width:26px;height:38px;border:0;border-radius:10px;background:#0d2a1fb3;color:#fff;font-size:20px;font-weight:900;padding:0}
.club-chip{min-width:58px;height:50px;border-radius:14px;border:2px solid #fff;background:#0f9fd2;color:#fff;box-shadow:0 2px 8px #0006;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1;padding:0 8px;position:relative}
.club-chip b{font-size:20px;font-weight:900}.club-chip small{font-size:11px;font-weight:800;opacity:.9;margin-top:2px}
.club-chip i{position:absolute;top:-7px;right:-7px;font-style:normal;background:#ff8a2b;border-radius:8px;font-size:10px;font-weight:900;padding:1px 5px;display:none}
.club-chip i.on{display:block}
#aim-label{font-size:12px;font-weight:800;transform:translate(-50%,-160%);text-shadow:0 1px 2px #000c}
#power{left:50%;right:auto;bottom:calc(var(--sa-b) + 70px);transform:translateX(-50%);background:#0d2a1f8c;color:#fff;border-radius:12px;padding:3px 10px;font-size:13px;white-space:nowrap;text-shadow:none}
#power b{font-size:15px}
#shot-stats{top:auto;bottom:calc(var(--sa-b) + 70px);left:56px;right:110px;grid-template-columns:repeat(2,1fr);gap:3px}
#shot-stats .s b{font-size:9px;padding:1px}#shot-stats .s span{font-size:12px;padding:1px}
#toast{top:calc(var(--sa-t) + 64px);font-size:14px;padding:5px 12px;border-radius:14px}
#type-row{margin:4px 0 10px}h3.sub{margin:8px 0 2px;font-size:14px}
.intro-card{transform:scale(.8)}

/* ---- v1.4 shared leaderboard ---- */
input.lb-name{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default;touch-action:manipulation;width:100%;min-width:0;font-size:16px;font-weight:700;font-family:inherit;padding:11px 12px;border:2px solid #e2e8ee;border-radius:10px;background:#f6f9fb;color:var(--ink);outline:none;-webkit-appearance:none;appearance:none}
input.lb-name:focus{border-color:var(--g);background:#fff}
.lb-post{background:#f1f8f4;border-radius:12px;padding:10px;margin:10px auto 4px;max-width:420px;text-align:left}
.lb-post label{display:block;font-weight:900;margin-bottom:6px}
.lb-row{display:flex;gap:8px;align-items:center}.lb-row .btn{width:auto;flex:none;margin:0;padding:11px 14px;font-size:16px}
.lb-msg{font-size:14px;font-weight:800;min-height:18px;margin-top:6px;color:var(--g2)}.lb-msg.err{color:#d6402f}
.lb-sets{margin:0 0 10px}.lb-sets:empty{display:none}
.lb-body{background:#fff;border-radius:12px;padding:6px 8px;box-shadow:0 3px 0 #0002;min-height:80px}
.lb-state{padding:22px 10px;text-align:center;font-weight:800;color:#4a5a6a;line-height:1.4}.lb-state.err{color:#d6402f}
table.lb{width:100%;border-collapse:collapse;font-size:14px;font-weight:700}
table.lb th{font-size:11px;text-transform:uppercase;letter-spacing:.4px;color:#6a7a8a;padding:6px 3px;text-align:left}
table.lb td{padding:8px 3px;border-top:1px solid #eef2f5;vertical-align:middle}
table.lb .rk{width:28px;text-align:center;font-weight:900;color:var(--g2)}table.lb .num{text-align:right;white-space:nowrap}
table.lb .nm{overflow-wrap:anywhere}table.lb .nm small{display:block;font-size:11px;font-weight:700;color:#6a7a8a}
table.lb td.tp{font-weight:900}table.lb td.tp.u{color:#d6402f}table.lb td.tp.e,table.lb td.tp.o{color:var(--ink)}
table.lb tr.me td{background:#e9fbf4}
.lb-sync{font-size:12px;font-weight:700;color:#6a7a8a;text-align:center;margin:6px 0 2px;min-height:16px}.lb-sync .live{display:inline-block;width:7px;height:7px;border-radius:50%;background:#2fbf71;margin-right:5px;vertical-align:1px}.lb-sync .err{color:#d6402f}.lb-sync .linkbtn{background:none;border:0;padding:0 2px;font:inherit;font-weight:900;color:var(--g2);text-decoration:underline;cursor:pointer}
.lb-me small{display:block;font-size:12px;font-weight:700;color:var(--g2);margin-top:4px;min-height:14px}

/* v1.5 Hop Brook 4: optional gong, a tappable HUD card in the same style as the lie/pin cards [GD: small white-on-dark HUD cards] */
.mini.gong{border:0;cursor:pointer;font:inherit;color:#fff;background:#5a3d14b3;box-shadow:0 0 0 1px #d6a65a80 inset;padding:4px 10px 4px 6px;animation:gongIn .35s ease-out}
.mini.gong:active{transform:scale(.96)}
.gong-ic{width:14px;height:14px;border-radius:50%;background:radial-gradient(circle at 40% 38%,#f3d18c,#b07a2f 55%,#6e4513);box-shadow:0 0 0 1px #3a2408}
@keyframes gongIn{from{opacity:0;transform:translateX(-8px)}to{opacity:1;transform:none}}

/* v1.8 setup-screen leaderboard: under Tee off, same table look as the Leaderboard screen, compact + its own scroll */
.setup-lb{max-width:520px;margin:14px auto 0}
.setup-lb-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:0 2px 6px}
.setup-lb-head h3{margin:0;font-size:17px;font-weight:900;color:var(--ink)}.setup-lb-head h3 span{font-size:14px;font-weight:800;color:var(--g2)}
.setup-lb .linkbtn{background:none;border:0;padding:4px 2px;font:inherit;font-size:14px;font-weight:900;color:var(--g2);text-decoration:underline;cursor:pointer}
.setup-lb-note{font-size:12px;font-weight:700;color:#4a5a6a;margin:0 2px 6px}
.setup-lb-body{min-height:64px;max-height:min(44vh,340px);overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;touch-action:pan-y}
.setup-lb-body .lb-state{padding:16px 8px}
.setup-lb-body table.lb th{position:sticky;top:0;background:#fff;z-index:1}
table.lb td.tee{white-space:nowrap;font-size:13px;color:#4a5a6a}
.setup-lb-body .btn{margin:4px auto 8px;font-size:16px;padding:10px}

/* v1.9 Add to Home Screen helper: secondary button on home + a bottom sheet with the steps (above all screens) */
.hs-btn{display:flex;align-items:center;justify-content:center;gap:8px;font-size:16px;padding:12px}
.hs-ic{width:18px;height:18px;border:2.5px solid currentColor;border-radius:5px;position:relative;flex:none}
.hs-ic::before,.hs-ic::after{content:"";position:absolute;left:50%;top:50%;background:currentColor;border-radius:1px;transform:translate(-50%,-50%)}
.hs-ic::before{width:9px;height:2.5px}.hs-ic::after{width:2.5px;height:9px}
.hs-ov{z-index:40;align-items:flex-end;padding:0;touch-action:auto}
.hs-sheet{max-width:520px;border-radius:20px 20px 0 0;padding:20px 20px calc(var(--sa-b) + 16px);text-align:left;animation:hsUp .22s ease-out}
.hs-sheet h2{text-align:center;font-size:22px;margin:0 0 4px}
.hs-lead{text-align:center;margin:0 0 12px;font-size:15px;font-weight:700;color:#4a5a6a}
.hs-steps{margin:0 0 10px;padding-left:28px;font-size:18px;line-height:1.4}
.hs-steps li{margin:0 0 10px;padding-left:4px}.hs-steps li::marker{font-weight:900;color:var(--g2)}
.hs-steps small{display:block;font-size:14px;color:#4a5a6a;line-height:1.3}
.hs-share{display:inline-flex;vertical-align:-5px;color:#0a84ff;background:#eef5ff;border-radius:7px;padding:2px 4px}
.hs-note{font-size:15px;line-height:1.35;margin:0 0 10px;background:#f1f8f4;border-radius:10px;padding:8px 10px}
.hs-sheet .btn{margin-top:12px}
@keyframes hsUp{from{transform:translateY(40px);opacity:.4}to{transform:none;opacity:1}}
/* v1.10.0 top 5: round-complete note when the board is full and the score would not make it */
.lb-msg.full{color:var(--ink);font-weight:800}
.field label small.opt{font-weight:600;color:#7a8794;margin-left:4px}

/* ---- v2.7.0 beer mode ---- */
#b-beer{position:absolute;right:54px;top:calc(var(--sa-t) + 8px);width:42px;height:42px;border-radius:50%;border:0;padding:0;background:#0d2a1f8c;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:background .2s,opacity .2s}
#b-beer:active{background:#1f9e6ee6}
#b-beer .can{display:block;transform-origin:50% 85%;filter:drop-shadow(0 1px 1px #0008)}
#b-beer.drinking .can{animation:bdrink 1.5s ease-in-out}
@keyframes bdrink{0%{transform:none}12%{transform:translateY(-3px) scale(1.12)}30%{transform:translate(-3px,-5px) rotate(-62deg) scale(1.12)}45%{transform:translate(-3px,-5px) rotate(-74deg) scale(1.12)}60%{transform:translate(-3px,-5px) rotate(-66deg) scale(1.12)}75%{transform:translate(-3px,-5px) rotate(-78deg) scale(1.12)}90%{transform:translateY(-1px) rotate(-6deg)}100%{transform:none}}
#b-beer.drinking::after{content:'';position:absolute;left:50%;top:2px;width:4px;height:4px;margin-left:-2px;border-radius:50%;background:#fff;box-shadow:-5px -3px 0 -0.5px #fffc,5px -4px 0 -1px #fffb,0 -7px 0 -1px #fff9;opacity:0;animation:bfizz .7s ease-out}
@keyframes bfizz{0%{opacity:1;transform:translateY(2px) scale(.6)}100%{opacity:0;transform:translateY(-12px) scale(1.3)}}
#b-beer.nope{animation:bnope .35s}
@keyframes bnope{20%{transform:translateX(-3px)}40%{transform:translateX(3px)}60%{transform:translateX(-2px)}80%{transform:translateX(2px)}}
#b-beer.queued{box-shadow:0 0 0 2px #ffd25a}
#b-beer.armed{background:#c4302be6;animation:barm .7s ease-in-out infinite alternate}
@keyframes barm{to{box-shadow:0 0 0 5px #ff5a4b55}}
.beer-n{position:absolute;right:-3px;bottom:-3px;min-width:16px;height:16px;border-radius:8px;background:#ffd25a;color:#3a2600;font-size:11px;font-weight:900;line-height:16px;padding:0 4px;text-align:center;box-shadow:0 1px 2px #0006}
#b-beer.warn .beer-n{background:#ff3b30;color:#fff}
#toast.beer{background:#ffd25a;color:#3a2600}
table.sc tr.beers td{color:#9a6a00;font-weight:800;font-size:12px}
/* v2.7.1: "4 beers" second line under the score (replaces the *4 star + key) */
table.lb .bbeers{display:block;color:#c98a00;font-weight:900;font-size:11px;line-height:13px;white-space:nowrap;margin-top:1px}
#ov-blackout{position:fixed;inset:0;z-index:12;background:#000;display:flex;align-items:center;justify-content:center;padding:16px;opacity:0}
#ov-blackout .panel{background:#111;color:#eee;box-shadow:0 0 0 1px #333}
#ov-blackout .big{color:#fff}
.bo-msg{font-size:18px;font-weight:900;margin:6px 0 2px;text-align:center}
.bo-sub{font-size:13px;opacity:.8;text-align:center;margin-bottom:8px}
#ov-blackout table.sc{color:#ddd}#ov-blackout table.sc tr.beers td{color:#ffd25a}

/* v2.7.1 Highland night ball choice: tiny ball swatches in the Glow / Regular buttons */
.bdot{display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:6px;vertical-align:-1px}
.bdot.glow{background:radial-gradient(circle,#f2fff0 0 35%,#8dff6a 70%);box-shadow:0 0 6px 2px rgba(141,255,106,.85)}
.bdot.reg{background:radial-gradient(circle at 35% 35%,#fff 0 45%,#d6dbe0 100%);box-shadow:0 0 0 1.5px rgba(16,36,15,.35)}

/* v2.8.0 phone UX (Jim t79u "do the screen fixes"; app-wide, layout only):
   - Tee off pinned to the bottom of the setup screen (it fell below the fold in Safari / Messages / iPhone SE / small Android)
   - tap areas of at least 44 pt: Back, Full board, the round HUD buttons, the club arrows
   - in-game HUD text 13-15 px (was 10-13 px) */
#tee-off{position:sticky;bottom:calc(var(--sa-b) + 8px);z-index:6;box-shadow:0 4px 0 #0f7a52,0 6px 18px #0004}
.back{min-height:44px;min-width:64px;padding:10px 14px;font-size:16px}
.setup-lb .linkbtn{min-height:44px;padding:10px 6px}
.cbtn{width:44px;height:44px;font-size:19px}
.cbtn small{font-size:12px;line-height:16px;padding:0 5px;right:-4px;bottom:-4px}
.abtn{width:44px;height:44px;font-size:22px}
.club-chip small{font-size:13px}
#hud-tl{gap:5px}
.mini{font-size:15px;line-height:21px;padding:3px 10px 3px 7px}
.mini small{font-size:13px}
#aim-label{font-size:14px}
#power{font-size:14px}#power b{font-size:16px}
#b-beer{right:60px;width:44px;height:44px}
/* ---- v2.10.0 breakfast ball / restart round / 3 beers per hole ---- */
#b-breakfast:disabled{opacity:.45;filter:grayscale(1);color:#777;box-shadow:0 4px 0 #0001}
.confirm-msg{margin:0 0 10px;color:#555;font-weight:700}
#b-beer.capped{opacity:.38;filter:grayscale(.85)}
#b-beer.capped:active{background:#0d2a1f8c}
/* ---- v2.11.0 alternate tee button (right side, mid screen: clear of the top-right buttons and the club selector) ---- */
#b-alttee{position:absolute;right:8px;top:calc(var(--sa-t) + 38%);border:0;cursor:pointer;font:inherit;color:#fff;background:#0d2a1fb3;box-shadow:0 0 0 1px #ffffff55 inset;padding:6px 11px 6px 8px;flex-direction:column;align-items:flex-end;gap:0;border-radius:14px;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
#b-alttee .at-ic{position:absolute;left:-2px;top:-8px;font-size:14px}
#b-alttee b{font-size:15px}#b-alttee small{font-size:12px}
#b-alttee:active{transform:scale(.96)}
#b-alttee.hidden{display:none}

/* v2.12.0 shot shaping: result tag + tinted stroke trail + How to swing diagram */
#shape-tag{position:absolute;left:50%;top:calc(var(--sa-t) + 98px);transform:translateX(-50%);padding:4px 12px;border-radius:14px;font-weight:900;font-size:14px;color:#0b1a10;background:#fff;box-shadow:0 3px 0 #0003;pointer-events:none;white-space:nowrap}
#shape-tag.green{background:#39d66a}#shape-tag.lime{background:#b6ef5a}#shape-tag.yellow{background:#ffe14d}#shape-tag.orange{background:#ff9a3d}#shape-tag.red{background:#ff5a4b;color:#fff}
#stroke-trail{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;transition:opacity .6s}
#stroke-trail polyline{fill:none;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;opacity:.75}
#stroke-trail.fade{opacity:0}
.help-swipes{display:block;width:100%;max-width:300px;height:auto;margin:6px auto;background:#0b1a1080;border-radius:10px}
.foot.music-credit{margin-top:4px;font-size:11px;opacity:.75}.foot.music-credit a{color:inherit}
.foot.music-credit a{white-space:nowrap}
/* ---- v2.14.0 green book ---- */
#b-book{position:absolute;right:112px;top:calc(var(--sa-t) + 8px);width:44px;height:44px;border-radius:50%;border:0;padding:0;background:#0d2a1f8c;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);-webkit-tap-highlight-color:transparent;cursor:pointer}
#b-book.hidden{display:none}
#b-book svg{filter:drop-shadow(0 1px 1px #0008)}
#b-book:active,#b-book.on{background:#c4302be6}
#ov-book{z-index:12;padding:calc(var(--sa-t) + 8px) 8px calc(var(--sa-b) + 8px);background:#000b}
.book-card{width:100%;max-width:520px;max-height:100%;display:flex;flex-direction:column;background:#14231a;border-radius:16px;overflow:hidden;box-shadow:0 0 0 2px #c4302b,0 8px 30px #000a;color:#fff}
.book-head{display:flex;align-items:center;justify-content:space-between;padding:8px 8px 8px 14px;background:#b8262b}
.book-head b{display:block;font-size:18px;font-weight:900;line-height:1.1}.book-head small{display:block;font-size:12px;opacity:.9;font-weight:700}
#book-x{width:44px;height:44px;border:0;border-radius:50%;background:#0003;color:#fff;font-size:20px;font-weight:900;cursor:pointer}
.book-map{flex:none;height:60vh;position:relative}
#book-cv{position:absolute;left:0;top:0;display:block}
#book-legend{padding:8px 12px 10px;font-size:12px;font-weight:700;line-height:1.35;background:#0e1a13}
.bk-ramp{display:flex;align-items:center;gap:6px;margin-bottom:5px}.bk-ramp i{flex:1;height:9px;border-radius:5px;background:linear-gradient(90deg,#2654a8,#2196aa,#3eaa5c,#c4d048,#f09c34,#d64028)}
.bk-facts{display:flex;flex-wrap:wrap;gap:2px 12px}.bk-facts b{color:#ffd25a}.bk-arr{opacity:.85}

/* ---------------- v3.0.0 cart (Jim t125u) ---------------- */
.cart-seg button{line-height:1.15}
.cart-seg .cm-ic{display:block;font-size:20px;margin-bottom:2px}
.cart-note{font-size:12px;color:#fff;opacity:.92;margin-top:6px;text-shadow:0 1px 2px #0006;min-height:15px}
#drive-hud{position:fixed;inset:0;z-index:4;pointer-events:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#drive-hud>*{pointer-events:auto;touch-action:none}
#drive-hud button,#cart-wait button{touch-action:manipulation}
#cp-top{position:absolute;left:8px;top:calc(var(--sa-t) + 8px);display:flex;gap:6px;align-items:stretch;pointer-events:none}
.cp-info{display:flex;flex-direction:column;justify-content:center;background:#0b1a10c4;color:#fff;border-radius:12px;padding:6px 10px;font-size:12px;line-height:1.3;min-width:104px}
.cp-info b{font-size:14px}.cp-info span:empty{display:none}
#cp-tgt{color:#7df9ff;font-weight:800}
.cp-speed{background:#0b1a10c4;color:#fff;border-radius:12px;padding:4px 10px;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:56px;position:relative}
.cp-speed b{font-size:24px;line-height:1;font-variant-numeric:tabular-nums}.cp-speed small{font-size:10px;opacity:.8}
#cp-gear{position:absolute;top:2px;right:5px;font-style:normal;font-weight:900;color:#ffd84a;font-size:11px}
#cp-mini{position:absolute;right:8px;top:calc(var(--sa-t) + 8px);width:112px;height:112px;border-radius:50%;box-shadow:0 2px 8px #0006;pointer-events:none}
#cp-tools{position:absolute;right:8px;top:calc(var(--sa-t) + 126px);display:flex;flex-direction:column;gap:6px;align-items:flex-end}
.cp-small{background:#0b1a10b0;color:#fff;border:1px solid #ffffff40;border-radius:10px;padding:6px 10px;font-weight:800;font-size:12px}
#cp-actrow button{pointer-events:auto}
#cp-act{min-width:210px;max-width:78vw;border:0;border-radius:16px;padding:12px 18px;font-weight:900;font-size:17px;color:#fff;background:#0b1a10a8;box-shadow:0 3px 0 #0005}
#cp-act small{display:block;font-size:11px;font-weight:700;opacity:.85}
#cp-act.go{background:#1fae6b;box-shadow:0 4px 0 #0f7a52,0 0 0 3px #ffffff70;animation:cpPulse 1.4s ease-in-out infinite}
#cp-act:disabled{opacity:.9}
#cp-drop{border:0;border-radius:12px;padding:8px 14px;font-weight:800;font-size:13px;background:#ffffffe0;color:#173;box-shadow:0 2px 0 #0004}
@keyframes cpPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.04)}}
#cart-wait{position:fixed;left:0;right:0;bottom:calc(var(--sa-b) + 96px);z-index:4;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none}
#cart-wait .btn{pointer-events:auto;min-width:230px;margin:0}
#cart-wait #cw-drive{font-size:18px;animation:cpPulse 1.4s ease-in-out infinite}
#cw-drive small{display:block;font-size:11px;opacity:.85;font-weight:700}
body.driving #hud>*:not(#hud-bl):not(#toast){display:none!important}
body.driving #hud-bl{bottom:auto;top:calc(var(--sa-t) + 66px);left:8px}
body.cartwait #hud>*:not(#hud-tl):not(#hud-bl):not(#toast):not(#shape-tag):not(#shot-stats):not(#stroke-trail){display:none!important}
body.driving #touch{pointer-events:none}
body.cartwait #m-lie,body.cartwait #m-read{display:none!important}
/* v3.0.0 cart v2 controls (Jim t127u/t128u): swipe wheel left, F/R rocker + brake + gas right; dark-glass pills */
#cp-actrow{position:absolute;left:0;right:0;bottom:calc(var(--sa-b) + 186px);display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none}
.cpad{position:absolute;left:calc(env(safe-area-inset-left) + 12px);bottom:calc(var(--sa-b) + 14px);width:152px;height:152px;border-radius:50%;background:radial-gradient(circle,#0b1a1000 52%,#0b1a1066 70%,#0b1a1000 72%);display:flex;align-items:center;justify-content:center}
#cp-wheel{width:144px;height:144px;filter:drop-shadow(0 4px 8px #0008);transition:transform .32s cubic-bezier(.3,1.6,.5,1)}
.cpad.on #cp-wheel{transition:none}
.cpad::after{content:'‹  swipe  ›';position:absolute;bottom:-2px;left:0;right:0;text-align:center;font-size:10px;font-weight:800;letter-spacing:1px;color:#ffffffb0;text-shadow:0 1px 2px #000a;pointer-events:none;transition:opacity .3s}
.cpad.on::after{opacity:0}
#cp-pedals{position:absolute;right:calc(env(safe-area-inset-right) + 10px);bottom:calc(var(--sa-b) + 14px);display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.ped-row{display:flex;gap:8px;align-items:flex-end}
.ped{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;padding-bottom:10px;color:#fff;border-radius:14px 14px 18px 18px;border:1.5px solid #ffffff55;box-shadow:0 6px 0 #0008,inset 0 1px 0 #ffffff40;transition:transform .06s,box-shadow .06s,filter .06s;overflow:hidden}
.ped b{font-size:12px;font-weight:900;letter-spacing:1px;position:relative}
.ped .ribs{position:absolute;inset:12px 12px 30px 12px;border-radius:6px;background:repeating-linear-gradient(180deg,#0000 0 7px,#00000040 7px 10px)}
.ped.brake{width:74px;height:94px;background:linear-gradient(180deg,#3a3f46e6,#1d2126e6)}
.ped.brake b{color:#ff8a7a}
.ped.gas{width:86px;height:136px;background:linear-gradient(180deg,#3a3f46e6,#1d2126e6)}
.ped.gas b{color:#5ff0a8}
.ped.on{transform:translateY(5px) scale(.97);box-shadow:0 1px 0 #0008,inset 0 2px 8px #0009}
.ped.gas.on{background:linear-gradient(180deg,#1fae6bf0,#127a49f0)}.ped.gas.on b{color:#fff}
.ped.brake.on{background:linear-gradient(180deg,#d2493bf0,#94291ff0)}.ped.brake.on b{color:#fff}
.cp-fr{display:flex;width:74px;height:40px;border-radius:12px;background:#0b1a10c4;border:1.5px solid #ffffff40;padding:3px;gap:3px;box-shadow:0 3px 0 #0006}
.cp-fr span{flex:1;display:flex;align-items:center;justify-content:center;border-radius:9px;font-weight:900;font-size:16px;color:#ffffff70;transition:background .12s,color .12s}
.cp-fr[data-gear=D] span[data-g=D]{background:#1fae6b;color:#fff;box-shadow:inset 0 -2px 0 #0004}
.cp-fr[data-gear=R] span[data-g=R]{background:#ffb02e;color:#1b1203;box-shadow:inset 0 -2px 0 #0004}
.cp-cam{display:flex;padding:3px!important;gap:2px}
.cp-cam span{padding:3px 8px;border-radius:7px;color:#ffffff80}
.cp-cam[data-view="1st"] .v1,.cp-cam[data-view="3rd"] .v3{background:#fff;color:#0b1a10}
#cp-gear:not(:empty){background:#ffb02e;color:#1b1203;border-radius:5px;padding:0 4px;top:3px}
@media (max-width:420px){.cpad{width:142px;height:142px}#cp-wheel{width:134px;height:134px}.ped.gas{width:80px}.ped.brake,.cp-fr{width:70px}}
.ped-col{display:flex;flex-direction:column;gap:8px;align-items:stretch}
#cp-actrow{bottom:calc(var(--sa-b) + 172px)}
/* v3.0.0 (Jim t135u): marshal speech bubble — anchored over his cart, text only */
#marshal-bubble{position:fixed;left:0;top:0;z-index:6;max-width:min(240px,62vw);background:#fff;color:#1b1203;border:3px solid #1b1203;border-radius:16px;padding:8px 12px;font-weight:900;font-size:15px;line-height:1.2;text-align:center;box-shadow:0 4px 0 #0005;pointer-events:none;will-change:transform}
#marshal-bubble::after{content:'';position:absolute;left:50%;bottom:-13px;margin-left:-9px;border:9px solid transparent;border-top:12px solid #1b1203;border-bottom:0}
#marshal-bubble::before{content:'';position:absolute;left:50%;bottom:-8px;margin-left:-6px;border:6px solid transparent;border-top:9px solid #fff;border-bottom:0;z-index:1}
#marshal-bubble.pop{animation:mbPop .28s cubic-bezier(.3,1.7,.5,1)}
#marshal-bubble.out{opacity:0;transition:opacity .5s}
@keyframes mbPop{0%{opacity:0;scale:.5}100%{opacity:1;scale:1}}

/* v3.0.0 (Jim t134u) 1st person: the cart's own 3D wheel / floor pedals / dash D-R switch are the controls — 2D ones hidden */
#cp-fp{position:absolute;inset:0;display:none;pointer-events:none;touch-action:none;-webkit-user-select:none;user-select:none}
body.cart-fp #cp-fp{display:block;pointer-events:auto}
body.cart-fp #cp-steer,body.cart-fp #cp-rev,body.cart-fp #cp-gas,body.cart-fp #cp-fr,body.cart-fp .ped-row{display:none!important}
body.cart-fp #cp-top,body.cart-fp #cp-mini,body.cart-fp #cp-tools,body.cart-fp #cp-actrow{z-index:2}
body.cart-fp #cp-actrow{bottom:auto;top:calc(var(--sa-t, env(safe-area-inset-top)) + 128px)}

/* v3.0.0 (Jim t140u) tokens, Cart Garage, Speed Run */
.tok-pill{margin-left:10px;padding:2px 10px;border-radius:12px;background:#ffffff22;font-weight:800}
.tok-line{color:#7a4d00}
#sr-timer{position:fixed;left:50%;transform:translateX(-50%);top:calc(var(--sa-t) + 64px);z-index:7;background:#0d2a1fe6;color:#fff;font:900 20px/1 ui-monospace,Menlo,monospace;padding:7px 14px;border-radius:14px;box-shadow:0 3px 0 #0004;pointer-events:none;letter-spacing:.5px}
#sr-timer.done{background:#1fb47a}
body.driving #sr-timer{top:calc(var(--sa-t) + 64px)}
.sr-line{font-weight:900;font-size:20px;margin:6px 0;color:#0b5d3b}
.cart-seg button{min-width:0}
.garage{max-width:440px}
.garage-bal{font-weight:900;font-size:18px;margin:4px 0 10px}.garage-bal small{font-weight:600;font-size:12px;opacity:.7}
.garage-how{font-size:12px;opacity:.8;margin:10px 0}
.gcar{display:flex;align-items:center;gap:10px;padding:8px;border-radius:14px;background:#0000000d;margin:6px 0;text-align:left}
.gcar.on{outline:3px solid #1fb47a}
.gcar .sw{width:54px;height:40px;border-radius:10px;flex:none;position:relative;box-shadow:inset 0 -6px 0 #0003}
.gcar .sw i{position:absolute;left:4px;right:4px;top:3px;height:7px;border-radius:4px}
.gcar .nm{flex:1;font-weight:900}.gcar .nm small{display:block;font-weight:600;opacity:.7}
.gcar button{min-width:92px}
.lb-kind{margin-bottom:6px}

/* v3.0.0 (Jim t142u) rollover: red edge warning while tipping; fade to black + message when she goes over */
body.cart-tipping.driving::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 40; box-shadow: inset 0 0 70px 18px rgba(230, 40, 30, .55); animation: tipPulse .35s ease-in-out infinite alternate; }
@keyframes tipPulse { from { opacity: .55; } to { opacity: 1; } }
body.cart-flipped #hud, body.cart-flipped #drive-hud, body.cart-flipped #sr-timer { display: none !important; }
#ov-flip { position: fixed; inset: 0; z-index: 400; background: rgba(0, 0, 0, 0); transition: background 1.4s ease-in; display: flex; align-items: center; justify-content: center; pointer-events: all; }
#ov-flip.hidden { display: none; }
#ov-flip.on { background: rgba(0, 0, 0, 1); }
#ov-flip .flip-msg { text-align: center; opacity: 0; transform: scale(.92); transition: opacity .7s ease .6s, transform .7s ease .6s; font-family: inherit; }
#ov-flip.msg .flip-msg { opacity: 1; transform: scale(1); }
#ov-flip .flip-big { color: #fff; font-weight: 900; font-size: 34px; letter-spacing: 2px; text-shadow: 0 0 18px rgba(255, 60, 40, .6); }
#ov-flip .flip-sub { color: #ff5a4a; font-weight: 800; font-size: 20px; letter-spacing: 6px; margin-top: 8px; }

/* v3.0.0 (Jim t143u) cart radio pill (3rd person); 1st person uses the 3D dash radio */
#cp-radio{display:flex;gap:4px}
#cp-radio-pwr{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#cp-radio-pwr.on{background:#0f3a22d0;border-color:#7dffb080;color:#c9ffe0}
#cp-radio-next{padding:6px 8px}
body.cart-fp #cp-radio{display:none}

/* v3.0.0 fix: the Cart Garage opens over the home screen (.screen is z-index 20) */
#ov-garage{z-index:30}

/* v3.0.0 phone-only gate (desktop / laptop browsers only) */
#desk-gate{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;background:linear-gradient(160deg,#0f5132,#1f8a4c 55%,#7fbf45);font-family:inherit;padding:24px}
#desk-gate[hidden]{display:none}
html.desk-gated body>*:not(#desk-gate){display:none!important}
#desk-gate .dg-card{background:#fff;border-radius:28px;box-shadow:0 24px 70px #0006;padding:34px 40px 30px;text-align:center;max-width:420px;color:#0b3d22}
#desk-gate .dg-ball{width:46px;height:46px;border-radius:50%;margin:0 auto 10px;background:radial-gradient(circle at 35% 30%,#fff,#dfe6e0 70%,#b9c4bb)}
#desk-gate h1{margin:0;font-size:34px;font-weight:900;letter-spacing:.5px;color:#0f5132}
#desk-gate .dg-sub{display:inline-block;margin:8px 0 18px;padding:4px 14px;border-radius:999px;background:#1f8a4c;color:#fff;font-weight:800;font-size:14px;letter-spacing:2px;text-transform:uppercase}
#desk-gate #dg-qr{display:block;width:260px;height:260px;margin:0 auto;border-radius:12px;border:6px solid #eef6f0}
#desk-gate p{font-size:17px;font-weight:700;margin:18px 0 6px}
#desk-gate small{color:#557a63;font-size:13px}
