*{box-sizing:border-box}
:root{font-family:ui-rounded,"Arial Rounded MT Bold",system-ui,sans-serif;color:#253548;background:#f4f6f2;--ink:#26394a;--muted:#71818a;--gold:#e8a15d;--mint:#e4efe5}
html,body{width:100%;height:100%;margin:0;overflow:hidden;overscroll-behavior:none}
button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
.scene-background{position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none;background:#f4f6f2}
.scene-background img{display:block;width:100%;height:100%;object-fit:cover;object-position:center}
.app{position:relative;z-index:1;width:min(100%,900px);height:100svh;min-height:500px;margin:auto;display:flex;flex-direction:column;padding:max(6px,env(safe-area-inset-top)) 8px max(6px,env(safe-area-inset-bottom));gap:4px}
.topbar{height:72px;flex:none;display:flex;align-items:center;gap:5px;min-width:0}
.title-card{position:relative;height:68px;width:min(44%,310px);min-width:130px;display:flex;align-items:center;padding:0 11px}
.panel-art{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;pointer-events:none}
.title-copy{position:relative;z-index:1;display:grid;gap:1px;min-width:0}
.title{font-size:clamp(12px,3.4vw,20px);line-height:1.05;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#253548}
.subtitle{font-size:9px;color:#819087;white-space:nowrap}
.hud{display:flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;margin-left:auto}
.hud-panel{height:56px;position:relative;display:grid;place-items:center;min-width:68px;padding:0 8px}
.hud-panel img{position:absolute;inset:0;width:100%;height:100%;object-fit:fill}
.mode{position:relative;z-index:1;font-size:clamp(10px,2.8vw,14px);font-weight:900;color:#587958;white-space:nowrap}
.score-copy{position:relative;z-index:1;display:flex;align-items:center;gap:4px;font-size:10px;font-weight:800;color:#566a68;white-space:nowrap}
.score-copy b{font-size:clamp(15px,4vw,20px);color:#de7954}
.stage{position:relative;flex:1;min-height:0;overflow:hidden;border:1px solid #e0e7e0;border-radius:22px;background:rgba(255,255,255,.1);touch-action:none}
#game{position:relative;z-index:1;display:block;width:100%;height:100%;touch-action:none}
.bengal-character{position:absolute;z-index:2;left:0;top:0;display:block;max-width:none;width:120px;height:120px;object-fit:fill;pointer-events:none;user-select:none;filter:drop-shadow(0 2px 4px #6f624522);transition:opacity .12s ease}
.stage.relaxing .bengal-character{z-index:6}
.overlay{position:absolute;inset:0;display:grid;place-items:center;padding:12px;background:rgba(248,247,237,.45);z-index:5;touch-action:auto}
.overlay.hidden{display:none}
.dialog{position:relative;isolation:isolate;width:min(100%,350px);min-height:260px;padding:40px 25px 24px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.dialog:before{content:"";position:absolute;inset:0;background:url("assets/ui/result_panel_v2.png") center/100% 100% no-repeat;opacity:.97;z-index:-1}
.home-dialog:before{background-image:url("assets/ui/result_panel_v2.png")}
.start-banner{position:absolute;width:74%;height:64px;object-fit:contain;top:-25px;left:13%;pointer-events:none}
.dialog h1{margin:3px 0 4px;font-size:clamp(24px,7vw,32px);line-height:1.1;color:#26394a;text-shadow:0 1px #fff9}
.dialog p{margin:4px 0 10px;color:#75847c;font-size:13px;line-height:1.4}
.modeChoices{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%;margin:5px 0 7px}
.mode-choice{height:51px;position:relative;border:0;background:transparent;color:#587958;font-size:17px;font-weight:950}
.mode-choice img{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;opacity:.95}
.mode-choice span{position:relative;z-index:1}
.mode-choice.selected{filter:drop-shadow(0 0 4px #e8a15d88)}
.image-action{width:170px;height:58px;border:0;background:transparent;padding:0;display:grid;place-items:center;transition:transform .1s ease,filter .1s ease}
.image-action img{max-width:100%;max-height:100%;object-fit:contain}
.start-action{position:relative;isolation:isolate;color:#fff;font-size:16px;font-weight:950;text-shadow:0 1px 2px #52645a;letter-spacing:.03em}
.start-action img{position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;z-index:-1}
.result-action{height:68px;width:126px;display:flex;flex-direction:column;gap:1px;align-items:center;justify-content:center;color:#536d63;font-size:10px;font-weight:850;white-space:nowrap}
.result-action img{width:44px;height:44px;object-fit:contain}
.image-action:active,.icon-button:active{transform:scale(.93);filter:brightness(.96)}
.result-stats{display:flex;align-items:baseline;justify-content:center;gap:0 7px;margin:13px 0 17px;color:#627467;font-size:20px;font-weight:800;line-height:1.3;white-space:nowrap}
.result-stats b{color:#bd6f39;font-size:28px;font-weight:850;line-height:1}
.result-stats .stats-separator{margin:0 1px;color:#c2af8c}
.result-dialog #dialogText:empty{display:none}
.dialog-actions{display:flex;justify-content:center;gap:6px;width:100%}
.dialog-actions .image-action{width:126px;height:68px}
#resumeButton{min-height:46px;padding:0 24px;border:0;border-radius:15px;background:#e69a55;color:#fff;font-weight:900}
.footer{height:64px;flex:none;display:flex;align-items:center;gap:5px;min-width:0}
.next-panel{position:relative;width:75px;height:58px;flex:none;display:flex;align-items:center;justify-content:center;gap:3px;color:#687b81;font-size:9px;font-weight:750}
.next-panel .panel-art{object-fit:fill}
#nextMarble{position:relative;z-index:1;width:38px;height:38px;flex:none}
.status{flex:1;min-width:0;text-align:center;color:#6d7f84;font-weight:800;font-size:clamp(8px,2.2vw,11px);line-height:1.2}
.controls{display:flex;align-items:center;gap:2px;flex:none}
.icon-button{width:44px;height:44px;min-width:44px;padding:0;border:0;background:transparent;display:grid;place-items:center;transition:transform .1s ease,filter .1s ease;position:relative}
.icon-button img{width:100%;height:100%;object-fit:contain}
.icon-button[aria-pressed="true"]:after{content:"×";position:absolute;right:-1px;top:-2px;width:16px;height:16px;display:grid;place-items:center;border-radius:50%;background:#e47d66;color:white;font-size:12px;font-weight:900}
.debug:not([open]){display:none}.debug{position:absolute;z-index:8;bottom:70px;left:12px;width:min(340px,calc(100% - 24px));padding:10px 13px;border:1px solid #dce3df;border-radius:15px;background:#ffffffed;box-shadow:0 5px 22px #26384a1a}
html[data-build="beta"] .debug{display:none!important}
.debug summary{font-size:11px;font-weight:850;color:#72818a}.debug-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px 12px;margin-top:10px}.debug-grid label{display:grid;grid-template-columns:1fr auto;align-items:center;gap:3px;font-size:10px;color:#687881}.debug-grid output{color:#e28d4e;font-weight:850}.debug-grid input{grid-column:1/-1;width:100%;height:17px;margin:0;accent-color:#e99555}.debug-readout{margin-top:8px;color:#87939b;font-size:9px;line-height:1.5}
.audio-debug{margin-top:10px;padding-top:9px;border-top:1px solid #e7ece7}.audio-debug-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:10px;color:#687881}.audio-debug-heading label{display:flex;align-items:center;gap:5px}.audio-debug-heading select{font:inherit;color:#52695c;border:1px solid #d9e4d9;border-radius:8px;background:#fff;padding:4px 7px}.audio-preview-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin-top:7px}.audio-preview-grid button{min-height:32px;padding:3px 4px;border:1px solid #dce6dc;border-radius:9px;background:#f7faf5;color:#5f7566;font-size:9px;font-weight:800}.audio-preview-grid button:active{transform:scale(.96);background:#e8f1e8}
.hidden{display:none!important}
.audio-preview-grid button{min-height:44px}.audio-check-button{margin-top:6px;min-height:44px;padding:4px 10px;border:1px solid #dce6dc;border-radius:9px;background:#f7faf5;color:#5f7566;font-size:9px;font-weight:800}

/* Start screen V3: keep the game scene and result screen styles unchanged. */
.app.home-view .topbar,.app.home-view .footer{display:none}
.app.home-view{gap:0}
.app.home-view .stage{border:0;border-radius:0;background:transparent}
.app.home-view #game,.app.home-view #bengalCharacter{display:none}
.home-bengal{display:none;position:absolute;z-index:6;left:50%;bottom:9px;width:210px;height:210px;transform:translateX(-50%);object-fit:contain;object-position:center bottom;pointer-events:none;user-select:none;filter:drop-shadow(0 2px 4px #6f62451f)}
.app.home-view .home-bengal{display:block}
.stage.home-view .overlay{padding:0;background:transparent}
.stage.home-view .dialog.home-dialog{width:min(350px,calc(100% - 32px));height:302px;min-height:0;padding:24px 24px 20px;justify-content:flex-start;border-radius:30px}
.stage.home-view .dialog.home-dialog:before{background:none;background-color:#fffaf0ed;border:1px solid #e4d8c0;border-radius:30px;box-shadow:0 14px 34px #6a64451d,inset 0 0 0 5px #ffffff74;opacity:1}
.stage.home-view .home-dialog .start-banner,.stage.home-view .home-dialog p{display:none}
.stage.home-view .home-dialog h1{margin:0 0 8px;color:#26394a;font-size:30px;line-height:1.2;letter-spacing:.06em;text-shadow:0 1px #fff}
.stage.home-view .home-dialog .modeChoices{width:90%;display:grid;grid-template-columns:1fr;gap:14px;margin:0;}
.stage.home-view .home-dialog .mode-choice{width:100%;height:58px;position:relative;display:grid;place-items:center;padding:0 38px 0 20px;border:2px solid #d8e4d5;border-radius:17px;background:#eaf2e8;color:#5f795d;box-shadow:0 3px 0 #dbe6d8;font-size:21px;font-weight:900;letter-spacing:.025em;transition:background .12s ease,border-color .12s ease,box-shadow .12s ease,transform .1s ease}
.stage.home-view .home-dialog .mode-choice img{display:none}
.stage.home-view .home-dialog .mode-choice.selected{border-color:#6f916d;background:#e1eddf;color:#3e6545;box-shadow:0 0 0 4px #88a98232,0 3px 0 #c3d5bf}
.stage.home-view .home-dialog .mode-choice.selected:after{content:"✓";position:absolute;right:11px;top:50%;width:22px;height:22px;transform:translateY(-50%);display:grid;place-items:center;border:2px solid #fff;border-radius:50%;background:#6e976e;color:#fff;font-size:13px;font-weight:900;line-height:1}
.stage.home-view .home-dialog .mode-choice:active{transform:scale(.985)}
.stage.home-view .home-dialog .start-action{flex:none;width:216px;height:62px;margin-top:26px;overflow:hidden;}
.stage.home-view .home-dialog .start-action img{inset:auto;top:-87px;left:0;width:216px;height:216px;max-width:none;max-height:none;object-fit:contain;z-index:-1}
.stage.home-view .home-dialog .start-action span{position:relative;z-index:1;font-size:16px;}
@media(max-width:370px){
  .stage.home-view .dialog.home-dialog{width:calc(100% - 28px);height:298px;padding:22px 20px 18px}
  .stage.home-view .home-dialog h1{font-size:28px}
  .stage.home-view .home-dialog .modeChoices{width:90%;gap:14px}
  .stage.home-view .home-dialog .mode-choice{height:58px;font-size:20px}
  .stage.home-view .home-dialog .start-action{margin-top:25px}
  .home-bengal{width:190px;height:190px;bottom:6px}
}

/* Start screen V3 refinement: use the existing watercolor mode panel as a cropped, undistorted banner. */
.stage.home-view .dialog.home-dialog{width:100%;height:auto;min-height:0;padding:0;border-radius:0;background:transparent;transform:translateY(-28px);}
.stage.home-view .dialog.home-dialog:before{display:none;}
.stage.home-view .home-dialog h1{display:none;}
.stage.home-view .home-dialog .modeChoices{width:100%;gap:8px;margin:0;justify-items:center;}
.stage.home-view .home-dialog .mode-choice{width:min(300px,100%);height:auto;aspect-ratio:480 / 256;flex:none;overflow:visible;padding:0;border:0;border-radius:0;background:transparent;color:#476344;box-shadow:none;font-size:23px;}
.stage.home-view .home-dialog .mode-choice img{display:block;position:absolute;left:-3.3333%;top:-48.4375%;width:106.6667%;height:auto;max-width:none;max-height:none;aspect-ratio:1;object-fit:contain;opacity:1;}
.stage.home-view .home-dialog .mode-choice .mode-art{position:absolute;z-index:0;inset:0;display:block;overflow:hidden;pointer-events:none;}
.stage.home-view .home-dialog .mode-choice .mode-label{position:relative;z-index:1;display:block;padding:0 16px 7px;color:#476344;font-size:23px;font-weight:950;text-shadow:0 1px 0 #fff9;}
.stage.home-view .home-dialog .mode-choice.selected{border:0;background:transparent;box-shadow:none;filter:drop-shadow(0 0 4px #557d5570);}
.stage.home-view .home-dialog .mode-choice.selected:after{right:12px;top:42%;width:23px;height:23px;border:2px solid #fff;background:#658c63;font-size:13px;}
.stage.home-view .home-dialog .start-action{width:188px;height:54px;margin-top:22px;}
.stage.home-view .home-dialog .start-action img{top:-78px;left:0;width:188px;height:188px;}
.stage.home-view .home-dialog .start-action span{font-size:15px;}
@media(max-width:370px){
  .stage.home-view .dialog.home-dialog{width:100%;height:auto;padding:0;transform:translateY(-24px);}
  .stage.home-view .home-dialog .modeChoices{width:100%;gap:6px;}
  .stage.home-view .home-dialog .mode-choice{width:min(278px,100%);height:auto;}
  .stage.home-view .home-dialog .start-action{width:178px;height:52px;margin-top:20px;}
  .stage.home-view .home-dialog .start-action img{top:-74px;width:178px;height:178px;}
}
@media(max-width:370px){.app{padding-left:5px;padding-right:5px}.topbar{height:64px}.title-card{height:61px;min-width:114px;padding:0 8px}.title{font-size:11px}.subtitle{font-size:8px}.hud-panel{height:49px;min-width:55px;padding:0 5px}.hud{gap:1px}.score-copy{gap:2px;font-size:8px}.score-copy b{font-size:14px}.footer{height:58px;gap:1px}.next-panel{width:58px;height:48px;font-size:8px}#nextMarble{width:32px;height:32px}.controls{gap:0}.icon-button{width:44px;height:44px;min-width:44px}.status{display:none}}
@media(min-width:600px){.app{padding-left:18px;padding-right:18px;gap:8px}.topbar{height:82px}.title-card{width:330px;height:78px}.title{font-size:21px}.hud-panel{height:66px;min-width:112px}.mode{font-size:15px}.score-copy{font-size:13px}.score-copy b{font-size:21px}.stage{border-radius:28px}.footer{height:74px;gap:12px}.next-panel{width:118px;height:68px;font-size:12px}#nextMarble{width:48px;height:48px}.controls{gap:7px}.icon-button{width:50px;height:50px;min-width:50px}.status{font-size:12px}.scene-background img{object-fit:cover}}
@media (orientation:landscape) and (max-height:520px){.app{min-height:0;flex-direction:row;flex-wrap:wrap;align-content:stretch}.topbar{width:100%;height:54px}.title-card{height:52px}.hud-panel{height:48px}.stage{height:calc(100% - 118px);flex:1 1 100%}.footer{width:100%;height:54px}.next-panel{height:48px}.icon-button{width:44px;height:44px;min-width:44px}}

/* Confirmed UI allocation: watercolor panels are used in their new roles. */
.legacy-header{width:100%;display:flex;align-items:center;gap:5px}
.math-header{display:none;width:100%;height:64px;align-items:center;justify-content:space-between;gap:8px;padding:0 13px}
.app.modern-game-header .legacy-header{display:none}
.app.modern-game-header .math-header{display:flex}
.challenge-title{flex:1;min-width:0;color:#405a53;font-size:clamp(18px,5.5vw,21px);font-weight:650;line-height:1.1;text-align:left;white-space:nowrap}
.score-art{position:relative;isolation:isolate;flex:none;width:132px;height:64px;overflow:visible}
.score-art img{position:absolute;left:0;top:-26px;width:116px;height:116px;max-width:none;max-height:none;object-fit:contain;pointer-events:none}
.score-value{position:absolute;z-index:1;left:51px;top:50%;width:53px;transform:translateY(-50%);transform-origin:50% 50%;color:#bd6f39;font-size:23px;font-weight:750;line-height:1;text-align:center;white-space:nowrap;font-variant-numeric:tabular-nums}
.score-value.long-score{font-size:18px;letter-spacing:-.035em}
.score-value.score-pop{animation:score-pop 220ms cubic-bezier(.2,.8,.25,1)}
@keyframes score-pop{0%{transform:translateY(-50%) scale(1)}45%{transform:translateY(-50%) scale(1.13)}100%{transform:translateY(-50%) scale(1)}}
@media(prefers-reduced-motion:reduce){.score-value.score-pop{animation:none}}
.app.home-view .home-dialog .modeChoices{width:100%;gap:0;margin:0;justify-items:center}
.app.home-view .home-dialog .mode-choice{width:174px;height:103px;aspect-ratio:auto;flex:none;overflow:visible;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:#476344}
.app.home-view .home-dialog .mode-choice .mode-art{position:absolute;inset:0;display:block;overflow:visible;pointer-events:none}
.app.home-view .home-dialog .mode-choice .mode-art img{display:block;position:absolute;left:0;top:-37px;width:174px;height:174px;max-width:none;max-height:none;aspect-ratio:1;object-fit:contain;opacity:1}
.app.home-view .home-dialog .mode-choice .mode-label{position:absolute;left:31px;top:42px;width:73px;transform:translateY(-50%);padding:0;text-align:center;color:#405d43;font-size:23px;font-weight:950;text-shadow:0 1px 0 #fff9;white-space:nowrap}
.app.home-view .home-dialog .mode-choice.selected{filter:drop-shadow(0 0 3px #d5b46b88) drop-shadow(0 0 7px #e9d5a65c)}
.app.home-view .home-dialog .mode-choice.selected .mode-art:after{content:"";position:absolute;z-index:1;left:8px;right:8px;top:17px;bottom:-2px;border-radius:26px;background:radial-gradient(ellipse at 53% 52%,rgba(255,221,155,.18),rgba(242,207,140,.065) 64%,transparent 100%);mix-blend-mode:soft-light;pointer-events:none}
.app.home-view .home-dialog .mode-choice.selected:after{display:none!important;content:none!important}
.app.home-view .home-dialog .start-action{margin-top:24px;overflow:visible}
.app.home-view .home-dialog .start-action img{pointer-events:none}
.next-panel{width:100px;height:58px;flex:none;overflow:hidden;justify-content:flex-start;gap:0}
.next-panel .panel-art{inset:auto;left:0;top:-24px;right:auto;width:100px;height:100px;object-fit:contain}
.next-panel span{position:absolute;z-index:2;left:7px;top:50%;transform:translateY(-50%);width:44px;text-align:center;font-size:9px;line-height:1.1;color:#61765c}
#nextMarble{position:absolute;z-index:2;right:5px;top:50%;transform:translateY(-50%);width:34px;height:34px}
@media(max-width:370px){.app.home-view .home-dialog .mode-choice{width:164px;height:97px}.app.home-view .home-dialog .mode-choice .mode-art img{width:164px;height:164px;top:-35px}.app.home-view .home-dialog .mode-choice .mode-label{left:29px;top:39px}.app.home-view .home-dialog .start-action{width:178px;height:52px;margin-top:20px}.app.home-view .home-dialog .start-action img{top:-74px;width:178px;height:178px}.next-panel{width:92px}.next-panel .panel-art{width:92px;height:92px;top:-22px}#nextMarble{width:32px;height:32px;right:4px}.next-panel span{left:5px;width:42px;font-size:8px}}
@media(min-width:600px){.math-header{padding:0 16px}.challenge-title{font-size:23px}.score-art{width:150px;height:68px}.score-art img{width:124px;height:124px;top:-28px}.score-value{left:55px;width:57px;font-size:25px}.score-value.long-score{font-size:20px}.next-panel{width:118px;height:68px}.next-panel .panel-art{width:118px;height:118px;top:-28px}#nextMarble{width:40px;height:40px;right:6px}.next-panel span{left:8px;width:50px;font-size:10px}}

/* Match feedback appears in the clear space below the loop without intercepting aiming. */
.match-feedback{position:absolute;z-index:4;left:50%;bottom:clamp(110px,16%,140px);display:flex;flex-direction:column;align-items:center;gap:2px;width:max-content;max-width:calc(100% - 24px);transform:translateX(-50%);opacity:0;visibility:hidden;pointer-events:none;text-align:center;white-space:nowrap;text-shadow:0 1px 0 #fff8}
.match-feedback.visible{visibility:visible;animation:match-feedback 1.4s ease-out both}
.match-equation{color:#35485b;font-size:clamp(30px,8vw,34px);font-weight:750;line-height:1.15;letter-spacing:.015em;font-variant-numeric:tabular-nums}
.match-points{color:#e37f62;font-size:clamp(18px,5vw,20px);font-weight:800;line-height:1.2}
@keyframes match-feedback{0%{opacity:0;transform:translate(-50%,10px) scale(.92)}14%{opacity:1;transform:translate(-50%,0) scale(1.04)}26%{opacity:1;transform:translate(-50%,0) scale(1)}68%{opacity:1;transform:translate(-50%,0) scale(1)}100%{opacity:0;transform:translate(-50%,-7px) scale(1)}}
@media(prefers-reduced-motion:reduce){.match-feedback.visible{animation:none;opacity:1;transform:translateX(-50%)}}

/* POC 0.8 visual-only variant. No path, spacing, hitbox, or scoring values are changed. */
.app.visual-enhanced .match-feedback{top:calc(50% + 52px);bottom:auto}
.app.visual-enhanced .match-feedback.visible{animation:match-feedback-enhanced 1s ease-out both}
.app.visual-enhanced .match-equation{font-size:clamp(32px,8.4vw,36px);color:#30465b;text-shadow:0 1px 0 #fff,0 2px 5px #60788b25}
.app.visual-enhanced .match-points{color:#e97860;font-size:clamp(19px,5.2vw,21px);animation:match-points-float 1s ease-out both}
@keyframes match-feedback-enhanced{0%{opacity:0;transform:translate(-50%,8px) scale(.92)}18%{opacity:1;transform:translate(-50%,0) scale(1.04)}32%{opacity:1;transform:translate(-50%,0) scale(1)}72%{opacity:1;transform:translate(-50%,-2px) scale(1)}100%{opacity:0;transform:translate(-50%,-14px) scale(1)}}
@keyframes match-points-float{0%,24%{opacity:0;transform:translateY(7px)}42%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-9px)}}
.app.visual-enhanced .score-value{color:#d7684e;font-size:24px;text-shadow:0 1px 0 #fff8}
.app.visual-enhanced .score-value.long-score{font-size:19px}
.app.visual-enhanced .score-value.score-pop{animation:score-pop-08 250ms cubic-bezier(.2,.8,.25,1)}
@keyframes score-pop-08{0%{transform:translateY(-50%) scale(1)}45%{transform:translateY(-50%) scale(1.1)}100%{transform:translateY(-50%) scale(1)}}
.app.visual-enhanced.home-view .home-dialog .mode-choice.selected{filter:drop-shadow(0 0 5px #d9a83b9c) drop-shadow(0 0 10px #e9ca7861)}
.app.visual-enhanced.home-view .home-dialog .mode-choice.selected .mode-art:after{background:radial-gradient(ellipse at 53% 52%,rgba(255,220,145,.24),rgba(242,197,112,.08) 64%,transparent 100%)}
.app.visual-enhanced.home-view .home-dialog .mode-choice:active{transform:scale(.97)}
.app.visual-enhanced.home-view .home-dialog .start-action:active{transform:scale(.97);filter:brightness(1.04)}
@media(prefers-reduced-motion:reduce){.app.visual-enhanced .match-feedback.visible,.app.visual-enhanced .match-points,.app.visual-enhanced .score-value.score-pop{animation:none}}

/* Pause and result overlays use the v2 blank panel so all copy stays dynamic. */
.dialog:before{background-image:url("assets/ui/result_panel_v2.png")}
.home-dialog:before{background-image:url("assets/ui/result_panel_v2.png")}
.pause-dialog,.result-dialog{width:min(100%,370px);min-height:0;aspect-ratio:1313 / 1198;padding:clamp(58px,17%,76px) 9% clamp(50px,15%,70px);gap:0;justify-content:center}
.pause-dialog h1,.result-dialog h1{margin:0 0 8px;color:#245b3d;font-size:clamp(27px,7.5vw,34px);font-weight:950;line-height:1.08;text-shadow:0 1px #fff9}
.pause-dialog p,.result-dialog p{margin:0 0 20px;color:#37694a;font-size:clamp(14px,4vw,17px);font-weight:750;line-height:1.35}
.pause-resume-action{position:relative;isolation:isolate;overflow:visible;width:min(78%,280px);height:auto;min-height:0;aspect-ratio:791 / 301;margin-top:5px;padding:0;border:0;border-radius:0;background:transparent;color:#fff;font-size:clamp(18px,5.5vw,23px);font-weight:950;text-shadow:0 1px 3px #17665e,0 0 4px #17665e}
#resumeButton.pause-resume-action{min-height:0;padding:0;border:0;border-radius:0;background:transparent}
.pause-resume-action img{position:absolute;left:-1.138%;top:-72.56%;width:101.138%;height:auto;max-width:none;max-height:none;object-fit:contain;z-index:-1;pointer-events:none}
.pause-resume-action span{position:relative;z-index:1}
.pause-dialog #dialogTitle{margin-bottom:8px}
.pause-dialog #dialogText{margin-bottom:16px}
.result-dialog{padding-top:20%;padding-bottom:20%}
.result-dialog h1{margin-bottom:12px;font-size:clamp(31px,8.4vw,39px);color:#a95a19;text-shadow:0 1px #fff,0 2px #edc66a}
.result-dialog #dialogText{display:none}
.result-stats{display:flex;align-items:center;justify-content:center;gap:clamp(3px,1.2vw,7px);margin:0 0 13px;color:#24613e;font-size:clamp(14px,4.3vw,19px);font-weight:900;line-height:1.15;white-space:nowrap}
.result-stats b{min-width:48px;padding:4px 8px;border-radius:999px;background:#ffe99c;color:#d45b08;font-size:clamp(21px,6vw,28px);font-weight:950;line-height:1.05}
.result-stats .stats-separator{display:inline;margin:0 1px;color:#c28a45}
.dialog-actions{gap:clamp(14px,5vw,24px);width:100%;align-items:center;margin-top:3px}
.dialog-actions .image-action{width:min(42%,145px);height:76px;gap:2px;color:#24613e;font-size:clamp(12px,3.5vw,15px);font-weight:900}
.dialog-actions .image-action img{width:56px;height:56px}
.result-dialog.fail-dialog h1{color:#49664f;text-shadow:0 1px #fff}
@media(max-width:370px){.pause-dialog,.result-dialog{width:min(100%,340px);padding-left:8%;padding-right:8%}.result-dialog{padding-top:20%;padding-bottom:20%}.result-dialog h1{font-size:28px;margin-bottom:10px}.result-stats{font-size:13px;gap:3px;margin-bottom:10px}.result-stats b{font-size:21px;min-width:42px;padding:4px 6px}.dialog-actions .image-action{height:68px}.dialog-actions .image-action img{width:48px;height:48px}.pause-resume-action{width:80%}}
@media(prefers-reduced-motion:reduce){.pause-resume-action,.dialog-actions .image-action{transition:none}}

/* Start screen watercolor assembly using the supplied UI-start art set. */
.app.home-view{--home-mode-width:min(340px,calc(100vw - 52px));--home-start-width:calc(var(--home-mode-width) * .97);--home-mode-gap:7px;--home-start-gap:28px;--home-title-shift:-1.4vw;--home-label-center:52%}
.app.home-view .home-bengal{display:none}
.stage.home-view .dialog.home-dialog{width:100%;height:auto;min-height:0;padding:0;border-radius:0;background:transparent;transform:translateY(-22px);gap:0}
.stage.home-view .dialog.home-dialog:before{display:none}
.stage.home-view .home-dialog h1,.stage.home-view .home-dialog p{display:none}
.home-title-art,.home-slogan-art{position:relative;flex:none;overflow:hidden;pointer-events:none}
.home-title-art,.home-slogan-art{display:none}
.app.home-view .home-title-art,.app.home-view .home-slogan-art{display:block}
.home-title-art{width:min(360px,calc(100vw - 22px));aspect-ratio:780 / 481;margin:0 auto 3px;align-self:center;transform:translateX(var(--home-title-shift))}
.home-title-art img{position:absolute;left:0;top:-33.9%;width:102.5642%;height:auto;max-width:none;max-height:none}
.home-slogan-art{width:min(330px,calc(100vw - 42px));aspect-ratio:740 / 111;margin:0 auto 12px}
.home-slogan-art img{position:absolute;left:-4.0541%;top:-284.6%;width:108.1082%;height:auto;max-width:none;max-height:none}
.app.home-view .home-dialog .modeChoices{width:100%;display:flex;flex-direction:column;align-items:center;gap:var(--home-mode-gap);margin:0;}
.app.home-view .home-dialog .mode-choice{position:relative;display:block;width:var(--home-mode-width);height:auto;flex:none;overflow:visible;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:#315d43;font-size:23px;line-height:1;}
.app.home-view .home-dialog .mode-choice[data-mode="10"]{aspect-ratio:744 / 237}
.app.home-view .home-dialog .mode-choice[data-mode="20"]{aspect-ratio:738 / 221}
.app.home-view .home-dialog .mode-choice .mode-art{position:absolute;z-index:0;inset:0;display:block;overflow:visible;pointer-events:none}
.app.home-view .home-dialog .mode-choice .mode-art img{position:absolute;display:block;max-width:none;max-height:none;height:auto;aspect-ratio:auto;object-fit:contain;opacity:1}
.app.home-view .home-dialog .mode-choice[data-mode="10"] .mode-art img{left:-3.2258%;top:-120.13%;width:107.5269%}
.app.home-view .home-dialog .mode-choice[data-mode="20"] .mode-art img{left:-4.7425%;top:-134.14%;width:108.4011%}
.app.home-view .home-dialog .mode-choice .mode-label{position:absolute;z-index:2;left:50%;top:var(--home-label-center);width:auto;transform:translate(-50%,-50%);padding:0;color:#245a43;font-size:clamp(29px,calc(var(--home-mode-width) * .106),36px);font-weight:950;line-height:1;text-align:center;text-shadow:0 1px 0 #fff9;white-space:nowrap}
.app.home-view .home-dialog .mode-choice.selected{filter:drop-shadow(0 0 3px #d6a9299e) drop-shadow(0 0 8px #ffe27a88)}
.app.home-view .home-dialog .mode-choice.selected .mode-art img{filter:drop-shadow(0 0 5px #f4ca45) drop-shadow(0 0 11px #ffdb61c9)}
.app.home-view .home-dialog .mode-choice:not(.selected){filter:none}
.app.home-view .home-dialog .mode-choice.selected .mode-art:after{content:"";position:absolute;z-index:1;left:9%;right:8%;top:17%;bottom:9%;border-radius:38px;background:radial-gradient(ellipse at 49% 50%,rgba(255,232,139,.2),rgba(255,211,82,.08) 60%,transparent 100%);mix-blend-mode:soft-light;pointer-events:none}
.app.home-view .home-dialog .mode-choice:active{transform:scale(.985)}
.app.home-view .home-dialog .start-action{position:relative;width:var(--home-start-width);height:auto;aspect-ratio:791 / 301;flex:none;margin-top:var(--home-start-gap);overflow:visible;color:#fff;font-size:clamp(39px,calc(var(--home-mode-width) * .145),50px);text-shadow:0 1px 3px #17665e,0 0 4px #17665e;font-weight:950}
.stage.home-view .home-dialog .start-action img{position:absolute;left:-1.138%;top:-72.56%;width:101.138%;height:auto;max-width:none;max-height:none;object-fit:contain;z-index:-1}
.app.home-view .home-dialog .start-action span{position:relative;z-index:1;font-size:inherit;line-height:1}
@media(max-width:370px){
  .app.home-view{--home-mode-width:min(278px,calc(100vw - 52px));--home-start-gap:24px;--home-mode-gap:6px}
  .stage.home-view .dialog.home-dialog{transform:translateY(-15px)}
  .home-title-art{width:calc(100vw - 22px);margin-bottom:2px}
  .home-slogan-art{width:calc(100vw - 42px);margin-bottom:9px}
  .app.home-view .home-dialog .modeChoices{gap:4px}
  .app.home-view .home-dialog .start-action{margin-top:22px}
}
@media(prefers-reduced-motion:reduce){.app.home-view .home-dialog .mode-choice,.app.home-view .home-dialog .start-action{transition:none}}
