/* All rules scoped to Stage 4. Face size equals the Stage 3 grid. */
#app[data-stage^="4"] #question,body.keyboardOpen #app[data-stage^="4"] #question{width:100%;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;white-space:normal;font-size:13px!important;line-height:1.5;letter-spacing:0;min-height:40px!important}
#app[data-stage^="4"] #stageContent{width:calc(100% - 36px);margin-left:0;transform:translateX(-50%);top:calc(var(--top) + 65px);bottom:calc(var(--bottom) + var(--cell) + 100px)}
body.keyboardOpen #app[data-stage^="4"] #stageContent{bottom:calc(var(--bottom) + var(--key-reserve) + var(--cell) + 23px)}
#app[data-stage^="4"] #play,body.keyboardOpen #app[data-stage^="4"] #play{inset:48px 0 0;gap:7px}
#app[data-stage^="4"].cubeFinishedView #play,body.keyboardOpen #app[data-stage^="4"].cubeFinishedView #play{top:96px}
#app[data-stage^="4"] #answerForm{bottom:calc(var(--bottom) + 66px);height:var(--cell)!important;min-height:0;grid-template-rows:var(--cell);align-items:start}
body.keyboardOpen #app[data-stage^="4"] #answerForm{bottom:calc(var(--bottom) + var(--key-reserve) + 16px)}
#app[data-stage^="4"] #answerForm #answer,#app[data-stage^="4"] #answerForm #ok{height:var(--cell)!important;min-height:0!important;max-height:var(--cell);box-sizing:border-box}
#app[data-stage^="4"] #cubeLetterReset{bottom:calc(var(--bottom) + 36px)}
#app[data-stage^="4"] .scene{flex:1;min-height:0;perspective:1400px;overflow:visible}
#app[data-stage^="4"] .face{width:calc(var(--unit) - 7px);height:calc(var(--unit) - 7px);left:calc((var(--unit) - 7px)/-2);top:calc((var(--unit) - 7px)/-2);border:1px solid #3d3d3d;border-radius:11px;box-shadow:none;font-size:24px}
#app[data-stage^="4"] .scene:not(.rubikTurning) .face,#app[data-stage^="4"] .scene:not(.rubikTurning) .face.whiteBlock{background:#222!important;color:#eee;border-color:#3d3d3d;box-shadow:none}
#app[data-stage^="4"] .scene:not(.rubikTurning) .face.path{outline:3px solid #d9e0e6;outline-offset:-4px}
#app[data-stage^="4"] .cluebar{max-width:var(--grid);min-height:42px}
#app[data-stage^="4"] .cluebar .clue{flex:1;text-align:center}
#app[data-stage^="4"] .routeLink{display:none}
#app[data-stage^="4"] .interactionNote{font-size:9px;flex:none;text-align:center;white-space:normal}
#app[data-stage^="4"] .selectedTurnFace{outline:2px solid #eee;outline-offset:-4px}
#app[data-stage^="4"] .selectedTurnFace:after{display:block!important;content:'↶ ↷';position:absolute;left:0;right:0;top:50%;text-align:center;font:15px Arial;color:#fff;text-shadow:0 1px 3px #000}
#app[data-stage^="4"] .turnControls{position:relative;height:34px;gap:16px}
#app[data-stage^="4"] .cubeTurnHint{display:none}
#app[data-stage^="4"] .canonicalCube .face{animation:cubeLettersIn .7s both}
@keyframes cubeLettersIn{from{color:transparent}to{color:#f3f3f3}}
#app[data-stage^="4"] .canonicalCube .whiteBlock{animation:cubeWhiteLettersIn .7s both}
@keyframes cubeWhiteLettersIn{from{color:transparent}to{color:#17191b}}
#app[data-stage^="4"] .cubeInstructionLine{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;font-size:11px;line-height:1.4;margin:3px 0}
#app[data-stage^="4"] .cubeInstructionLine b{font:12px Arial;color:#a1a6ad}
#app[data-stage^="4"] .cubeDiagram{display:grid;grid-template-columns:repeat(3,8px);grid-template-rows:repeat(3,8px);gap:2px;flex:none}
#app[data-stage^="4"] .cubeDiagram i{border:1px solid #71767c;border-radius:1px}
#app[data-stage^="4"] .cubeDiagram i.marked{background:var(--diagram-color);border-color:var(--diagram-color)}

/* Stage 4-1 cube blocks use a common input color. */
#app[data-stage="4A"] .scene:not(.rubikTurning) .face,
#app[data-stage="4A"] .scene:not(.rubikTurning) .face.whiteBlock{background:#282b2f!important;color:#f1f2f4;border-color:#3b3e42;box-shadow:none}
#app[data-stage^="4"] .cubeDiagram i.marked{position:relative;background:transparent;border-color:#aeb3ba;color:#f3f4f5;font:700 8px/6px Arial,sans-serif;text-align:center}
#app[data-stage^="4"] .cubeDiagram i.faceMark{background:#aeb3ba;border-color:#aeb3ba}

#app[data-stage^="4"] .cubeOrientationNote{font-size:10px;line-height:1.3;color:#aeb3ba;margin:1px 0}
#app[data-stage^="4"] .cubeFaceDiagram{display:flex;flex-direction:column;align-items:center;gap:3px;flex:none}
#app[data-stage^="4"] .cubeFaceDiagram small{font:9px/1.2 'Noto Sans JP',sans-serif;color:#aeb3ba;margin:0;letter-spacing:0}
#app[data-stage^="4"].cubeFinishedView #play,body.keyboardOpen #app[data-stage^="4"].cubeFinishedView #play{top:112px}
