@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Libre+Caslon+Display&display=swap');
:root{--cream:#f3f0e5;--ink:#173e31;--gold:#d6a763}*{box-sizing:border-box}body{margin:0;background:#7a9f88;color:var(--ink);font-family:'DM Sans',Arial,sans-serif;overflow:hidden}button,select,input{font:inherit}button,select{cursor:pointer}button{color:inherit;border:0;background:none}button:focus-visible,select:focus-visible,#pad:focus-visible{outline:3px solid #d28a31;outline-offset:3px}#world{position:fixed;inset:0}#world canvas{width:100%;height:100%;display:block;touch-action:none}header{position:absolute;top:0;left:0;right:0;padding:25px 32px;display:flex;justify-content:space-between;align-items:center;background:linear-gradient(#f3f0e5ee,#f3f0e500);pointer-events:none}.brand{display:flex;align-items:center;gap:12px;font-size:16px;letter-spacing:3px;font-weight:700}.brand small{display:block;font-size:8px;letter-spacing:1.9px;margin-top:6px}.mark{font-family:Georgia;font-size:46px;line-height:40px}.header-actions{display:flex;gap:16px;pointer-events:auto;font-size:12px}.header-actions button{padding:11px 16px;border:1px solid #173e3140;border-radius:24px;background:#f3f0e560}.scoreboard{position:absolute;top:100px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:25px;background:var(--cream);padding:14px 25px;border-radius:3px;box-shadow:0 6px 24px #133b2720;min-width:310px;justify-content:space-between}.scoreboard>div{text-align:center}.scoreboard small{font-size:9px;display:block;white-space:nowrap;font-weight:700;letter-spacing:1px}.scoreboard b{font-family:Georgia;font-weight:400;font-size:38px;line-height:43px}.dot{display:inline-block;width:7px;height:7px;border-radius:50%;margin-left:4px}.blue{background:#2875ce}.black{background:#222}.red{background:#cf4b40}.yellow{background:#e4bd39}.scoreline{font-size:8px;letter-spacing:1.5px;text-align:center;color:#6a7d70}.scoreline em{font-style:normal;display:block;margin-top:9px;font-size:9px;color:var(--ink);letter-spacing:1px}.course{position:absolute;left:30px;top:150px;width:220px;background:#f3f0e5e8;padding:22px;border-radius:3px;box-shadow:0 8px 26px #12321d15}.eyebrow{font-size:9px;letter-spacing:1.6px;font-weight:700}.course-title{font-family:'Libre Caslon Display',Georgia,serif;font-size:28px;line-height:1.08;margin-top:12px}#map{width:100%;height:auto;margin:12px 0 4px}.course-foot{display:flex;justify-content:space-between;font-size:8px;gap:5px;font-weight:700}#history{border-top:1px solid #173e3120;margin-top:15px;padding-top:12px;font-size:10px;line-height:1.5;color:#587160}.views{position:absolute;right:28px;top:185px;display:grid;gap:8px}.views button{background:#f3f0e5e8;border-radius:3px;padding:12px 16px;text-align:left;font-size:18px}.views span{font-size:11px;margin-left:7px}.views button.active{background:var(--ink);color:var(--cream)}.live{position:absolute;bottom:218px;left:50%;transform:translateX(-50%);background:#173e31df;color:var(--cream);font-size:11px;padding:10px 18px;border-radius:30px;display:flex;gap:9px;align-items:center;white-space:nowrap}.live-dot{width:6px;height:6px;border-radius:50%;background:#e3b66b}.shotpanel{position:absolute;left:30px;right:30px;bottom:49px;min-height:145px;padding:24px 28px;background:var(--cream);display:flex;justify-content:space-between;align-items:center;gap:22px;border-radius:4px;box-shadow:0 4px 30px #153e311a}.turn{display:flex;align-items:center;gap:20px}#ballbadge{width:36px;height:36px;border-radius:50%;background:radial-gradient(circle at 30% 25%,#71b3ff,#155197 75%);box-shadow:3px 5px 7px #0003;flex-shrink:0}h1{font-family:'Libre Caslon Display',Georgia,serif;font-size:32px;font-weight:400;line-height:1;margin:10px 0}p{font-size:11px;margin:0;color:#607566}.shotcontrols{display:flex;align-items:center;gap:28px}.aim-control{width:185px}.aim-control label{font-size:8px;letter-spacing:1.3px;display:flex;justify-content:space-between}.aim-control input{width:100%;accent-color:var(--ink);margin:13px 0}.distance{font-size:9px;color:#6f7e72}#pad{width:185px;background:var(--ink);color:var(--cream);padding:12px 18px;border-radius:3px;cursor:ns-resize;touch-action:none;user-select:none;position:relative;text-align:center}#pad .pad-icon{font-size:26px;line-height:24px;display:block;color:var(--gold)}#pad b{font-size:10px;letter-spacing:1.3px;display:block;margin-top:5px}#pad small{font-size:9px;display:block;margin:4px 0 9px;color:#bcccbf}.power-track{height:3px;background:#ffffff30;overflow:hidden}#powerfill{width:0;height:100%;background:var(--gold)}footer{position:absolute;left:32px;right:32px;bottom:13px;display:flex;align-items:center;justify-content:space-between;font-size:8px;letter-spacing:1.3px;color:#f3f0e5}footer>div{display:flex;gap:20px}footer button,footer select{font-size:10px;letter-spacing:0;color:var(--cream)}footer select{background:#173e31;border:0;border-radius:3px;padding:4px 7px}#labels{position:absolute;inset:0;pointer-events:none;overflow:hidden}.hoop-label{position:absolute;transform:translate(-50%,-100%);background:#f3f0e5dc;font-size:10px;padding:4px 7px;border-radius:20px}.hoop-label.target{background:#e6bb78;color:#173e31;font-weight:bold;padding:6px 11px}dialog{max-width:530px;width:calc(100% - 30px);padding:35px;border:0;border-radius:6px;background:var(--cream);color:var(--ink);box-shadow:0 20px 100px #0005}dialog::backdrop{background:#102d2599;backdrop-filter:blur(5px)}dialog h2{font-family:Georgia;font-size:36px;font-weight:400;margin:15px 0}dialog p,dialog li{font-size:13px;line-height:1.6}dialog ol{padding-left:20px}dialog li{margin:10px 0}dialog .note{font-size:11px;background:#dfe5d8;padding:13px;margin-top:15px}dialog a{display:block;color:var(--ink);font-size:11px;margin:18px 0}.primary{background:var(--ink);color:var(--cream);padding:13px 20px;border-radius:3px;width:100%}.close{position:absolute;right:15px;top:10px;font-size:28px}#toast{position:absolute;left:50%;top:180px;transform:translateX(-50%) translateY(-10px);opacity:0;transition:.3s;background:var(--cream);padding:15px 24px;border-radius:4px;text-align:center;pointer-events:none;font-family:Georgia;font-size:23px;box-shadow:0 5px 25px #1234}#toast.show{opacity:1;transform:translateX(-50%)}
@media(max-width:1000px){.course{width:172px;padding:16px;top:130px}.course-title{font-size:24px}.shotpanel{padding:20px}.shotcontrols{gap:15px}.aim-control{width:135px}#pad{width:155px}h1{font-size:27px}.turn{gap:14px}.brand small{font-size:7px}.views span{display:none}.views button{padding:12px}.views{right:20px}}
@media(max-width:680px){header{padding:18px}.brand{font-size:12px;letter-spacing:2px;gap:8px}.brand small{display:none}.mark{font-size:34px}.header-actions{gap:6px}.header-actions button{padding:8px 11px;font-size:10px}#sound{display:none}.scoreboard{top:77px;min-width:277px;gap:17px;padding:9px 18px}.scoreboard b{font-size:30px;line-height:34px}.course{display:none}.views{right:12px;top:165px;gap:6px}.views button{font-size:17px;padding:10px}.shotpanel{left:12px;right:12px;bottom:49px;padding:16px;display:block;min-height:200px}.turn{gap:12px}#ballbadge{width:27px;height:27px}h1{font-size:25px;margin:7px 0}.eyebrow{font-size:8px}#hint{font-size:10px;line-height:1.4}.shotcontrols{margin-top:15px;gap:20px;justify-content:space-between}.aim-control{width:45%}#pad{width:49%;padding:10px 14px}#pad .pad-icon{font-size:20px;line-height:18px}#pad b{font-size:9px}.live{bottom:267px;font-size:10px;padding:8px 14px}footer{left:14px;right:14px;bottom:12px}footer>span{display:none}footer>div{width:100%;justify-content:space-between}#toast{top:150px;font-size:20px;width:75%}.hoop-label{font-size:8px;padding:3px 5px}.hoop-label.target{padding:4px 7px}dialog{padding:25px}dialog h2{font-size:30px}}
@media(max-height:650px) and (min-width:681px){.course{top:100px;width:150px;padding:12px}.course-title{font-size:20px}#map{max-height:160px}.scoreboard{top:75px}.shotpanel{min-height:120px;padding:15px}.live{bottom:182px}.views{top:130px}}
/* Keep the centre of the lawn clear. */
.scoreboard{left:30px;top:102px;transform:none;min-width:0;width:220px;gap:10px;padding:10px 15px}.scoreboard b{font-size:29px;line-height:32px}.scoreboard small{font-size:8px;letter-spacing:.5px}.scoreline{font-size:7px;letter-spacing:1px}.scoreline em{font-size:8px;letter-spacing:.4px}.course{top:205px}.course-title{font-size:25px}#courtname{font-family:Georgia,serif;font-size:19px;margin-top:10px;color:#56715d}.course-title{display:none}.header-actions select{color:var(--ink);border:1px solid #173e3140;border-radius:24px;background:#f3f0e5e8;padding:10px 30px 10px 15px;font-size:12px;max-width:210px}.header-actions{pointer-events:auto}#distance{font-variant-numeric:tabular-nums}
@media(max-width:1000px){.scoreboard{width:172px;left:30px;padding:9px;gap:5px;top:105px}.scoreboard small{font-size:6px}.scoreline{font-size:6px;letter-spacing:.4px}.scoreline em{font-size:7px}.scoreboard .dot{width:5px;height:5px;margin-left:2px}.course{top:200px}.header-actions{gap:8px}.header-actions select{font-size:10px;max-width:180px}#courtname{font-size:17px}}
@media(max-width:680px){header{align-items:flex-start}.header-actions{display:grid;grid-template-columns:1fr;gap:5px;justify-items:end}.header-actions select{max-width:172px;padding:8px 22px 8px 10px}.header-actions button{padding:6px 10px;background:#f3f0e5d9}.scoreboard{top:79px;left:12px;width:198px;padding:7px 12px;gap:7px}.scoreboard b{font-size:24px;line-height:27px}.scoreboard small{font-size:7px}.scoreline{font-size:6px}.scoreline em{font-size:7px;margin-top:5px}.views{top:157px}#hint{min-height:28px}.live{bottom:282px}.shotpanel{min-height:215px}}
@media(max-height:650px) and (min-width:681px){.scoreboard{top:86px;width:150px;left:30px}.course{top:174px}.course #map{max-height:150px}.course #history{display:none}.course #courtname{font-size:15px}}
#ballprogress{font-size:9px;line-height:1.7;margin-top:12px;color:#526d58}#ballchoices{margin-top:9px}#ballchoices button{padding:5px 12px;margin-right:5px;border:1px solid #9eae95;border-radius:20px;font-size:10px;background:#e0e6d7}#ballchoices button:disabled{opacity:.4}#contactcontrols{margin-top:9px;max-width:285px}#contactcontrols label{font-size:9px;letter-spacing:1px;text-transform:uppercase}#contactcontrols input{width:100%;accent-color:#173e31;margin:5px 0 0}#ruleDetails{margin-top:12px;font-size:12px;line-height:1.6}dialog{max-height:90dvh;overflow:auto}footer>div{gap:12px}footer select{max-width:170px}
@media(max-width:680px){footer>div{gap:5px}footer select{max-width:140px;font-size:9px;padding:5px}footer #mode{max-width:115px}footer button{font-size:9px;white-space:nowrap}#contactcontrols{max-width:200px}.shotpanel:has(#contactcontrols:not([hidden])),.shotpanel:has(#ballchoices:not([hidden])){padding-top:12px;padding-bottom:12px}.live{bottom:300px}h1{font-size:23px}}
.yard-label{position:absolute;transform:translate(-50%,-50%);font-size:10px;line-height:1;color:#fff9e6;text-shadow:0 1px 3px #173e31,0 0 5px #173e31;background:#173e3155;padding:3px 5px;border-radius:8px;white-space:nowrap}.desktop-shot #pad{width:320px;cursor:ew-resize}.desktop-shot #pad .pad-icon{font-size:0}.desktop-shot #pad .pad-icon:after{content:'←';font-size:26px}.desktop-shot #pad small{font-variant-numeric:tabular-nums}.desktop-shot #pad .power-track{position:relative;height:5px}.desktop-shot #powerfill{position:absolute;right:0}.desktop-shot #pad.pulling{box-shadow:0 0 0 3px #d6a76388}.desktop-shot #pad b{letter-spacing:1.8px}
@media(min-width:681px) and (max-width:1100px){.desktop-shot .shotpanel{display:block}.desktop-shot .shotcontrols{justify-content:space-between;margin-top:14px}.desktop-shot .aim-control{flex:1;max-width:270px}.desktop-shot #pad{width:320px;max-width:55%}.desktop-shot .live{bottom:286px}.desktop-shot .shotpanel h1{font-size:25px}}
@media(max-width:680px){.yard-label{font-size:8px}.desktop-shot #pad{max-width:49%}}
/* Mobile scores live in the controls dock, outside the visible playing area. */
@media(max-width:680px){
 .scoreboard{top:auto;bottom:43px;left:12px;right:12px;width:auto;min-width:0;height:39px;padding:3px 12px;gap:12px;background:#f3f0e5;border-radius:0 0 4px 4px;box-shadow:none;pointer-events:none;justify-content:center;z-index:3}
 .scoreboard>div{display:flex;align-items:center;gap:8px}.scoreboard small{font-size:7px}.scoreboard b{font-family:inherit;font-weight:600;font-size:18px;line-height:22px}.scoreline{font-size:6px}.scoreline em{font-size:7px;margin-top:3px}
 .shotpanel{bottom:80px;min-height:195px;border-radius:4px 4px 0 0;padding:13px 16px}.live{bottom:290px}.shotpanel h1{font-size:22px}.shotcontrols{margin-top:11px}#hint{min-height:24px}
 #world{bottom:285px}.views{top:100px}.views button{padding:8px}.hoop-label{font-size:8px}
}

#jump{font-size:10px;border:1px solid #8eaa97;border-radius:14px;padding:4px 10px;margin-top:7px;background:#e0e6d7}#jump[aria-pressed="true"]{background:#173e31;color:#f3f0e5}#pad #swingfeedback{font-size:9px;margin:4px 0;color:#e3b66b}.swing-guide{height:3px;background:#ffffff18;position:relative;margin:6px auto;width:70%}.swing-guide:before{content:'';position:absolute;left:50%;height:7px;width:1px;top:-2px;background:#fff8}.swing-guide i{position:absolute;width:5px;height:5px;background:#e3b66b;border-radius:50%;left:calc(50% + var(--drift,0%));top:-1px;transform:translateX(-50%)}
@media(max-width:680px){.shotpanel{min-height:225px}#world{bottom:315px}.live{bottom:320px}#pad{padding:8px 12px}#pad #swingfeedback{font-size:8px}#jump{font-size:9px}}

/* A compact mobile swing dock leaves the lawn as the main view. */
@media(max-width:680px){
 .shotpanel,.shotpanel:has(#contactcontrols:not([hidden])),.shotpanel:has(#ballchoices:not([hidden])){min-height:0;padding:10px 12px}
 .shotpanel .turn{gap:8px}.shotpanel #turntitle,.shotpanel #hint{display:none}
 .shotpanel h1,.desktop-shot .shotpanel h1{font-size:17px;line-height:20px;margin:0}
 .shotpanel #ballbadge{width:18px;height:18px}.shotcontrols{margin-top:8px;gap:12px}
 .aim-control input{margin:8px 0}.distance{font-size:8px;line-height:1.25}
 #pad{padding:8px 10px;min-height:96px}#pad .pad-icon{display:none}#pad b{font-size:8px;letter-spacing:1px;margin-top:0}#pad small{font-size:8px;margin:5px 0;line-height:1.25}
 #jump{margin-top:5px;padding:5px 9px}#world{bottom:245px}.live{bottom:250px}
 #ballchoices{margin-top:6px}#contactcontrols{margin-top:6px}
}
.rule-guide{margin:18px 0}.rule-guide details{border-top:1px solid #173e3133;padding:12px 0}.rule-guide summary{font-size:14px;font-weight:700;cursor:pointer;min-height:24px}.rule-guide p{margin-top:9px}.rule-guide .note{margin-top:10px}

body{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation}button,canvas,#pad,input[type="range"]{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}#helpdialog{-webkit-user-select:text;user-select:text}

.multiplayer .scoreboard #them{font:600 10px/1.6 'DM Sans',Arial,sans-serif;white-space:normal}.multiplayer .scoreboard>div:last-child{max-width:190px}.multiplayer .scoreboard>div:first-child .dot.black{display:none}footer select[hidden]{display:none}@media(max-width:680px){footer #players{max-width:130px}.multiplayer .scoreboard>div:last-child{display:block}.multiplayer .scoreboard #them{font-size:9px}}

/* Keep the court visible right up to the top edge. */
header{background:none}


/* Timed swing: large center band and marker work with touch or mouse. */
#pad,.desktop-shot #pad{cursor:pointer}.desktop-shot #powerfill{left:0;right:auto}#pad .pad-icon{display:none!important}.swing-guide{height:12px;width:100%;margin:9px auto;background:#ffffff26;border-radius:6px}.swing-guide:before{left:43%;width:14%;height:12px;top:0;background:#a7d4a866;border-radius:3px}.swing-guide i{height:18px;width:4px;top:-3px;background:#ffe1a0;border-radius:2px}#pad:focus-visible{outline:3px solid #d6a763}#pad[aria-disabled="true"]{opacity:.45;cursor:default}#placeconfirm,#placeedit{padding:9px 12px;border-radius:5px;background:#173e31;color:#f3f0e5;font-size:12px;margin-top:6px;min-height:36px}#placeconfirm:disabled{opacity:.45}.placing .shotcontrols{display:none}.placing #hint{display:block;max-width:450px;font-size:12px;line-height:1.4}.placing #contactcontrols{max-width:400px}.placing #contactangle{min-height:36px}.placing .shotpanel{border:2px solid #d6a763}.placing .live{background:#173e31}#contactcontrols[hidden],#placeconfirm[hidden],#placeedit[hidden]{display:none!important}
@media(max-width:680px){.placing .shotpanel h1{display:block}.placing #hint{font-size:11px}.placing #contactcontrols{max-width:100%;margin-top:4px}.placing #ballbadge{display:none}.placing .turn{display:block}#pad b{line-height:1.4}.swing-guide{margin:8px auto}}
