:root{color-scheme:light;--ink:#272142;--muted:#635c78;--purple:#6943c5;--line:#e7e0f2;--soft:#f2ebff;font-family:"Hiragino Sans","Yu Gothic",Meiryo,system-ui,sans-serif;color:var(--ink);background:#f7f5fc}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0}
button,input{font:inherit}
button{cursor:pointer;color:inherit}
button:disabled{cursor:default;opacity:.55}
button:focus-visible,input:focus-visible{outline:3px solid #9871ef;outline-offset:3px}
h1,h2,p,dl,dd{margin:0}
h1{font-size:clamp(1.5rem,4vw,2rem)}
h2{font-size:1.1rem}
p{line-height:1.65}
.top{background:#fff;border-bottom:1px solid var(--line)}
.top-inner,.layout,footer{max-width:1200px;margin:auto}
.top-inner{padding:0 26px;display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:70px}
.brand,.nav-link,.text-button{border:0;background:none;font-weight:800}
.brand{display:flex;align-items:center;gap:10px;padding:0;text-align:left}
.logo,.section-icon{display:grid;place-items:center;border-radius:11px;width:38px;height:38px;background:var(--soft);color:var(--purple);font-size:1.3rem;flex:none}
.logo{background:#7047cf;color:#fff;box-shadow:0 3px 0 #503097}
nav,.actions{display:flex;gap:8px;flex-wrap:wrap}
.nav-link{padding:10px 12px;border-radius:8px;color:var(--muted);font-size:.88rem}
.nav-link.active,.nav-link:hover{background:var(--soft);color:#5933ad}
.layout{display:grid;grid-template-columns:minmax(0,1fr) 294px;gap:22px;padding:26px}
.content,.view,aside{min-width:0}
aside{display:flex;flex-direction:column;gap:16px}
.hero{min-height:323px;position:relative;overflow:hidden;border-radius:19px;background:linear-gradient(110deg,#33205f 14%,#492780 58%,#6540a3);color:#fff;display:flex;isolation:isolate;box-shadow:0 7px 20px #43237625}
.hero-copy{position:relative;z-index:3;padding:31px 32px}
.hero .eyebrow{font:800 .78rem ui-monospace,monospace;letter-spacing:.19em;color:#e0c6ff}
.hero h1{font-size:clamp(2.2rem,5vw,3.6rem);line-height:1.09;margin:10px 0 12px;letter-spacing:.03em;text-shadow:3px 4px #28184d}
.hero-copy>p:not(.eyebrow){color:#eee4ff;font-weight:700}
.cta,.primary,.secondary{border-radius:9px;border:1px solid transparent;font-weight:800;padding:10px 15px;min-height:44px}
.cta{background:#ffd77b;color:#332149;margin-top:17px;box-shadow:0 4px 0 #bc8034}
.primary{background:var(--purple);color:white;box-shadow:0 3px 0 #52309e}
.secondary{background:#fff;border-color:#dcd1ed;color:#52359a}
.cta:hover,.primary:hover,.secondary:hover{filter:brightness(.95)}
.hero-art{position:absolute;inset:0 0 0 44%;overflow:hidden}
.moon{position:absolute;width:187px;height:187px;top:26px;right:17%;border-radius:50%;background:linear-gradient(#b98eed,#8158be);box-shadow:0 0 50px #d6a9ff60;opacity:.7}
.star{position:absolute;color:#ffe3a2;font-size:22px}.s1{top:19%;left:17%}.s2{top:9%;right:12%;font-size:28px}.s3{top:36%;right:8%;font-size:16px}.s4{top:39%;left:29%;font-size:12px}
.hill{position:absolute;width:79%;height:60%;border-radius:50%;background:#503184;bottom:-36%;right:-9%}
.h2{background:#7150a8;bottom:-41%;right:36%}.h3{background:#291e52;bottom:-44%;right:0;width:110%}
.sprite{image-rendering:pixelated;object-fit:contain}
.hero-art img{position:absolute;filter:drop-shadow(0 7px 0 #281c5688);width:37%;bottom:10%}
.hero-art .art-fire{left:0;bottom:6%;transform:rotate(-8deg)}
.hero-art .art-leaf{left:27%;width:44%;bottom:13%;z-index:2}
.hero-art .art-water{right:1%;bottom:5%;transform:rotate(7deg)}
.card{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 3px 10px #40275e08}
.stage-panel{margin-top:18px;padding:21px}
.section-head,.sidebar-heading,.partner-name,.exp-label,.stage-footer,.battle-top{display:flex;align-items:center;gap:10px}
.section-head p,.exp-label,.stage-footer>span,dt,.tip p{color:var(--muted);font-size:.88rem}
.rows{margin:17px 0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}
.row{display:flex;flex-direction:column;align-items:flex-start;position:relative;padding:8px 10px;min-height:68px;border:1px solid var(--line);border-radius:9px;background:#fff;text-align:left}
.row strong{font-size:1rem}
.row small{color:var(--muted);font-size:.75rem;letter-spacing:.05em}
.row[aria-pressed=true]{background:#f4edff;border-color:#a987eb;color:#5933a9}
.row[aria-pressed=true]::after{content:"✓";font-size:.82rem;position:absolute;right:7px;top:7px;color:#6841b9}
.row:hover{border-color:#a987eb}
.stage-footer,.partner-name,.exp-label,.battle-top{justify-content:space-between}
.stage-footer{border-top:1px solid var(--line);padding-top:14px}
.sidebar,.tip{padding:17px}
.sidebar-heading>span{color:var(--purple);font-size:1.2rem}
.partner-display{display:grid;place-items:center;background:radial-gradient(circle,#fff 0%,#f2eaff 76%);border-radius:11px;margin:13px 0;min-height:102px}
.partner-display img{width:88px;height:88px}
.partner-display.empty img{opacity:.35}
.partner-name{margin-bottom:13px}
.pill{font-weight:800;color:#6038af;background:var(--soft);border-radius:20px;padding:4px 9px;font-size:.83rem;white-space:nowrap}
progress{display:block;width:100%;height:10px;border:0;border-radius:12px;background:#eee7f8;overflow:hidden;accent-color:#794bd1}
progress::-webkit-progress-bar{background:#eee7f8}
progress::-webkit-progress-value{background:#794bd1;border-radius:12px}
progress::-moz-progress-bar{background:#794bd1;border-radius:12px}
.exp-label{margin-bottom:5px}
.wide{width:100%;margin-top:13px}
dl{margin-top:6px}
dl>div{display:flex;justify-content:space-between;gap:8px;padding:7px 0;border-bottom:1px solid #f0ebf5}
dl>div:last-child{border:0;padding-bottom:0}
dd{font-weight:800;font-size:.88rem}
.tip{background:#efe7fc;border:1px solid #e7daf9;border-radius:14px}
.tip p{margin:5px 0}
.text-button{padding:4px 0;color:#5b34a9;text-decoration:underline}
.detail{padding:clamp(16px,4vw,32px);min-height:320px}
.detail p,.detail .actions,.detail>button{margin-top:14px}
.keyboard,.partner-options,.metrics{display:flex;gap:8px;margin:20px 0;flex-wrap:wrap}
kbd{display:grid;place-items:center;width:42px;height:46px;background:var(--soft);border-radius:7px;border-bottom:3px solid #cdb9ef;font-size:1.2rem;font-weight:800}
kbd:nth-child(4),kbd:nth-child(5){background:var(--purple);color:white}
.partner-options button{flex:1;min-width:117px;display:grid;justify-items:center;gap:5px;background:#faf7ff;border:1px solid var(--line);border-radius:12px;padding:10px}
.partner-options img{width:82px}
.enemy-box{display:grid;justify-items:center;background:#f8f3ff;border-radius:12px;padding:12px;margin:16px 0}
.enemy-box img{width:104px}
.enemy-box progress{max-width:250px;margin-top:7px}
.enemy-box p{margin:4px 0;font-size:.85rem}
#typing-area{text-align:center}
#prompt{display:block;font-size:3rem;font-weight:900}
#hint{font:800 1.2rem ui-monospace,monospace;color:#6744aa;min-height:1.5em}
#hint b{color:#187745}
#typing{margin-top:7px;width:min(100%,220px);padding:8px;border:2px solid #b9a2e3;border-radius:8px;text-align:center;background:white;color:var(--ink)}
#input-message{margin-top:7px}
.metrics{justify-content:center}
.metrics span,.result,.notice{background:var(--soft);padding:8px 12px;border-radius:8px}
.result{font-weight:800}
.notice{margin-top:12px}
footer{padding:0 26px 18px;color:var(--muted);font-size:.85rem}
footer span{margin-left:8px}
@media(max-width:880px){.layout{grid-template-columns:minmax(0,1fr) 235px;gap:14px;padding:16px}.hero-copy{padding:26px 19px}.stage-panel{padding:14px}.row{padding:8px 5px}.row small{font-size:.68rem}}
@media(max-width:690px){.top-inner{padding:10px 14px;flex-wrap:wrap}.nav-link{padding:8px}.layout{grid-template-columns:1fr}aside{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.tip{grid-column:1/-1}}
@media(max-width:440px){.hero{min-height:335px}.hero-art{inset:60px 0 0 27%;opacity:.68}.hero-art img{bottom:3%}.hero-art .art-leaf{bottom:6%}.hero-art .art-fire,.hero-art .art-water{bottom:2%}.moon{width:130px;height:130px;right:10%;top:26%}.rows{grid-template-columns:repeat(2,minmax(0,1fr))}.stage-footer{align-items:flex-start;flex-direction:column}.sidebar{padding:10px}.sidebar h2{font-size:.96rem}}
.duel{display:flex;align-items:center;justify-content:center;gap:clamp(4px,3vw,24px)}
.duel span{color:var(--purple);font-size:1.6rem}
.duel img{width:clamp(70px,17vw,104px)}
.duel.solo #arena-partner,.duel.solo span{display:none}
