:root{--paper:#f5ecd6;--ink:#314d4d;--red:#bf4c53;--mint:#a9cfc4;--gold:#e9bb6e}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}body{display:flex;flex-direction:column;align-items:center;justify-content:center;background:radial-gradient(ellipse at 50% 30%,#697e76,#324c4b 65%,#243738);color:var(--paper);font-family:Trebuchet MS,Segoe UI,sans-serif;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}button{font:inherit;cursor:pointer;touch-action:manipulation}button:focus-visible,canvas:focus-visible{outline:3px solid #ffdf86;outline-offset:3px}header{width:min(1120px,calc(100vw - 40px),calc((100dvh - 160px)*1.42857));display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.brand{font-size:clamp(18px,2.1vw,30px);font-weight:900;letter-spacing:.08em;line-height:1}.brand b{color:var(--gold)}.brand small{display:block;font-size:9px;letter-spacing:.28em;margin-top:6px;color:#bfd8cc}.tools{display:flex;gap:7px}.tools button{border:1px solid #c8d3b755;border-radius:6px;background:#152e2e66;color:var(--paper);padding:8px 11px;font-weight:bold;font-size:12px}.tools #help-button{border-radius:50%;background:#f5ecd622;width:35px}#game-shell{width:min(1120px,calc(100vw - 40px),calc((100dvh - 160px)*1.42857))}#hud{display:grid;grid-template-columns:repeat(5,1fr);background:#f2e4c4;color:var(--ink);border:2px solid #e9bc79;border-bottom:0;border-radius:9px 9px 0 0;padding:7px 10px;text-align:center}#hud div{display:grid;gap:1px}#hud div+div{border-left:1px solid #314d4d33}#hud small{font-size:9px;font-weight:900;letter-spacing:.16em}#hud strong{font:900 clamp(16px,2vw,23px)/1.1 Georgia,serif;font-variant-numeric:tabular-nums}#hearts{color:#ad3947}#board{aspect-ratio:10/7;border:2px solid #e9bc79;box-shadow:0 14px 45px #172b2b99;background:#8e684b}canvas{width:100%;height:100%;display:block;touch-action:none}#status{min-height:25px;text-align:center;font-size:12px;font-weight:700;padding:6px;background:#203a3b;border-radius:0 0 6px 6px;color:#eee1ba}.hint{margin:10px 0 0;font-size:10px;letter-spacing:.07em;color:#c7d6c3}.modal{position:fixed;inset:0;z-index:1000;display:none;place-items:center;padding:14px;overflow-y:auto;background:#203938ee}.modal.is-visible{display:grid}.modal-card{width:min(650px,100%);max-height:calc(100dvh - 28px);overflow-y:auto;border:2px solid #e5b878;border-radius:10px;background:linear-gradient(135deg,#fff2d7,#dfd9bb);color:var(--ink);padding:28px;box-shadow:0 20px 80px #10222388}.eyebrow{font-size:10px;font-weight:900;letter-spacing:.2em;color:#ae404a;margin:0 0 8px}.modal h1,.modal h2{font:900 clamp(32px,5vw,49px)/1 Georgia,serif;margin:0 0 12px}.modal h1 em{font-style:normal;color:#ae404a}.modal p{line-height:1.4}.guide{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:17px 0}.guide p{padding:10px;border-top:3px solid #6d9d8e;background:#fff7e488;margin:0;font-size:12px}.guide b{font-size:12px;letter-spacing:.06em}.primary{width:100%;min-height:44px;margin-top:8px;border:0;border-radius:5px;background:#ae404a;color:#fff2d7;font-weight:900;letter-spacing:.1em}.primary:hover{background:#933039}.result{max-width:430px;text-align:center}#touch-controls{display:none;pointer-events:none}.touch-actions{display:flex;flex-direction:column;gap:10px;pointer-events:none}.touch-actions button{width:116px;min-height:50px;padding:7px;border:2px solid #efd69c;border-radius:10px;background:#ae404a;color:#fff2d7;pointer-events:auto;font-weight:900;font-size:13px;box-shadow:0 4px 0 #203a3b;touch-action:none}.touch-actions button.pressed,.touch-actions button:active{transform:translateY(3px);box-shadow:0 1px 0 #203a3b}.touch-actions #shield{background:#587e70}.touch-actions #touch-sound{background:#425a65;min-height:40px;font-size:10px}.virtual-joystick{pointer-events:auto}body.touch-device .tools,body.touch-device .hint{display:none}body.touch-device header{width:min(calc(100vw - 294px),calc((100dvh - 112px)*1.42857));margin-bottom:5px}body.touch-device .brand{font-size:16px}body.touch-device .brand small{font-size:7px;margin-top:4px}body.touch-device #hud{padding:4px}body.touch-device #hud small{font-size:8px}body.touch-device #hud strong{font-size:15px}body.touch-device #status{font-size:9px;min-height:23px;padding:5px 2px}body.touch-device #touch-controls{display:flex;position:fixed;inset:0;align-items:center;justify-content:space-between;padding:8px;z-index:38}body.touch-device.vibecade-joystick-rails #game-shell.vibecade-joystick-playfield{width:min(calc(100vw - 294px),calc((100dvh - 112px)*1.42857))!important;height:auto!important;max-width:none!important;max-height:none!important;overflow:visible!important;margin:0!important}
@media(max-width:599px){body.touch-device{justify-content:flex-start}body.touch-device header{width:calc(100vw - 20px);margin-top:58px}body.touch-device #game-shell{width:calc(100vw - 20px)}body.touch-device #touch-controls{inset:auto 8px 12px!important;height:160px!important}.touch-actions{gap:7px}.guide{grid-template-columns:1fr}}
@media(orientation:landscape) and (max-height:500px){.modal-card{padding:14px}.modal h1{font-size:30px;margin-bottom:7px}.modal-card>p{font-size:12px;line-height:1.25;margin:7px 0}.guide{margin:10px 0}.guide p{font-size:11px;line-height:1.3;padding:8px}.primary{min-height:40px;font-size:12px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
@media(max-width:599px){body.touch-device:not(.vibecade-joystick-rails) #touch-controls{inset:auto 8px max(12px,env(safe-area-inset-bottom))!important;height:160px!important}body.touch-device .touch-actions{justify-content:center}}
