*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;background:#111722;color:#fff2d4;font-family:system-ui,sans-serif}body{overflow:hidden}[hidden]{display:none!important}button,a,select{touch-action:manipulation}button{font:inherit;cursor:pointer;border:1px solid #5fc7bb;background:#256f72;color:#fff5dd;border-radius:10px;min-height:44px;padding:10px 14px;font-weight:700}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:3px solid #ffc36c;outline-offset:2px}button:active,.active{background:#c47c3e!important}a{color:#a8e5de;text-decoration:none}select{background:#243d4b;color:white;border:1px solid #599695;border-radius:8px;padding:8px;max-width:115px}.vault-game{height:100dvh;width:min(100%,1200px);margin:auto;display:flex;flex-direction:column;padding:10px 14px;gap:6px}header{display:flex;align-items:center;gap:9px;flex-wrap:wrap}header strong{margin-right:auto;letter-spacing:2px}header button{padding:8px;min-width:44px}.hud{display:flex;gap:14px;justify-content:space-between;font-size:13px;padding:8px 2px}.hud b{font-weight:400;color:#a7c3c7}.hud strong{color:#ffca79}.hint{font-size:13px;text-align:center;color:#a6dfd5;min-height:18px;margin:0}#board{position:relative;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden}canvas{display:block;max-width:100%;max-height:100%;aspect-ratio:10/7;width:auto;height:auto;object-fit:contain;border:1px solid #386069;border-radius:14px;background:#121d2b;touch-action:none;image-rendering:auto}#overlay{position:absolute;inset:0;background:#07131dbb;display:flex;align-items:center;justify-content:center;padding:8px}.card{width:min(100%,470px);max-height:100%;overflow:auto;touch-action:pan-y;padding:24px;background:#fff0d4;color:#403736;border:2px solid #ddba7f;border-radius:18px;text-align:center;box-shadow:0 12px 40px #0006}.card h1{font-family:Georgia,serif;font-size:30px;margin:12px 0}.card p{line-height:1.5;font-size:15px}.card button{width:100%;margin:6px 0}.card small{display:block;line-height:1.4;margin-top:9px;color:#6a6260}.eyebrow{font-size:10px;font-weight:900;letter-spacing:2px;color:#946641}.secondary{background:#bda984;border-color:#8b7652;color:#342c28}.controls{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:5px 0}.dpad{display:grid;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px);gap:4px}.dpad button{padding:0;font-size:24px}.dpad [data-move=up]{grid-column:2}.dpad [data-move=left]{grid-column:1;grid-row:2}.dpad [data-move=down]{grid-column:2;grid-row:2}.dpad [data-move=right]{grid-column:3;grid-row:2}.dig-buttons{display:flex;gap:8px}.dig-buttons button{font-size:24px;max-width:160px}.dig-buttons span{display:block;font-size:11px}.keyboard-help{font-size:12px;color:#91a6b1;text-align:center;margin:0;line-height:1.4}#emotion{font-size:50px}html[data-device=desktop] .controls{justify-content:center;gap:40px}@media(max-width:600px){.vault-game{padding:7px;gap:3px}header{gap:5px;font-size:11px;flex-wrap:nowrap}header button{min-width:36px;min-height:36px}select{width:68px;font-size:11px;padding:7px 0}.hud{gap:5px;font-size:10px;flex-wrap:wrap}.hud span{white-space:nowrap}.keyboard-help{display:none}.card{padding:15px}.card h1{font-size:25px}.card p{font-size:13px}.dig-buttons button{font-size:22px;padding:8px;max-width:96px}.dpad{grid-template-columns:repeat(3,38px);grid-template-rows:repeat(2,38px)}.dpad button{min-height:38px}}@media(orientation:landscape) and (max-height:550px){.vault-game{padding:4px 12px;gap:2px}header button{min-height:32px;padding:4px}.hud{padding:2px;font-size:11px}.hint{font-size:11px;min-height:13px}.controls{position:absolute;bottom:18px;left:12px;right:12px;pointer-events:none}.controls button{pointer-events:auto}.keyboard-help{display:none}#board{margin:0 150px}.dpad{grid-template-columns:repeat(3,36px);grid-template-rows:repeat(2,36px)}.dpad button{min-height:36px}.dig-buttons{flex-direction:column}.dig-buttons button{min-height:36px;padding:4px;max-width:125px}.dig-buttons span{font-size:10px}.card{padding:12px}.card h1{font-size:22px}.card p{font-size:12px;margin:8px 0}}

@media(orientation:landscape) and (max-height:550px){html[data-device=desktop] .controls{justify-content:space-between;gap:12px}}

/* Game controls never participate in text selection or the iOS callout menu. */
.vault-game,.vault-game *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.controls,.controls button,.controls button *{touch-action:none}
#view{font-size:11px;letter-spacing:0;max-width:92px;line-height:1.15}
@media(max-width:600px) and (orientation:portrait){#board{align-items:center}canvas{width:100%;height:auto;max-height:100%}.controls{padding:10px 0}.dpad{grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px)}.dpad button{min-height:44px}.hint{min-height:32px}}

/* Desktop: dedicate the available height to the board, with controls beside it. */
@media(min-width:1000px){
 html[data-device=desktop] .vault-game{width:100%;padding:6px 10px;gap:4px;position:relative}
 html[data-device=desktop] #board{margin:0 150px;container-type:size}
 html[data-device=desktop] canvas{width:min(100cqw,142.857cqh);height:auto;max-width:100%;max-height:100%}
 html[data-device=desktop] .controls{position:absolute;bottom:34px;left:12px;right:12px;justify-content:space-between;gap:12px;pointer-events:none}
 html[data-device=desktop] .controls button{pointer-events:auto}
 html[data-device=desktop] .dig-buttons{flex-direction:column}
 html[data-device=desktop] .dig-buttons button{max-width:135px}
}

/* Keep desktop actions together below the board. */
@media(min-width:1000px){
 html[data-device=desktop] #board{margin:0}
 html[data-device=desktop] .controls{position:static;flex-shrink:0;justify-content:center;gap:16px;pointer-events:auto;padding:4px 0}
 html[data-device=desktop] .dig-buttons{flex-direction:row;gap:8px}
}
