:root{--ink:#142e3b;--cream:#f5ead0;--red:#b94435;--gold:#e7b552}*{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:repeating-linear-gradient(120deg,#112d3c 0 42px,#133443 42px 84px);color:var(--cream);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 #ffd875;outline-offset:3px}.topbar{width:min(1180px,calc(100vw - 40px));display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.brand{font-size:clamp(20px,2vw,30px);font-weight:900;letter-spacing:.13em;line-height:1}.brand b{color:#efb35c}.brand small{display:block;margin-top:5px;color:#b9cbd0;font-size:10px;letter-spacing:.22em}.desktop-tools{display:flex;gap:7px}.desktop-tools button{border:1px solid #a8c0bc99;background:#183d4cbb;color:#f8eddb;padding:8px 12px;border-radius:4px;font-weight:800}.desktop-tools #help-button{width:39px;border-radius:50%;background:#f5ead025;color:#fff}#game-shell{width:min(1180px,calc(100vw - 40px),calc((100dvh - 122px)*1.6));}#hud{display:grid;grid-template-columns:repeat(5,1fr);gap:3px;padding:7px 12px;border:2px solid #c49256;border-bottom:0;background:#ebd9b6;color:#203844;text-align:center}#hud div{display:grid;gap:2px}#hud small{font:900 10px/1.1 Georgia,serif;letter-spacing:.16em}#hud strong{font:900 clamp(15px,2.2vw,23px)/1.1 Georgia,serif}#board{position:relative;aspect-ratio:8/5;border:2px solid #c49256;background:#e9ddbf;box-shadow:0 22px 50px #061923aa}canvas{display:block;width:100%;height:100%;touch-action:none}#announcement{position:absolute;left:0;right:0;top:42%;text-align:center;color:#fff;font:900 clamp(18px,3.5vw,40px)/1 Georgia,serif;letter-spacing:.1em;text-shadow:0 3px 0 #163747,0 5px 15px #0b2438;pointer-events:none}.hint{margin:8px 0 0;text-align:center;font-size:11px;font-weight:900;letter-spacing:.13em;color:#d9d6bd}.hint span{color:var(--gold);padding:0 6px}.modal{position:fixed;inset:0;z-index:1000;display:none;place-items:center;overflow-y:auto;padding:16px;background:#091c28e8}.modal.is-visible{display:grid}.modal-card{width:min(575px,100%);max-height:calc(100dvh - 32px);overflow-y:auto;padding:clamp(18px,3vw,34px);border:4px double #edc784;background:#f0e1bd;color:#173746;box-shadow:0 25px 80px #051822}.eyebrow{margin:0 0 6px;font-size:11px;font-weight:900;letter-spacing:.22em;color:#aa493a}.modal h1,.modal h2{margin:0 0 10px;font:900 clamp(34px,6vw,58px)/1 Georgia,serif;text-transform:uppercase}.modal h1 em{font-style:normal;color:#ad4233}.modal p{line-height:1.4}.guide{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:16px 0}.guide p{margin:0;padding:12px;background:#fff7df;border-left:4px solid #bb6042;font-size:13px}.guide b{letter-spacing:.08em}.primary{width:100%;min-height:46px;margin-top:8px;border:0;background:#af4536;color:white;font-weight:900;letter-spacing:.13em}.primary:hover{background:#96372e}.result{text-align:center;width:min(420px,100%)}#touch-controls{display:none;pointer-events:none}.touch-actions{display:flex;flex-direction:column;gap:12px;pointer-events:none}.touch-actions button{width:120px;min-height:58px;border:2px solid #efd69c;border-radius:12px;background:#b94537;color:white;font-weight:900;letter-spacing:.07em;pointer-events:auto;box-shadow:0 4px 0 #642b28}.touch-actions button:active,.touch-actions button.pressed{transform:translateY(3px);box-shadow:0 1px 0 #642b28}.touch-actions small{display:block;font-size:9px}.touch-actions #touch-sound{background:#244b57}.virtual-joystick{pointer-events:auto}.joystick-knob{position:absolute;left:50%;top:50%;width:48px;height:48px;border-radius:50%;background:#e3c893;border:2px solid white;transform:translate(-50%,-50%)}.joystick-mark{position:absolute;top:44%;color:#fff}.joystick-mark.left{left:9px}.joystick-mark.right{right:9px}body.touch-device .desktop-tools,body.touch-device .hint{display:none}body.touch-device #touch-controls{display:flex;position:fixed;inset:0;z-index:38;align-items:center;justify-content:space-between;padding:8px max(8px,env(safe-area-inset-right)) 8px max(8px,env(safe-area-inset-left))}body.touch-device #game-shell{width:min(calc(100vw - 294px),calc((100dvh - 90px)*1.6));}body.touch-device .topbar{width:min(calc(100vw - 294px),calc((100dvh - 90px)*1.6));margin-bottom:4px}body.touch-device .brand{font-size:17px}body.touch-device .brand small{font-size:8px}body.touch-device #hud{padding:3px 5px}body.touch-device #hud small{font-size:8px}body.touch-device #hud strong{font-size:15px}@media(max-width:599px),(orientation:portrait) and (pointer:coarse){body.touch-device{justify-content:flex-start}body.touch-device .topbar{width:calc(100vw - 16px);margin-top:54px}body.touch-device #game-shell{width:calc(100vw - 16px)}body.touch-device #touch-controls{inset:auto 8px max(10px,env(safe-area-inset-bottom))!important;height:144px!important}body.touch-device #hud strong{font-size:13px}body.touch-device #hud small{font-size:7px}.guide{grid-template-columns:1fr}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
body.touch-device.vibecade-joystick-rails #game-shell.vibecade-joystick-playfield{width:min(calc(100vw - 294px),calc((100dvh - 90px)*1.6))!important;height:auto!important;max-width:none!important;max-height:none!important;overflow:visible!important}
