#game-screen{position:relative;overflow:hidden}.image-layer,.game-ui{position:absolute;inset:0}.image-layer{background:var(--bg)}#word-image{width:100%;height:100%;object-fit:cover}.gradient-overlay{position:absolute;inset:0;background:linear-gradient(#0006,transparent 28%,transparent 62%,#000b)}.game-ui{display:flex;flex-direction:column;padding:20px;gap:16px}.top-bar{order:1;display:flex;align-items:center;justify-content:space-between}.score{color:var(--bg);font-size:22px;font-weight:900;padding:8px 16px;border-radius:12px;background:var(--yellow,#FFD700);border:2px solid var(--text);box-shadow:4px 4px 0 var(--text);transform:rotate(2deg);letter-spacing:-0.5px;display:inline-block}.dice-area{order:3;align-self:center;margin-top:4px}.dice-button{display:block;border:0;background:none;width:115px;height:115px;padding:12px;filter:drop-shadow(2px 2px 0 #25f4ee) drop-shadow(-2px -2px 0 #fe2c55)}.dice{width:100%;height:100%;animation:sway 3s ease-in-out infinite}.dice>rect{fill:white}.dice g{fill:#101010}.rolling .dice{animation:roll .45s linear infinite}.awaiting .dice-area{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);margin:0}.awaiting .dice-button{width:180px;height:180px;padding:15px}.feedback{order:2;align-self:center;margin-top:0;background:#000a;padding:10px 15px;border-radius:8px;font-size:14px;max-width:100%;overflow-wrap:anywhere;text-align:center}.feedback:empty{display:none}.feedback.success{color:#FFD700;font-size:24px;font-weight:900;background:none;text-shadow:0 2px 10px #000,0 0 20px rgba(255,215,0,.5);animation:feedin .35s cubic-bezier(.34,1.56,.64,1)}.feedback.error{color:#ff8ba3}.bottom-area{order:4;margin-top:auto;padding-bottom:8px}.english-subtitle{font-size:clamp(48px,12vw,72px);text-align:center;margin:0 0 12px;text-shadow:0 2px 8px black;overflow-wrap:anywhere;font-weight:900;letter-spacing:-1px}.controls{display:flex;align-items:center;justify-content:center;gap:18px;position:relative}.speak-button{background:var(--cyan);color:black;display:flex;justify-content:center;align-items:center;gap:10px;border:0;border-radius:6px;font-weight:650;padding:16px 32px;min-height:56px;min-width:190px}.speak-button.listening{animation:pulse 1s infinite}.speak-button:active{transform:scale(.92);box-shadow:0 0 30px var(--cyan),0 0 8px #fff2;filter:brightness(1.25)}.help-button{width:54px;height:54px;font-size:27px;font-weight:700;position:absolute;right:0;top:50%;transform:translateY(-50%)}.help-button:hover{transform:translate(-2px,calc(-50% - 2px)) !important}.help-modal{position:absolute;inset:0;z-index:4;background:rgba(0,0,0,0.6);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);display:flex;align-items:flex-end}.help-content{position:relative;width:100%;padding:40px 26px;text-align:center}.help-content .close-button{position:absolute;right:16px;top:16px;z-index:10}.help-content h2{font-size:clamp(26px,7vw,38px);overflow-wrap:anywhere;margin:20px 0}.listen-button{color:var(--bg);background:var(--yellow,#FFD700);border:3px solid var(--text);border-radius:16px;width:64px;height:64px;font-size:32px;box-shadow:4px 4px 0 var(--text);transition:all 0.2s;transform:rotate(2deg);display:inline-flex;align-items:center;justify-content:center}@keyframes roll{to{transform:rotate(360deg)}}@keyframes sway{0%,100%{transform:rotate(-10deg)}50%{transform:rotate(10deg)}}@keyframes pulse{50%{box-shadow:0 0 0 6px #fe2c5530}}@keyframes feedin{from{opacity:0;transform:scale(.7) translateY(-10px)}to{opacity:1;transform:none}}@keyframes star-pop{0%{transform:scale(1) rotate(0)}40%{transform:scale(1.7) rotate(20deg)}70%{transform:scale(.9) rotate(-10deg)}100%{transform:scale(1) rotate(0)}}.score.pop{animation:star-pop .5s cubic-bezier(.34,1.56,.64,1)}
.dice-button{filter:none}.dice>rect{fill:#fff;stroke:var(--cyan);stroke-width:2}.speak-button{background:var(--btn-bg, var(--cyan)) !important;border:2px solid var(--text) !important;border-radius:12px !important;font-weight:800;min-height:72px;font-size:26px;padding:20px 48px;box-shadow:4px 4px 0 var(--text) !important;transform:rotate(-2deg) !important;transition:all 0.1s}.speak-button:active,.speak-button.listening{background:var(--red) !important;transform:scale(0.95) rotate(-2deg) !important;box-shadow:2px 2px 0 var(--text) !important;filter:none !important}.help-content{background:var(--bg);color:var(--text);border:4px solid var(--text);border-bottom:none;border-radius:24px 24px 0 0;box-shadow:0 -8px 0 var(--red)}.help-content h2{font-weight:900;text-transform:uppercase;color:var(--cyan);text-shadow:2px 2px 0 var(--text);transform:rotate(-2deg);margin-bottom:12px}.listen-button:active{transform:translate(2px,2px) rotate(2deg);box-shadow:2px 2px 0 var(--text);background:var(--cyan)}.feedback.success{color:var(--bg);font-size:24px;font-weight:900;background:var(--yellow,#FFD700);border:3px solid var(--text);padding:10px 20px;border-radius:12px;box-shadow:4px 4px 0 var(--text);transform:rotate(-2deg);margin-top:12px;text-transform:uppercase;display:inline-block;text-shadow:none}.feedback.error{color:var(--bg);font-size:20px;font-weight:900;background:var(--red);border:2px solid var(--text);padding:8px 16px;border-radius:10px;box-shadow:4px 4px 0 var(--text);transform:rotate(1deg);margin-top:12px;text-transform:uppercase;display:inline-block}.english-subtitle{letter-spacing:-.5px}.help-translation{font-size:24px;color:var(--bg);background:var(--cyan);border:2px solid var(--text);padding:8px 16px;border-radius:10px;font-weight:800;text-transform:uppercase;display:inline-block;box-shadow:4px 4px 0 var(--text);transform:rotate(-1deg);margin-bottom:24px}

#word-image{object-fit:contain;object-position:center center}

.image-layer{background:#fff}.gradient-overlay{background:none}#word-image{transform-origin:center;object-fit:contain;object-position:center}

#word-image{position:absolute;top:16%;left:0;width:100%;height:56%;object-fit:contain}

#game-screen:not(.awaiting) .dice-area{position:absolute;top:18px;left:50%;transform:translateX(-50%);margin:0}#game-screen:not(.awaiting) .dice-button{width:115px;height:115px;padding:12px}

/* Keep the original dark dice stage; white belongs to the loaded image. */
#game-screen.awaiting .image-layer{background:var(--bg)}
/* A dark edge keeps the brutalist controls visible on white images too. */
.speak-button{border-color:#0a0a0a !important;box-shadow:4px 4px 0 #0a0a0a !important}
.speak-button:hover{transform:translate(-2px,-2px) rotate(-2deg) !important;box-shadow:6px 6px 0 #0a0a0a !important}
.speak-button:active,.speak-button.listening{box-shadow:2px 2px 0 #0a0a0a !important}
#word-image{top:25%;height:47%}
@media(max-width:699px){
 .game-ui{padding:16px;gap:10px}
 .controls{gap:12px;padding-right:60px}
 .speak-button{min-width:0;width:100%;padding:16px 10px;font-size:22px;min-height:64px}
 .english-subtitle{font-size:clamp(32px,10vw,52px)}
}
@media(max-height:650px){
 #word-image{top:30%;height:36%}
 .english-subtitle{font-size:32px;margin-bottom:8px}
 .speak-button{min-height:56px;padding:12px 16px;font-size:20px}
}

.play-mode{position:absolute;top:calc(50% + 105px);left:50%;transform:translateX(-50%);margin:0;padding:12px 16px;border:2px solid var(--cyan);border-radius:12px;width:max-content;max-width:calc(100% - 32px);background:var(--surface);color:var(--text);display:flex;gap:18px}
.play-mode legend{font-weight:800;padding:0 6px;font-size:16px}.play-mode label{display:flex;align-items:center;gap:6px;min-height:32px;font-weight:700}.play-mode input{accent-color:var(--cyan);width:18px;height:18px}
@media(max-height:520px){.awaiting .dice-area{top:42%}.play-mode{top:calc(42% + 95px);padding:6px 12px}}

/* Camera composition is opt-in; the regular game keeps its layout. */
.camera-actions{position:absolute;right:20px;top:82px;display:flex;flex-direction:column;align-items:flex-end;gap:10px;z-index:2}
.camera-button{width:54px;height:54px;background:var(--cyan);color:#111;border:3px solid #111;border-radius:10px;box-shadow:4px 4px 0 var(--red);font-size:28px;transform:rotate(2deg)}
.camera-button:active{transform:translate(2px,2px) rotate(2deg);box-shadow:2px 2px 0 var(--red)}
.camera-button[aria-pressed=true]{background:var(--red);box-shadow:4px 4px 0 var(--cyan)}
.camera-space-button{background:#111;color:#fff;border:2px solid #fff;border-radius:8px;padding:6px 8px;font-size:12px;font-weight:800;min-height:36px}
.camera-layout #app{width:min(100vw,56.25dvh);height:min(100dvh,177.7778vw);margin:0 auto;padding:0;border-radius:0}
.camera-layout .site-footer{display:none}
.camera-layout .camera-actions{top:78px;right:12px;gap:6px}
.camera-layout .game-ui{padding:12px;gap:6px}
.camera-layout #word-image{top:19%;height:25%}
.camera-layout .bottom-area{position:absolute;top:44%;left:12px;right:12px;margin:0;padding:0}
.camera-layout .english-subtitle{font-size:clamp(24px,4.5dvh,40px);line-height:1.1;margin-bottom:8px}
.camera-layout .controls{padding-right:54px;gap:8px}
.camera-layout .speak-button{width:100%;min-width:0;font-size:clamp(16px,2.8dvh,24px);padding:10px;min-height:48px}
.camera-layout .help-button{width:44px;height:44px}
.camera-layout .feedback{position:absolute;top:35%;left:12px;right:12px;font-size:16px;z-index:2;padding:6px;margin:0}
.camera-panel{position:absolute;top:60%;bottom:7%;left:0;right:0;overflow:hidden;background:#0a0a0a;border-top:3px solid var(--cyan)}
.camera-panel video{display:block;width:100%;height:100%;object-fit:cover;transform:scaleX(-1)}
.camera-notice{position:absolute;bottom:0;left:0;right:0;min-height:7%;margin:0;padding:6px 10px;background:#111;color:#fff;font-size:11px;line-height:1.3;z-index:3}
.camera-layout .awaiting .dice-area{top:29%}
.camera-layout .play-mode{top:calc(29% + 100px);gap:10px;padding:8px;font-size:14px}
@media(max-height:600px){.camera-layout .camera-actions{top:68px}.camera-layout .camera-button{width:46px;height:46px;font-size:24px}.camera-layout .camera-space-button{font-size:10px;min-height:28px;padding:4px}.camera-layout .awaiting .dice-button{width:130px;height:130px}.camera-layout .play-mode{top:calc(29% + 72px)}.camera-layout .speak-button{min-height:40px}}

.play-mode{flex-wrap:wrap;justify-content:center;width:280px;gap:8px 18px}
.start-game-button{flex-basis:100%;min-height:46px;padding:8px 18px;border:3px solid #fff;border-radius:10px;background:var(--yellow);color:#111;box-shadow:4px 4px 0 var(--cyan);font-weight:900;font-size:20px;transform:rotate(-1deg)}
.start-game-button:active{transform:translate(2px,2px) rotate(-1deg);box-shadow:2px 2px 0 var(--cyan)}
.camera-layout .play-mode{width:260px}
@media(max-height:650px){.awaiting .dice-area{top:38%}.awaiting .dice-button{width:150px;height:150px}.play-mode{top:calc(38% + 85px);padding:8px}.play-mode label{min-height:26px}.camera-layout .awaiting .dice-area{top:23%}.camera-layout .play-mode{top:calc(23% + 80px)}.start-game-button{min-height:40px;font-size:18px}}

.camera-frame-toggle{position:absolute;top:10px;left:10px;background:var(--yellow);color:#111;border:2px solid #111;border-radius:8px;padding:8px 12px;font-weight:900;box-shadow:3px 3px 0 var(--cyan);min-height:40px}
.camera-frame-controls{position:absolute;inset:8px;overflow:auto;padding:12px 40px 12px 12px;background:#111e;color:#fff;border:2px solid var(--cyan);border-radius:10px}
.camera-frame-controls label{display:block;font-size:13px;font-weight:800;margin-bottom:8px}.camera-frame-controls input{display:block;width:100%;accent-color:var(--cyan);min-height:24px}.camera-frame-controls button{background:var(--yellow);border:2px solid #fff;border-radius:6px;padding:6px 12px;font-weight:800}#camera-frame-close{position:absolute;right:6px;top:6px;font-size:22px}

.camera-layout .camera-panel{bottom:0}
.camera-recording-toast{position:absolute;left:16px;right:16px;top:64%;padding:18px 40px 18px 18px;background:var(--yellow);color:#111;border:3px solid #111;border-radius:12px;box-shadow:5px 5px 0 var(--cyan);z-index:6;font-size:14px;line-height:1.4}
.camera-recording-toast strong{font-size:18px}.camera-recording-toast p{margin:8px 0 0}#camera-toast-close{position:absolute;top:6px;right:6px;background:#111;color:#fff;border:0;border-radius:6px;width:28px;height:28px;font-size:22px}
.camera-layout .site-footer{display:flex;position:absolute;left:auto;right:10px;bottom:10px;width:auto;height:auto;background:none;border:0;z-index:5}
.camera-layout .site-footer .about-button{background:var(--yellow);padding:5px 10px;font-size:11px;min-height:28px;border:2px solid #111;box-shadow:2px 2px 0 var(--cyan);color:#111}

.camera-frame-toggle{top:8px;left:8px;width:28px;height:28px;min-height:28px;padding:0;font-size:18px;line-height:1;border-width:2px;border-radius:6px;box-shadow:2px 2px 0 var(--cyan)}

/* Keep pronunciation help in the vocabulary half, clear of the camera. */
.camera-layout .help-modal{bottom:40%;align-items:flex-end;overflow-y:auto;overscroll-behavior:contain;background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}
.camera-layout .help-content{min-height:0;padding:32px 18px 18px;border-bottom:4px solid var(--text);border-radius:18px 18px 0 0;box-shadow:0 -5px 0 var(--red)}
.camera-layout .help-content h2{font-size:clamp(24px,4dvh,36px);margin:12px 0}
.camera-layout .help-translation{font-size:18px;margin-bottom:16px}

.camera-options{position:relative}.camera-options summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:center;width:30px;height:30px;background:#111;color:#fff;border:2px solid var(--cyan);border-radius:7px;font-size:18px}.camera-options summary::-webkit-details-marker{display:none}
.camera-options-menu{position:absolute;right:36px;top:0;display:flex;flex-direction:column;gap:8px;width:150px;padding:10px;background:#111;border:2px solid var(--cyan);border-radius:10px;box-shadow:3px 3px 0 var(--red)}

.hard-mode-choice{flex-basis:100%;flex-wrap:wrap;justify-content:center}.hard-mode-choice small{flex-basis:100%;font-size:11px;font-weight:500;text-align:center}
.word-image-circle{position:absolute;top:25%;left:50%;transform:translateX(-50%);width:min(80%,42dvh);aspect-ratio:1;border-radius:50%;overflow:hidden;background:#fff;border:3px solid #111;box-shadow:4px 4px 0 var(--cyan)}
.word-image-circle:has(img[hidden]){display:none}
#word-image,.camera-layout #word-image{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;padding:15%;border-radius:0}
.camera-layout .word-image-circle{top:19%;width:min(70%,24dvh)}
.english-subtitle{color:#111;background:var(--yellow);border:3px solid #111;border-radius:10px;box-shadow:4px 4px 0 var(--red);text-shadow:none;font-size:clamp(24px,6vw,42px);line-height:1.15;padding:6px 12px;margin:0 auto 14px;width:fit-content;max-width:100%;max-height:20dvh;overflow-y:auto;transform:rotate(-1deg)}
.camera-layout .english-subtitle{font-size:clamp(20px,3.5dvh,30px);max-height:8dvh;margin-bottom:12px}
.help-content{border-bottom:4px solid var(--red);box-shadow:0 -5px 0 var(--red),inset 0 -4px 0 var(--red)}
.camera-layout .help-content{border-bottom:4px solid var(--red);box-shadow:0 -5px 0 var(--red),inset 0 -4px 0 var(--red)}
@media(max-height:650px){.word-image-circle{top:24%;width:min(70%,30dvh)}.camera-layout .word-image-circle{top:20%;width:22dvh}.play-mode{top:calc(32% + 78px)}.awaiting .dice-area{top:32%}.camera-layout .play-mode{top:calc(21% + 65px)}.camera-layout .awaiting .dice-area{top:21%}.play-mode{gap:4px 12px}.hard-mode-choice small{font-size:10px}}

@media(min-width:850px){
 body:not(.camera-layout) .controls{padding-right:54px;gap:8px}
 body:not(.camera-layout) .speak-button{min-width:0;width:100%;font-size:22px;padding:14px 10px;min-height:60px}
 body:not(.camera-layout) .word-image-circle{width:min(78%,34dvh)}
 body:not(.camera-layout) .english-subtitle{font-size:30px}
}
