:root{color-scheme:dark;--blue:#45ddff;--orange:#ff9839}*{box-sizing:border-box}body{margin:0;background:#030a14;color:#ecf9ff;font-family:'Avenir Next',Tahoma,sans-serif;overscroll-behavior:none}.game{width:100%;max-width:480px;height:100svh;min-height:540px;margin:auto;display:flex;flex-direction:column;background:#08182c;overflow:hidden;border-inline:1px solid #19364f}header{height:65px;flex-shrink:0;display:flex;align-items:center;padding:12px 16px;gap:10px;background:#071323}.brand{text-decoration:none;color:#5fe5ff;font-size:25px;font-weight:1000;font-style:italic;letter-spacing:-1.5px;line-height:.85}.brand span{color:#ffa64b}.brand small{display:block;letter-spacing:2px;font-size:8px;margin-top:7px;color:#8aa9ba;font-style:normal}.practice{font-size:8px;letter-spacing:1px;color:#8db4c8;margin-left:auto}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}header button{background:#122a40;border:1px solid #29455c;color:#bbd4e6;width:30px;height:30px;border-radius:10px;font-size:20px}.court{height:28%;min-height:170px;max-height:270px;position:relative;overflow:hidden;background:linear-gradient(#193155,#9f5472 62%,#f9a05b);border-bottom:3px solid #31b8df}.scoreboard{position:absolute;z-index:10;top:6px;left:12px;right:12px;display:flex;justify-content:space-between;align-items:center;background:#061426dc;border:1px solid #3a526b;border-radius:13px;padding:7px 15px;box-shadow:0 5px 20px #0005}.scoreboard small{display:block;font-size:8px;letter-spacing:1px;color:#9bbaca}.scoreboard strong{font-size:29px;font-weight:900;color:var(--blue);line-height:1.1}.scoreboard>div:last-child{text-align:right}.scoreboard>div:last-child strong{color:#ffb15f}.center-score{text-align:center}.center-score span{display:block;font-size:8px;letter-spacing:1.5px;color:#8cb1c4}.center-score b{font-size:12px;display:block;margin-top:6px}.sky{position:absolute;inset:40% 0 18%;display:flex;align-items:end;gap:9px;opacity:.8}.sky i{flex:1;background:repeating-linear-gradient(90deg,transparent 0 9px,#fbc28055 10px 12px),#172b46;height:80%}.sky i:nth-child(2n){height:120%}.sky i:nth-child(3n){height:60%}.fence{position:absolute;inset:45% 0 14%;background:repeating-linear-gradient(45deg,transparent 0 12px,#08162866 13px 14px),repeating-linear-gradient(-45deg,transparent 0 12px,#08162866 13px 14px);border-block:3px solid #132338}.floor{position:absolute;bottom:0;width:100%;height:21%;background:linear-gradient(#27435a,#12273c);border-top:2px solid #ffbb76}.court-lines{position:absolute;border:2px solid #89a8ae66;border-radius:50%;width:150px;height:45px;bottom:-20px;right:10px}.floodlight{position:absolute;top:37%;width:4px;height:55%;background:#142438;box-shadow:0 -10px 25px 10px #ffcb8e44}.floodlight:before{content:'';position:absolute;top:0;left:-10px;width:24px;height:10px;background:#ffe3a5;box-shadow:0 0 15px #fff3ac}.left{left:8%}.right{right:7%}.backboard{position:absolute;right:14%;top:41%;width:58px;height:40px;background:#b1d1ddaa;border:3px solid #16283d;transform:skewY(-6deg)}.backboard div{border:2px solid #e3f3ef;width:22px;height:20px;margin:12px auto}.rim{position:absolute;right:17%;top:58%;width:38px;height:9px;border:3px solid #ff8e40;border-radius:50%;z-index:4}.net{position:absolute;right:18%;top:61%;width:30px;height:24px;border:2px solid #e1e7dc;clip-path:polygon(0 0,100% 0,80% 100%,20% 100%);background:repeating-linear-gradient(65deg,transparent 0 6px,#fff9 7px 8px)}.player{position:absolute;bottom:14%;left:37%;width:45px;height:83px;z-index:5;transform:rotate(-9deg)}.head{position:absolute;width:22px;height:25px;border-radius:45%;background:#bd7751;left:11px;top:0;border-top:7px solid #162439}.jersey{position:absolute;top:24px;left:3px;width:37px;height:36px;background:linear-gradient(110deg,#60dcff,#0874d1);border:3px solid #c5f5ff;border-radius:8px 8px 3px 3px;text-align:center;font-size:16px;font-weight:900;color:#07305a}.arm{position:absolute;top:27px;left:33px;width:32px;height:9px;background:#bd7751;border-radius:8px;transform:rotate(-45deg);transform-origin:left}.leg{position:absolute;top:57px;width:12px;height:28px;background:#0e5eaa;border-bottom:7px solid #d1f2ff;transform-origin:top}.one{left:7px;transform:rotate(15deg)}.two{left:25px;transform:rotate(-20deg)}.basketball{position:absolute;width:19px;height:19px;left:50%;bottom:35%;border-radius:50%;background:repeating-linear-gradient(30deg,transparent 0 7px,#74350e 8px 9px),#ff9b32;box-shadow:0 0 14px #ffa13466;z-index:6}#court-callout{position:absolute;left:14px;bottom:30px;font-size:13px;font-style:italic;font-weight:1000;color:#e5f8ff;text-shadow:0 2px 8px #000}.court-caption{position:absolute;bottom:7px;left:14px;font-size:7px;letter-spacing:2px;color:#7fa3b8}.playfield{flex:1;min-height:0;position:relative;background:radial-gradient(ellipse at 50% 5%,#173b56,#071529 75%);border-inline:6px solid #0d263d}.board-label{position:absolute;top:10px;left:9px;right:9px;display:flex;justify-content:space-between;font-size:8px;letter-spacing:1px;color:#6c9cb7;pointer-events:none}.board-label b{color:#ffb76a}canvas{display:block;width:100%;height:100%;touch-action:none}#toast{position:absolute;top:57%;left:0;right:0;text-align:center;font-size:11px;color:#a2c2d7;pointer-events:none;transition:opacity .3s}.next-label{position:absolute;bottom:29px;left:68%;font-size:8px;color:#91adc0}#next{position:absolute;bottom:44px;left:68%;width:22px;height:22px;border-radius:50%;border:2px solid #fff8;box-shadow:0 0 10px #0008}footer{height:105px;padding:12px 14px max(12px,env(safe-area-inset-bottom));display:flex;gap:16px;align-items:center;background:linear-gradient(#102b42,#061320);border-top:1px solid #285475;flex-shrink:0}.energy{flex:1}.energy-title{display:flex;justify-content:space-between;font-size:10px;margin-bottom:8px}.energy-title b{color:#6ae6ff;letter-spacing:1px}.energy-title span{color:#b1d0e1}.track{height:17px;border:1px solid #2e6e89;border-radius:10px;background:#05111e;padding:3px}#energy-fill{height:100%;width:0;background:linear-gradient(90deg,#087dc0,#57edff);border-radius:8px;transition:width .35s}.energy small{display:block;color:#7394ab;font-size:9px;margin-top:7px}#dunk{width:115px;min-height:72px;border:2px solid #ffcb75;border-radius:17px;background:linear-gradient(140deg,#ffc353,#f26b19);color:#fff;transform:skew(-5deg);box-shadow:0 0 23px #ff9a3040, inset 0 0 0 3px #71330a44}#dunk span{font-size:19px}#dunk b{font-size:21px;font-weight:1000;font-style:italic;display:block;line-height:1}#dunk small{font-size:7px;letter-spacing:.6px}#dunk:disabled{filter:saturate(.25);opacity:.5;box-shadow:none}#dunk:not(:disabled){animation:ready 1s infinite alternate}.dunking .player{animation:jump 1.5s ease-in-out}.dunking .basketball{animation:slam 1.5s ease-in-out}.dunking #court-callout{font-size:26px;color:#ffce66;z-index:9}.dunking .rim{animation:shake .2s 1s 4}.dunking{box-shadow:inset 0 0 70px #55ddff55}@keyframes jump{40%,65%{transform:translate(65px,-40px) rotate(15deg)}80%{transform:translate(50px,-10px)}}@keyframes slam{40%{left:72%;bottom:55%;transform:scale(1.3)}65%{left:76%;bottom:35%}100%{left:76%;bottom:5%}}@keyframes shake{50%{transform:translateY(4px)}}@keyframes ready{to{box-shadow:0 0 24px #ffb13199;transform:skew(-5deg) scale(1.03)}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}@media(max-height:650px){header{height:52px}.court{min-height:150px}footer{height:85px}#dunk{min-height:60px}}
/* v2: articulated canvas player, synchronized ball and rim. */
#court-animation{position:absolute;inset:0;width:100%;height:100%;z-index:5;pointer-events:none}.court #court-callout{z-index:6;pointer-events:none;font-size:12px!important}.court .court-caption{z-index:6}#preview-dunk{position:absolute;right:10px;bottom:8px;z-index:8;border:1px solid #a5dfff66;border-radius:6px;background:#061627bb;color:#c5f3ff;font-size:8px;letter-spacing:.5px;padding:7px 9px;min-height:30px}.dunking{box-shadow:inset 0 0 70px #55ddff33}#preview-dunk:focus-visible{outline:2px solid #5be2ff}
/* Game-designer polish: court-only lighting and feedback, never move the aiming board. */
.court:after{content:'';position:absolute;inset:0;z-index:3;pointer-events:none;background:linear-gradient(115deg,transparent 20%,#ffe4a314 40%,transparent 60%);animation:court-light 9s ease-in-out infinite alternate}.scoreboard{top:8px;padding-top:9px;padding-bottom:8px}.scoreboard small{font-size:9px;letter-spacing:.7px}.scoreboard .center-score span{font-size:8px}.scoreboard .center-score b{font-size:12px}.energy-title{font-size:11px}#combo{font-size:9px}.board-label{font-size:9px}.court-caption{max-width:55%;font-size:6px}#preview-dunk{min-height:34px}#dunk:active:not(:disabled){transform:skew(-5deg) scale(.95)}header{padding-top:max(12px,env(safe-area-inset-top))}@keyframes court-light{to{opacity:.35;transform:translateX(15px)}}@media(prefers-reduced-motion:reduce){.court:after{animation:none}}
/* Pool-inspired controls: target tap, relative ruler, explicit shot. */
.aim-controls{flex-shrink:0;display:flex;align-items:center;gap:12px;padding:8px 14px;background:#0a2034;border-top:1px solid #264c65;height:88px}.fine-wrap{flex:1;min-width:0}.fine-title{display:flex;align-items:center;justify-content:space-between;font-size:8px;letter-spacing:.6px;color:#9dbdce;margin-bottom:4px}.fine-title output{font-size:10px;color:#8eecff;font-variant-numeric:tabular-nums}#fine-aim{height:48px;position:relative;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;border:1px solid #38718b;border-radius:10px;background:linear-gradient(#183b50,#092234);cursor:ew-resize}#fine-aim:focus-visible{outline:2px solid #73efff;outline-offset:2px}.ruler-ticks{position:absolute;inset:5px -80px 18px;background:repeating-linear-gradient(90deg,transparent 0 9px,#9cd6eaaa 9px 10px);transform:translateX(var(--ruler-shift,0px))}.ruler-marker{position:absolute;top:0;bottom:18px;left:50%;width:2px;background:#ffbf61;box-shadow:0 0 8px #ffb754}.ruler-marker:before{content:'';position:absolute;left:-4px;top:0;border-top:6px solid #ffbf61;border-inline:5px solid transparent}.ruler-arrows{position:absolute;bottom:4px;left:10px;right:10px;display:flex;justify-content:space-between;font-size:9px;color:#a2d0e1}.ruler-arrows i{font-size:7px;letter-spacing:1.5px;font-style:normal}.adjusting{border-color:#9cf2ff!important;box-shadow:0 0 12px #46c8ff44}#fine-aim[aria-disabled=true]{opacity:.5}#shoot{flex:0 0 108px;min-height:58px;border:2px solid #9bf5ff;border-radius:13px;background:linear-gradient(#4ad8ee,#0d86b7);color:#05263d;box-shadow:0 3px 0 #065a7c;font-weight:900}#shoot b{display:block;font-style:italic;font-size:20px;letter-spacing:.4px}#shoot small{display:block;font-size:7px;letter-spacing:.7px;margin-top:3px}#shoot:active:not(:disabled){transform:translateY(2px);box-shadow:none}#shoot:disabled{opacity:.45;cursor:default}.court{height:24%;min-height:170px}footer{height:90px}#dunk{width:108px;min-height:64px}#toast{font-size:10px;top:65%;padding-inline:8px}.playfield{min-height:280px}.game{min-height:700px}@media(max-height:740px){.game{min-height:620px}header{height:52px}.court{height:23%;min-height:142px}.playfield{min-height:250px}.aim-controls{height:78px}footer{height:82px;padding-top:7px;padding-bottom:max(7px,env(safe-area-inset-bottom))}#dunk{min-height:58px}.scoreboard{padding:5px 12px}.scoreboard strong{font-size:23px}.court-caption{display:none}}@media(max-width:350px){.aim-controls{padding-inline:8px;gap:8px}#shoot{flex-basis:92px}.fine-title{font-size:7px}}
#game-over[hidden]{display:none}#game-over{position:absolute;inset:0;z-index:30;display:grid;place-items:center;background:#030d20d9;backdrop-filter:blur(4px)}#game-over>div{width:85%;max-width:330px;padding:24px;text-align:center;border:1px solid #ff9b64;border-radius:20px;background:#0d263b;box-shadow:0 0 30px #0008}#game-over small{font-size:9px;letter-spacing:2px;color:#9abacc}#game-over h2{font-size:30px;font-style:italic;color:#ffb570;margin:10px 0}#game-over p{font-size:12px;color:#b4cbd8}#game-over strong{display:block;font-size:25px;margin:18px;color:#73eaff}#play-again{width:100%;min-height:48px;border:0;border-radius:12px;font-weight:900;color:#082438;background:#60dfff}
/* Quick mode is the default; precision tools are optional. */
#precision-panel[hidden]{display:none}.game{height:100svh;height:100dvh;min-height:0}.playfield{min-height:0}.mode-toggle{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:6px;padding:3px 12px;background:#0a2034;border-top:1px solid #264c65;min-height:42px}.mode-toggle span{font-size:8px;letter-spacing:.6px;color:#a8c7d8}#precision-toggle{min-height:36px;padding:6px 9px;border:1px solid #36576a;border-radius:8px;background:#112d43;color:#b6e8f5;font-size:10px;touch-action:manipulation}.court{height:23%;min-height:120px;flex-shrink:0}header{height:56px}.aim-controls{height:76px}footer{height:86px}#shoot,#dunk,#precision-toggle{touch-action:manipulation}#board{cursor:crosshair}@media(max-height:650px){header{height:44px;padding-block:6px}.court{height:21%;min-height:100px}.scoreboard{padding:3px 10px}.scoreboard strong{font-size:20px}.scoreboard small{font-size:7px}.center-score span{font-size:7px}.center-score b{font-size:9px}footer{height:76px}#dunk{min-height:54px}.mode-toggle{min-height:38px;padding-block:0}.aim-controls{height:68px;padding-block:3px}.brand{font-size:21px}.practice{font-size:7px}}
/* Sunset Court 3D: strong depth and compact challenge HUD. */
.court{height:27%;min-height:160px;max-height:270px}.court.is-3d>.sky,.court.is-3d>.fence,.court.is-3d>.floodlight,.court.is-3d>.floor,.court.is-3d>.court-lines{display:none}.court.is-3d:after{display:none}#street-court{position:absolute;inset:0;width:100%;height:100%;z-index:4;pointer-events:none}#court-animation[hidden]{display:none}.court .scoreboard{background:linear-gradient(110deg,#061526ef,#14263de8);border-color:#72939b55}.court .court-caption{color:#c4d9d8}.court #court-callout{bottom:22px;text-shadow:0 2px 5px #02080c}.loading-court{position:absolute;inset:0;display:grid;place-items:center;color:#9ee2ec;font-size:10px;letter-spacing:2px;z-index:5;background:#16263a}.court[aria-busy=false] .loading-court{display:none}header{gap:7px}.brand{font-size:23px}.practice{font-size:7px}header button{flex:0 0 30px}header button:disabled{opacity:.4}.challenge-strip{min-height:30px;display:flex;align-items:center;justify-content:space-between;gap:6px;background:#0c2133;padding:4px 13px;border-top:1px solid #345366;font-size:9px;flex-shrink:0;letter-spacing:.5px}#shots-left{color:#b7d1dc;font-variant-numeric:tabular-nums}#streak-label{color:#ffbd6a;font-size:8px}.dunk-progress{display:flex;gap:5px}.dunk-progress i{width:12px;height:5px;border-radius:5px;background:#294656}.dunk-progress i.done{background:#64e5e8;box-shadow:0 0 8px #64e5e850}.board-label{font-size:8px}.board-label b{font-size:8px;letter-spacing:.3px}.energy small{line-height:1.25}#dunk small{letter-spacing:0;font-size:7px}
/* Native dialogs supply focus containment and block board interaction. */
.overlay{color:#eaf7fa;padding:0;width:min(92vw,400px);max-height:90svh;overflow:auto;border:1px solid #4d7d8f;border-radius:23px;background:#0a1a2b;box-shadow:0 25px 100px #000b}.overlay::backdrop{background:#020a17d9;backdrop-filter:blur(5px)}.overlay:not([open]){display:none!important}.modal-card{padding:26px 22px;text-align:center;background:radial-gradient(ellipse at 50% 0,#173d50,#091a2b 65%)}.modal-card>small{font-size:9px;letter-spacing:2px;color:#8cb5c5}.modal-card h2{font-size:28px;letter-spacing:-1px;font-style:italic;line-height:1.05;margin:13px 0;color:#ffbe79}.modal-card p{font-size:12px;line-height:1.55;color:#b0c9d5;margin:10px 0}.modal-card button{display:block;width:100%;min-height:46px;border-radius:12px;font-weight:900;font-size:12px;letter-spacing:.6px}.primary-button{border:1px solid #b3f5f7;background:linear-gradient(130deg,#8af1ee,#2bb6df);color:#05263c;box-shadow:0 4px 0 #073c53}.secondary-button{border:1px solid #345a70;background:#102c40;color:#c4e6ed;margin-top:12px}.modal-card button:focus-visible{outline:3px solid #ffb769;outline-offset:3px}.guide-demo{display:flex;justify-content:center;align-items:center;gap:5px;height:64px;margin:12px 0;background:#051426;border-radius:12px}.demo-bubble{height:25px;width:25px;border-radius:50%;background:radial-gradient(circle at 30% 25%,#e9ffff,#2dc9de 40%,#103953 95%);border:1px solid #8fe8ec}.demo-bubble.gold{background:radial-gradient(circle at 30% 25%,#fff7ce,#ffac49 40%,#6c3a24 95%)}.demo-arrow{font-size:34px;color:#a5f2f6;margin-inline:5px}.guide-demo>b{color:#ffca78;font-size:15px}.guide-steps{padding:0;margin:0;list-style:none;counter-reset:step;text-align:left}.guide-steps li{counter-increment:step;position:relative;padding:0 0 14px 34px}.guide-steps li:before{content:counter(step);position:absolute;left:0;top:1px;background:#173f52;color:#8deff0;width:24px;height:24px;display:grid;place-items:center;border-radius:8px;font-size:12px;font-weight:900}.guide-steps b{font-size:12px;display:block;color:#e2f4fa}.guide-steps span{font-size:11px;color:#9ab9c8;line-height:1.5;display:block;margin-top:4px}.guide-tip{font-size:10px!important;color:#85abb9!important;margin-bottom:16px!important}#game-over{position:fixed;inset:0;margin:auto;display:revert;width:min(92vw,400px);max-width:400px;place-items:normal;background:#0a1a2b}#game-over>.modal-card{width:auto;max-width:none;border:0;border-radius:0;box-shadow:none;padding:25px 22px}.result-dialog #result-symbol{font-size:44px;color:#eeac73;line-height:1;margin:14px 0}.result-dialog.victory{border-color:#b89b64}.result-dialog.victory h2{color:#84f0ed}.result-dialog.victory #result-symbol{color:#ffcc70;text-shadow:0 0 25px #ffbd5b77}#result-stars{font-size:32px;letter-spacing:6px;color:#ffca72;min-height:18px}.result-grid{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:#2d4c5e;border:1px solid #2d4c5e;border-radius:12px;overflow:hidden;margin:18px 0}.result-grid>div{padding:12px 4px;background:#0c2437}.result-grid b{font-size:23px;display:block;color:#9de9ee}.result-grid small{font-size:8px;letter-spacing:1px;color:#90b0c0;display:block;margin-top:4px}#result-tip{color:#e9c291;font-size:11px;margin-bottom:18px}#share-status{font-size:10px;min-height:14px;margin-bottom:0}#play-again{font-size:12px;color:#05263c;background:linear-gradient(130deg,#8af1ee,#2bb6df)}.mode-toggle{min-height:38px}#precision-toggle{min-height:32px}footer{height:86px}.court .scoreboard{padding:5px 12px}.scoreboard strong{font-size:24px}.scoreboard small{font-size:8px}.center-score b{font-size:11px}.center-score span{font-size:7px}
@media(max-height:700px){.court{height:25%;min-height:132px}.challenge-strip{min-height:27px;font-size:8px}.court #court-callout{font-size:9px!important;bottom:17px}.court .scoreboard{top:5px;padding:3px 10px}.scoreboard strong{font-size:19px}.scoreboard small{font-size:7px}#preview-dunk{font-size:7px;min-height:28px;padding:4px 6px;bottom:4px}footer{height:76px}.modal-card{padding:20px 18px}.guide-demo{height:47px}.guide-steps li{padding-bottom:10px}.modal-card h2{font-size:25px}.guide-steps span{font-size:10px}.guide-dialog{max-height:94svh}.result-grid>div{padding:9px 4px}.result-grid{margin:10px 0}.result-dialog #result-symbol{font-size:30px;margin:9px 0}.result-dialog h2{font-size:25px}}
@media(max-width:350px){.brand{font-size:20px}.practice{font-size:6px;letter-spacing:0}header{padding-inline:10px;gap:6px}.mode-toggle span{font-size:7px}#streak-label{font-size:7px}.challenge-strip{padding-inline:9px}.energy-title{font-size:10px}}

/* Leave the 3D rim below the score overlay on compact phone courts. */
#street-court{top:38px;height:calc(100% - 38px)}
@media(max-height:700px){#street-court{top:30px;height:calc(100% - 30px)}}

#game-over.victory h2{color:#84f0ed}

/* Two-team poster dunk presentation, with phone-sized preview targets. */
.duel-preview{position:absolute;bottom:0;right:0;display:flex;z-index:8;gap:1px;background:#08182ce8;border-radius:8px 0 0 0;overflow:hidden}
.duel-preview button,#preview-dunk{position:static;min-height:44px;min-width:100px;border:0;border-radius:0;background:transparent;padding:0 9px;font:800 9px sans-serif;color:#a2f8ff;letter-spacing:.4px;touch-action:manipulation}
.duel-preview #preview-rival{color:#ffc38a}.duel-preview i{display:inline-block;width:6px;height:6px;background:#16becb;border-radius:50%;margin-right:3px}.duel-preview #preview-rival i{background:#f18435}.duel-preview button:disabled{opacity:.4}
.court{height:30%;min-height:210px}.court-caption{bottom:8px;font-size:6px;max-width:calc(100% - 210px)}#court-callout{bottom:46px;left:12px;font-size:13px}
#street-court{top:36px;height:calc(100% - 62px)}
@media(max-height:700px){.court{height:33%;min-height:184px}.duel-preview button,#preview-dunk{min-height:44px;font-size:8px;min-width:95px}#street-court{top:30px;height:calc(100% - 54px)}#court-callout{bottom:44px;font-size:11px}.court-caption{font-size:5px}}

.court-caption{color:#d3e4ef;background:#0b1c30d9;padding:4px 6px;letter-spacing:.5px;font-weight:700}.duel-preview{border-top:1px solid #6594aa33}#court-callout{max-width:calc(100% - 20px)}
