/* One arena, shared across desktop, tablet and touch layouts. */
#gameScreen{--board-w:min(calc((100dvh - 100px)/2),calc(100vw - 460px));font-family:DriftRounded,ui-rounded,system-ui,sans-serif;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:12px;padding:max(14px,env(safe-area-inset-top)) 18px max(12px,env(safe-area-inset-bottom));background:radial-gradient(ellipse at 50% 43%,#a3c6df30 0%,transparent 48%),linear-gradient(160deg,#edf8ff 0%,#d0e5f4 42%,#b2d0e6 100%);color:#233e55;isolation:isolate}
.game-atmosphere{position:absolute;inset:0;z-index:-1;overflow:hidden;pointer-events:none}.game-atmosphere:before,.game-atmosphere:after{content:'';position:absolute;background:url('world.svg') center/contain no-repeat;width:410px;height:530px;opacity:.09;filter:blur(1px);transform:rotate(-8deg)}.game-atmosphere:before{left:-120px;bottom:-60px}.game-atmosphere:after{right:-145px;top:35px;transform:scale(.8) rotate(8deg);opacity:.06}.game-atmosphere i{position:absolute;width:4px;height:4px;border-radius:50%;background:#fff9;left:12%;top:18%;animation:dust-drift 12s ease-in-out infinite}.game-atmosphere i:nth-child(2){left:26%;top:76%;animation-delay:-3s;width:6px;height:6px}.game-atmosphere i:nth-child(3){left:81%;top:31%;animation-delay:-8s}.game-atmosphere i:nth-child(4){left:91%;top:69%;animation-delay:-4s;width:7px;height:7px}.game-atmosphere i:nth-child(5){left:64%;top:9%;animation-delay:-6s}.game-atmosphere i:nth-child(6){left:7%;top:49%;animation-delay:-2s}
#gameScreen header{position:relative;display:flex;align-items:center;gap:16px;flex:none;width:calc(var(--board-w) + 382px);max-width:100%;height:52px;padding:0;background:none;z-index:2}.game-identity{display:flex;align-items:center;gap:12px;min-width:115px;flex:1}.game-wordmark{display:block;font-size:28px;font-weight:900;line-height:1;letter-spacing:-1.3px;color:#294e60}.app .game-heading{font-size:8px;color:#7291a3;text-shadow:none;letter-spacing:1.8px;margin-top:6px;white-space:nowrap}.app .stats{background:#f9fdffb3;border:1px solid #ffffffc9;box-shadow:0 3px 13px #43617a08;border-radius:13px;min-width:124px;padding:5px 18px;color:#254b60;display:flex;flex-direction:column;text-align:right}.app .stats .label{display:block;font-size:7px;letter-spacing:1.8px;color:#7d98a6;line-height:1.3}.app .score{font-size:25px;font-weight:900;line-height:1.2;letter-spacing:-.6px;font-variant-numeric:tabular-nums}.app .icon-button{display:flex;align-items:center;justify-content:center;background:#f7fdffb3;color:#466b7f;text-shadow:none;border:1px solid #ffffffba;border-radius:12px;box-shadow:0 2px 4px #45657d0d;min-width:37px;width:37px;height:39px;padding:0;font-size:18px}.app .icon-button:hover{background:#fff}.app .icons{gap:7px}.app #controlsButton{font-size:16px;font-weight:900}.app .icon-button:active{transform:translateY(1px) scale(.96)!important}
#gameScreen .playarea{display:grid;grid-template-columns:170px var(--board-w) 150px;align-items:start;justify-content:center;column-gap:26px;height:auto;min-height:0;flex:none;position:relative;width:auto;max-width:100%;z-index:1}.app .board{grid-column:2;grid-row:1;width:var(--board-w);height:auto;padding:4px;border:1px solid #99bace;border-radius:17px;background:#142444;box-shadow:0 15px 45px #1f45692b,0 0 0 5px #ffffff38,inset 0 0 0 1px #cee9ff44;overflow:hidden}.app canvas#game{display:block;width:100%;height:auto;aspect-ratio:1/2;border-radius:11px;touch-action:none}.app .pad{position:absolute;inset:auto 4px 4px;width:auto;height:30%;left:4px;transform:none;border-radius:0 0 11px 11px;z-index:1;pointer-events:none}.app.lower-controls .pad{pointer-events:auto}.flow-panel{grid-column:1;grid-row:1;align-self:center;min-width:0;color:#46697d}.pip-companion{position:relative;text-align:center;margin:0 0 28px}.pip-companion img{display:block;width:125px;height:125px;object-fit:contain;margin:0 auto;filter:drop-shadow(0 8px 8px #436b7a1c)}.pip-name{display:block;font-size:8px;letter-spacing:2.5px;color:#7c9aa7;font-weight:900;margin-top:9px}.flow-panel .desktop-kicker{font-size:7px;letter-spacing:1.6px;color:#7e97a8;font-weight:900}.flow-panel h2{font-size:23px;letter-spacing:-.7px;line-height:1.25;font-weight:900;margin:11px 0 10px;color:#345b70}.flow-panel>p{font-size:11px;line-height:1.7;color:#7693a4;margin:0 0 17px}.goal-track{height:5px;border-radius:20px;background:#8dacc12b;overflow:hidden}.goal-track>span{display:block;height:100%;width:0%;border-radius:inherit;background:linear-gradient(90deg,#77d8b5,#35a87c);transition:width .3s ease}.goal-numbers{display:flex;justify-content:space-between;margin-top:7px;font-size:9px;font-weight:800;color:#7593a4}.best-run{margin-top:25px;padding-top:19px;border-top:1px solid #7195b026}.best-run>span{display:block;font-size:7px;letter-spacing:1.5px;font-weight:900;color:#88a0b1}.best-run b{display:block;margin-top:5px;font-size:25px;font-weight:900;color:#416880;letter-spacing:-.5px}.flow-panel .last-run-note{font-size:8px;letter-spacing:.5px;margin-top:10px}.flow-panel details{font-size:10px;color:#66899d;margin-top:22px}.flow-panel summary{cursor:pointer;font-weight:800}.flow-panel dl{margin:14px 0;display:grid;gap:7px}.flow-panel dl div,.keyboard-guide div{display:flex;gap:10px;align-items:center}.flow-panel dt{width:58px;font-size:9px;padding:3px 5px;border:1px solid #a2becd66;border-radius:5px;text-align:center;background:#ffffff40}.flow-panel dd{margin:0;font-size:10px}
#gameScreen .side{grid-column:3;grid-row:1;align-self:start;display:flex;flex-direction:column;justify-content:start;gap:17px;width:150px;max-width:none;height:auto;padding:24px 0 0;color:#466b7d}.side #hold,.side .hud-next{width:100%;height:auto;min-height:104px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;background:#f8fdff8c;border:1px solid #ffffffa1;border-radius:15px;box-shadow:0 4px 12px #41698405;padding:13px 10px;color:inherit}.side #hold:hover{background:#fff9}.side .label{font-size:8px!important;letter-spacing:1.7px;color:#7d99aa!important;font-weight:900}.side #held{width:64px;height:50px;object-fit:contain}.next-pieces{display:flex;flex-direction:column;gap:0;align-items:center}.side .next-pieces canvas{width:66px;height:54px;object-fit:contain}.side .next-pieces canvas:first-child{width:78px;height:62px}.side .next-pieces canvas:not(:first-child){opacity:.8}.session-metrics{display:grid;grid-template-columns:1fr 1fr;width:100%;padding:18px 5px;border-top:1px solid #7195b026;border-bottom:1px solid #7195b026}.side .hud-metric{min-width:0;gap:7px}.side .hud-metric>span:last-child{font-size:26px;font-weight:900;color:#456e86;text-shadow:none;font-variant-numeric:tabular-nums}.mode-pill{font-size:9px;letter-spacing:1px;font-weight:800;padding:5px 12px;border:1px solid #a8c4d082;border-radius:20px;color:#7f9aa9}.side-note{font-size:10px;text-align:center;line-height:1.8;color:#8aa0ae;margin:0}.mobile-progress{display:none}#gameScreen .hint{bottom:15px;max-width:calc(var(--board-w) - 20px);font-size:10px;z-index:2;padding:6px 10px;color:#4b6b73;background:#f8fffaeb;border:1px solid #d3e5da;box-shadow:0 3px 12px #183f5322;left:50%;transform:translateX(-50%)}
/* Scores lead the result, with a single strong next action. */
.app .overlay{inset:4px;border-radius:11px;padding:14px;background:#101d3c9c;backdrop-filter:blur(5px);z-index:4;overflow:auto}.app .result-card{padding:22px 20px 20px;max-width:340px;border:1px solid #ffffffe6;border-radius:23px;background:linear-gradient(150deg,#fffefa,#f3f6ef);box-shadow:0 12px 35px #061a3a38;color:#46645e;text-align:center;flex-shrink:0}.result-kicker{font-size:7px;font-weight:900;letter-spacing:2px;color:#96a49c}.result-pip{display:block;width:100px;height:100px;object-fit:contain;margin:11px auto 5px;filter:drop-shadow(0 5px 6px #49695916)}.app .result-card h1{font-family:DriftRounded,system-ui;font-size:23px;line-height:1.2;letter-spacing:-.6px;color:#355d50;font-weight:900;margin:14px 0 9px}.app .result-card p{font-size:11px;color:#87938c;line-height:1.6;margin:8px 0 20px}.result-score{font-size:clamp(36px,4vw,57px);font-weight:900;line-height:1.1;letter-spacing:-2px;color:#2f6953;font-variant-numeric:tabular-nums;margin:8px -9px 0}.app .is-result .result-card h1{font-size:18px;margin:8px 0}.app .is-result .result-card #message{font-size:10px;margin:5px 0 17px}.result-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:8px 0 14px;padding:12px 0;border-top:1px solid #d4e0d5;border-bottom:1px solid #d4e0d5}.result-metrics span{display:block;font-size:7px;letter-spacing:1.5px;font-weight:800;color:#95a79b}.result-metrics b{display:block;margin-top:5px;color:#597566;font-size:18px;font-weight:900}.app .result-card .result-comparison{color:#59a480;font-size:10px;font-weight:800;margin:5px 0 17px}.app .result-card #play,#controlsModal .primary{font-family:DriftRounded,system-ui;font-size:16px;line-height:1.3;min-height:49px;padding:12px 14px;border:1px solid #26865d;border-radius:13px;background:linear-gradient(#52c994,#2ba56c);box-shadow:inset 0 1px #ddffea70,0 3px #23825a,0 5px 8px #42764c12;text-shadow:0 1px #23744640;letter-spacing:.1px;font-weight:900}.app .result-card #play:before{display:none}.app .result-card #share{background:transparent;color:#7b988c;border:1px solid #d5e2d7;border-radius:12px;min-height:36px;padding:8px;font:800 11px DriftRounded,system-ui;text-shadow:none;box-shadow:none;margin-top:12px}.app .result-card #share:before{display:none}.app .result-card #share:hover{background:#e9f3eb}.result-card .ribbon{display:none}
#controlsModal{font-family:DriftRounded,system-ui;background:#f7fcf8;border:1px solid #daebe1;color:#47695b;box-shadow:0 15px 50px #193f4838}#controlsModal h2{margin:0 0 16px;font-size:24px}#controlsModal p{font-size:12px;line-height:1.8;color:#7d9386}.keyboard-guide{display:grid;gap:9px;margin:23px 0}.keyboard-guide dt{background:#e7f1ea;border:1px solid #cfdfd3;border-radius:6px;min-width:75px;text-align:center;padding:5px;font-size:12px;font-weight:800}.keyboard-guide dd{margin:0;font-size:12px}#controlsModal::backdrop{background:#162f466e}
#celebrationLayer{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:8}.confetti-piece{position:absolute;top:12%;left:var(--x);width:7px;height:12px;border-radius:2px;opacity:0;animation:confetti-drop 1.8s ease-out var(--delay) forwards}.milestone-banner{position:absolute;left:50%;top:76px;transform:translateX(-50%);display:flex;align-items:center;gap:10px;padding:10px 18px 10px 10px;border-radius:17px;background:#fffffff2;border:1px solid #d4f2e3;box-shadow:0 6px 24px #244c6826;z-index:9;pointer-events:none;white-space:nowrap}.milestone-banner img{object-fit:contain}.milestone-banner b,.milestone-banner span{display:block}.milestone-banner b{font-size:13px;font-weight:900;color:#328567}.milestone-banner span{font-size:9px;color:#80a191;margin-top:2px}.pip-party{animation:pip-cheer .5s ease-in-out 3}
@keyframes dust-drift{0%,100%{transform:translate(0,0);opacity:.2}50%{transform:translate(13px,-35px);opacity:.8}}@keyframes confetti-drop{0%{opacity:0;transform:translate(0,-20px) rotate(0)}10%{opacity:1}100%{opacity:0;transform:translate(var(--drift),65dvh) rotate(var(--spin))}}@keyframes pip-cheer{0%,100%{transform:translateY(0) rotate(0)}40%{transform:translateY(-9px) rotate(-6deg)}70%{transform:translateY(-2px) rotate(5deg)}}
@media(min-width:1100px) and (min-height:900px){#gameScreen{--board-w:min(calc((100dvh - 100px)/2),500px)}}
@media(max-width:1000px) and (min-width:700px) and (min-aspect-ratio:6/5){#gameScreen{--board-w:min(calc((100dvh - 95px)/2),calc(100vw - 240px))}.flow-panel{display:none}#gameScreen .playarea{grid-template-columns:var(--board-w) 140px;gap:22px}.app .board{grid-column:1}#gameScreen .side{grid-column:2;width:140px}.app header{width:calc(var(--board-w) + 162px)!important}}
/* Phone and portrait tablet: the same hierarchy, with a compact bottom dock. */
@media(max-width:699px),(max-aspect-ratio:6/5){#gameScreen{--board-w:min(calc((100dvh - 138px)/2),calc(100vw - 20px));gap:9px;padding:max(7px,env(safe-area-inset-top)) 10px max(7px,env(safe-area-inset-bottom));background:radial-gradient(ellipse at 50% 40%,#e2f0f9 0%,#c2dceb 75%)}#gameScreen header{width:min(100%,500px);height:59px;gap:8px;flex-wrap:wrap;align-content:start}.game-identity{gap:6px;min-width:72px}.game-wordmark{font-size:23px}.app .game-heading{font-size:6px;letter-spacing:1px;margin-top:5px}.app .stats{min-width:83px;padding:3px 9px;border-radius:10px}.app .score{font-size:22px}.app .stats .label{font-size:6px;letter-spacing:1.5px}.app .icons{gap:4px}.app .icon-button{width:30px;height:33px;min-width:30px;border-radius:9px;font-size:16px}.game-identity>.icon-button{width:26px;min-width:26px}.app .icons svg{width:16px;height:16px}.mobile-progress{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;height:15px;flex:none;margin-top:4px;font-size:8px;color:#7d9aa7}.mobile-progress .goal-track{width:65px;height:3px}.flow-panel{display:none}#gameScreen .playarea{display:flex;flex-direction:column;align-items:center;gap:11px;width:100%;height:auto}.app .board{width:var(--board-w);border-radius:14px;padding:3px;flex:none}.app canvas#game{border-radius:10px}.app .overlay{inset:3px;padding:12px}.app .pad{inset:auto 3px 3px;left:3px}.app .result-card{padding:18px 17px 16px;border-radius:20px;max-width:305px}.result-pip{width:82px;height:82px;margin-top:8px}.result-kicker{font-size:6px;letter-spacing:1.7px}.result-score{font-size:47px}.app .result-card h1{font-size:21px}.app .is-result .result-card h1{font-size:16px}.app .is-result .result-card #message{margin-bottom:11px}.result-metrics{padding:10px 0;margin:7px 0 10px}.result-metrics b{font-size:17px}.app .result-card #play{font-size:15px;min-height:45px}.app .result-card .result-comparison{margin-bottom:12px}#gameScreen .side{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:10px;width:min(calc(var(--board-w) + 5px),480px);height:41px;min-height:41px;padding:0;flex:none}.side #hold{flex-direction:row;width:auto;min-width:66px;min-height:41px;height:41px;padding:3px 6px;gap:0;border-radius:10px}.side #held{width:33px;height:33px}.side .hud-next{flex-direction:row;min-height:41px;height:41px;width:auto;flex:1;padding:3px 5px;gap:3px;border-radius:10px}.side .next-pieces{flex-direction:row;gap:0}.side .next-pieces canvas,.side .next-pieces canvas:first-child{width:29px;height:32px}.side .label{font-size:6px!important;letter-spacing:1px}.side .session-metrics{width:auto;gap:16px;padding:0 3px;border:none}.side .hud-metric{gap:3px}.side .hud-metric>span:last-child{font-size:18px}.side .mode-pill,.side .side-note{display:none}#gameScreen .hint{bottom:73px;max-width:calc(var(--board-w) - 12px);font-size:8px;padding:4px 7px}.milestone-banner{top:80px;padding:7px 12px 7px 6px;gap:6px;max-width:calc(100% - 25px)}.milestone-banner img{width:37px;height:37px}.milestone-banner b{font-size:11px}.milestone-banner span{font-size:8px}.game-atmosphere:before{opacity:.06;left:-200px}.game-atmosphere:after{right:-230px;opacity:.04}}
@media(min-width:600px) and (max-aspect-ratio:6/5){#gameScreen{--board-w:min(calc((100dvh - 155px)/2),calc(100vw - 50px));gap:13px;padding-top:14px}.app .stats{min-width:110px}.app .score{font-size:27px}.app .icon-button{width:37px;height:39px}.app .result-card{max-width:340px;padding:24px}.result-score{font-size:60px}.result-pip{width:112px;height:112px}}
@media(max-height:650px) and (min-aspect-ratio:6/5){#gameScreen{--board-w:calc((100dvh - 83px)/2);padding:7px 16px;gap:6px}#gameScreen header{height:45px;width:calc(var(--board-w) + 165px)}#gameScreen .playarea{grid-template-columns:var(--board-w) 130px;gap:20px}.flow-panel{display:none}.app .board{grid-column:1}.app .score{font-size:20px}.app .game-wordmark{font-size:23px}#gameScreen .side{grid-column:2;width:130px;padding-top:3px;gap:9px}.side #hold{min-height:68px;padding:7px}.side #held{width:45px;height:35px}.side .hud-next{min-height:0;padding:7px}.side .next-pieces{flex-direction:row}.side .next-pieces canvas,.side .next-pieces canvas:first-child{width:33px;height:35px}.session-metrics{padding:8px 3px}.side .hud-metric>span:last-child{font-size:20px}.side-note{display:none}.app .result-card{padding:12px;max-width:240px}.result-pip{width:45px;height:45px;margin:3px auto}.result-score{font-size:30px}.app .result-card h1{font-size:17px;margin:5px 0}.app .is-result .result-card h1{font-size:13px}.result-kicker{font-size:5px}.app .result-card p,.app .is-result .result-card #message{font-size:8px;margin:4px 0 8px}.result-metrics{padding:6px 0;gap:3px;margin:5px 0}.result-metrics b{font-size:13px}.result-metrics span{font-size:5px}.app .result-card .result-comparison{font-size:7px;margin:4px 0 8px}.app .result-card #play{font-size:11px;min-height:32px;padding:7px}.app .result-card #share{min-height:26px;font-size:8px;margin-top:7px;padding:5px}.app .overlay{padding:9px}.milestone-banner{top:61px}.hint.guide{display:none}}
@media(max-width:359px) and (max-aspect-ratio:6/5){#gameScreen header{gap:4px}.app .stats{min-width:72px;padding-inline:6px}.app .score{font-size:19px}.app .icon-button{width:26px;min-width:26px;height:31px}.game-wordmark{font-size:20px}.app .icons{gap:3px}.side .session-metrics{gap:9px}.side #hold{min-width:59px}.side .next-pieces canvas,.side .next-pieces canvas:first-child{width:24px}.side .label{letter-spacing:.5px}}
@media(prefers-reduced-motion:reduce){.game-atmosphere i,.pip-party,.confetti-piece{animation:none!important}.confetti-piece{display:none}.goal-track>span{transition:none}}
.app .overlay{align-items:safe center}
@media(max-height:650px) and (min-aspect-ratio:6/5){#gameScreen .overlay{position:fixed;inset:58px 0 0;transform:none;width:auto;border-radius:0;background:#14283e85;backdrop-filter:blur(4px);z-index:10;padding:10px;align-items:safe center}#gameScreen .result-card{max-width:320px;width:min(320px,90vw);padding:12px 18px}#gameScreen .result-score{font-size:36px}#gameScreen .is-result .result-card h1{font-size:16px}#gameScreen .result-card p{font-size:9px}#gameScreen .result-card #play{font-size:12px}#gameScreen .result-card #share{font-size:9px}}
@media(max-height:700px) and (max-aspect-ratio:6/5){.app .result-card{padding:12px}.result-pip{width:58px;height:58px}.result-score{font-size:39px}.app .is-result .result-card h1{font-size:14px}.app .result-card #play{min-height:39px;padding:9px}.result-metrics{padding:7px 0}.app .is-result .result-card #message{margin-bottom:8px}.app .result-card p{font-size:9px}.app .result-card #share{min-height:31px;padding:6px}}
@media(max-height:650px) and (min-aspect-ratio:6/5){#gameScreen .result-pip{position:absolute;top:14px;left:15px;width:42px;height:42px;margin:0}#gameScreen .result-kicker{display:block;line-height:10px;padding:0 40px}#gameScreen .result-score{margin:7px 0 0}#gameScreen .result-card{padding-top:13px}}

.app .result-card .result-comparison{margin-bottom:4px}.app .result-card .result-best-comparison{font-size:8px;line-height:1.4;margin:0 0 14px;color:#8caa99}@media(max-height:650px) and (min-aspect-ratio:6/5){#gameScreen .result-card .result-best-comparison{font-size:7px;margin:0 0 7px}}

/* Keep the queue visible beside the board on portrait screens too. */
@media(max-width:699px),(max-aspect-ratio:6/5){
 #gameScreen{--board-w:min(calc((100dvh - 105px)/2),calc(100vw - 110px))}
 #gameScreen .playarea{display:grid;grid-template-columns:var(--board-w) 72px;column-gap:10px;align-items:start;justify-content:center;width:100%}
 #gameScreen .board{grid-column:1;grid-row:1}
 #gameScreen .side{grid-column:2;grid-row:1;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;width:72px;height:auto;min-height:0;gap:10px;padding-top:2px}
 #gameScreen .side .hud-next{order:-1;display:flex!important;flex:none;flex-direction:column;width:72px;min-height:0;height:auto;padding:9px 3px;gap:5px;visibility:visible!important;opacity:1}
 #gameScreen .next-pieces{display:flex;flex-direction:column;gap:4px}
 #gameScreen .side .next-pieces canvas,#gameScreen .side .next-pieces canvas:first-child{display:block!important;width:56px;height:48px;visibility:visible!important;opacity:1}
 #gameScreen .side #hold{flex-direction:column;width:72px;min-width:0;height:auto;min-height:72px;padding:8px 3px;gap:3px}
 #gameScreen .side #held{width:48px;height:40px}
 #gameScreen .side .session-metrics{display:flex;flex-direction:column;gap:15px;width:72px;padding:10px 2px;border-top:1px solid #7195b026}
 #gameScreen .side .label{font-size:8px!important;letter-spacing:1px}
 #gameScreen .side .hud-metric{align-items:center;text-align:center}
 #gameScreen .side .hud-metric>span:last-child{font-size:22px}
 #gameScreen .overlay{position:fixed;inset:78px 8px 8px;width:auto;border-radius:16px;z-index:10;padding:12px;background:#14283ec7;align-items:safe center}
 #gameScreen .result-card{width:min(100%,340px);max-width:340px}
 #gameScreen .hint{bottom:12px}
}
/* Override inherited hiding rules from earlier responsive layouts. */
#gameScreen .hud-next,#gameScreen .next-pieces{visibility:visible!important;opacity:1}
#homeChallenges{grid-column:1/-1;width:100%;min-height:43px;font:900 13px DriftRounded,system-ui;background:linear-gradient(#e8fff5,#b8efd7);color:#236650;border:1px solid #72bf9f;box-shadow:0 3px #4ca080;border-radius:15px;text-shadow:none;margin-bottom:8px}#homeChallenges:before{display:none}.home-bottom{flex-wrap:wrap}#challengeModal{font-family:DriftRounded,system-ui;border:1px solid #d7ece1;background:#f4fcf7;color:#345b50}#challengeModal h2{font-size:24px;line-height:1.2;margin:4px 0 15px}#challengeList{display:grid;gap:10px;margin:17px 0}.challenge-option{display:flex;align-items:center;gap:12px;width:100%;padding:9px 13px;background:#e5f4ec;border:1px solid #c5e3d4;border-radius:15px;color:#346750;text-align:left;font:800 14px DriftRounded,system-ui;box-shadow:0 2px #b9d8c7;text-shadow:none}.challenge-option img{width:52px;height:52px}.challenge-option:before{display:none}.pip-reaction{text-align:center;font-size:10px;color:#4c7c6c}.pip-reaction img{width:95px;height:95px;display:block;margin:auto}.pip-reaction span{display:block}.app .result-card #challengeLink,.app .result-card #nextChallenge{display:block;width:100%;background:transparent;color:#4f8069;border:1px solid #d5e2d7;border-radius:10px;min-height:32px;font:800 10px DriftRounded,system-ui;text-shadow:none;box-shadow:none;margin-top:9px;padding:7px}.app .result-card #challengeLink:before,.app .result-card #nextChallenge:before{display:none}.side #hold:disabled{opacity:.5;cursor:default}
@media(max-width:699px),(max-aspect-ratio:6/5){.pip-reaction img{width:64px;height:64px}.pip-reaction{font-size:8px}.app .result-card #challengeLink,.app .result-card #nextChallenge{margin-top:6px}}
@media(max-height:650px) and (min-aspect-ratio:6/5){.pip-reaction{display:none}.app .result-card #challengeLink,.app .result-card #nextChallenge{min-height:24px;margin-top:4px;padding:4px;font-size:8px}}
#gameScreen.challenge-run .side .hud-next,#gameScreen.challenge-run #hold{display:none!important}#gameScreen.challenge-run .pip-reaction{order:-1}#gameScreen.challenge-run .best-run{display:none}
/* Compact right rail gives phones more board without hiding the next pieces. */
@media(max-width:699px),(max-aspect-ratio:6/5){#gameScreen{--board-w:min(calc((100dvh - 100px)/2),calc(100vw - 80px));padding-inline:6px}#gameScreen .playarea{grid-template-columns:var(--board-w) 56px;column-gap:6px}#gameScreen .side,#gameScreen .side .hud-next,#gameScreen .side #hold,#gameScreen .side .session-metrics{width:56px}#gameScreen .side{gap:7px}#gameScreen .side .hud-next{padding:7px 1px;gap:2px}#gameScreen .next-pieces{gap:1px}#gameScreen .side .next-pieces canvas,#gameScreen .side .next-pieces canvas:first-child{width:48px;height:43px}#gameScreen .side #hold{min-height:59px;padding:5px 1px}#gameScreen .side #held{width:43px;height:34px}#gameScreen .side .session-metrics{gap:10px;padding:8px 0}#gameScreen .side .hud-metric>span:last-child{font-size:19px}#gameScreen .side .label{font-size:7px!important}.pip-reaction img{width:54px;height:54px}.pip-reaction span{font-size:7px}.side-action{font-size:8px!important;min-width:0!important;padding:8px 2px!important}.app .game-heading{max-width:90px;overflow:hidden;text-overflow:ellipsis}.app .stats{min-width:75px;padding-inline:7px}.app .score{font-size:20px}}
/* Steady gameplay avoids background animation and backdrop-filter compositing. */
#gameScreen .game-atmosphere i{animation:none!important}#gameScreen .overlay{backdrop-filter:none}.app .board{box-shadow:0 5px 18px #1f456929,0 0 0 3px #ffffff38}
.side-action{font:800 10px DriftRounded,system-ui;color:#245d49;background:#e4f6ed;border:1px solid #a8d1bd;border-radius:10px;padding:9px 6px;box-shadow:none;text-shadow:none;width:100%;min-height:35px}.side-action:before{display:none}.app .result-card #challengeHint,.app .result-card #challengeSolution,.app .result-card #watchReplay{font:800 10px DriftRounded,system-ui;min-height:31px;padding:7px;margin-top:7px;width:100%;background:#e2f2e9;color:#345e4c;border:1px solid #c9e0d1;border-radius:10px;text-shadow:none;box-shadow:none}.app .result-card #challengeHint:before,.app .result-card #challengeSolution:before,.app .result-card #watchReplay:before{display:none}#challengeHelp{font-size:11px;line-height:1.6;color:#335c4c;background:#eff8f1;padding:9px;border-radius:9px}.zen-clock{font-size:11px;font-weight:800;color:#35654f;white-space:nowrap;background:#e6f8ed;border:1px solid #badbc7;border-radius:9px;padding:6px}.quiet-zen .stats,.quiet-zen .best-run,.quiet-zen .last-run-note,.quiet-zen .goal-numbers,.quiet-zen .goal-track,.quiet-zen #resultScore,.quiet-zen #resultComparison,.quiet-zen #resultBestComparison{display:none!important}.quiet-zen .result-metrics>div:nth-child(2){display:none}.quiet-zen .result-metrics{grid-template-columns:1fr 1fr}.quiet-zen .best-pill{visibility:hidden}
#tutorialModal,#replayModal{font-family:DriftRounded,system-ui;border:1px solid #c5e3d3;background:#f5fcf7;color:#315b48;padding:20px;border-radius:22px}#tutorialModal h2,#replayModal h2{font-size:23px;margin:12px 0 8px}#tutorialText{font-size:13px;line-height:1.5;min-height:40px}.tutorial-top{display:flex;align-items:center;justify-content:space-between;font-size:9px;letter-spacing:1px}.tutorial-top button{font:800 12px DriftRounded,system-ui;padding:7px 12px;border:1px solid #bdd9c7;border-radius:9px;background:transparent;color:#315b48;box-shadow:none;text-shadow:none}#tutorialCanvas{display:block;width:min(100%,270px);aspect-ratio:1;margin:12px auto;border-radius:13px;touch-action:none;outline-offset:3px}.tutorial-actions{display:grid;grid-template-columns:1fr 1.4fr 1fr 1.4fr;gap:7px}.tutorial-actions button{font:800 12px DriftRounded,system-ui;border-radius:9px;background:#d5f1e2;border:1px solid #a5d2b9;box-shadow:none;color:#315b48;padding:10px 2px;text-shadow:none}.tutorial-actions button:before{display:none}#tutorialStatus{font-size:11px;text-align:center;font-weight:800}.app .icon-button:focus-visible,button:focus-visible,a:focus-visible{outline:3px solid #1f624d;outline-offset:3px}#replayCanvas{display:block;width:auto;height:min(48dvh,450px);max-width:100%;aspect-ratio:1/2;margin:12px auto;border-radius:12px}
body.high-contrast #gameScreen{background:#e8f4fc;color:#102e42}body.high-contrast #gameScreen .label,body.high-contrast .flow-panel p,body.high-contrast .desktop-kicker,body.high-contrast .pip-name,body.high-contrast .goal-numbers,body.high-contrast .mobile-progress,body.high-contrast .side-note,body.high-contrast .mode-pill,body.high-contrast .result-card p,body.high-contrast .result-kicker,body.high-contrast .result-metrics span{color:#284e5b!important}body.high-contrast .icon-button,body.high-contrast .hud-next,body.high-contrast #hold{border-color:#315768!important;background:#fff!important;color:#163747!important}body.high-contrast .app .board{border-color:#163747}body.reduce-motion *,body.reduce-motion *:before,body.reduce-motion *:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
@media(max-width:699px),(max-aspect-ratio:6/5){.zen-clock{position:absolute;top:58px;right:0;font-size:8px;padding:3px 5px;z-index:3}.quiet-zen .zen-clock{position:static;margin-left:auto;font-size:10px}.quiet-zen header .game-identity{flex:1}.app .result-card #challengeHint,.app .result-card #challengeSolution,.app .result-card #watchReplay{margin-top:5px;min-height:29px;padding:6px}#gameScreen .result-card{max-height:calc(100dvh - 115px);overflow:auto}}
@media(max-height:650px){#tutorialCanvas{width:170px}#tutorialModal{padding:12px}#tutorialText{font-size:11px;min-height:0;margin:6px 0}#tutorialModal h2{font-size:19px}.app .result-card #challengeHint,.app .result-card #challengeSolution,.app .result-card #watchReplay{font-size:8px;min-height:23px;margin-top:4px;padding:4px}}
#challengeList{max-height:55dvh;overflow:auto;padding:3px 3px 8px}#challengeModal #closeChallenges{position:absolute;top:9px;right:10px;width:auto;min-height:32px;padding:6px 12px;background:#e2f2e9;border:1px solid #b8d6c4;border-radius:9px;font:800 11px DriftRounded,system-ui;color:#315b48;box-shadow:none;text-shadow:none}#challengeModal #closeChallenges:before{display:none}#challengeTitle{padding-right:55px}

.comfort-settings{border:1px solid #ffffff30;border-radius:16px;margin:16px 0;padding:12px}.comfort-settings legend{font-weight:900;color:#b4f6d8}.comfort-settings label{gap:12px}.comfort-settings select{max-width:58%}

.player-link{color:white;background:#142444d9;border:1px solid #ffffff60;border-radius:20px;padding:8px 12px;font:800 12px DriftRounded,system-ui;text-decoration:none;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.home-top{gap:8px}.account-card{max-width:620px;margin:20px auto}.account-actions{display:flex;flex-wrap:wrap;gap:12px}.account-actions button{min-height:44px}.profile-photo{width:56px;height:56px;border-radius:50%;object-fit:cover}.account-message{min-height:24px}.account-card [hidden]{display:none!important}@media(max-width:480px){.player-link{max-width:120px;font-size:11px}.home-top .best-pill{font-size:10px}}

#playerModal{width:min(94vw,620px);max-height:90dvh;overflow:auto;padding:20px;font-family:DriftRounded,system-ui,sans-serif}#playerModal .panel{background:transparent;box-shadow:none;padding:12px 0;margin:0}#playerModal h1{font-size:clamp(24px,6vw,36px);margin:14px 0}#playerModal .account-actions{display:flex;gap:10px;flex-wrap:wrap}#playerModal [hidden]{display:none!important}#playerModal pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}.inline-account{background:transparent;border:0;color:inherit;text-decoration:underline;cursor:pointer}#importDialog,#deleteAccountDialog{max-width:460px}.home-top .best-pill,.player-link{min-width:0;flex-shrink:1}

#playerModal .account-back{width:auto;min-height:36px;padding:8px 12px;border:0;box-shadow:none;border-radius:10px;background:#e8dfc6;color:#635b45;font-size:13px}#playerModal #signInGoogle{display:block;width:100%;padding:16px;min-height:48px;margin:16px 0;background:linear-gradient(#22ba8b,#078d66);color:white;border:1px solid #087557;border-radius:14px;font-weight:900;box-shadow:0 4px #06674d}#playerModal .account-actions button,#importDialog button,#deleteAccountDialog button{padding:12px 16px;border-radius:12px;background:#187187;color:white;border:1px solid #115a6b;font-weight:800;min-height:44px}#playerModal #deleteAccount,#confirmAccountDelete{background:#ad4242!important;border-color:#803030!important}

/* Drift player controls: consistent rounded edges, moulded depth and branded Google mark. */
#playerLink{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:46px;padding:7px 16px 7px 8px;max-width:220px;border:1px solid #b6e9fa;border-radius:16px;background:linear-gradient(180deg,#f8feff 0%,#e1f6ff 55%,#c5ebfb 100%);color:#235773;box-shadow:inset 0 2px 0 #fff,0 4px 0 #2987b6,0 7px 16px #064c7438;font:900 14px DriftRounded,system-ui,sans-serif;text-decoration:none;transition:transform .12s,box-shadow .12s;overflow:visible;white-space:nowrap}
#playerLink .player-label{overflow:hidden;text-overflow:ellipsis;min-width:0}#playerLink .google-icon-chip{width:30px;height:30px;flex:0 0 30px;border:1px solid #d2e6ed;background:white;box-shadow:0 1px 2px #154c6614}#playerLink.signed-in .google-icon-chip{display:none}
.google-icon-chip{display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:#fff}.google-icon-chip img{display:block;object-fit:contain;flex:none}
#playerModal{padding:26px;border:2px solid #91dafa;border-radius:26px;background:linear-gradient(160deg,#fffef1,#fff3d9);color:#63553d;box-shadow:inset 0 0 0 3px #fffdf3,0 6px 0 #3c93c4,0 20px 60px #062b5550}
#playerModal .player-modal-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}#playerModal .player-eyebrow{font:900 11px DriftRounded,system-ui;letter-spacing:1.8px;color:#8b784f}
#playerModal .account-back{display:inline-flex;align-items:center;justify-content:center;min-height:34px;width:34px;padding:0;border-radius:11px;border:1px solid #c8b99a;background:linear-gradient(#fffef3,#eee3cb);color:#7b6b4f;box-shadow:inset 0 1px white,0 2px #c6b38b;font:900 16px DriftRounded,system-ui;cursor:pointer}
#playerModal h1{font-weight:900;line-height:1.12;letter-spacing:-.7px;margin:15px 0 12px}#playerModal #playerEmail{font-size:13px;font-weight:800;color:#8a795b}#playerModal #guestDescription{font-size:14px;line-height:1.6}
#playerModal #signInGoogle{display:flex;align-items:center;justify-content:center;position:relative;gap:14px;width:100%;min-height:60px;padding:12px 20px;margin:22px 0 18px;border:1px solid #8ab8c9;border-radius:17px;background:linear-gradient(180deg,#fff 0%,#f7fcff 52%,#e1eff5 100%);color:#254b5d;box-shadow:inset 0 2px 0 white,0 4px 0 #7aa7b9,0 8px 18px #21556b16;font:900 17px DriftRounded,system-ui,sans-serif;text-shadow:none;cursor:pointer;transition:transform .12s,box-shadow .12s}
#playerModal #signInGoogle .google-icon-chip{width:34px;height:34px;flex:0 0 34px;border-radius:11px;background:white}#playerModal #accountStatus{font-size:12px;line-height:1.5;color:#8a795b}
#playerLink:hover,#playerModal #signInGoogle:hover{filter:brightness(1.025)}#playerLink:active,#playerModal #signInGoogle:active{transform:translateY(3px);box-shadow:inset 0 1px white,0 1px 0 #7aa7b9}#playerLink:focus-visible,#playerModal #signInGoogle:focus-visible,#playerModal .account-back:focus-visible{outline:3px solid #8874dc;outline-offset:4px}
@media(max-width:480px){#playerLink{max-width:150px;min-height:44px;gap:7px;padding-right:12px;font-size:12px;border-radius:14px}#playerLink .google-icon-chip{width:27px;height:27px;flex-basis:27px}#playerModal{padding:20px;border-radius:23px}#playerModal #signInGoogle{font-size:15px;gap:10px;padding:12px;min-height:56px}}
@media(prefers-reduced-motion:reduce){#playerLink,#playerModal #signInGoogle{transition:none}}

/* A visible, consistent exit at the start of every panel. */
dialog .modal-back{display:inline-flex;align-items:center;gap:8px;min-width:92px;min-height:44px;width:auto;margin:0 0 16px;padding:8px 15px;border:2px solid #c5e8ef;border-radius:14px;background:linear-gradient(#fffef7,#e6f7fa);color:#205777;box-shadow:0 3px 0 #acd4e0;font:900 15px DriftRounded,Nunito,sans-serif;cursor:pointer;}
dialog .modal-back span{font-size:28px;line-height:20px;}
dialog .modal-back:focus-visible{outline:3px solid #167eae;outline-offset:4px;}
dialog .modal-back:active{transform:translateY(2px);box-shadow:0 1px 0 #acd4e0;}
#playerModal .player-modal-heading{justify-content:space-between;}
#closePlayer{display:none;}

.settings-group{margin:14px 0;border:2px solid #d5e8e9;border-radius:18px;background:#fffdf5;overflow:hidden}.settings-group>summary{padding:15px 18px;font-weight:900;color:#27516c;cursor:pointer;min-height:48px}.settings-group-content{padding:0 16px 16px}.settings-group-content label{min-height:48px}.player-state{display:inline-block;padding:8px 13px;border-radius:20px;background:#eee0fa;color:#633b87;font-weight:900}dialog{max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain}dialog .modal-back{position:sticky;top:0;z-index:5} @media(max-width:380px){dialog{max-width:calc(100vw - 20px);padding:16px}.settings-group-content{padding:0 10px 12px}}
#modal .comfort-settings legend{color:#31586e;font-weight:900}#modal .comfort-settings{margin-top:12px}
