@font-face{font-family:Pixel;src:url(/pixel.ttf)}*{box-sizing:border-box}body{margin:0;background:#0b0d1c;color:#f6f5ff;font:16px/1.45 system-ui,sans-serif;min-height:100vh}.wrap{max-width:1280px;width:92%;margin:auto}header{background:#101222;border-bottom:1px solid #323248}.bar,.brand,nav,.cab,.courtfoot,.lower,footer,.cap,.shots,.tabs{display:flex;align-items:center}.bar{height:77px;gap:24px}.brand{gap:11px;flex:1;line-height:1.3}.brand img{width:44px;height:44px;object-fit:contain;border-radius:50%}.brand strong{font-size:15px}.brand small{display:block;color:#bbb9cd;font-size:13px}button,input{font:inherit}button{cursor:pointer;color:inherit;background:#1b1c32;border:1px solid #38384d;border-radius:7px;padding:9px 16px}button:focus-visible,input:focus-visible{outline:3px solid #67f3e4}nav{gap:5px}nav button{border-color:transparent;background:none;color:#aaa9bd;font-weight:600;font-size:14px}nav button.sel,.tabs .sel{background:#302942;color:#e0c4ff;border-color:#514261}#sound{width:39px;padding:8px;color:#aaaac0}.intro{margin:36px 0 25px}.tag,.cab,.cap,.courtfoot,label,.hud,.spark,footer span:first-child,kbd{font-family:Pixel,monospace}.tag{color:#65e4d1;font-size:13px;letter-spacing:1px}h1{font:clamp(34px,4.3vw,66px)/1.15 Pixel,monospace;letter-spacing:-.065em;margin:6px 0 5px;color:#eee9ff;text-shadow:3px 3px #58466b}.spark{font:30px/1 Pixel;color:#fdd97d;text-shadow:none;vertical-align:top;display:inline-block;transform:rotate(8deg);margin-left:13px}p{margin:0;color:#b1b2c9}.grid{display:grid;grid-template-columns:minmax(0,2.35fr) minmax(285px,1fr);gap:20px}.machine,.console,.panel,.lower{background:#15172b;border:1px solid #393a52;border-radius:12px;overflow:hidden}.machine{display:flex;flex-direction:column}.cab,.courtfoot{justify-content:space-between;padding:13px 17px;font-size:12px;letter-spacing:.03em}.cab{background:#1c1e34}.cab strong{font-weight:400;color:#c4c4dc}.cab span{color:#bca6dc}.cab i,.courtfoot i{background:#6ee6bd;display:inline-block;width:7px;height:7px;margin-right:7px}.screen{position:relative;flex:1;min-height:280px;overflow:hidden;background:#18214b}.screen canvas{position:absolute;width:100%;height:100%;inset:0;image-rendering:pixelated;touch-action:manipulation}.hud{position:absolute;top:13px;left:50%;transform:translateX(-50%);background:#11132be8;border:1px solid #68607e;border-radius:6px;display:flex;padding:6px 0;pointer-events:none}.hud div{min-width:60px;text-align:center;padding:0 12px}.hud div+div{border-left:1px solid #44405c}.hud small{display:block;font-size:10px;color:#7ce9df}.hud div:nth-child(2) small{color:#b8b8ce}.hud div:last-child small{color:#ff9eaa}.hud b{font-size:20px;line-height:1.1;display:block;font-weight:400}.courtfoot{color:#a4a5c1;font-size:11px;gap:6px}.courtfoot strong{font-weight:400;color:#75ddcd}.cap{background:#222039;padding:12px 19px;gap:9px;color:#ddc6ff;font-size:13px}.pico{font:21px/1 monospace}.pad{padding:20px}h2{font:24px/1.2 Pixel;margin:0 0 7px;letter-spacing:-1.4px}.pad p{font-size:14px}label{display:block;font-size:11px;color:#c4bfd5;letter-spacing:1px;margin:18px 0 7px}input{width:100%;padding:11px 12px;border:1px solid #40415c;border-radius:6px;background:#0f1122;color:white}#start{width:100%;margin-top:11px;background:#b99ae8;color:#20172d;border:1px solid #d2b4f8;box-shadow:0 3px #6c538d;font-weight:750}#start span{font-size:13px;margin-right:6px}.line{height:1px;background:#333448;margin-top:20px}.shots{gap:8px}.shots button{flex:1;padding:9px 4px;font-weight:600;font-size:13px;background:#24253c}.shots b{color:#bda3e8;font-size:11px;margin-right:4px}kbd{background:#151628;color:#aaa7bd;border:1px solid #515066;border-radius:3px;margin-left:5px;padding:0 3px;font-size:10px}.tip{margin-top:10px;font-size:13px!important}.lower{padding:16px 20px;margin:18px 0 26px;gap:16px}.medal{font:28px/1 monospace;color:#f3cc78;background:#383027;border:1px solid #5a4833;border-radius:9px;padding:9px}.lower p{font-size:14px;margin-top:2px}.lower button{margin-left:auto;font-size:13px}.lower strong{font-size:16px}footer{justify-content:space-between;border-top:1px solid #2a2b3f;padding:16px 0 20px;color:#87879f;font-size:12px}section:not(#play){padding:40px 0;min-height:65vh}.tabs{gap:8px;margin:20px 0}.panel{padding:20px}.row{display:flex;justify-content:space-between;gap:15px;border-bottom:1px solid #36354c;padding:12px}.row:last-child{border:0}#record{margin-top:18px}.flash{animation:fade .45s}@keyframes fade{50%{opacity:.2}}[hidden]{display:none!important}@media(min-width:1450px){.intro{margin-top:52px}}@media(max-width:820px){.grid{grid-template-columns:1fr}.screen{aspect-ratio:800/440;min-height:0}.intro{margin:24px 0 18px}.bar{gap:8px}.wrap{width:94%}.console .pad{padding:16px}.lower{gap:10px}.bar nav button{padding:7px}.grid{gap:12px}}@media(max-width:550px){.brand strong{font-size:11px}.brand small{font-size:10px}.brand img{width:33px;height:33px}.brand{gap:5px}.bar{height:58px}.bar nav{gap:0}.bar nav button{font-size:11px}nav button span{display:block}.bar #sound{width:29px}.spark{font-size:18px}.intro p{font-size:14px}.hud{top:5px;padding:2px 0}.hud div{min-width:36px;padding:0 5px}.hud b{font-size:14px}.hud small{font-size:8px}.cab,.courtfoot{padding:8px 10px;font-size:9px}.lower button{display:none}.lower p{font-size:12px}footer{font-size:10px}.shots button{min-height:46px}.live .intro,.live .cap,.live #name,.live label[for=name],.live .line,.live #start,.live #greeting{display:none}.live .grid{margin-top:10px}.live .screen{aspect-ratio:1.45}.live .pad label{margin-top:6px}}

.flake{color:#8ce7e0;font-size:30px}.shots #smash{background:#efd184;color:#272034}.screen canvas{touch-action:none}@media(max-width:650px){h1{font-size:clamp(24px,6.4vw,37px)}.spark{display:none}}
/* Keep both thumb targets in the same footprint when a lob calls for Smash. */
.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: clamp(64px, 8.4vh, 81px);
  gap: 10px;
  align-items: stretch;
}
.shots button {
  position: relative;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 -4px #131626;
}
.shots .stroke {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  font: 15px Pixel, monospace;
  background: #203a40;
  border-color: #507379;
}
.shots #fore {background: #332d49; border-color: #6a587f}
.stroke img {image-rendering: pixelated; pointer-events: none}
#fore img {transform: scaleX(-1); }
.stroke kbd {position: absolute; top: 7px; right: 7px}
.shots #smash {grid-column: 1 / -1; font: 21px Pixel, monospace}
.shots button:active {transform: translateY(2px); box-shadow: inset 0 2px #171a2a}
@media (max-width: 820px) {
  .shots {grid-auto-rows: clamp(70px, 25.2vw, 118px)}
  .stroke img {width: 34px; height: 34px}
}
@media (pointer: coarse) {
  .shots kbd {display: none}
}

.courtfoot {min-height:42px;flex-wrap:wrap;align-content:center;gap:4px 12px}
#feedback {font:500 13px/1.3 system-ui,sans-serif;color:#c8cbdf}
footer {padding-bottom:max(16px,env(safe-area-inset-bottom))}
footer nav {width:100%;justify-content:center;gap:clamp(6px,3vw,24px)}
footer nav a,footer #sound {display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 6px;color:#bbb9cf;font:600 14px system-ui;text-decoration:none;background:none;border:0;width:auto}
footer nav a[aria-current=page] {color:#8aebdd;text-decoration:underline;text-underline-offset:5px}
.live .intro,.live .lower,.live .tip,.live .line,.live label[for=name],.live #name,.live #start,.live #greeting {display:none}
.live .grid {margin-top:12px}
@media(max-width:820px){
  .intro {margin:12px 0}.intro .tag,.intro p,.lower {display:none}
  .intro h1 {font-size:clamp(20px,5vw,32px)}
  .grid {gap:8px}.live .screen {aspect-ratio:1.5}
  .live .pad {padding:10px}.live .cap,.live .pad label {display:none}
  .live #hint {font-size:12px;margin-bottom:6px}
  .live .grid {margin-top:max(6px,env(safe-area-inset-top))}
  footer {margin-top:10px;padding-top:3px}
  .courtfoot {min-height:42px}.courtfoot #feedback {font-size:12px}
}
@media(max-width:820px) and (max-height:680px){
  .live .screen {aspect-ratio:auto;height:clamp(148px,36svh,255px);flex:none}
  .live .shots {grid-auto-rows:clamp(56px,14svh,92px)}
}

.shots .stroke {gap:3px;padding-block:4px}.stroke img {width:34px;height:34px}

#nameDialog,#serveDialog,#menuDialog,#deleteDialog{width:min(350px,90vw);padding:24px;color:#f4efff;background:#1d2036;border:1px solid #797190;border-radius:12px;box-shadow:0 16px 50px #080917aa}
#nameDialog::backdrop,#serveDialog::backdrop,#menuDialog::backdrop,#deleteDialog::backdrop{background:#090b1bc7}
#nameTitle label{font:inherit;letter-spacing:inherit;color:inherit;margin:0 0 16px}
#nameForm button,.shots #serve{width:100%;background:#b99ae8;color:#21192e;font:20px Pixel,monospace}
#nameForm button{margin-top:12px;font-size:16px}
.shots #serve{grid-column:1/-1}

#serveSplit{grid-column:1/-1;display:grid;grid-template-columns:1fr max(20%,44px);border-radius:8px;overflow:hidden}
#serveSplit #serve{grid-column:auto;border-radius:0}
#servePicker{border-radius:0;background:#a389cf;color:#231b35;font-size:26px;border-left:1px solid #71578d}
#serveDialog h2{margin-bottom:16px}
#serveDialog button{width:100%;text-align:left;margin:3px 0;padding:9px 12px}
#serveDialog small{display:block;color:#bab9cd}
#serveDialog [aria-pressed=true]{border-color:#bba1e5;background:#362e49}
#serveDialog [aria-pressed=true] strong::after{content:' ✓'}
#hint:empty{display:none}
.shots #dink.contact{background:#b4ffda;box-shadow:inset 0 0 0 2px #e8fff2}

/* The viewport is the play surface, with a control strip under the court. */
main.wrap {width:100%;max-width:none;margin:0;min-height:100svh;display:flex;flex-direction:column}
#play {display:flex;flex:1;flex-direction:column}
#stats,#scores {width:min(96%,760px);margin:auto}
.cab {padding-top:max(8px,env(safe-area-inset-top))}
#play .intro {padding-top:env(safe-area-inset-top)}
#play .intro {margin:8px 0 12px}
#play .intro .tag,#play .intro p,.console .cap {display:none}
#play .intro h1 {font-size:clamp(20px,4.4vw,34px);text-align:center}
#play .grid {flex:1;display:flex;flex-direction:column;gap:0;margin:0;border:0;border-radius:0}
#play .machine {flex:1;border-radius:0}
#play .console {border:0;border-radius:0}
#play .screen {flex:1;min-height:140px;aspect-ratio:auto;height:auto}
#play .console .pad {width:min(100%,760px);margin:auto}
.cab,.courtfoot {padding-inline:max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right))}
#play .intro p,.console .tip {display:none}
.machine,.console {border:0;border-radius:0}
.machine .screen,.live .machine .screen {flex:none;width:100%;height:auto;min-height:0;aspect-ratio:20/11}
.console {border-top:1px solid #444057;background:#201f34}
.console .pad {padding:12px clamp(12px,3vw,24px)}
.shots,.live .shots {grid-auto-rows:clamp(62px,10svh,88px)}
.courtfoot {min-height:36px}
footer {justify-content:center;border:0;margin:0;padding-top:5px}
#openMenu {min-height:44px;font:14px Pixel,monospace;background:none;border-color:transparent;color:#cfbedf}
#menuDialog nav {display:grid;gap:6px;margin:12px 0}
#menuDialog a,#menuDialog button,#deleteDialog button {display:block;width:100%;padding:11px 14px;min-height:44px;border:1px solid #48465e;border-radius:7px;background:#29293e;color:#eeeaf7;font:600 15px system-ui;text-align:left;text-decoration:none;margin:4px 0}
#menuDialog a[aria-current=page]{border-color:#9b8bab}
#deleteDialog p {margin:12px 0}
#deleteDialog #confirmDelete{color:#ffd5d4;border-color:#98656e}
@media (max-width:550px) and (orientation:portrait){
  .machine .screen,.live .machine .screen {aspect-ratio:1.55}
}
@media (orientation:landscape) and (max-height:730px){

  #play .intro,.console .tip {display:none}
  .cab,.courtfoot {padding:5px 10px;min-height:24px}
  .console .pad {padding:6px 10px}
  .shots,.live .shots {grid-auto-rows:54px}
  .shots .stroke {gap:0}.stroke img {width:26px;height:26px}
}

/* The scoreboard and thumb controls sit on the same scene as the court. */
#play {position:relative;height:100dvh;min-height:260px;overflow:hidden}
#play .grid,#play .machine,#play .screen {position:absolute;inset:0;width:100%;height:100%;margin:0;min-height:0}
main:has(#play:not([hidden])) footer {display:none}
#play .hud {box-sizing:border-box;display:block;top:max(8px,env(safe-area-inset-top));width:min(92%,400px);padding:0 10px 5px;border:2px solid #72738e;border-radius:7px;background:#15192fea;box-shadow:inset 0 2px #aaa8c0,0 3px 0 #343047;pointer-events:auto}
.scoreTitle {display:flex;align-items:center;justify-content:space-between;gap:6px;background:transparent;border:0}
.scoreTitle h1 {margin:0;color:#fff0d7;text-shadow:2px 2px #65466a;letter-spacing:-.05em;font:clamp(13px,3.7vw,19px) Pixel,monospace}
.scoreTitle i {font-style:normal;color:#75e1d2;padding:0 6px}
.scoreTitle #openMenu {padding:0;width:44px;height:44px;font:21px system-ui;color:#d0c6df}
#play .scoreRow {display:grid;grid-template-columns:1fr 1.25fr 1fr;border:0;border-top:2px dotted #655574;padding:4px 0 0}
#play .scoreRow div {padding:0;min-width:0}
#play .scoreRow b {font-size:clamp(16px,4.4vw,22px)}
#play .console {position:absolute;inset:auto 0 max(6px,env(safe-area-inset-bottom));background:transparent;border:0;pointer-events:none}
#play .console .pad {padding:4px max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));pointer-events:auto}
#play .courtfoot {position:absolute;bottom:calc(max(6px,env(safe-area-inset-bottom)) + clamp(54px,9dvh,84px) + 10px);left:50%;transform:translateX(-50%);width:max-content;max-width:96%;justify-content:center;border-radius:5px;background:#111a2ee0;padding:4px 10px;min-height:22px}
#play .courtfoot:empty {display:none}
#play .shots {grid-auto-rows:clamp(54px,9dvh,84px)}
#play #hint:not(:empty),#play #greeting:not([hidden]) {background:#171b30;color:#fcf3ff;border-radius:4px;padding:4px 8px}
.live #play #hint {display:none}
#play .shots #volley {grid-column:1/-1;background:#fed284;color:#30212c;font:22px Pixel}
#play .shots #volley:disabled {background:#48475a;color:#f6eef9;cursor:default}
#play .shots #volley:disabled kbd {display:none}
#play .shots #volley.contact {background:#b4ffda;box-shadow:inset 0 0 0 2px #e8fff2}
@media(max-height:480px){
 #play .hud{width:min(300px,50%);top:2px}
 .scoreTitle #openMenu{height:32px;min-height:32px}.scoreTitle h1{font-size:13px}
 #play .scoreRow small{display:inline;margin-right:4px}#play .scoreRow b{display:inline;font-size:15px}
 #play .shots{grid-auto-rows:46px}#play .courtfoot{bottom:calc(56px + env(safe-area-inset-bottom))}
}
#play:has(#greeting:not([hidden])) .shots,#play:has(#greeting:not([hidden])) .courtfoot{display:none}
#play #start:not([hidden]){margin-bottom:4px}

.menuHead,.arcHeader,.tableHead,.rankBand{display:flex;align-items:center;justify-content:space-between;gap:10px}
.menuHead,.arcHeader{border:0;background:transparent}
.menuHead h2{margin:0}
#menuDialog #closeMenu,.arcHeader a{flex:0 0 44px;width:44px;height:44px;text-align:center;padding:4px;background:transparent;color:#ddd1ee;border:0;text-decoration:none;font-size:26px}
#menuDialog nav{display:grid;margin:12px 0 0;gap:8px}
#menuDialog nav>*{margin:0}
#menuDialog #resetMine{background:#472931;border-color:#77505d;color:#ffd5d7}
main.wrap .arcPage{box-sizing:border-box;width:min(100%,720px);margin:0 auto;min-height:0;padding: max(14px,env(safe-area-inset-top)) clamp(16px,4vw,32px) 24px}
main:has(.arcPage:not([hidden])){background:radial-gradient(ellipse at 20% 0%,#283552 0,transparent 48%),#101326}
.arcHeader{min-height:50px;border-bottom:2px dotted #5d607e;color:#94e2d3;font:14px Pixel,monospace}
.arcPage h1{font-size:clamp(25px,6vw,40px);margin:22px 0 6px}
.arcPage .tabs{margin:18px 0 12px}
.rankBand{background:#223d45;border-left:3px solid #87e6cb;padding:14px;color:#c3ffeb;font-weight:650}
.tableHead,.subhead{font:14px Pixel,monospace;color:#c6b6de;margin:22px 0 6px}
#board .row,#recent .row{font-variant-numeric:tabular-nums;border-color:#31374c}
#record{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
#record .row{flex-direction:column;gap:3px;background:#20243a;border:0;border-radius:6px}
#record .row span:last-child{font:20px Pixel,monospace;color:#98ebd7}
.guides{padding-left:1.6em}.guides li{padding:10px 0;line-height:1.5;color:#d6d6e7}.guides li::marker{color:#a9e5d8}
#saveNotice:not(:empty){background:#20283c;color:#fff;padding:5px 10px;font-size:13px;border-radius:5px}
#saveNotice:empty{display:none}#moreScores{margin-top:12px}

main:has(.arcPage:not([hidden])){background:linear-gradient(180deg,#10172a66,#101326e8 245px,#101326 430px),var(--winter-scene) center top / 100% auto no-repeat,#101326}
.arcHeader{background:#11182cc9;padding:0 12px;border-radius:6px;color:#baf4e7}
.arcPage h1{text-shadow:2px 3px #483956}

.shotChoice .screen::after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(115deg,transparent 30%,#b9fff31c 50%,transparent 70%);background-size:220% 100%;animation:choice-glint 2.4s ease-in-out infinite;box-shadow:inset 0 0 36px #92f4df38}
@keyframes choice-glint{from{background-position:150% 0}to{background-position:-50% 0}}
@media(prefers-reduced-motion:reduce){.shotChoice .screen::after{animation:none;background:none}}

#crackerIntro{position:absolute;z-index:2;top:clamp(88px,22dvh,200px);left:50%;transform:translateX(-50%);width:max-content;max-width:94%;padding:9px 16px;text-align:center;background:#172739f5;border-block:2px solid #e0be78;box-shadow:0 3px #263049;pointer-events:none}
#crackerIntro small,#crackerIntro strong,#crackerIntro b{display:block;font-family:Pixel,monospace}
#crackerIntro small{color:#a8ecdc;font-size:11px;letter-spacing:.08em}
#crackerIntro strong{color:#fff1cf;font-size:clamp(17px,5vw,25px)}
#crackerIntro span{display:block;color:#e5e8ee;font-size:14px}
#crackerIntro b{color:#ffce85;font-size:11px;margin-top:3px}
@media(max-height:480px){#crackerIntro{top:58px;padding:3px 16px}#crackerIntro strong{font-size:16px}}

#play .shots:is([data-mode="stroke"],[data-mode="kitchen"],[data-mode="dink"]){grid-template-columns:repeat(3,minmax(0,1fr))}
#play .shots :is(.softShot,.attackShot,#lob){min-width:0;padding-inline:3px;font:clamp(15px,4vw,22px) Pixel,monospace;color:#172735}
#play .shots .softShot{background:#91dfc9}#play .shots #lob{background:#bca5e6}#play .shots .attackShot{background:#ffd184}
#play .shots[data-mode="trees"] #lob{grid-column:1/-1}
#shotControls kbd,.serveKeys{display:none}

#play .shots #atp{grid-column:1/-1;background:#fed284;color:#30212c;font:22px Pixel}
#play .shots #atp.contact{background:#b4ffda}
#play .shots[data-mode="pause"]{visibility:hidden}
@media (min-width:800px) and (hover:hover) and (pointer:fine) and (not (any-pointer:coarse)){
  #play .console{bottom:20px}
  #play .console .pad{padding:0 24px;margin-left:auto;margin-right:0;width:max-content;max-width:100%}
  #play .shots{display:flex;align-items:center;gap:10px;padding:10px 13px;min-height:62px;background:#1a1c32;border:2px solid #686980;border-radius:8px;box-shadow:0 3px #33354a}
  #play .console #shotControls button,#play .console #shotControls button.contact{display:inline-flex;align-items:center;gap:9px;min-height:38px;width:auto;flex:none;padding:0 4px;box-shadow:none;background:transparent;color:#f3f0ff;border:0;border-radius:3px;font:650 17px/1.2 system-ui,sans-serif}
  #play #shotControls button:active{transform:none}
  #play #shotControls .stroke img,#play #shotControls .touchPicker,#play #volley:disabled kbd{display:none}
  #shotControls kbd{position:static;display:inline-grid;place-items:center;width:35px;height:34px;margin:0 0 3px;border:0;border-radius:5px;background:#d7baf7;box-shadow:0 3px #87719f;color:#252037;font:bold 24px/1 system-ui,sans-serif}
  #shotControls .softShot kbd{background:#95efd7;box-shadow:0 3px #3f9d90}
  #shotControls :is(#volley,#smash,.attackShot,#atp) kbd{background:#ffcf85;box-shadow:0 3px #a98153}
  #shotControls :is(#volley,.softShot,.attackShot,#lob,#atp).contact kbd{background:#bcffdf;box-shadow:0 3px #509e88}
  #play #shotControls #serveSplit{display:flex;align-items:center;gap:12px;overflow:visible}
  #play #shotControls #servePicker{order:-1;border-right:1px solid #48475a;padding-right:14px;font-weight:450}
  #play #shotControls #servePicker:disabled{display:none}
  #shotControls .serveKeys{display:inline-flex;align-items:center;gap:8px}
  #shotControls #servePicker kbd{background:#42425b;color:#f4efff;box-shadow:0 3px #2d2d41}
  #play #start:not([hidden])::before{content:'↑';margin-right:8px}
}

#play :is(#dodgeLeft,#dodgeRight){background:#ffd184;color:#282239;font:clamp(15px,4vw,20px) Pixel,monospace}
@media (min-width:800px) and (hover:hover) and (pointer:fine) and (not (any-pointer:coarse)){#play #shotControls :is(#dodgeLeft,#dodgeRight){font:650 17px/1.2 system-ui;background:transparent;color:inherit}}
