:root{color-scheme:dark;--ink:#edf3f6;--muted:#a6b6c5;--surface:#121b26;--line:#293a4a;--gold:#f4c272;--green:#80edd4;--rose:#fa8d9e}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;min-width:320px;color:var(--ink);font:14px/1.5 "Yu Gothic UI","Meiryo",sans-serif;background:radial-gradient(ellipse at 40% 0%,#182739 0%,#0c1118 65%);min-height:100vh}
main{width:min(1450px,100%);margin:auto;padding:20px clamp(12px,3vw,44px) 28px}
button{font:inherit;cursor:pointer;color:var(--ink);border:1px solid var(--line);background:#1b2836;border-radius:8px;min-height:42px;padding:8px 13px}
button:hover:not(:disabled){border-color:var(--gold);background:#293748}
button:focus-visible{outline:2px solid var(--green);outline-offset:3px}
button:disabled{opacity:.45;cursor:default}
.header,.brand,nav,.guide-head{display:flex;align-items:center}
.header,.guide-head{justify-content:space-between;gap:12px}
.header{padding-bottom:16px}
.brand{gap:11px}
.brand-mark{color:var(--gold);border:1px solid #806c51;background:#2b2828;display:grid;place-items:center;width:37px;height:37px;border-radius:8px;font-size:21px}
.brand strong,.brand small{display:block;line-height:1.23}
.brand strong{font:800 clamp(15px,2vw,22px)/1.2 "Segoe UI",sans-serif;letter-spacing:.17em}
.brand small{color:var(--muted);font-size:11px;letter-spacing:.16em;margin-top:3px}
nav{gap:7px}
.quiet{background:#121d29;color:#d7e3ed}
.layout{display:grid;grid-template-columns:minmax(0,1fr) 244px;gap:15px;align-items:start}
.field,.panel{border:1px solid var(--line);background:var(--surface);border-radius:12px;overflow:hidden}
.hud,.xp-strip{display:flex;align-items:center;padding:9px 15px;gap:clamp(12px,4vw,60px)}
.hud-item{white-space:nowrap}
.hud-item>span{display:block;color:var(--muted);font-size:11px}
.hud-item strong{font:700 24px/1.15 "Cascadia Mono",Consolas,monospace}
.hud-item small{font:12px Consolas,monospace;color:var(--muted)}
.hp{margin-left:auto;min-width:min(150px,30%)}
.hp strong{font-size:16px}
.arena{position:relative;background:#121b28;isolation:isolate}
canvas{width:100%;height:auto;display:block}
.notice{position:absolute;top:12px;left:50%;transform:translateX(-50%);border:1px solid #b78f60;background:#201b24;color:#ffdb9a;border-radius:6px;padding:5px 12px;font-weight:700;text-align:center;z-index:2;pointer-events:none}
.xp-strip{gap:12px;min-height:39px}
.xp-strip b,.xp-strip span{white-space:nowrap;font:700 13px Consolas,monospace;color:var(--green)}
.meter{height:6px;background:#273345;border-radius:8px;overflow:hidden}
.meter i{display:block;height:100%;width:0%;border-radius:8px}
.experience{flex:1}
.experience i{background:linear-gradient(90deg,#3f9cbc,#88f3d2)}
.health{margin-top:3px}
.health i{background:linear-gradient(90deg,#c8566d,#ffa49e);width:100%}
aside{display:grid;gap:10px}
.panel{padding:11px 12px}
h2{margin:0 0 7px;font-size:14px}
.panel h2{display:flex;justify-content:space-between;align-items:center}
.panel h2 span{color:var(--muted);font:12px Consolas,monospace}
.slots{display:grid;gap:4px;margin-bottom:12px}
.slots:last-child{margin-bottom:0}
.slot{display:flex;gap:7px;align-items:center;min-height:24px;padding:2px 6px;background:#1b2836;border:1px solid #253848;border-radius:5px;font-size:12px}
.slot.empty{color:#8c9fb2;background:#121d28;border-style:dashed}
.slot .symbol,.slot .rank{color:var(--accent,var(--muted))}
.slot .symbol{width:16px;text-align:center}
.slot .rank{margin-left:auto;font:11px Consolas,monospace}
.gems{display:flex;gap:18px}
.gems span{display:flex;gap:6px;align-items:center}
.gem{display:inline-block;width:8px;height:8px;transform:rotate(45deg);background:#62eac8;border:1px solid #c1fff0}
.gem.medium{width:10px;height:10px;background:#5ebeff;border-color:#c6e8ff}
.gem.large{width:12px;height:12px;background:#ba8cff;border-color:#f0dbff}
.heal{display:inline-grid;width:17px;height:17px;place-items:center;border-radius:3px;background:#582838;color:#ffb3bd;font:bold 15px/1 sans-serif;vertical-align:middle}
.panel p{margin:7px 0 0;color:var(--muted);font-size:12px}
.panel .device-status{color:#bde888;font-weight:700}
kbd{display:inline-block;padding:1px 4px;border:1px solid #46596c;border-radius:4px;color:#dce8f1;background:#202d3d;font:11px Consolas,monospace}
.screen{position:absolute;inset:0;z-index:3;display:grid;place-items:center;padding:12px;overflow:auto;background:#090f19a8}
.screen:empty{display:none}
.screen-inner{text-align:center;width:min(94%,790px);margin:auto}
.cover{max-width:550px;padding:clamp(14px,4vw,43px);background:linear-gradient(150deg,#162538f7,#111923f7);border:1px solid #536378;border-radius:14px;box-shadow:0 20px 80px #05080cb3}
.cover h1,.screen h2{margin:0;font-size:clamp(23px,4.5vw,55px);font-weight:800;line-height:1.1;letter-spacing:.045em}
.cover h1 span{display:block;margin-bottom:9px;color:var(--gold);font:800 .34em/1.1 "Segoe UI",sans-serif;letter-spacing:.32em}
.screen p{margin:9px 0 14px;color:#c5d2df}
.primary{background:var(--gold);border-color:var(--gold);color:#211908;font-weight:800;min-width:135px}
.primary:hover:not(:disabled){background:#ffda9d;color:#211908}
.choice-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(150px,100%),1fr));gap:9px}
.choice-list.four-choices{grid-template-columns:repeat(2,minmax(0,1fr))}
.choice{display:grid;align-content:start;gap:5px;text-align:left;min-height:125px;background:#172638;border-color:var(--accent);padding:10px}
.choice.cheat-choice{background:#273042}
.choice .type{color:var(--accent);font-weight:bold;font-size:11px}
.choice strong{font-size:clamp(13px,1.6vw,19px);line-height:1.25}
.choice .detail{color:#c5d2df;font-size:12px}
.upgrade-details{display:flex;flex-wrap:wrap;gap:3px 5px}
.upgrade-details>span{border-radius:4px;padding:0 4px;background:#253749}
.choice .upgrade-details{color:var(--accent);font-size:12px;font-weight:700}
.mode-select{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.mode-select button{min-width:0;text-align:left;padding:10px}
.mode-select strong,.mode-select small{display:block}
.mode-select small{margin-top:3px;font-size:11px}
.choice-tools{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;margin:9px 0;color:var(--muted)}
.choice-tools button{min-height:36px;padding:4px 12px}
.skill-icon{display:block;width:34px;height:34px;flex:none}
.skill-icon.mini{width:21px;height:21px}
.skill-name,.mix-part,.reward-prize{display:flex;gap:7px;align-items:center}
.skill-name{font-weight:800;font-size:clamp(14px,1.65vw,19px);line-height:1.25}
.mix-info{display:grid;gap:4px;border-top:1px solid #354758;margin-top:4px;padding-top:5px}
.mix-label{font-size:10px;font-weight:700;color:#aec1d4}
.mix-row{display:flex;align-items:center;gap:4px;flex-wrap:wrap;font-size:10px;line-height:1.25;color:#c7d6e4}
.mix-row.ready{color:#a3f4d2}
.mix-part{gap:4px}
.mix-arrow{color:var(--gold)}
.guide-item .skill-name{margin-bottom:4px}
.reward-screen .choice{--accent:#b38acd;min-height:70px}
.reward-prize{justify-content:center;margin:8px 0;color:#e7c8ff;font-weight:700}
.reward-back,.retry-back{margin:8px}
.boss-hud{position:absolute;left:50%;top:9px;z-index:2;width:min(320px,78%);transform:translateX(-50%);padding:6px 9px;border:1px solid #a75272;border-radius:8px;background:#201925f0;pointer-events:none}
.boss-hud>div:first-child{display:flex;justify-content:space-between;gap:6px;color:#ffd1db;font-size:12px}
.boss-hud small{display:block;text-align:center;color:#e1b4d2;font-size:10px;padding-top:3px}
.boss-hud .health{height:5px}
.boss-hud:not([hidden])+.notice{top:77px;white-space:nowrap;font-size:11px}
dialog{color:var(--ink);width:min(700px,94vw);max-height:85vh;overflow:auto;background:#14202d;border:1px solid #536378;border-radius:12px;padding:17px 20px}
dialog::backdrop{background:#060a12bd}
.guide-head h2{font-size:23px;margin:0}
.guide-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(225px,100%),1fr));gap:7px}
.guide-item{padding:8px;border-left:2px solid var(--accent);background:#1a2a39}
.guide-item small{display:block;color:#bdcbd7}
.guide-ranks{display:grid;gap:3px;margin:7px 0 0;padding:6px 0 0;border-top:1px solid #344759;list-style:none;font-size:12px}
.guide-ranks li{display:grid;grid-template-columns:36px 1fr;gap:4px;color:#d4e0e9}
.guide-ranks b{color:var(--accent);font-family:Consolas,monospace}
.touch{display:none;padding-top:8px;text-align:center;touch-action:none;user-select:none}
.touch button{min-width:54px;margin:2px;font-size:18px}
@media(max-width:960px){.layout{grid-template-columns:minmax(0,1fr) 192px}.panel{padding:8px}.controls kbd{font-size:10px}}
@media(max-width:740px){.layout{display:block}aside{margin-top:10px;grid-template-columns:1fr 1fr}.controls{grid-column:2;grid-row:1}.hud,.xp-strip{padding-inline:8px}.cover h1,.screen h2{font-size:clamp(21px,5vw,42px)}.screen p{margin:5px 0 10px}.choice{min-height:0}.choice-list{gap:5px}.choice .detail{font-size:11px}.screen-inner{width:100%}}
@media(max-width:500px){nav kbd{display:none}nav button{padding-inline:6px;font-size:12px}.hud-item strong{font-size:19px}.hp strong{font-size:13px}.arena{min-height:232px;display:grid;align-items:center}.choice-list,.choice-list.four-choices{grid-template-columns:1fr}.choice{display:block;padding:4px 6px}.choice .detail{display:block}.choice strong{margin-left:6px}.controls p span{display:block}}
@media(max-width:500px){.choice-tools{font-size:11px;gap:5px}.choice-tools button{min-height:30px;font-size:11px}.skill-name .skill-icon{width:26px;height:26px}.mix-row .skill-icon{width:17px;height:17px}.boss-hud:not([hidden])+.notice{top:65px}}
@media(pointer:coarse){.touch{display:block}.controls{display:none}}
