/* 立體彈珠台: the same palette, type and shapes as the other aioo games. */
:root{--ink:#102f3b;--teal:#078675;--teal-dark:#046355;--paper:#f6f7f1;--yellow:#ffd358;--red:#dd5548;--muted:#4f6767;--line:rgba(16,47,59,.14);--sans:'Noto Sans TC','Microsoft JhengHei','PingFang TC',sans-serif;--mono:'Barlow Condensed',ui-monospace,'SFMono-Regular',Menlo,monospace;--halo:0 0 1px #edf4eb,0 0 2px #edf4eb,0 0 3px #edf4eb,0 0 5px #edf4eb,0 0 8px #edf4ebe6,0 0 13px #edf4ebcc}
*{box-sizing:border-box}
html,body{height:100%;margin:0;overscroll-behavior:none}
[hidden]{display:none!important}
body{background:#d6e7e5;color:var(--ink);font-family:var(--sans);font-size:14px;overflow:hidden;overscroll-behavior:none;-webkit-tap-highlight-color:transparent}
body[data-screen=home]{overflow-x:hidden;overflow-y:auto;height:auto;min-height:100%;overscroll-behavior-y:auto}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none;transition:background .18s,transform .18s,box-shadow .18s}
button,dialog{touch-action:manipulation}
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible+span{outline:3px solid var(--teal);outline-offset:3px}
button:disabled{opacity:.5;cursor:default}
svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
a{color:var(--teal-dark);text-underline-offset:4px}
#world{position:fixed;inset:0;width:100%;height:100%;display:block;z-index:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.world-shade{position:fixed;inset:0;z-index:1;pointer-events:none;background:linear-gradient(90deg,rgba(237,244,235,.97) 0%,rgba(237,244,235,.86) 24%,rgba(237,244,235,.25) 49%,transparent 70%),linear-gradient(0deg,rgba(230,238,225,.5),transparent 28%)}
/* Portrait: the page puts --cta-end under the main buttons and --text-end where the last line of text ends. The pale ground is strong behind the title and the buttons and has cleared by the end of the text, so the scene has everything below it; the lines under the buttons carry a soft halo of their own. The bottom bar has its own ground, as tall as itself. */
@media(orientation:portrait){.world-shade{background:linear-gradient(180deg,rgba(237,244,235,.97) 0,rgba(237,244,235,.95) calc(var(--cta-end,34vh) - 24px),rgba(237,244,235,.7) var(--cta-end,34vh),rgba(237,244,235,0) var(--text-end,42vh))}}
body[data-screen=game] .world-shade{background:linear-gradient(180deg,rgba(234,243,237,.35),transparent 24%),linear-gradient(0deg,rgba(16,47,59,.18),transparent 30%)}

/* Top bar (home only) */
.topbar{position:relative;z-index:5;display:flex;align-items:center;justify-content:space-between;max-width:1660px;margin:0 auto;padding:calc(16px + env(safe-area-inset-top)) max(22px,env(safe-area-inset-right)) 16px max(22px,env(safe-area-inset-left));pointer-events:none}
.topbar>*{pointer-events:auto}
body[data-screen=game] .topbar{display:none}
.brand{display:flex;align-items:center;gap:10px;color:var(--ink);min-height:44px;text-align:left}
.brand-symbol{display:grid;place-items:center;width:40px;height:40px;border-radius:11px;background:var(--teal);color:var(--yellow)}
.brand-symbol svg{width:28px;height:28px;stroke-width:1.7}
.brand-name{font-weight:900;font-size:17px;letter-spacing:-.02em}
.top-actions{display:flex;align-items:center;gap:8px}
.icon-button{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:var(--paper);box-shadow:0 3px 10px #102f3b22}
.icon-button svg{width:22px;height:22px}
.help-icon{font:800 20px/1 var(--mono)}
.sound-off{display:none}
.icon-button[aria-pressed=false] .sound-wave{display:none}
.icon-button[aria-pressed=false] .sound-off{display:block}
.sound-slot{position:relative;display:flex}
.sound-hint{position:absolute;top:calc(100% + 11px);right:-8px;padding:9px 15px;border-radius:12px;background:var(--ink);color:var(--paper);font:700 13px/1.2 var(--sans);white-space:nowrap;box-shadow:0 10px 28px #102f3b38;transform-origin:calc(100% - 26px) 0;animation:sound-hint-in .36s cubic-bezier(.2,1.3,.4,1) .05s both}
.sound-hint:before{content:'';position:absolute;top:-5px;right:21px;width:11px;height:11px;border-radius:2px;background:inherit;transform:rotate(45deg)}
body:not([data-screen=home]) .sound-hint{display:none}
@keyframes sound-hint-in{from{opacity:0;transform:translateY(-6px) scale(.96)}to{opacity:1;transform:none}}

/* Home: the arrangement of the 七秒上路 home screen. The title block, one row of buttons, one line of facts and one
   row of links sit on the scene's pale top (portrait) or left (wide); the machine has the rest to itself. */
.home{position:relative;z-index:4;max-width:1660px;margin:0 auto;padding:0 max(22px,env(safe-area-inset-right)) 0 max(22px,env(safe-area-inset-left));display:flex;flex-direction:column}
body:not([data-screen=home]) .home{display:none}
.hero-copy{position:relative;width:53%;margin-top:clamp(20px,4.2vh,65px)}
.hero-copy h1{margin:18px 0 28px;font:900 clamp(52px,5.5vw,88px)/1.15 var(--sans);letter-spacing:-.035em;color:var(--ink)}
.outlined{color:var(--teal-dark)}
.hero-cta{display:grid;grid-template-columns:1fr 1fr;gap:14px;max-width:440px}
.hero-cta:has(#room-open[hidden]){grid-template-columns:1fr}
/* 排名賽: a row of its own under the two ways to play, the tier at its right end (app.js paints it, dist/ranked.js buttonView). */
.hero-cta .ranked-open{grid-column:1/-1;min-height:50px;padding:6px 16px;border-radius:12px;background:var(--ink);color:#fff;display:flex;align-items:center;justify-content:space-between;gap:12px;font:800 17px/1.2 var(--sans)}
.hero-cta .ranked-open:active{transform:translateY(2px)}
.hero-cta .ranked-open[aria-busy=true]{opacity:.7}
.ranked-open .ro-tier{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:800;color:var(--yellow)}
@media(orientation:portrait) and (max-height:700px){.hero-cta .ranked-open{min-height:44px;font-size:16px;border-radius:10px}}
.primary,.secondary{min-height:50px;padding:12px 22px;border-radius:12px;font-weight:800;font-size:15px;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.primary{background:var(--yellow);color:var(--ink);box-shadow:0 4px 0 #c5a039}
.primary:active{transform:translateY(2px);box-shadow:0 2px 0 #c5a039}
.primary.large,.secondary.large{font-size:18px;min-height:63px;border-radius:12px}
/* The second way to play is the same button in white with a dark border; in a room its text (房間 ABCDE · 3 人) steps down a size and may take two lines. */
.home .secondary.large{background:#fff;color:var(--ink);border:2px solid var(--ink);box-shadow:none;padding:6px 10px;line-height:1.2;text-align:center;text-wrap:balance}
.home .secondary.large:active{transform:translateY(2px);background:#eef3ec}
.home .secondary.large[data-room=in]{font-size:15px}
.home .primary.large{box-shadow:0 4px 12px #86691820}
.home .primary.large:active{transform:translateY(2px);box-shadow:0 1px 6px #86691820}
.secondary{background:#e7efdf;color:var(--teal-dark);box-shadow:0 1px 0 #9ab7a7}
.full{width:100%;display:flex}
.text-button{min-height:44px;padding:8px 12px;font-size:13px;font-weight:700;color:var(--teal-dark);display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none}
.home .text-button{padding:9px 0;font-weight:600;color:var(--ink)}
.centered{display:flex;margin:4px auto 0}
/* Under the main buttons: 自由投 as a text link at the left, the facts at the right (under it when the line is too narrow). Soft halos keep the lines readable over the scene. */
.home-line{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:0 14px;max-width:440px;margin-top:6px}
/* Behind these lines the scene may be dark (the scoreboard, the clerk), so each gets a soft pale cloud of its own: no edge, no box. */
.home-line,.home-stats{position:relative;isolation:isolate}
.home-line::before,.home-stats::before{content:"";position:absolute;z-index:-1;inset:4px -10px;border-radius:14px;background:rgba(237,244,235,.94);filter:blur(6px);pointer-events:none}
.home-stats::before{inset:-3px -12px}
.free-link{display:inline-flex;align-items:center;gap:1px;min-height:44px;padding:0 6px 0 0;font:700 14px/1 var(--sans);color:var(--ink);text-shadow:var(--halo)}
.free-link svg{width:16px;height:16px;stroke-width:2.6;transition:transform .18s}
.free-link:hover svg{transform:translateX(2px)}
.exam-promise{margin:0;font-size:12px;font-weight:600;color:#243f39;text-shadow:var(--halo)}
.home-stats{width:fit-content;max-width:100%;margin:-6px 0 0;padding:0;color:#243f39;text-shadow:var(--halo);font-size:12px;font-weight:600;line-height:1.75;font-variant-numeric:tabular-nums}
.home-stats p{margin:0;display:flex;flex-wrap:wrap;align-items:center}
.live-dot{display:inline-block;width:7px;height:7px;margin:0 8px 1px 2px;border-radius:50%;background:#1f9d63;box-shadow:0 0 0 3px rgba(31,157,99,.18);vertical-align:middle}
.home-stats:not([data-live]) .live-dot{display:none}
#home-plays:not([hidden])+#home-best:not([hidden])::before{content:'·';margin:0 .5em}
.home-stats span[id]:not([hidden])~#home-rank:not([hidden])::before{content:'·';margin:0 .5em}
/* The one to beat: a small card in the empty top right of the home screen, beside the title. It is a button for the leaderboard. */
.home-top{position:absolute;z-index:2;top:2px;right:0;display:flex;flex-direction:column;align-items:flex-start;width:max-content;min-width:112px;max-width:min(166px,46%);padding:7px 11px 8px;border-radius:12px;background:rgba(246,247,241,.94);border:1px solid rgba(16,47,59,.16);box-shadow:0 2px 12px #102f3b1f;color:var(--ink);text-align:left;line-height:1.25}
.home-top[hidden]{display:none}
.home-top:active{background:#e7efdf}
.ht-label{font-size:11px;font-weight:700;color:var(--muted)}
.ht-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px;font-weight:900}
.ht-points{display:flex;align-items:baseline;gap:2px;font:700 12px/1 var(--sans);color:var(--muted);white-space:nowrap}
.ht-points b{font:700 31px/1 var(--mono);font-variant-numeric:tabular-nums;color:var(--ink);letter-spacing:0}
.ht-note{margin-top:3px;font-size:11px;font-weight:700;color:var(--teal-dark);white-space:nowrap}
.ht-empty{font-size:13px;font-weight:700;color:var(--muted);white-space:nowrap}
.home-top[data-you]{background:#fff3c4;border-color:#e4ca79}
/* While the first-visit sound hint hangs under the sound button the card sits lower, beside the second title line, and leaves its note out. */
body:has(#sound-hint:not([hidden])) .home-top{top:33px}
body:has(#sound-hint:not([hidden])) .home-top .ht-note{display:none}
body:has(#sound-hint:not([hidden])) .home-top{padding:4px 11px 5px}
body:has(#sound-hint:not([hidden])) .ht-label{line-height:1}
body:has(#sound-hint:not([hidden])) .ht-points b{font-size:28px}
/* No room beside the title (a short upright phone, or any wide window): the card goes in the flow under the stats line, in one row. */
@media(orientation:landscape),(orientation:portrait) and (max-height:700px){
  .home-top{position:relative;top:auto;right:auto;display:flex;flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:0 8px;margin:8px 0 0;max-width:100%;padding:5px 11px 6px}
  .ht-name{max-width:9em;font-size:14px}
  .ht-points b{font-size:24px}
  body:has(#sound-hint:not([hidden])) .ht-points b{font-size:24px}
  .ht-note{flex-basis:100%;margin-top:1px}
  .ht-empty{padding:2px 0}
  body:has(#sound-hint:not([hidden])) .home-top{top:auto}
  body:has(#sound-hint:not([hidden])) .home-top .ht-note{display:block}
}
@media(orientation:portrait) and (max-height:700px){.home-top{margin-left:auto}}
.challenge-note{margin-top:12px;background:#fff7d8;border:1px solid #e4ca79;padding:7px 10px;max-width:280px;font-size:11px;font-weight:700;line-height:1.7}
/* 友誼球: the inviter's note on the home screen (once) and the friend's line on the result sheet, each with the ball's two halves. */
.friend-ball-note{display:flex;align-items:center;gap:7px;background:#eef6fb;border-color:#a9cde4}
.friend-ball-mark{width:20px;height:20px;flex:none;stroke:#24324a;stroke-width:1.5}
.friend-ball-note .friend-ball-mark{width:17px;height:17px}
.friend-ball-line{display:flex;align-items:center;gap:9px;margin:0 0 8px;background:#eef6fb;border:1px solid #a9cde4;border-radius:10px;padding:8px 12px;font-size:13px;font-weight:700;line-height:1.6;text-wrap:pretty}
/* 排名賽 season: the home note (once) for the week's drop and the kept rounds played against */
.ranked-note{background:#e9f5f1;border-color:#96cdbf;text-wrap:pretty}
/* The bottom bar, fixed to the bottom edge: one row for everything else, and under it the details line and the credit. Its pale ground is only as tall as itself and fades out at the top. */
.home-bottom{position:fixed;z-index:6;left:0;right:0;bottom:0;isolation:isolate;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;padding:12px max(14px,env(safe-area-inset-right)) calc(2px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))}
.home-bottom::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(0deg,rgba(237,244,235,.94),rgba(237,244,235,.9) calc(100% - 16px),rgba(237,244,235,0))}
.home-bar{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));overflow:hidden;border-radius:12px;background:rgba(255,255,255,.78);border:1px solid rgba(16,47,59,.16);box-shadow:0 2px 12px #102f3b14}
.home-bar>*{position:relative;display:flex;align-items:center;justify-content:center;gap:5px;min-height:46px;padding:0 4px;font:700 14px/1.2 var(--sans);color:var(--ink);text-decoration:none;white-space:nowrap}
.home-bar>*+*{border-left:1px solid rgba(16,47,59,.12)}
.home-bar>*:active{background:#e7efdf}
.simulator-intro{grid-column:1;margin:0;padding:0;font-size:12px;color:#243f39}
.simulator-intro summary{cursor:pointer;display:flex;align-items:center;min-height:40px;font-weight:600;color:#243f39}
/* Opened, the paragraph and the rules link float above the bar over the scene; nothing moves. */
.simulator-intro p{position:absolute;left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));bottom:calc(100% + 46px);max-height:max(120px,calc(100svh - var(--text-end,40svh) - 210px));margin:0;overflow-y:auto;font-size:13px;line-height:1.8;background:rgba(246,247,241,.97);padding:10px 14px 4px;border-radius:12px 12px 0 0;box-shadow:0 -6px 22px #102f3b1c}
.simulator-intro a{position:absolute;left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));bottom:calc(100% + 2px);display:flex;align-items:center;min-height:44px;padding:0 14px;font-size:13px;background:rgba(246,247,241,.97);border-radius:0 0 12px 12px;box-shadow:0 6px 22px #102f3b1c}
.home-footer{grid-column:2;display:flex;align-items:center;justify-content:flex-end;font-size:12px;color:#243f39}
.home-footer a{font-size:12px;min-height:40px;display:inline-flex;align-items:center;font-weight:400;color:#243f39}
.news-dot{position:absolute;top:8px;right:-8px;width:7px;height:7px;border-radius:50%;background:#e2483d;box-shadow:0 0 0 2px #e6eee4}
.home-bar .news-dot{position:static;flex:none;margin-top:-12px;margin-left:-2px;box-shadow:none}

/* Stacked layout: a phone held upright, or any window taller than wide. */
@media(orientation:portrait){
  .topbar{padding-bottom:8px}
  .hero-copy{width:100%;margin-top:6px}
  .hero-copy h1{font-size:clamp(38px,10vw,60px);line-height:1.14;letter-spacing:-.025em;margin:6px 0 14px}
  .hero-cta{gap:12px}
  .hero-cta .large{min-height:58px;font-size:17px;border-radius:10px}
}
@media(orientation:portrait) and (max-width:360px){
  .hero-cta{gap:10px}
  .hero-cta .large{font-size:16px}
  .home .secondary.large[data-room=in]{font-size:14px}
  .home-bar>*{font-size:13px}
}
/* A short upright phone: the title goes on one line so the machine keeps its room. */
@media(orientation:portrait) and (max-height:700px){
  .hero-copy h1{font-size:36px;line-height:1.2;margin:4px 0 10px}
  .hero-copy h1 br{display:none}
  .hero-copy h1 .outlined{margin-left:.3em}
  .hero-cta .large{min-height:48px}
  .home-bottom{padding-top:8px}
  .home-bar>*{min-height:44px}
  .simulator-intro summary,.home-footer a{min-height:34px}
  /* the one-line title would run under the first-visit sound hint, so it steps down while the hint shows */
  .hero-copy{transition:margin-top .25s ease-out}
  body:has(#sound-hint:not([hidden])) .hero-copy{margin-top:34px}
}
@media(max-height:730px) and (min-width:761px) and (min-height:561px){
  .hero-copy{margin-top:10px}
  .hero-copy h1{font-size:56px;margin:12px 0 16px}
}


/* Game HUD: only the top of the screen. The whole canvas is the control surface. */
.game{position:fixed;inset:0;z-index:3;pointer-events:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.game button{pointer-events:auto}
.game-toolbar{position:absolute;top:calc(12px + env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));display:flex;align-items:center;gap:10px}
.game-title{flex:1;min-width:0}
.game-title small{display:inline-block;font:700 11px/1.3 var(--sans);letter-spacing:.1em;color:var(--ink);background:#f6f7f1cc;padding:1px 7px;border-radius:5px}
.game-title h2{margin:2px 0 0;font-size:16px;line-height:1.3;font-weight:900;color:var(--ink);text-shadow:0 1px 6px #f6f7f1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.round-button{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:var(--paper);box-shadow:0 3px 10px #102f3b22;flex-shrink:0}
.round-button svg{width:22px;height:22px}
.camera-view{min-width:56px;min-height:44px;border-radius:12px;background:var(--paper);font-size:12px;font-weight:700;padding:8px 10px;box-shadow:0 3px 10px #102f3b22;flex-shrink:0;white-space:nowrap}
.camera-view[aria-pressed=true]{background:var(--yellow)}
.instrument{position:absolute;top:calc(64px + env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));display:flex;align-items:stretch;gap:8px}
.instrument>div{display:flex;align-items:baseline;gap:6px;background:var(--paper);padding:6px 13px;border-radius:12px;box-shadow:0 3px 12px #102f3b1c;min-height:48px}
.instrument strong{font:700 30px/1.1 var(--mono);font-variant-numeric:tabular-nums}
.instrument span,.instrument small{font-size:12px;font-weight:700;color:var(--muted)}
.time-readout{position:relative;flex:1;min-width:0;padding-bottom:10px!important}
.time-readout strong{display:inline-block;min-width:3.4ch}
.points-readout{min-width:84px}
.streak-readout{min-width:76px}
.points-readout strong,.streak-readout strong{display:inline-block;min-width:2ch;text-align:right}
.timer-track{position:absolute!important;left:13px;right:13px;bottom:5px;height:4px;min-height:0!important;padding:0!important;background:#dce4dd!important;border-radius:2px;box-shadow:none!important;display:block!important}
.timer-track i{display:block;width:100%;height:100%;transform-origin:left;transform:scaleX(0);background:var(--teal);border-radius:2px}
.game[data-final=true] .time-readout{background:#fff0e8}
.game[data-final=true] .time-readout strong{color:#a52c27}
.game[data-final=true] .timer-track i{background:var(--red)}
.game[data-final=true] .points-readout{background:var(--yellow)}
.game[data-free=true] .time-readout{padding-bottom:6px!important}
.game[data-free=true] .timer-track{display:none!important}
.game[data-free=true] #time-label,.game[data-free=true] #timer-unit{display:none}
/* 「不計時」 is words, not digits: the mono face has no Chinese glyphs and the browser fell back to a serif. */
.game[data-free=true] #timer{font:800 22px/1.25 var(--sans)}
.task-hint{position:absolute;top:calc(122px + env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));max-width:calc(100vw - 28px);background:var(--paper);padding:7px 12px;border-radius:9px;font-size:12px;font-weight:700;line-height:1.6;box-shadow:0 3px 10px #102f3b18}
.task-hint[data-tone=final]{background:var(--yellow)}
.task-hint[data-tone=over]{background:#e4f4e8;color:var(--teal-dark)}
/* One slot under the HUD: the pop, the clerk's line or the hint, whichever app.js names in data-slot. */
.game:not([data-slot=hint]) .task-hint,.game:not([data-slot=clerk]) .comment,.game:not([data-slot=pop]) .score-pop{display:none}
/* A short upright screen: the clerk's line goes at the bottom right, above the balls, near where he stands. */
@media(orientation:portrait) and (max-height:700px){.game .comment{top:auto;bottom:max(34svh,calc(env(safe-area-inset-bottom) + 176px));left:auto;right:max(14px,env(safe-area-inset-right));max-width:min(190px,56vw)}.game[data-versus=true] .comment{top:auto}}
/* Versus: a row of the other players' scores under the instrument, and everything below it moves down. */
.room-strip{position:absolute;top:calc(122px + env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));justify-content:flex-start}
/* The race line sits in its own row under the strip, so the hint, pop and clerk's line go one row lower while a versus round is on. */
.race-line{position:absolute;z-index:3;top:calc(152px + env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));max-width:calc(100vw - 28px);box-sizing:border-box;padding:2px 10px 3px;border-radius:7px;background:var(--ink);color:#fff;font:700 13px/1.5 var(--sans);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none;opacity:0;transition:opacity .15s ease-out}
.race-line[data-on=true]{opacity:1}
.game:not([data-versus=true]) .race-line{display:none}
.game[data-versus=true] .task-hint{top:calc(186px + env(safe-area-inset-top))}
.game[data-versus=true] .score-pop{top:calc(186px + env(safe-area-inset-top))}
.game[data-versus=true] .comment{top:calc(228px + env(safe-area-inset-top))}
.game[data-versus=true] .photo-thumb{top:calc(186px + env(safe-area-inset-top))}
.comment{position:absolute;top:calc(164px + env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));max-width:min(300px,calc(100vw - 28px));background:#f6f7f1ee;padding:7px 14px 7px 10px;border-radius:10px;box-shadow:0 3px 18px #102f3b1c}
.comment small{display:block;font-size:11px;color:var(--teal-dark);letter-spacing:.1em;font-weight:700}
.comment p{margin:2px 0 0;font-size:13px;line-height:1.6;font-weight:500}
.score-pop{position:absolute;z-index:3;left:max(14px,env(safe-area-inset-left));top:calc(122px + env(safe-area-inset-top));opacity:0;pointer-events:none;padding:4px 12px 5px;border-radius:999px;background:var(--ink);color:var(--yellow);font:800 20px/1.2 var(--mono);letter-spacing:.02em;white-space:nowrap;box-shadow:0 4px 12px #102f3b33}
.score-pop[data-tone=swish]{background:var(--yellow);color:var(--ink)}
.score-pop.show{animation:score-pop .7s ease-out both}
@keyframes score-pop{0%{opacity:0;transform:translateY(12px)}18%{opacity:1}70%{opacity:1}100%{opacity:0;transform:translateY(0)}}
.photo-thumb{position:absolute;top:calc(122px + env(safe-area-inset-top));right:max(14px,env(safe-area-inset-right));width:92px;padding:4px;border-radius:10px;background:var(--paper);box-shadow:0 5px 18px #102f3b30;text-align:center}
.photo-thumb img{display:block;width:100%;height:60px;object-fit:cover;border-radius:7px;background:#d6e5da}
.photo-thumb span{display:block;margin-top:3px;font-size:11px;font-weight:700;color:var(--teal-dark)}

.countdown{position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding-top:44svh;background:#102f3b16;pointer-events:none}
.countdown>span{font:800 clamp(100px,20vw,200px)/1 var(--mono);color:var(--paper);text-shadow:0 5px 0 var(--teal),0 12px 50px #102f3b33;animation:count-in .5s cubic-bezier(.2,1.3,.4,1) both}
@keyframes count-in{from{opacity:0;transform:scale(1.4)}to{opacity:1;transform:none}}
/* 排名賽: the opponent's name over the three, two, one; it stays put while the numbers change. */
.countdown{flex-direction:column}
.countdown-foe{margin:0 16px 14px;max-width:calc(100vw - 32px);box-sizing:border-box;padding:6px 14px;border-radius:8px;background:var(--ink);color:#fff;font:800 17px/1.4 var(--sans);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* The first round on this device: a ring on the nearest ball and a short swipe trail up toward the rim, until the first throw. */
.first-guide{position:absolute;inset:0;pointer-events:none}
.guide-trail{position:absolute;inset:0;overflow:visible}
.guide-trail line{stroke:var(--yellow);stroke-width:7;stroke-linecap:round;stroke-dasharray:1;stroke-dashoffset:1;filter:drop-shadow(0 2px 5px #102f3b66);animation:guide-swipe 1.5s ease-out infinite}
.guide-ring{position:absolute;left:0;top:0;width:10px;height:10px;margin:-5px 0 0 -5px;border-radius:50%;border:4px solid var(--yellow);box-shadow:0 0 0 2px #102f3b55;animation:guide-pulse 1.5s ease-out infinite}
@keyframes guide-swipe{0%{stroke-dashoffset:1;opacity:1}55%{stroke-dashoffset:0;opacity:1}100%{stroke-dashoffset:0;opacity:0}}
@keyframes guide-pulse{0%{opacity:.95;transform:scale(.9)}100%{opacity:0;transform:scale(1.5)}}
@media(prefers-reduced-motion:reduce){.guide-trail line{stroke-dashoffset:0}.guide-ring{opacity:.9}}
.flash{position:fixed;inset:0;background:#fff;opacity:0;pointer-events:none;z-index:70}
.flash.fire{animation:flash .4s ease-out}
@keyframes flash{0%{opacity:.85}100%{opacity:0}}
.toast{position:fixed;bottom:max(20px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:100;background:var(--ink);color:#fff;padding:10px 16px;border-radius:10px;box-shadow:0 5px 22px #102f3b33;font-size:12px;width:max-content;max-width:90vw;white-space:normal;overflow-wrap:anywhere;pointer-events:none}

/* Sheets */
dialog.sheet{border:0;border-radius:20px;background:var(--paper);color:var(--ink);width:min(440px,calc(100vw - 24px));max-height:calc(100svh - 24px);padding:26px;box-shadow:0 24px 100px #102f3b40;overflow:auto;overscroll-behavior:contain}
dialog::backdrop{background:#102f3b70;backdrop-filter:blur(6px)}
.sheet h2{margin:0 0 12px;font-size:28px;line-height:1.3;font-weight:900;letter-spacing:-.03em}
.sheet-intro{margin:0;color:var(--muted);line-height:1.8;font-size:12px}
.close-dialog{position:absolute;top:8px;right:8px;width:44px;height:44px;display:grid;place-items:center;border-radius:50%;background:#ffffffd9;font:400 26px/1 var(--sans);color:var(--ink);z-index:1}
.pause-sheet .primary,.pause-sheet .secondary{margin-bottom:8px}
/* 排名賽: the one line over the pause sheet's buttons */
.pause-sheet .pause-note{margin:0 0 12px;font-size:14px;font-weight:700;line-height:1.6;color:var(--muted)}
dialog.help-sheet h2,dialog.changelog-sheet h2,.records-sheet h2,.board-sheet h2,.room-sheet h2{padding-right:34px}
.help-steps{list-style:none;margin:16px 0;padding:0;counter-reset:step}
.help-steps>li{display:flex;flex-direction:column;border-top:1px solid var(--line);padding:11px 0 11px 38px;position:relative;counter-increment:step}
.help-steps>li::before{content:'0' counter(step);position:absolute;left:0;top:10px;font:600 24px var(--mono);color:var(--teal-dark)}
.help-steps b{font-size:14px}
.help-steps span{font-size:12px;line-height:1.8;color:var(--muted)}
.keyboard-guide{font-size:12px;display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-bottom:12px;line-height:1.9}
.keyboard-guide kbd{font:500 11px var(--mono);padding:3px 5px;background:#e4eadd;border:1px solid #ccd8cb;border-radius:4px}
.changelog-list{list-style:none;margin:16px 0 0;padding:0;display:grid;gap:16px}
.changelog-list>li{padding-top:14px;border-top:1px solid var(--line)}
.changelog-list>li:first-child{padding-top:0;border-top:0}
.changelog-list>li>b{display:block;margin:0 0 6px;font:800 15px/1.3 var(--mono);letter-spacing:.02em}
.changelog-list ul{margin:0;padding-left:1.2em;font-size:13px;line-height:1.75}
.records-list{list-style:none;margin:14px 0 0;padding:0}
.records-list li{display:flex;justify-content:space-between;gap:12px;padding:11px 2px;border-top:1px solid var(--line);font-size:13px}
.records-list li:last-child{border-bottom:1px solid var(--line)}
.records-list b{font:700 18px/1.2 var(--mono)}

/* Result */
dialog.result-sheet{padding:0}
.result-photo{position:relative;height:min(22svh,180px);background:#d6e5da;overflow:hidden}
.result-photo img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.result-photo img:not([src]){visibility:hidden}
.result-reel{position:absolute;left:12px;bottom:12px;z-index:1;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:8px 16px 8px 8px;border-radius:999px;background:rgba(16,47,59,.88);color:var(--paper);font:800 14px/1 var(--sans);box-shadow:0 8px 24px #102f3b47}
.result-reel svg{flex:none;width:28px;height:28px;padding:6px 5px 6px 7px;border-radius:50%;background:var(--yellow);fill:var(--ink);stroke:none}
.result-body{padding:14px 22px 20px}
.result-sheet h2{margin:0 0 6px;font-size:24px}
.result-badges{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 6px;padding:0;list-style:none}
.result-badges li{display:inline-flex;align-items:center;gap:6px;background:var(--yellow);color:var(--ink);border-radius:999px;padding:4px 12px 4px 6px;font-size:12px;font-weight:800;line-height:1.3}
.result-badges li::before{content:'';width:17px;height:17px;border-radius:50%;background:var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd358' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center/11px no-repeat}
.result-detail{margin:0 0 10px;font-size:13px;line-height:1.7;color:#37564e}
.result-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px}
.result-stats:has(> div[hidden]){grid-template-columns:1fr}
.result-stats>div{background:#fff;border-radius:12px;padding:7px 12px;box-shadow:0 1px 0 var(--line)}
.result-stats span{display:block;font-size:11px;color:var(--muted)}
.result-stats strong{font:700 34px/1.15 var(--mono)}
.result-coach{border-block:1px solid #b9cec4;padding:8px 0;margin:8px 0;line-height:1.7}
.result-coach b{font-size:13px;color:var(--teal-dark)}
.result-coach p{margin:2px 0 0;font-size:13px;line-height:1.7;color:#37564e}
/* 排名賽: who won, both scores, and the stars (their line keeps its room until the server's answer comes) */
.ranked-result{margin:0 0 8px;padding:8px 12px;border-radius:10px;background:var(--ink);color:#fff;line-height:1.5}
.ranked-result p{margin:0}
.ranked-result .rk-head{font-size:17px;font-weight:900;overflow-wrap:anywhere}
.ranked-result .rk-score{font-size:13px;font-weight:700}
.ranked-result .rk-stars{min-height:1.5em;font-size:13px;font-weight:800;color:var(--yellow)}
.ranked-result .rk-ball{font-size:13px;font-weight:700;color:#fff;text-wrap:pretty}
.friend-comparison{margin:0 0 8px;background:#fff7d8;border:1px solid #e4ca79;border-radius:10px;padding:8px 12px;font-size:13px;font-weight:700;line-height:1.6}
.result-list-head{display:flex;align-items:center;justify-content:space-between;margin-top:8px}
.result-list-title{margin:0;font-size:12px;font-weight:700;color:var(--muted)}
.result-list-head .text-button{min-height:40px;padding:6px 0 6px 12px;font-size:12px}
.result-shots{list-style:none;margin:0 0 4px;padding:0;font-size:12px}
.result-shots:not([data-open]) li:nth-child(n+4){display:none}
.result-shots li{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border-bottom:1px solid var(--line);line-height:1.5}
.result-shots span{color:var(--muted);font-variant-numeric:tabular-nums}
.result-tools{display:flex;flex-direction:column;margin:6px 0 0}
.result-tools>.text-button{width:100%;min-height:40px;padding:6px 2px;justify-content:flex-start;border-top:1px solid var(--line)}
.board-block{display:grid;gap:10px;margin:8px 0;padding:12px;background:#fff;border-radius:12px;box-shadow:0 1px 0 var(--line);min-width:0}
.board-block-title{margin:0;font-size:12px;font-weight:700;color:var(--muted)}
.board-block .submit-status{margin:0;color:var(--ink);font-size:13px;font-weight:700;line-height:1.7}
.board-block-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;margin:-6px 0}
.board-block-head .text-button{min-height:44px;padding:6px 0 6px 12px;font-size:12px}
.board-block>.secondary{width:100%;min-height:48px}
.result-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:2px 0 4px}
.result-actions:has(#share-open[hidden]){grid-template-columns:1fr}
.result-actions:has(#result-back:not([hidden])){grid-template-columns:1fr 1fr}
/* The leading button (and one left alone on its row) takes the whole row; app.js says which (result-ui.js actionsLayout). */
.result-actions>button{min-width:0;padding-inline:10px}
.result-actions>[data-wide]{grid-column:1/-1}
.result-actions>.primary[data-wide]{min-height:54px;font-size:16px}
/* A brag in a narrow share button: its line small over 分享, on the challenge note's yellow paper. */
.result-actions .ra-stack{display:grid;justify-items:center;gap:1px;line-height:1.2;min-width:0;max-width:100%}
.result-actions .ra-line{font-size:12px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
#share-open.secondary[data-brag]{background:#fff7d8;color:var(--ink);box-shadow:inset 0 0 0 1.5px #e4ca79,0 1px 0 #c5a039;padding-block:6px}
.friend-status{margin:2px 0 6px;font-size:13px;font-weight:700;line-height:1.6;color:var(--teal-dark);text-align:center}
.friend-text{display:block;width:100%;margin:0 0 8px;padding:8px 10px;border:1px solid #b9cec4;border-radius:10px;background:#fff;color:var(--ink);font:500 16px/1.5 var(--sans);resize:none}

/* Share, board */
dialog.share-sheet{width:min(440px,calc(100vw - 28px));padding:24px;text-align:center}
.share-sheet h2{font-size:21px;margin:0;padding:0 40px}
#share-preview{display:block;width:auto;max-width:100%;max-height:49svh;margin:10px auto 0;border-radius:6px;box-shadow:0 7px 24px #102f3b26;background:var(--ink)}
#share-preview:not([src]){visibility:hidden;width:min(100%,30svh);aspect-ratio:4/5}
.share-video-box{position:relative;width:min(100%,calc(49svh * 9 / 16));margin:10px auto 0}
#share-video{display:block;width:100%;height:auto;aspect-ratio:9/16;border-radius:12px;background:var(--ink);object-fit:contain;cursor:pointer}
.video-sound{position:absolute;right:10px;bottom:10px;display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:8px 14px 8px 10px;border-radius:999px;background:rgba(16,47,59,.88);color:var(--paper);font:800 14px/1 var(--sans);box-shadow:0 6px 18px #102f3b47}
.video-sound svg{flex:none;width:24px;height:24px;fill:currentColor;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.video-sound svg path:first-child{stroke:none}
.video-sound svg .wave,.video-sound svg .slash{fill:none}
.video-sound[aria-pressed="false"] .wave,.video-sound[aria-pressed="true"] .slash{display:none}
.video-sound[aria-pressed="false"]{left:50%;right:auto;transform:translateX(-50%);background:var(--yellow);color:var(--ink);font-size:16px;padding:8px 18px 8px 12px}
.share-image-status{font-size:12px;line-height:1.6;color:var(--muted);margin:8px 0 0}
.share-image-status:empty{margin:0}
.share-clip-info{margin:8px 0 0;padding:8px 10px;border-radius:8px;background:#fff;color:var(--ink);font:11px/1.5 var(--mono);white-space:pre-wrap;word-break:break-all;user-select:text;-webkit-user-select:text}
.share-clip-info[hidden]{display:none}
.share-progress{display:block;width:100%;height:6px;margin:10px 0 0;border:0;border-radius:3px;background:#dfe7e1;overflow:hidden;-webkit-appearance:none;appearance:none}
.share-progress::-webkit-progress-bar{background:#dfe7e1;border-radius:3px}
.share-progress::-webkit-progress-value{background:var(--teal-dark);border-radius:3px}
.share-progress::-moz-progress-bar{background:var(--teal-dark);border-radius:3px}
.format-picker{padding:0;border:0;margin:12px 0;display:flex;gap:6px;justify-content:center;flex-wrap:wrap}
.format-picker legend{font-size:11px;color:var(--muted);margin:0 auto 6px}
/* Three formats in one row: a segmented control. */
.format-picker.segmented{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin:12px 0 0;border:1px solid #b1c3b8;border-radius:10px;overflow:hidden}
.format-picker.segmented:has(#share-video-option[hidden]){grid-template-columns:repeat(2,minmax(0,1fr))}
.format-picker.segmented legend{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.format-picker.segmented label{position:relative;display:grid;place-items:center;min-height:44px;padding:0;border:0;border-radius:0;font-size:14px;font-weight:700}
.format-picker.segmented label+label{border-left:1px solid #b1c3b8}
.format-picker.segmented input{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer}
.format-picker.segmented label:has(input:focus-visible){outline:3px solid var(--teal);outline-offset:-3px}
.format-picker.segmented label:has(input:checked){background:var(--teal-dark);color:var(--paper)}
.format-picker label{display:flex;gap:7px;align-items:center;min-height:42px;padding:8px 9px;border:1px solid #b1c3b8;border-radius:8px;font-size:12px;cursor:pointer}
.format-picker label:has(input:checked){background:#e1eee6;border-color:var(--teal-dark);color:var(--teal-dark);font-weight:700}
.format-picker input{accent-color:var(--teal-dark);margin:0}
.caption-label{display:block;font-size:12px;font-weight:700;text-align:left;margin:4px 0 6px}
#share-caption{display:block;width:100%;font:500 16px/1.5 var(--sans);color:var(--ink);background:#fff;border:1px solid #a4b9ac;border-radius:8px;padding:9px 12px;min-height:46px}
#challenge-url{display:block;width:100%;margin-top:6px;padding:10px;border:1px solid #a9bbb1;border-radius:8px;background:#fff;color:var(--ink);font:400 16px/1.6 var(--sans);resize:vertical}
.share-actions,.license-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:12px}
.share-actions button,.license-actions button{min-height:48px;padding:10px;font-size:13px;white-space:nowrap}
.board-tabs{display:flex;gap:6px;margin:6px 0 10px;flex-wrap:wrap}
.board-tabs button{min-height:40px;padding:6px 14px;border-radius:999px;background:#e7efdf;color:var(--teal-dark);font-size:12px;font-weight:700}
.board-tabs [aria-selected=true]{background:var(--ink);color:var(--paper)}
.board-list{list-style:none;margin:0 0 10px;padding:0;font-size:13px;max-height:40svh;overflow-y:auto}
.board-list li{display:flex;justify-content:space-between;gap:12px;padding:8px 2px;border-top:1px solid var(--line)}

/* While the scripts come, the home screen is already there (its markup needs none of them): the loading mark sits where
   the machine will stand and lets taps through. A failure, and a landscape screen, get the full cover. */
.loading{position:fixed;left:0;right:0;top:calc(50% + 24px);z-index:30;display:grid;justify-items:center;gap:10px;text-align:center;transition:opacity .3s;pointer-events:none}
.loading.failed{inset:0;place-content:center;background:#d6e7e5;pointer-events:auto}
@media (orientation:landscape){.loading{inset:0;place-content:center;background:#d6e7e5;pointer-events:auto}}
.loading.done{opacity:0;pointer-events:none}
.home button[aria-busy=true],.home-bar button[aria-busy=true]{opacity:.55}
.loading-symbol{display:grid;place-items:center;width:84px;height:84px;border-radius:24px;background:var(--teal);color:var(--yellow)}
.loading-symbol svg{width:58px;height:58px;stroke-width:4}
.loading p{margin:0;font-size:12px;color:var(--muted)}
.loading>span{display:block;width:120px;height:4px;border-radius:2px;background:#bfd3cf;overflow:hidden;position:relative}
.loading>span::after{content:'';position:absolute;inset:0;width:40%;background:var(--teal);border-radius:2px;animation:load-bar 1.1s ease-in-out infinite}
@keyframes load-bar{from{transform:translateX(-100%)}to{transform:translateX(300%)}}
.loading.failed>span{display:none}
.loading-error{max-width:300px;line-height:1.8;color:#8c2920!important;font-weight:700;padding:6px 12px;border-radius:10px;background:rgba(246,247,241,.94)}
.loading-detail{max-width:300px;margin:0;font-size:11px;line-height:1.6;color:var(--muted);overflow-wrap:anywhere}
.unsupported{position:relative;z-index:40;background:var(--paper);padding:24px;margin:0}

/* Replay panel and instant replay (filled in by the replay task) */
.replay-panel{position:fixed;z-index:30;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(720px,calc(100vw - 24px));background:var(--paper);border:1px solid #fff;border-radius:16px;padding:15px 18px;box-shadow:0 5px 18px #102f3b25}
.replay-heading{display:flex;justify-content:space-between;align-items:center;gap:10px}
.replay-heading h2{font-size:17px;line-height:1.4;margin:0;white-space:nowrap}
.replay-heading>.secondary{min-height:40px;font-size:12px;padding:8px 12px;flex-shrink:0}
.replay-time{display:flex;justify-content:space-between;gap:15px;font-size:12px;margin-top:10px}
.replay-time output{font-variant-numeric:tabular-nums;color:var(--teal-dark);font-weight:700}
#replay-scrub{width:100%;accent-color:var(--teal-dark);height:32px;margin:4px 0 8px;cursor:pointer;touch-action:pan-y}
.replay-actions{display:grid;grid-template-columns:1fr 64px 76px 1.7fr;gap:8px}
.replay-actions button{font-size:13px;min-height:44px;padding:8px 12px;white-space:nowrap}
.replay-actions [aria-pressed=true]{background:#e1eee6;color:var(--teal-dark)}
.instant-replay{position:fixed;inset:0;z-index:40;cursor:pointer;user-select:none;-webkit-user-select:none;touch-action:manipulation;background:linear-gradient(180deg,rgba(16,47,59,.5),transparent 20%,transparent 74%,rgba(16,47,59,.55))}
.instant-replay::after{content:'';position:absolute;inset:0;background:#fff;opacity:0;pointer-events:none}
.instant-replay.cut::after{animation:instant-cut .24s ease-out}
.instant-top{position:absolute;top:max(16px,env(safe-area-inset-top));left:max(16px,env(safe-area-inset-left));right:max(120px,calc(env(safe-area-inset-right) + 108px));display:flex;flex-direction:column;align-items:flex-start;gap:12px}
.instant-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.instant-caption{margin:0;max-width:100%;text-wrap:balance;color:var(--paper);font:900 clamp(30px,7.4vw,56px)/1.18 var(--sans);text-shadow:3px 0 0 var(--ink),-3px 0 0 var(--ink),0 3px 0 var(--ink),0 -3px 0 var(--ink),0 8px 22px rgba(16,47,59,.45)}
.instant-caption:empty{display:none}
.instant-tag{display:inline-flex;align-items:center;gap:7px;background:var(--red);color:#fff;font:800 14px/1 var(--mono);letter-spacing:.16em;padding:6px 9px 5px;border-radius:5px}
.instant-tag::before{content:'';width:7px;height:7px;border-radius:50%;background:#fff;animation:instant-blink 1s steps(2,start) infinite}
.instant-cam{color:var(--paper);font:800 14px/1.3 var(--sans);letter-spacing:.06em;text-shadow:0 1px 6px rgba(16,47,59,.75)}
.instant-slow{background:var(--yellow);color:var(--ink);font:800 12px/1 var(--sans);padding:6px 9px;border-radius:5px}
.instant-skip{position:absolute;top:max(12px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));min-height:44px;padding:8px 18px;border-radius:999px;background:rgba(16,47,59,.72);color:var(--paper);font:800 14px/1 var(--sans);border:1px solid rgba(246,247,241,.35);backdrop-filter:blur(6px)}
.instant-stamp{position:absolute;left:50%;top:64%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;gap:14px;width:max-content;max-width:calc(100vw - 32px);pointer-events:none}
.instant-stamp strong{display:block;padding:8px 26px 10px;border:6px solid var(--red);border-radius:14px;background:rgba(246,247,241,.94);color:var(--red);font:900 clamp(44px,10vw,80px)/1.1 var(--sans);letter-spacing:.04em;transform:rotate(-6deg);animation:instant-stamp .34s cubic-bezier(.2,1.5,.4,1) both}
.instant-stamp span{max-width:min(100%,520px);background:rgba(16,47,59,.88);color:var(--paper);font:800 clamp(15px,3.6vw,20px)/1.4 var(--sans);padding:8px 18px;border-radius:999px;text-align:center}
.instant-stamp span:empty{display:none}
.instant-progress{position:absolute;left:0;right:0;bottom:0;height:4px;background:rgba(246,247,241,.22)}
.instant-progress i{display:block;height:100%;background:var(--yellow);transform-origin:left;transform:scaleX(0)}
@keyframes instant-cut{from{opacity:.7}to{opacity:0}}
@keyframes instant-stamp{from{opacity:0;transform:rotate(-6deg) scale(1.9)}to{opacity:1;transform:rotate(-6deg) scale(1)}}
@keyframes instant-blink{to{visibility:hidden}}
body[data-screen=instant] :is(.topbar,.world-shade){display:none}
body[data-mode=replay] .game-toolbar{display:none}

/* Each fact of the stats line moves as one piece (the line is a flex row that wraps between facts). */
.home-stats span[id]{white-space:nowrap}
@media(max-width:360px){.instrument strong{font-size:26px}.points-readout{min-width:72px}.streak-readout{min-width:66px}}

/* Wide screens: the bottom bar sits under the text column only, left of the machine; its ground fades out toward the scene, and the opened details paragraph goes to the right of it, over the scene. */
@media(orientation:landscape){
  .home-bottom{right:auto;width:min(54vw,580px);padding:12px 22px calc(4px + env(safe-area-inset-bottom)) max(22px,env(safe-area-inset-left))}
  .home-bottom::before{-webkit-mask-image:linear-gradient(90deg,#000 94%,transparent);mask-image:linear-gradient(90deg,#000 94%,transparent)}
  .simulator-intro p,.simulator-intro a{left:calc(100% - 20px);right:auto;width:min(380px,32vw)}
  .simulator-intro p{bottom:48px;max-height:calc(100svh - 120px)}
  .simulator-intro a{bottom:4px}
}

/* Landscape phones: a slimmer HUD along the top, sheets in two columns. */
@media(max-height:560px) and (orientation:landscape){
  .hero-copy{width:46%;margin-top:0}
  .hero-copy h1{font-size:32px;line-height:1.2;margin:8px 0 14px}
  .hero-copy h1 br{display:none}
  .hero-copy h1 .outlined{margin-left:.3em}
  .hero-cta .large{min-height:48px;font-size:16px}
  .hero-cta{max-width:340px}
  .topbar{padding-top:calc(8px + env(safe-area-inset-top));padding-bottom:4px}
  .home-bottom{padding-top:10px}
  .home-bar>*{min-height:44px}
  .simulator-intro summary,.home-footer a{min-height:34px}
  .game-toolbar{right:auto;left:max(12px,env(safe-area-inset-left));width:300px;gap:6px;top:8px}
  .game-toolbar .round-button{width:40px;height:40px}
  .camera-view{min-height:40px;min-width:48px;padding:6px 8px}
  .game-title small{display:none}
  .game-title h2{font-size:14px}
  .instrument{top:8px;left:auto;right:max(12px,env(safe-area-inset-right));gap:6px;width:min(400px,calc(100vw - 330px))}
  .instrument>div{min-height:40px;padding:4px 10px}
  .instrument strong{font-size:24px}
  .points-readout,.streak-readout{min-width:60px}
  .task-hint{top:56px;left:12px;max-width:min(300px,34vw);font-size:11px;padding:5px 9px}
  .comment{top:94px;left:12px;max-width:min(260px,32vw);padding:5px 10px 5px 8px}
  .comment p{font-size:12px;line-height:1.5}
  .score-pop{top:12px;left:auto;right:calc(max(12px,env(safe-area-inset-right)) + min(400px,calc(100vw - 330px)) + 10px);font-size:18px}
  .photo-thumb{top:60px;right:12px;width:84px}
  .photo-thumb img{height:52px}
  .room-strip{top:56px;left:auto;right:max(12px,env(safe-area-inset-right));max-width:min(420px,50vw);justify-content:flex-end}
  .game[data-versus=true] .task-hint{top:56px}
  .game[data-versus=true] .score-pop{top:12px}
  .game[data-versus=true] .comment{top:94px}
  .game[data-versus=true] .photo-thumb{top:118px}
  .race-line{top:86px;left:auto;right:max(12px,env(safe-area-inset-right));max-width:min(420px,50vw);font-size:12px}
  dialog.result-sheet[open]{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);width:min(720px,calc(100vw - 24px));overflow:hidden}
  .result-photo{height:calc(100svh - 24px);max-height:none}
  .result-body{padding:12px 20px;max-height:calc(100svh - 24px);overflow-y:auto}
  .result-sheet h2{font-size:19px;margin-bottom:4px}
  .result-detail{margin-bottom:6px}
  .result-stats>div{padding:3px 10px}
  .result-stats strong{font-size:22px}
  .result-coach{margin:4px 0;padding:4px 0}
  .primary{min-height:46px}
  dialog.help-sheet,dialog.changelog-sheet,dialog.share-sheet{padding:16px 20px}
  .help-steps{margin:8px 0}.help-steps>li{padding-top:6px;padding-bottom:6px}
  dialog.share-sheet{width:min(560px,calc(100vw - 28px))}
  dialog.share-sheet[open]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:18px;align-content:start;width:min(760px,calc(100vw - 28px))}
  .share-sheet>h2{grid-column:1/-1}
  .share-sheet>:not(h2):not(#share-preview):not(#share-video):not(.close-dialog){grid-column:1}
  .share-sheet>#share-preview,.share-sheet>#share-video{grid-column:2;grid-row:2/9;align-self:start;margin-top:0}
  #share-preview{max-height:calc(100svh - 110px)}
  #share-video{max-height:calc(100svh - 110px)}
  .replay-panel{width:min(620px,calc(100vw - 24px));bottom:8px;padding:8px 14px}
  #replay-scrub{height:24px;margin:1px 0 3px}
  .replay-actions button{min-height:40px;padding:6px 10px}
  .instant-stamp{top:68%;gap:8px}
  .instant-stamp strong{font-size:clamp(34px,10vh,56px);padding:4px 20px 6px}
}

/* A miss's tag: the same slot as the score pop, quieter. */
.score-pop[data-tone=miss]{background:var(--paper);color:var(--muted);font-size:15px;padding:3px 11px 4px;box-shadow:0 2px 8px #102f3b1f}
/* A ball into the player: a ball-shaped smudge on the glass, and the HUD shaking for 300 ms. */
.hit-smudge{position:fixed;z-index:60;left:50%;top:62%;width:min(86vw,70vh);aspect-ratio:1;margin:calc(min(86vw,70vh) / -2) 0 0 calc(min(86vw,70vh) / -2);border-radius:50%;pointer-events:none;opacity:0;
  background:radial-gradient(circle at 42% 38%,rgba(226,121,43,.62) 0 52%,rgba(150,66,20,.5) 64%,rgba(100,40,12,.28) 72%,rgba(100,40,12,0) 74%);
  box-shadow:inset 0 0 0 5px rgba(90,36,10,.18)}
.hit-smudge::before,.hit-smudge::after{content:'';position:absolute;border:5px solid rgba(70,28,8,.3);border-radius:50%}
.hit-smudge::before{left:-34%;top:12%;width:70%;height:76%;clip-path:inset(0 0 0 52%)}
.hit-smudge::after{right:-34%;top:12%;width:70%;height:76%;clip-path:inset(0 52% 0 0)}
.hit-smudge.show{opacity:1;animation:hit-smudge 1.2s ease-out both}
@keyframes hit-smudge{0%{opacity:0;transform:scale(1.5)}10%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.96)}}
.game.shake{animation:hud-shake .3s linear both}
@keyframes hud-shake{0%{transform:translate(0,0)}15%{transform:translate(-7px,4px)}30%{transform:translate(6px,-3px)}50%{transform:translate(-4px,3px)}70%{transform:translate(3px,-2px)}100%{transform:translate(0,0)}}
/* The stamp word on a round that scored nothing. */
.result-stamp{display:inline-block;margin:0 0 8px;padding:2px 14px 4px;border:4px solid var(--red);border-radius:10px;color:var(--red);font:900 26px/1.2 var(--sans);letter-spacing:.06em;transform:rotate(-4deg)}
.result-stamp[hidden]{display:none}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}.score-pop.show{opacity:1}.flash.fire{opacity:0}.hit-smudge.show{opacity:.85}}

/* ===== tickets and the prize cabinet (兌獎櫃): prize-ui.js. Appended as one block; nothing above is touched. ===== */
.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.ticket-mark{width:1.2em;height:1.2em;flex:none;fill:var(--yellow);stroke:var(--ink);stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round}
/* The home pill: after the free-play link and the facts line, the same cloud behind it. */
.prize-pill{position:relative;display:inline-flex;align-items:center;gap:7px;min-height:34px;margin:2px 0 6px;padding:0 14px 0 10px;border-radius:999px;background:var(--paper);border:1.5px solid var(--ink);color:var(--ink);font:800 13px/1 var(--sans);box-shadow:0 2px 8px #102f3b1f}
.prize-pill::after{content:"";position:absolute;inset:-5px -4px}
.prize-pill:active{transform:translateY(1px);background:#e7efdf}
.prize-pill[hidden]{display:none}
.prize-pill .ticket-mark{width:20px;height:20px}
.result-detail{text-wrap:pretty;word-break:keep-all}
.ticket-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;column-gap:10px;min-width:0;margin:0 0 8px;padding:6px 12px;background:#fff6d2;border-radius:12px;box-shadow:0 1px 0 var(--line)}
.ticket-row[hidden]{display:none}
.ticket-row .ticket-mark{grid-row:1;width:30px;height:30px}
.ticket-gain{grid-row:1;grid-column:2;display:flex;align-items:baseline;gap:4px;min-width:0;margin:0}
.ticket-num{font:700 34px/1.15 var(--mono);font-variant-numeric:tabular-nums;color:var(--ink)}
.ticket-unit{font:800 15px/1 var(--sans);color:var(--ink)}
.ticket-row[data-zero=true]{background:#fff}
.ticket-row[data-zero=true] .ticket-mark{width:22px;height:22px}
.ticket-row[data-zero=true] .ticket-num{font:700 14px/1.5 var(--sans)}
.ticket-row-text{grid-row:1;grid-column:3;margin:0;font-size:13px;font-weight:700;line-height:1.5;color:var(--ink);text-align:right;white-space:nowrap}
.ticket-row-text[hidden],.ticket-note[hidden]{display:none}
.ticket-note{grid-row:2;grid-column:1 / 3;margin:0 0 4px;font-size:12px;line-height:1.5;color:#37564e;text-wrap:pretty}
.ticket-row.reveal{animation:ticket-in .4s cubic-bezier(.2,1.2,.4,1) both}
.ticket-row.reveal .ticket-mark{animation:ticket-mark-pop .55s cubic-bezier(.2,1.5,.4,1) both}
@keyframes ticket-in{from{opacity:0;transform:translateY(8px) scale(.97)}to{opacity:1;transform:none}}
@keyframes ticket-mark-pop{0%{transform:scale(.5) rotate(-16deg)}60%{transform:scale(1.18) rotate(4deg)}100%{transform:none}}
.result-body .prize-link{grid-row:2;grid-column:3;justify-self:end;min-height:44px;margin:-10px 0 -10px;padding:6px 0 6px 8px;font-size:12px;white-space:nowrap}
.result-body .prize-link[hidden]{display:none}
/* player levels: the home chip, the XP row of a solo result, the level block of 個人紀錄 (level-ui.js) */
/* In the top bar, before the sound button: the player's level (a button for 個人紀錄) and the tickets (a button for the 兌獎櫃),
   drawn like the round buttons beside them. On a phone the brand's name gives its room to them; the big title is right under it. */
.top-actions .level-chip{min-height:40px;margin:0;padding:0 13px;border:0;background:var(--paper);box-shadow:0 3px 10px #102f3b22;cursor:pointer}
.top-actions .level-chip:active,.top-actions .prize-pill:active{transform:translateY(1px);background:#e7efdf}
.top-actions .prize-pill{min-height:40px;margin:0;padding:0 13px 0 10px;gap:6px;border:0;box-shadow:0 3px 10px #102f3b22}
.top-actions .prize-pill::after{content:none}
@media(max-width:429px){.brand-name{display:none}}
/* The day's facts sit at the right end of the line with 自由投 (under it when the line is too narrow). */
.home-line .home-stats{margin:0}
.home-line .home-stats p{justify-content:flex-end}
.level-chip{display:inline-flex;flex-direction:column;justify-content:center;gap:4px;box-sizing:border-box;min-height:34px;margin:2px 0 6px;padding:0 12px;border-radius:999px;background:rgba(246,247,241,.86);border:1.5px solid var(--line);color:var(--ink);font:800 13px/1 var(--sans);flex:none}
.level-chip[data-compact=true]{padding:0 10px}
.lc-name{white-space:nowrap}
.lc-bar{display:block;width:100%;min-width:44px;height:4px;border-radius:2px;background:rgba(16,47,59,.2);overflow:hidden}
.lc-bar[hidden]{display:none}
.lc-bar i,.xp-bar i{display:block;height:100%;width:0;border-radius:inherit;background:var(--teal)}
.xp-row{min-width:0;margin:0 0 8px;padding:2px 12px 0}
.xp-row[hidden]{display:none}
.xp-line{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;column-gap:10px;margin:0;font-size:13px;line-height:1.5;color:var(--ink)}
.xp-name,.xp-gain{font-weight:800;white-space:nowrap;font-variant-numeric:tabular-nums}
.xp-bar{display:block;height:6px;border-radius:3px;background:rgba(16,47,59,.14);overflow:hidden}
.xp-bar i{transition:width .4s ease-out}
.xp-up{margin:3px 0 0;font-size:13px;font-weight:800;line-height:1.5;color:var(--teal-dark);text-wrap:pretty}
.xp-up[data-kept=true]{min-height:1.5em}
.xp-up[data-kept=false]:empty{display:none}
.level-block{margin:0 0 12px}
.lb-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:0 0 5px}
.lb-name{font:800 16px/1.4 var(--sans);color:var(--ink)}
.lb-detail{font-size:13px;font-weight:700;color:#37564e;font-variant-numeric:tabular-nums;white-space:nowrap}
.level-block .xp-bar{height:8px;border-radius:4px}

dialog.prize-sheet{padding:0}
.prize-head{position:sticky;top:0;z-index:2;padding:16px 24px 12px;background:var(--paper);box-shadow:0 1px 0 var(--line)}
.prize-sheet h2{margin:0 0 2px;padding-right:46px;font-size:24px}
.prize-balance{display:flex;align-items:center;gap:8px;margin:0 0 8px;font:700 42px/1.05 var(--mono);font-variant-numeric:tabular-nums}
.prize-balance .ticket-mark{width:32px;height:32px}
.prize-unit{align-self:flex-end;padding-bottom:4px;font:800 16px/1 var(--sans);color:var(--muted)}
.prize-clerk{display:flex;align-items:baseline;gap:10px;margin:0;padding:6px 14px 6px 10px;border-radius:10px;background:#fff;box-shadow:0 1px 0 var(--line),0 3px 14px #102f3b14}
.prize-clerk small{flex:none;font-size:11px;font-weight:700;letter-spacing:.1em;color:var(--teal-dark)}
.prize-clerk span{flex:1;min-width:0;font-size:14px;font-weight:600;line-height:1.6;min-height:1.6em}
.prize-list{padding:2px 26px 26px}
.prize-group{margin:18px 0 0}
.prize-group-title{margin:0 0 8px;font-size:12px;font-weight:800;letter-spacing:.1em;color:var(--muted)}
.prize-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.prize-card{display:flex;flex-direction:column;gap:6px;min-width:0;padding:8px 8px 8px;border-radius:14px;background:#fff;border:2px solid transparent;box-shadow:0 1px 0 var(--line)}
.prize-card[data-state=using]{border-color:var(--teal-dark)}
.prize-pic{display:grid;place-items:center;height:78px;border-radius:9px;background:#e7efdf;overflow:hidden}
.prize-pic svg{width:92%;height:100%}
/* The ball's shadow is a box-shadow on a round box, not a CSS filter: on an iPhone a filtered element inside the scrolling sheet
   is not painted again once it has been scrolled away (the owner saw the balls vanish, and only the balls: they alone had a filter). */
.prize-ball{display:block;width:68px;height:68px;border-radius:50%;box-shadow:0 5px 6px -1px #102f3b33}
.prize-name{margin:2px 2px 0;font-size:14px;font-weight:800;line-height:1.3;overflow-wrap:anywhere}
.prize-price{display:flex;align-items:center;gap:5px;margin:0 2px 2px;min-height:18px;font:700 16px/1 var(--mono);font-variant-numeric:tabular-nums;color:var(--muted)}
.prize-price b{font-weight:700}
.prize-free{font:700 13px/1.3 var(--sans);letter-spacing:.04em}
/* The 友誼球 says where it came from where a price goes: a longer line, so it may wrap and stays smaller. */
.prize-free.prize-gift{font-size:12px;letter-spacing:0;color:var(--teal-dark)}
.prize-pic[data-cat=net]{background:#2f6a6a}
.prize-mark{display:inline-flex}
.prize-btn{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-height:44px;padding:6px 8px;border-radius:10px;font:800 14px/1.25 var(--sans);text-align:center;text-wrap:balance;overflow-wrap:anywhere}
.prize-btn[data-state=buy]{background:var(--yellow);color:var(--ink);box-shadow:0 3px 0 #c5a039}
.prize-btn[data-state=buy]:active{transform:translateY(2px);box-shadow:0 1px 0 #c5a039}
.prize-btn[data-state=confirm]{background:var(--ink);color:var(--yellow);box-shadow:0 0 0 3px var(--yellow)}
.prize-btn[data-state=equip]{background:#e7efdf;color:var(--teal-dark);box-shadow:0 1px 0 #9ab7a7}
.prize-btn[data-state=using]{background:var(--teal-dark);color:var(--paper)}
.prize-btn[data-state=using]::before{content:"";width:14px;height:14px;flex:none;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f6f7f1' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") center/contain no-repeat}
.prize-btn[data-state=short]{background:transparent;color:var(--muted);border:1.5px dashed #9fb4aa}
.prize-btn[aria-disabled=true],.prize-btn[data-state=short]{cursor:default}
.prize-btn[data-state=using],.prize-btn[data-state=equip],.prize-btn[data-state=buy]{white-space:nowrap}
@media(max-width:340px){.prize-btn[data-state=using]::before{display:none}}
.prize-btn:focus-visible{outline:3px solid var(--teal);outline-offset:2px}
/* The grand prize: one card across the sheet. */
.prize-card.wide{grid-column:1/-1;display:grid;grid-template-columns:104px minmax(0,1fr);grid-template-areas:"pic name" "pic price" "btn btn";column-gap:12px;row-gap:2px;align-items:center}
.prize-card.wide .prize-pic{grid-area:pic;height:84px}
.prize-card.wide .prize-name{grid-area:name;align-self:end;font-size:16px}
.prize-card.wide .prize-price{grid-area:price;align-self:start}
.prize-card.wide .prize-btn{grid-area:btn;margin-top:6px}
@media(max-width:340px){
  dialog.prize-sheet{width:calc(100vw - 16px)}
  .prize-head{padding:14px 16px 10px}
  .prize-list{padding:2px 14px 20px}
  .prize-grid{gap:8px}
  .prize-card{padding:6px}
  .prize-balance{font-size:40px}
  .prize-card.wide{grid-template-columns:84px minmax(0,1fr)}
}
/* A short phone: the title and the balance share a line, so the list keeps its room under the sticky head. */
@media(max-height:640px){
  .prize-head{display:flex;flex-wrap:wrap;align-items:center;gap:0 14px}
  .prize-sheet h2{margin:0;padding-right:0;font-size:20px}
  .prize-balance{margin:0;font-size:32px}
  .prize-balance .ticket-mark{width:24px;height:24px}
  .prize-clerk{flex:1 1 100%;margin-top:8px}
}
@media(max-height:560px) and (orientation:landscape){
  .prize-head{position:static}
  .prize-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* The cabinet with a few dozen prizes: a row of category buttons under the header, 試聽 on the sounds, 看看機台 by the balance. */
.prize-peek{flex:none;display:inline-flex;align-items:center;gap:5px;margin:0 0 0 auto;min-height:44px;padding:0 2px 0 8px;font:800 13px/1 var(--sans);letter-spacing:.02em;color:var(--teal-dark)}
.prize-peek .peek-mark{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.prize-peek:active{opacity:.6}
.prize-peek:focus-visible{outline:3px solid var(--teal);outline-offset:-1px;border-radius:8px}
.prize-tabs{position:sticky;top:var(--prize-head-h,0px);z-index:2;background:var(--paper);box-shadow:0 1px 0 var(--line)}
.prize-tabs::before,.prize-tabs::after{content:"";position:absolute;top:0;bottom:0;width:30px;z-index:1;pointer-events:none;opacity:0;transition:opacity .15s}
.prize-tabs::before{left:0;background:linear-gradient(90deg,var(--paper) 25%,#f6f7f100)}
.prize-tabs::after{right:0;background:linear-gradient(270deg,var(--paper) 25%,#f6f7f100)}
.prize-tabs[data-more=left]::before,.prize-tabs[data-more=both]::before,.prize-tabs[data-more=right]::after,.prize-tabs[data-more=both]::after{opacity:1}
.prize-tabs-track{display:flex;gap:6px;padding:3px 26px 3px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}
.prize-tabs-track::-webkit-scrollbar{display:none}
.prize-tab{flex:none;min-height:44px;padding:0 15px;border-radius:999px;background:#e7efdf;color:var(--teal-dark);font:800 13px/1 var(--sans);white-space:nowrap;transition:background .15s,color .15s}
.prize-tab:active{transform:translateY(1px)}
.prize-tab[aria-current=true]{background:var(--ink);color:var(--paper)}
.prize-tab:focus-visible{outline:3px solid var(--teal);outline-offset:-1px}
.prize-group-title{scroll-margin-top:calc(var(--prize-sticky,150px) + 6px)}
.prize-sub-title{display:flex;align-items:baseline;gap:8px;margin:12px 0 6px;font-size:13px;font-weight:800}
.prize-group-title+.prize-sub-title{margin-top:0}
.prize-sub-title small{font-size:11px;font-weight:600;color:var(--muted)}
.prize-price .prize-try{position:relative;flex:none;display:inline-flex;align-items:center;gap:4px;min-height:30px;margin-left:auto;padding:0 10px 0 8px;border-radius:999px;border:1.5px solid #9ab7a7;background:#fff;color:var(--teal-dark);font:800 12px/1 var(--sans)}
.prize-price .prize-try::after{content:"";position:absolute;inset:-7px -4px}
.prize-try .speaker-mark{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.prize-try:active{background:#e7efdf}
.prize-try:focus-visible{outline:3px solid var(--teal);outline-offset:2px}
@media(max-width:340px){
  .prize-tabs-track{padding-left:14px;padding-right:14px}
  .prize-tab{padding:0 12px}
  .prize-price .prize-try{gap:3px;padding:0 7px 0 5px;font-size:11px}
  .prize-price{gap:4px}
}
@media(max-height:640px){
  /* the title, the balance and 看看機台 share the close button's line here: the eye alone, and room kept for the × */
  .prize-balance{flex-wrap:nowrap;margin-right:44px}
  .prize-peek{margin-left:0;padding:0;min-width:40px;justify-content:center}
  .prize-peek span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .prize-head{padding-top:10px;padding-bottom:8px}
  .prize-clerk{margin-top:4px}
}
@media(prefers-reduced-motion:reduce){.prize-tabs::before,.prize-tabs::after,.prize-tab{transition:none}}
