/* Game controls remain on the play surface; setup lives in a modal. */
.settings-button{background:var(--chip);border:1px solid var(--line);color:var(--fg);border-radius:10px;font:inherit;font-size:14px;font-weight:600;min-height:44px;padding:9px 17px;flex-shrink:0}.game-heading .edition{display:none}.game-heading{gap:12px}.wheel-layout,.timer-layout{display:block;max-width:620px;margin:auto}.game-dialog{color:var(--fg);background:var(--surface);border:1px solid var(--line);border-radius:20px;width:min(540px,calc(100% - 24px));max-height:calc(100dvh - 32px);padding:22px;overflow-y:auto;overscroll-behavior:contain;box-shadow:0 24px 90px #0008}.game-dialog::backdrop{background:#000b;backdrop-filter:blur(5px)}.dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}.dialog-heading h2{font-size:22px;margin:0}.dialog-close{background:var(--chip);border:1px solid var(--line);color:var(--fg);font:inherit;font-size:28px;width:44px;height:44px;border-radius:10px;line-height:1;flex-shrink:0}.game-dialog .settings-panel{padding:0;border:0;border-radius:0}.game-dialog .rules{margin:0;border:0;padding:0;font-size:16px;line-height:1.8}.game-dialog .settings-panel textarea{font-size:16px}.dialog-done{margin-top:15px}.dialog-open{overflow:hidden}.game-dialog .action{background:var(--chip);color:var(--fg);border:1px solid var(--line);border-radius:12px;min-height:48px;padding:12px 20px;font:inherit;font-weight:600;width:100%}.game-dialog #apply-commands,.game-dialog #apply-time{background:var(--accent);color:var(--accent-ink)}.game-dialog select,.game-dialog input{font-size:16px}.game-dialog .game-note{margin:16px 0 0}.clock.running{letter-spacing:8px;color:var(--muted)}
@media(max-width:800px){
 body:not(:has(.hub-main)):not(.bus-page){min-height:100svh}
 body:has(.hub-main),body.bus-page{min-height:100svh;min-height:100dvh;display:flex;flex-direction:column}
 body:has(.hub-main)>header,body.bus-page>header{width:100%;padding:10px 16px;padding-top:max(10px,env(safe-area-inset-top));min-height:60px;flex-shrink:0}
 .brand{font-size:20px}.brand span{font-size:12px}nav{gap:6px}nav button{width:40px;min-height:40px}.bus-page .hub-back{display:none}
 .hub-main,.bus-page>main{width:100%;padding:12px 16px max(12px,env(safe-area-inset-bottom));margin:0 auto;flex:1;min-height:0}
 .hub-intro{margin-bottom:15px}.hub-intro .eyebrow{display:none}.hub-intro h1{font-size:48px;line-height:1;margin-bottom:10px}.hub-intro>p:last-child{font-size:14px}
 .game-grid{gap:10px}.game-tile{padding:15px 18px;grid-template-columns:66px 1fr;column-gap:15px;border-radius:16px}.tile-index{display:none}.tile-art{grid-row:1/4;font-size:68px}.timer-art{font-size:32px}.card-art{font-size:32px;gap:5px}.game-tile h2{margin:0;font-size:22px}.game-tile p{font-size:14px;line-height:1.5;margin:5px 0 10px}.tile-cta{font-size:14px;padding-top:8px}
 .hub-main>footer,.bus-page main>footer{font-size:12px;margin-top:18px;padding-top:12px;padding-bottom:0;gap:8px}.hub-main>footer>span{display:none}
 .playing .hub-main{display:flex;flex-direction:column}.playing .view:not([hidden]){display:flex;flex-direction:column;flex:1;min-height:0}.playing footer,.bus-page footer{display:none!important}.back-link{min-height:32px;align-self:flex-start;font-size:14px}.game-heading{margin:4px 0 12px}.game-heading .eyebrow{display:none}.game-heading h1{font-size:clamp(22px,6vw,30px);line-height:1.4}.wheel-layout,.timer-layout{width:100%;flex:1;min-height:0;display:flex}.play-panel{width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:18px 16px;border-radius:18px;min-height:0}.play-panel>.action{flex-shrink:0;margin-top:auto}.wheel-stage{width:min(100%,320px,calc(100dvh - 350px));width:max(145px,min(100%,320px,calc(100dvh - 350px)));margin:14px auto 20px;flex-shrink:0}.wheel-result{min-height:82px;margin:0 0 14px;width:100%}.wheel-result h2{font-size:20px;line-height:1.5;margin:0;overflow-wrap:anywhere}.wheel-center{width:60px;height:60px;font-size:23px}.wheel-result .eyebrow{margin-bottom:4px}.timer-panel{padding:24px 16px 20px}.timer-panel>.eyebrow{font-size:14px}.target-display{font-size:30px}.clock{font-size:clamp(70px,20vw,100px);margin:clamp(12px,4vh,30px) 0 0}.timer-panel #timer-hint{margin:8px 0 18px;max-width:100%;font-size:14px}.timer-panel #timer-action{margin-top:0}.timer-result{min-height:96px;margin:18px 0 0}.timer-result h2{font-size:22px}.timer-result p{font-size:16px;margin:8px 0}.keyboard-tip{display:none}
 .bus-page>main{display:flex;flex-direction:column}.bus-page .intro{align-items:center;gap:10px;margin-bottom:12px}.bus-page .intro .eyebrow,.bus-page #subtitle{display:none}.bus-page h1{font-size:38px;line-height:1;margin:0}.bus-page .table{padding:16px 14px 0;flex:1;display:flex;flex-direction:column;min-height:0}.bus-page .steps{margin:14px 0 18px}.bus-page .steps li{font-size:14px;line-height:1.35}.bus-page .steps b{font-size:12px}.bus-page .cards{gap:9px;margin:auto auto 20px}.bus-page .card{width:min(calc((100vw - 93px)/4),100px,calc((100dvh - 390px)/1.425));min-width:44px}.bus-page .prompt h2{font-size:26px}.bus-page #hint{font-size:14px;margin:0 0 16px}.bus-page .choices{min-height:50px;gap:8px;flex-shrink:0}.bus-page .choice{font-size:16px;padding:12px 8px;min-width:0}.bus-page .choice .icon{margin-right:4px}.bus-page .suit-name{font-size:14px}.bus-page .feedback{height:35px;font-size:14px}.bus-page .table-bottom{margin-top:auto;min-height:48px;padding:10px 0;flex-shrink:0}.bus-page .table-bottom button{min-height:40px}.bus-page .face{border-radius:8px}
}
@media(max-width:800px) and (max-height:660px){
 .playing .hub-main,.bus-page>main{padding-top:7px}.game-heading{margin-bottom:8px}.play-panel{padding:12px 14px}.wheel-stage{margin-top:12px;margin-bottom:16px}.wheel-result{min-height:70px;margin-bottom:8px}.wheel-result h2{font-size:18px}.wheel-center{width:50px;height:50px;font-size:19px}.timer-panel{padding:16px}.clock{font-size:76px;margin:10px 0 0}.timer-panel #timer-hint{margin:6px 0 12px}.timer-result{min-height:78px;margin-top:14px}.target-display{font-size:27px}.bus-page .steps{margin:10px 0 14px}.bus-page .cards{margin-bottom:12px}.bus-page .prompt h2{font-size:24px}.bus-page #hint{margin-bottom:10px}.bus-page h1{font-size:32px}.bus-page .feedback{height:30px}.hub-intro h1{font-size:38px}.game-tile{padding:12px 14px}.game-tile h2{font-size:20px}.game-tile p{margin:4px 0 7px}
}
/* Short landscape screens use two columns without shrinking tap targets. */
@media(max-width:800px) and (max-height:500px) and (orientation:landscape){
 .playing .back-link{display:none}.playing .game-heading{margin:0 0 8px}.wheel-layout .play-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}.wheel-stage{grid-row:1/3;width:min(210px,calc(100dvh - 170px));margin:8px auto}.wheel-result{margin:0;min-height:70px}.timer-panel{display:grid;grid-template-columns:1fr 1fr;gap:6px 20px}.timer-panel>.eyebrow{margin:0}.target-display{grid-column:1;grid-row:2}.clock{grid-column:1;grid-row:3/5;font-size:76px;margin:0}.timer-panel #timer-hint{grid-column:2;grid-row:1/3;margin:0}.timer-panel #timer-action{grid-column:2;grid-row:3}.timer-result{grid-column:2;grid-row:4;margin:0;min-height:60px}.timer-result h2{font-size:18px}.timer-result p{font-size:14px}.bus-page .table{display:grid;grid-template-columns:1fr 1fr;gap:4px 18px}.bus-page .table-top{grid-column:1}.bus-page .steps{grid-column:1;grid-row:2;margin:0}.bus-page .cards{grid-column:1;grid-row:3/6;margin:8px auto}.bus-page .card{width:min(65px,calc((100dvh - 190px)/1.425))}.bus-page .prompt{grid-column:2;grid-row:1/4;align-self:center}.bus-page .choices{grid-column:2;grid-row:4}.bus-page .feedback{grid-column:2;grid-row:5}.bus-page .table-bottom{grid-column:1/-1}.game-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.game-tile{display:flex;min-height:0}.tile-art{display:none}.tile-cta{margin-top:8px}.hub-main>footer{display:none}
}
/* Allow natural scrolling for very short screens or enlarged text rather than clip controls. */
@media(max-width:800px) and (min-height:501px){body.playing,body.bus-page{height:100dvh;min-height:560px}}
@media(max-width:800px){
 .wheel-stage{width:max(145px,min(100%,320px,calc(100dvh - 400px)))}
 .bus-page #prompt-label{display:none}.bus-page .table:not(.win):not(.lose) #hint{display:none}.bus-page .steps{margin:10px 0 12px}.bus-page .card{width:min(calc((100vw - 93px)/4),100px,calc((100dvh - 530px)/1.425));min-width:44px}.bus-page .table-bottom{min-height:44px;padding:0}.bus-page .feedback{height:24px}.bus-page .suit-name{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.bus-page .choice .icon{margin:0}.bus-page .table{padding-top:14px}
}
@media(max-width:800px) and (max-height:500px) and (orientation:landscape){.wheel-stage{width:min(210px,calc(100dvh - 170px))}.bus-page .steps{margin:0}.bus-page .card{width:min(65px,calc((100dvh - 190px)/1.425))}.bus-page .cards{margin:8px auto}}
@media(max-width:800px) and (min-height:501px){.hub-intro>p:last-child{display:none}.hub-intro h1{font-size:40px}.game-tile{padding:14px 18px}.game-tile p{margin:5px 0 0}.tile-cta{display:none}.tile-art{grid-row:1/3}}
.clock.running{letter-spacing:1px;color:var(--accent);font-variant-numeric:tabular-nums}.timer-panel{position:relative}.history-button{position:absolute;top:16px;right:16px;border:1px solid var(--line);border-radius:9px;background:var(--chip);color:var(--muted);font:inherit;font-size:14px;min-height:40px;padding:8px 13px}.history-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px}.clear-history{border:1px solid var(--line);background:var(--chip);color:var(--red);font:inherit;font-size:14px;min-height:44px;border-radius:9px;padding:9px 14px}.history-list{display:flex;flex-direction:column;gap:12px}.history-empty{text-align:center;padding:28px 8px;color:var(--muted);font-size:16px;line-height:1.8}.history-item{background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:14px}.history-item-heading{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:14px;color:var(--muted);margin-bottom:12px}.history-item-heading strong{color:var(--fg);font-weight:500}.history-values{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.history-values span{display:block;font-size:14px;color:var(--muted);margin-bottom:4px}.history-values strong{font-family:'Mali',sans-serif;font-size:26px;font-weight:700;line-height:1.2;color:var(--fg);font-variant-numeric:tabular-nums}.history-values>div:last-child strong{color:var(--accent)}@media(max-width:800px){.timer-panel>.eyebrow{padding-top:28px}.history-button{top:12px;right:12px}.history-values{gap:6px}.history-values strong{font-size:24px}.history-item{padding:12px}}@media(max-width:800px) and (max-height:500px) and (orientation:landscape){.timer-panel>.eyebrow{padding-top:0}.history-button{position:static;grid-column:2;grid-row:1;justify-self:end;min-height:36px;padding:5px 10px}.timer-panel #timer-hint{grid-row:2;font-size:14px;max-width:100%}.timer-panel .target-display{grid-row:2}.timer-panel .clock{grid-row:3/5}}
@media(max-width:800px){.timer-panel>.eyebrow{padding-top:0}.history-button{min-height:40px}}
