:root{--ink:#162e31;--paper:#e6dcc6;--amber:#e7b56d;--red:#b9544e}*{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(90deg,#14282c 0 28px,#172d30 28px 56px);color:var(--paper);font-family:Segoe UI,Trebuchet MS,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 #ffe39b;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,2.2vw,32px);font-weight:900;letter-spacing:.13em;line-height:1}.brand b{color:var(--amber)}.brand small{display:block;margin-top:5px;font-size:10px;letter-spacing:.22em;color:#b7c7bd}.desktop-tools{display:flex;gap:7px}.desktop-tools button{border:1px solid #94aaa888;background:#244044;color:#f3e8d2;padding:8px 12px;border-radius:4px;font-weight:800}.desktop-tools #help-button{width:39px;border-radius:50%;background:#f5ead025}#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 #a88b61;border-bottom:0;background:#e9ddc6;color:#19363a;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 #a88b61;background:#172e32;box-shadow:0 22px 50px #061518aa}canvas{display:block;width:100%;height:100%;touch-action:none}#announcement{position:absolute;left:0;right:0;top:40%;text-align:center;color:#fff;font:900 clamp(18px,3.5vw,40px)/1 Georgia,serif;letter-spacing:.1em;text-shadow:0 3px 0 #10272a,0 5px 15px #061518;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(--amber);padding:0 6px}.modal{position:fixed;inset:0;z-index:1000;display:none;place-items:center;overflow-y:auto;padding:16px;background:#071719e8}.modal.is-visible{display:grid}.modal-card{width:min(590px,100%);max-height:calc(100dvh - 32px);overflow-y:auto;padding:clamp(18px,3vw,34px);border:4px double #bd9867;background:#e9ddc6;color:#173338;box-shadow:0 25px 80px #061518}.eyebrow{margin:0 0 6px;font-size:11px;font-weight:900;letter-spacing:.22em;color:#a34441}.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:#a34441}.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:#f8f0df;border-left:4px solid #ba6552;font-size:13px}.guide b{letter-spacing:.08em}.primary{width:100%;min-height:46px;margin-top:8px;border:0;background:#a74441;color:white;font-weight:900;letter-spacing:.13em}.primary:hover{background:#8d3534}.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:#af4f49;color:white;font-weight:900;letter-spacing:.07em;pointer-events:auto;box-shadow:0 4px 0 #552625}.touch-actions button:active,.touch-actions button.pressed{transform:translateY(3px);box-shadow:0 1px 0 #552625}.touch-actions #touch-sound{background:#31565a}.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}

/* Brass instrument panel around the illustrated tower. */
body{background:radial-gradient(ellipse at 50% 36%,#324b50 0,#142b34 48%,#07141d 100%)}
.topbar{padding:0 2px}.brand{color:#f4ebcf;text-shadow:0 2px 0 #0007;letter-spacing:.17em}.brand b{color:#e0b96e}.brand small{color:#93aca8;letter-spacing:.25em}
.desktop-tools button{background:linear-gradient(#30494e,#1b313b);border-color:#82918466;box-shadow:inset 0 1px #d4cfaa15,0 2px 5px #0003;border-radius:7px;font-size:12px}
#hud{border-color:#a38d5e;background:linear-gradient(#263e45,#142832);color:#f2dfb8;padding:9px 12px;border-radius:9px 9px 0 0;box-shadow:inset 0 1px #d3c9a940}
#hud div+div{border-left:1px solid #a69c7150}#hud small{font-family:Segoe UI,sans-serif;font-size:9px;letter-spacing:.2em;color:#9ab3af}#hud strong{font-family:Georgia,serif;text-shadow:0 2px #0a161d;font-variant-numeric:tabular-nums}#hearts{color:#e9a090}
#board{border-color:#a38d5e;box-shadow:0 20px 70px #0008,0 0 0 4px #07151b,0 0 0 5px #80907c44}
#announcement{top:auto;bottom:3.3%;left:25%;right:25%;font:700 clamp(7px,1vw,13px)/1.15 Segoe UI,sans-serif;letter-spacing:.1em;color:#ffdf9c;text-shadow:0 1px 3px #07121c;background:#0a1922}
#announcement:empty{display:none}.hint{font-size:10px;color:#92aaa6;letter-spacing:.12em;margin-top:12px}
.modal{background:radial-gradient(ellipse at center,#0c2733da,#030d16f2)}.modal-card{border:1px solid #c6ac72;border-radius:12px;background:linear-gradient(135deg,#f1e8d2,#ccbd9c);box-shadow:0 0 0 5px #10252c,0 25px 80px #000a}.guide p{background:#fff8e855;border-left-color:#a88b57;border-radius:0 5px 5px 0}.primary{border-radius:5px;background:linear-gradient(#9c4a42,#753333);box-shadow:inset 0 1px #e6b78b77,0 3px 8px #3b231d33}.touch-actions button{background:linear-gradient(#ab6354,#743b3d);border-color:#c5ae7c;box-shadow:0 4px 0 #091821, inset 0 1px #edcca240}.touch-actions #touch-sound{background:linear-gradient(#426466,#263f49)}
body.touch-device #hud{padding:4px 5px}body.touch-device #announcement{font-size:7px;letter-spacing:.04em}
@media(orientation:landscape) and (max-height:500px){body.touch-device .modal-card{padding:16px}body.touch-device .modal h1{font-size:32px;margin-bottom:6px}body.touch-device .modal-card>p{font-size:12px;line-height:1.3;margin:7px 0}body.touch-device .modal-card>.eyebrow{font-size:9px}body.touch-device .guide{margin:10px 0;gap:8px}body.touch-device .guide p{font-size:11.5px;line-height:1.3;padding:9px}body.touch-device .primary{min-height:40px;margin-top:6px;font-size:12px}}
