/* Revision 05 — a consistent scale, clear material, and continuous geometry. */
:root{--white:#eee;--panel:#202020;--edge:#393939;--muted:#a1a1a1}
body,button,input{font-family:"Helvetica Neue",Arial,"Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;-webkit-font-smoothing:antialiased}
button{font-weight:400;border-radius:10px;background:#202020;border-color:#393939;letter-spacing:.06em}
button:active,button.pressed{background:#404040;border-color:#888}
#app{max-width:440px}.brand{font-size:12px;letter-spacing:.26em;color:#b0b0b0}
header{left:20px;right:20px}.stageNav{gap:2px}#stageLabel{font-size:11px;color:#ccc;letter-spacing:.1em}
#infoButton{font-size:11px;color:#ddd;padding:0 12px;border-color:#424242}
#stageContent{top:calc(var(--top) + 96px)}
#question{font-size:17px;font-weight:400;letter-spacing:.03em;line-height:1.8;min-height:54px;color:#eee}
#app[data-stage^="3"] #question{font-size:16px;min-height:48px}
#play{inset:66px 0 0}.boardTools{height:24px;min-height:24px;margin-bottom:6px}.boardTools button{min-height:24px;font-size:10px}.boardTools .memoHelp{font-size:10px}
#app[data-stage^="3"] #play{height:calc(var(--grid) + 30px)}
.tile,.tile.center{border:1px solid #3d3d3d;background:#222;border-radius:11px}.tile span{font-size:24px;color:#eee}
.singleButton{width:94px;height:94px;background:#242424;border:1px solid #505050;border-radius:14px}
#answerForm input,#ok{font-size:17px;border-radius:10px}#answerForm input{background:#141414;border-color:#414141;letter-spacing:.08em}#answerForm input::placeholder{font-size:12px}
#status{top:calc(var(--top) + 150px);font-size:11px}
.keyRow button{height:42px;min-height:42px;font-size:14px;background:#242424;border-color:#454545}
#keyPanel{width:min(calc(100vw - 32px),320px);margin-left:0;transform:translateX(-50%);padding:8px 0 0;bottom:calc(var(--bottom) + 12px)}
.keyHeader{height:28px;margin-bottom:8px}.keyHeader>span{display:none}.keyTabs{margin-left:auto}.keyTabs button{font-size:11px;min-height:28px}
.keyRow.numeric{gap:6px;margin-bottom:6px}
.keyRow.numeric button,.keyRow.numeric:nth-child(3)>button:nth-child(2){width:44px;height:44px;min-height:44px;background:#242424;font-size:18px;border-radius:9px}
.keyRow.numeric .zero{width:94px}
body.keyboardOpen #app{overflow:hidden;height:var(--vh)}
body.keyboardOpen .brand{visibility:hidden}
body.keyboardOpen #stageContent{top:calc(var(--top) + 58px);height:auto;bottom:calc(var(--bottom) + var(--keyboard-height) + var(--entry-cell) + 32px)}
body.keyboardOpen #question{position:relative!important;top:auto!important;transform:none!important;min-height:38px!important;font-size:14px!important;line-height:1.5}
body.keyboardOpen #play{display:flex!important;inset:46px 0 0}
body.keyboardOpen #app[data-stage^="3"] #play{inset:auto 0 0;height:calc(var(--grid) + 30px)}
body.keyboardOpen #wordResults{display:none!important}
body.keyboardOpen #answerForm{bottom:calc(var(--bottom) + var(--keyboard-height) + 24px)}
body.keyboardOpen #answerForm input,body.keyboardOpen #ok{font-size:16px}
body.keyboardOpen .singleButton{width:64px;height:64px}
body.keyboardOpen .cluebar .clue{font-size:12px}
body.keyboardOpen #status{top:calc(var(--top) + 95px)}
.referenceCube{position:absolute;bottom:0;left:50%;transform:translateX(-50%);background:transparent;border-color:#444;min-height:34px;padding:0 14px;font-size:11px}
.scene{animation:weightless 7s ease-in-out infinite}.scene.morphing{animation:none}.scene.morphing .cubie{transition:none}
.face{border-radius:5px;background:linear-gradient(145deg,#535557,#303234);border:1px solid #0e0e0e;box-shadow:inset 0 0 0 1px #ffffff18}
.face.U{background:#606264}.face.L{background:#353739}.face.R{background:#47494b}.face.D{background:#292b2d}
.face.glow{background:var(--color);box-shadow:inset 0 0 14px #ffffff22,0 0 14px color-mix(in srgb,var(--color) 35%,transparent)}
.scene.small .face,.innerCore .face{border-radius:14px;border:1px solid #5b5d60;background:linear-gradient(145deg,#484b50,#24272b);color:#f1f1f1;font:12px "Helvetica Neue",sans-serif;letter-spacing:.01em;box-shadow:inset 0 1px 8px #ffffff12}
.scene.small .face.red,.innerCore .face.red{color:#ff4c57}
.scene.small .cubie:before,.innerCore:before{content:'';position:absolute;width:calc(var(--unit)*1.12);height:calc(var(--unit)*1.12);left:calc(var(--unit)*-.56);top:calc(var(--unit)*-.56);border-radius:50%;background:#303338;pointer-events:none}
.cinema{background:#000}.cinema.clearOverlay{background:#0009;backdrop-filter:blur(9px);-webkit-backdrop-filter:blur(9px)}
.clearOverlay .clearHeading{font-size:clamp(27px,8.2vw,42px);letter-spacing:.08em;font-weight:400;white-space:nowrap;line-height:1.2;margin:0 0 36px;animation:overlayReveal .65s both}
.clearOverlay button{font-size:11px;min-height:40px;border-color:#777;background:#ffffff08;animation:overlayReveal .65s .16s both}
@keyframes overlayReveal{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.opening .openingLogo{font-family:"Helvetica Neue",Arial,sans-serif;font-weight:300;font-size:clamp(34px,10vw,48px);letter-spacing:.16em;margin:0 0 42px;animation:logoArrival 1.8s cubic-bezier(.16,1,.3,1) both}
.opening button{border-color:#666;border-radius:9px;min-height:42px;padding:0 32px;font-size:11px;animation:overlayReveal 1s .4s both}
.opening .openingNote{font-size:9px;color:#888;letter-spacing:.16em;animation:overlayReveal 1s .65s both}
.mission{font-size:clamp(14px,4.2vw,19px);white-space:nowrap;letter-spacing:.08em;animation:overlayReveal .8s both}
@keyframes logoArrival{from{opacity:0;letter-spacing:.29em;transform:translateY(5px)}to{opacity:1;letter-spacing:.16em;transform:translateY(0)}}
#info.holdShaking .modal{animation:none}.closeRow button.holding:after{display:none}
.holdReady{animation:holdBreath 3s ease-in-out both!important}
@keyframes holdBreath{0%{border-color:#555}100%{border-color:#eee;filter:brightness(1.25)}}
.cinematicBusy header,.cinematicBusy #answerForm,.cinematicBusy #play{pointer-events:none}
.boardBridge{position:fixed;z-index:45;perspective:850px;pointer-events:none}.boardBridge .board{width:100%;height:100%;transform-origin:center;transform-style:preserve-3d}.boardBridge button:disabled{opacity:1}
#app.breakingCube .scene{animation:none}#app.breakingCube .cubie{transition:none}
.completed #stageContent{top:80px;bottom:50px}.completed #play{inset:0;justify-content:center}.completed #question{display:none}
.congratulations{font-size:11px;letter-spacing:.22em;color:#bbb;margin:0 0 30px;animation:overlayReveal .8s both}
.finalLogo{white-space:nowrap;font-size:clamp(29px,8.5vw,43px);font-weight:300;letter-spacing:.1em;margin:0 0 48px;color:#f4f4f4;animation:overlayReveal 1.2s .6s both}
.finalLogo .diceLetter{animation:revealDice 1.8s 1.9s both}
@keyframes revealDice{from{color:#f4f4f4}to{color:#ff3347}}
.completed .clearShare{animation:overlayReveal 1s 2.5s both}
@media(prefers-reduced-motion:reduce){.opening *,.clearOverlay *,.finalLogo,.congratulations,.finalLogo .diceLetter,.completed .clearShare{animation-duration:1ms!important;animation-delay:0s!important}}

/* Revision 06: immutable puzzle geometry, two keyboards side by side. */
#app #stageContent,body.keyboardOpen #app #stageContent{top:calc(var(--top) + 84px);bottom:calc(var(--bottom) + var(--key-reserve) + var(--cell) + 23px);height:auto}
#app #answerForm,body.keyboardOpen #app #answerForm{top:auto;bottom:calc(var(--bottom) + var(--key-reserve) + 16px);width:var(--grid);height:var(--cell);margin-left:calc(var(--grid)/-2)}
#app #answerForm input,#app #ok,body.keyboardOpen #app #answerForm input,body.keyboardOpen #app #ok{height:var(--cell)!important;font-size:17px}
#app #play,body.keyboardOpen #app #play{display:flex!important;inset:54px 0 0}
#app[data-stage^="3"] #play,body.keyboardOpen #app[data-stage^="3"] #play{inset:auto 0 0;height:calc(var(--grid) + 30px)}
#app #question,body.keyboardOpen #app #question{font-size:16px!important;line-height:1.65;min-height:48px!important}
body.keyboardOpen .brand{visibility:visible}
body.keyboardOpen .singleButton{width:94px;height:94px}
body.keyboardOpen .cluebar .clue{font-size:14px}
body.keyboardOpen #status,#status{top:calc(var(--top) + 132px)}
#keyPanel{width:calc(100% - 24px);max-width:416px;height:calc(var(--key-reserve) - 8px);bottom:calc(var(--bottom) + 8px);padding:4px 0 0;border:0}
.dualKeyHeader{height:32px;display:flex;gap:6px;justify-content:flex-end;margin-bottom:8px}
.dualKeyHeader button{font-size:11px;min-height:28px;padding:0 12px;background:#171717}
.dualKeys{display:grid;grid-template-columns:minmax(0,1fr) calc(var(--number-key)*3 + 8px);gap:10px;height:calc(var(--number-key)*4 + 12px)}
.alphaKeys{display:grid;grid-template-rows:repeat(3,1fr);gap:4px;min-width:0}
.alphaRow{display:flex;justify-content:center;gap:3px;min-height:0}
.alphaRow button{flex:1;max-width:calc((100% - 27px)/10);min-width:0;min-height:0;padding:0;font-size:13px;background:#242424;border:1px solid #424242;border-radius:6px;letter-spacing:0}
.numberKeys{display:grid;grid-template-columns:repeat(3,var(--number-key));grid-template-rows:repeat(4,var(--number-key));gap:4px}
.numberKeys button{width:var(--number-key);height:var(--number-key);min-height:0;padding:0;font-size:15px;background:#242424;border-color:#424242;border-radius:6px;letter-spacing:0}
.numberKeys .zero{width:auto;grid-column:span 2}.numberKeys .dot{background:#f5f5f3!important;color:#111!important}
.alphaRow button:active,.numberKeys button:active{background:#555}
.finalLogo{font-size:clamp(28px,8vw,40px);letter-spacing:.08em}
.finalLogo .diceD{--dice-color:#ff354b}.finalLogo .diceI{--dice-color:#348cff}.finalLogo .diceC{--dice-color:#32db88}.finalLogo .diceE{--dice-color:#ffe14a}
@keyframes revealDice{from{color:#f4f4f4}to{color:var(--dice-color)}}
.resetTools{margin-top:16px;border-bottom:1px solid #303030;padding-bottom:10px}.resetTools summary{font-size:10px;letter-spacing:.14em;color:#aaa;cursor:pointer;padding:7px 0}.resetTools button{display:block;width:100%;min-height:36px;margin-top:6px;font-size:11px;text-align:left;padding:0 10px;background:#1b1b1b}
#info .modal{max-height:calc(var(--vh) - var(--top) - var(--bottom) - 64px);overflow-y:auto;padding-bottom:18px}
#info .closeRow{position:relative;left:auto;bottom:auto;transform:none;margin:20px auto 0;width:92px}
#app.breakingCube #stageContent{top:0;bottom:0}#app.breakingCube #play{inset:0}
#app.completed #stageContent{top:80px;bottom:50px}#app.completed #play{inset:0}
#app[data-stage="2B"] #question,#app[data-stage="5"] #question,body.keyboardOpen #app[data-stage="2B"] #question,body.keyboardOpen #app[data-stage="5"] #question{position:absolute!important;top:50%!important;transform:translateY(-50%)!important;min-height:0!important}
