*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#10131c;color:#f3efe7}body{font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Noto Sans JP",sans-serif;-webkit-user-select:none;user-select:none;overscroll-behavior:none}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:2px solid #a6ddff;outline-offset:3px}[hidden]{display:none!important}.castle-shell{width:min(100%,450px);margin:auto;padding:0 4px max(4px,env(safe-area-inset-bottom))}.arena{height:calc(100svh - var(--nav-height,52px) - 65px - env(safe-area-inset-bottom));min-height:370px;max-height:790px;position:relative;overflow:hidden;border:1px solid #76664c;border-radius:10px;background:#222331;isolation:isolate}canvas{display:block;width:100%;height:100%;touch-action:none}.hud{position:absolute;top:8px;left:10px;right:10px;pointer-events:none;text-shadow:0 1px 3px #000;font-size:11px}.hud-top{display:flex;gap:8px;align-items:center}.hud-top strong{font-size:12px;flex:1;color:#eddbb3}.hud-top>span{font-size:10px;color:#f1ce8e}.hud button{pointer-events:auto;border:1px solid #8b7b6255;border-radius:8px;background:#161b27b8;color:#eee7d9;width:44px;height:32px;margin:-2px -3px 0 0}.health-row{display:flex;align-items:center;gap:8px;margin-top:3px}.health-row>span{min-width:92px;font-size:10px;font-weight:700;color:#fbd0cc}progress{width:100%;height:7px;appearance:none;border:none;border-radius:5px;background:#3c2833;overflow:hidden}progress::-webkit-progress-bar{background:#3c2833}progress::-webkit-progress-value{background:linear-gradient(90deg,#c36b7e,#eda88c);border-radius:5px}progress::-moz-progress-bar{background:#e99b8e}.hud-bottom{display:flex;justify-content:space-between;margin-top:5px;font-size:10px;color:#d4c8b5}.notice{position:absolute;left:50%;top:24%;transform:translateX(-50%);width:max-content;max-width:90%;text-align:center;border:1px solid #cdb68355;border-radius:8px;background:#151820d9;color:#ffe1aa;font-size:11px;padding:8px 13px;pointer-events:none;opacity:0;transition:opacity .18s;z-index:2}.notice.show{opacity:1}.controls{position:absolute;inset:0;pointer-events:none}.controls button,.stick{pointer-events:auto;touch-action:none}.stick{position:absolute;left:15px;bottom:20px;width:112px;height:112px;border:1px solid #b3c4df55;border-radius:50%;background:radial-gradient(circle,#788aa822,#161c2e99);box-shadow:inset 0 0 0 9px #8194b311;display:grid;place-items:center}.stick-cross{font-size:58px;color:#a8badb33;line-height:1}.thumb{position:absolute;width:43px;height:43px;border-radius:50%;border:1px solid #d4dfeb88;background:radial-gradient(circle at 35% 30%,#adbdcc88,#52668299);box-shadow:0 3px 10px #080c1a99}.stick-label{position:absolute;bottom:6px;font-size:9px;color:#bdc8d7}.actions{position:absolute;right:12px;bottom:22px;width:170px;height:125px}.actions button{position:absolute;display:flex;align-items:center;justify-content:center;flex-direction:column;border-radius:50%;color:#fdf3d9;box-shadow:0 3px 0 #101421,0 0 0 4px #090c1744}.actions button>span{font-size:26px;line-height:1.2}.actions button>small{font-size:10px;font-weight:700}.attack{right:0;bottom:0;width:79px;height:79px;border:1px solid #ead4a2;background:radial-gradient(circle at 35% 25%,#ac8058,#67483f 60%,#3a2b38)}.roll{left:11px;bottom:0;width:59px;height:59px;border:1px solid #a2bdd8;background:radial-gradient(circle at 35% 25%,#537696,#243b58)}.skill{right:45px;top:0;width:56px;height:56px;border:1px solid #b4a1dc;background:radial-gradient(circle at 35% 25%,#76608c,#39304f)}.skill.ready{border-color:#ffe5a0;box-shadow:0 0 0 3px #8c683b55,0 0 20px #f2bf6555;background:radial-gradient(circle at 35% 25%,#b69057,#63414a)}.actions button:active,.actions button.held{filter:brightness(1.25);transform:translateY(2px)}.actions button:disabled{opacity:.48}.potion{position:absolute;left:12px;bottom:150px;border:1px solid #aac3b766;background:#1d302dbd;color:#c2e1c4;border-radius:8px;min-width:49px;min-height:38px;font-size:15px}.potion span{font-size:12px}.door{position:absolute;left:50%;bottom:161px;transform:translateX(-50%);background:#cbb17a;color:#252534;border:1px solid #f7df9c;border-radius:8px;min-height:44px;padding:8px 16px;font-size:12px;font-weight:700}.companion{display:flex;align-items:center;gap:8px;height:57px;padding:5px 8px;overflow:hidden}.companion img{flex-shrink:0;object-fit:contain}.companion strong{font-size:11px;color:#ddcdb0}.companion p{font-size:11px;color:#b9beca;margin:3px 0 0;line-height:1.4}.overlay{position:absolute;inset:0;z-index:5;background:#0b0e18db;display:grid;place-items:center;padding:12px;overflow:auto;overscroll-behavior:contain;backdrop-filter:blur(3px)}.panel{position:relative;width:100%;max-height:100%;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;border:1px solid #af957166;border-radius:12px;background:#191d29;padding:18px 14px;color:#eee8dc;box-shadow:0 10px 35px #0005;text-align:center}.panel:focus{outline:none}.panel h2{font-size:22px;margin:0 0 8px;color:#f2ddb1;letter-spacing:2px}.panel p{font-size:12px;line-height:1.7;color:#c5c4cc;margin:8px 0 13px}.panel .eyebrow{font-size:10px;letter-spacing:2px;color:#c8af7f;margin:0 0 5px}.cover{display:block;width:calc(100% + 28px);height:145px;object-fit:cover;object-position:center 42%;margin:-18px -14px 13px;mask-image:linear-gradient(#000 70%,transparent)}.cast-picker{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin:12px 0}.cast-picker button{display:flex;align-items:center;flex-direction:column;border:1px solid #68708377;background:#242938;border-radius:8px;color:#d3d4df;padding:6px 2px;min-height:80px;gap:4px}.cast-picker button[aria-pressed=true]{border-color:#d7bc80;background:#3a3440;box-shadow:inset 0 0 0 1px #d7bc8066}.cast-picker img{width:43px;height:43px}.cast-picker span{font-size:10px}.cast-picker small{font-size:8px;color:#c0bfca}.panel button.primary{width:100%;border:1px solid #f3deb5;border-radius:8px;background:#c5a874;color:#211e28;min-height:46px;font-size:14px;font-weight:700;margin-top:7px}.panel button.secondary{background:#2b303e;color:#ddd8d2;border:1px solid #7a7d8a55;border-radius:8px;min-height:42px;font-size:12px;padding:8px 12px;margin-top:8px}.panel .button-row{display:flex;gap:8px}.button-row>button{flex:1}.panel small.meta{display:block;color:#b1adbc;font-size:10px;line-height:1.6;margin-top:11px}.choice-list{display:grid;gap:9px;margin:14px 0}.choice{display:grid;grid-template-columns:38px 1fr;align-items:center;gap:0 8px;min-height:76px;width:100%;text-align:left;padding:10px;border:1px solid #7c728255;border-radius:8px;background:#292c3a;color:#eee5d3}.choice>span{grid-row:span 2;font-size:26px;text-align:center;color:#e4c691}.choice>strong{font-size:13px}.choice>small{font-size:11px;line-height:1.6;color:#bcbec9}.choice:disabled{opacity:.4}.choice:not(:disabled):active{border-color:#e4cc91;background:#3c3641}.summary{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:13px 0}.summary div{background:#252a37;padding:11px 3px;border-radius:8px}.summary strong{display:block;color:#f0d5a4;font-size:21px}.summary span{font-size:10px;color:#b3b4c1}.help-list{text-align:left;font-size:12px;line-height:1.8;color:#cac8d0;padding-left:20px}.inventory{display:flex;flex-wrap:wrap;justify-content:center;gap:5px;margin:10px 0}.inventory span{font-size:10px;color:#e0c9a7;background:#30303c;border-radius:6px;padding:5px 8px}.training .choice{grid-template-columns:32px 1fr auto;min-height:70px}.training .choice>b{font-size:11px;grid-column:3;grid-row:1/3;color:#e0c28e}.training .choice>small{grid-column:2}.panel .danger{color:#e8a2a2}button:disabled{cursor:default}@media(max-height:700px){.cover{height:102px}.panel{padding:14px 12px}.cover{margin:-14px -12px 9px;width:calc(100% + 24px)}.panel h2{font-size:20px}.panel p{margin:6px 0 9px;font-size:11px}.cast-picker{margin:9px 0}.cast-picker button{min-height:70px}.cast-picker img{width:36px;height:36px}.cast-picker small{font-size:8px}.choice{min-height:67px;padding:8px}.choice-list{gap:7px;margin:10px 0}}@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* All screen heights reserve the same touch area; potion sits between thumbs. */
.potion{left:calc(50% - 24px);bottom:100px;min-width:48px;min-height:44px}
.choice .comparison{grid-column:2;color:#e2cf9f;font-size:10px;border-top:1px solid #a89b7533;margin-top:6px;padding-top:5px}
.roll[aria-disabled=true]{opacity:.55}
@media(max-height:600px){.arena{min-height:410px}.companion{height:48px}.castle-shell{padding-bottom:max(2px,env(safe-area-inset-bottom))}.arena{height:calc(100svh - var(--nav-height,52px) - 53px - env(safe-area-inset-bottom))}.cast-picker button{min-height:66px}.panel .meta{font-size:9px}}
