*{box-sizing:border-box}body{margin:0;background:#101c26;color:#ebf2f5;font-family:Inter,system-ui,Arial,sans-serif}button,input,select{font:inherit}button{background:#233744;color:#e8eff2;border:1px solid #ffffff15;border-radius:11px;padding:11px 16px;cursor:pointer;transition:background .15s,transform .15s}button:hover{background:#34505d}button:active{transform:translateY(1px)}button:disabled{opacity:.5;cursor:default}.primary,.gold{background:#f9d264;color:#192a32;border-color:#f9d264}.primary:hover,.gold:hover{background:#ffe298}.active{background:#a3dec8;color:#16332d}header{padding:18px 4%;border-bottom:1px solid #ffffff0c;display:flex;gap:12px;align-items:center;background:#14242e}.brand{display:flex;align-items:center;gap:10px;font-size:20px;font-weight:900;letter-spacing:1.5px;color:#edf5f3;text-decoration:none}.brand i{display:inline-block;width:19px;height:28px;border-radius:12px;background:#f9d264;transform:rotate(22deg)}nav{display:flex;gap:5px;margin-left:auto}nav button{border:0;background:transparent;font-size:13px}main{max-width:1360px;margin:0 auto;padding:26px 30px 50px}.hero{border-radius:24px;background:linear-gradient(115deg,#254b47,#203746 80%);display:grid;grid-template-columns:1.3fr 1fr;min-height:315px;padding:38px 42px;margin-bottom:32px;position:relative;overflow:hidden;border:1px solid #ffffff10}.hero h1{font-size:clamp(28px,4vw,46px);letter-spacing:-1.8px;line-height:1.15;margin:18px 0}.hero em{color:#f8d580;font-style:normal}.hero p,.hint{color:#a7bbc6;line-height:1.65;font-size:13px}.eyebrow{font-size:10px;letter-spacing:2.7px;color:#acd9c8;font-weight:700}#mascot{height:280px;width:100%;touch-action:none}.sectionhead{display:flex;align-items:end;justify-content:space-between;margin:25px 0 18px;gap:14px}h2{font-size:23px;letter-spacing:-.5px;margin:0 0 12px}h3{font-size:17px;margin:10px 0}.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(235px,1fr));gap:16px}.card{border:1px solid #ffffff12;background:#1a2b37;border-radius:17px;padding:20px;overflow:hidden}.card p{font-size:12px;color:#9fb5c0;line-height:1.7}.card .number{font-size:11px;letter-spacing:2px;color:#d3dcca}.card svg{width:100%;height:90px;background:#13232e;border-radius:8px;margin:10px 0}.card .actions{margin-top:14px}.actions{display:flex;gap:8px;flex-wrap:wrap}.card button{font-size:12px;padding:9px 13px}.card.new{border-color:#e8ce7b42}.tag{font-size:10px;color:#f4d588;margin-left:10px}.form{max-width:440px;display:grid;gap:12px}.form input,input,select{padding:11px;border:1px solid #ffffff25;border-radius:9px;color:#eaf3f8;background:#13242f;min-width:0}label{font-size:12px;color:#b0c3cd;display:grid;gap:6px}.strip{display:flex;align-items:center;gap:12px;margin-bottom:16px}.strip strong{margin-right:auto}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:20px}.stage{position:relative;border-radius:17px;overflow:hidden;border:1px solid #ffffff22}#world{display:block;width:100%;aspect-ratio:16/10;touch-action:none;outline:none}.hud{position:absolute;inset:14px 14px auto;display:flex;justify-content:space-between;pointer-events:none;font-size:12px;gap:8px}.hud span{background:#0d273bd9;padding:9px 13px;border-radius:10px}.touch{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}.touch button{touch-action:none;user-select:none;min-width:44px}aside{background:#1a2b37;border:1px solid #ffffff10;border-radius:17px;padding:18px;overflow:auto;max-height:760px}.tools{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin:14px 0}.tools button{padding:9px 5px;font-size:11px}.editor-controls{display:grid;gap:8px}.editor-controls .actions button{font-size:11px;padding:8px}.wheel-wrap{width:290px;height:290px;position:relative;margin:30px auto}.wheel-wrap:after{content:'▼';position:absolute;top:-20px;left:132px;color:#fff;font-size:28px}.wheel{position:absolute;inset:0;border-radius:50%;border:9px solid #f3d783;background:conic-gradient(#f4d878 0 72deg,#8fd0b5 72deg 144deg,#8bb7dc 144deg 216deg,#baa0da 216deg 288deg,#e89d87 288deg);transition:transform 3.8s cubic-bezier(.13,.67,.12,1)}.wheel span{position:absolute;top:50%;left:50%;font-weight:900;color:#20333b}dialog{color:#edf5f5;background:#192e3c;border:1px solid #b7d5cc44;border-radius:20px;padding:28px;max-width:440px;width:90%}dialog::backdrop{background:#051421aa;backdrop-filter:blur(5px)}dialog p{color:#b5cbd4;line-height:1.7}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#d9efe1;color:#14392f;padding:14px 23px;max-width:90%;border-radius:12px;z-index:10;box-shadow:0 10px 40px #0004}footer{font-size:11px;color:#879eab;margin:32px 0}details{margin:12px 0}summary{cursor:pointer;font-size:12px;margin-bottom:10px}.swatch{height:8px;border-radius:10px;margin-bottom:15px}#avatarPreview{width:100%;height:320px;touch-action:none}.feature{display:flex;gap:25px;align-items:center}.feature>div{flex:1}.feature canvas{max-width:420px}[hidden]{display:none!important}@media(max-width:850px){header{flex-wrap:wrap;padding:13px 16px;gap:8px}.brand{margin-right:auto}nav{order:2;width:100%;overflow:auto;margin:0}nav button{white-space:nowrap}main{padding:18px 12px}.hero{padding:24px;grid-template-columns:1fr 140px;min-height:250px}.hero h1{font-size:29px;letter-spacing:-1px}.hero p{font-size:12px}#mascot{height:235px}.cards{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}.card{padding:14px}.game-layout{grid-template-columns:1fr}aside{max-height:none}.tools{grid-template-columns:repeat(4,1fr)}.strip{gap:6px;flex-wrap:wrap}.strip button{font-size:12px;padding:8px}.feature{flex-direction:column}.hud{font-size:10px;inset:9px 9px auto}.hud span{padding:6px}.touch button{padding:11px 13px}.hero .primary{font-size:12px}}@media(max-width:420px){.hero{grid-template-columns:1fr}.hero #mascot{display:none}.hero h1{font-size:31px}.tools{grid-template-columns:repeat(3,1fr)}}

/* Visual update: preserve model proportions at every viewport size. */
#avatarPreview{display:block;width:100%;height:390px!important;aspect-ratio:auto!important;max-height:65vh;background:radial-gradient(ellipse at 50% 50%,#294a57,#192e3d);border:1px solid #476573;border-radius:24px;cursor:grab;touch-action:none}
#avatarPreview:active{cursor:grabbing}
@media(max-width:600px){#avatarPreview{height:330px!important}}

/* Sakura chapter */
body{background:radial-gradient(ellipse at 75% 0,#46516b 0,transparent 65%),#202c40;color:#f4edf4}
header{background:#26344bea;border-bottom-color:#eac0d52a}.card{background:linear-gradient(135deg,#354459,#29384c);border-color:#e9cfdd29;box-shadow:0 9px 25px #111b2929}
button.primary,button.active{background:#f0c4d4;color:#36394e;border-color:#f8d7e2}button:hover{filter:brightness(1.07)}
.hero{background:linear-gradient(115deg,#3a5266,#59516b)}.stage{border-color:#8298a8}button:focus-visible{outline:3px solid #ffe9ba;outline-offset:3px}
/* Illustrated paper palette */
body{background:#eee9da;color:#30464a}header{background:#f6f0e4f5;border-bottom:2px solid #748d88}.card{background:#f8f3e9;border:1.5px solid #80958e;border-radius:18px;box-shadow:3px 4px 0 #879b8820}.card h3,.sectionhead h2{color:#314c50}.card p,.hint{color:#5c726d}button{background:#e0e7d8;color:#324d4d;border:1.5px solid #7f978c;box-shadow:0 2px 0 #45625320}button.primary,button.active{background:#a9c9b1;color:#263e3c;border-color:#587f70}.equipped{border:2px solid #527f6e;background:#e7efdd}.hero{background:linear-gradient(120deg,#c4d6c8,#d8ddc7);color:#304c4d}.hero h1,.hero h2{color:#304c4d}.stage{border:3px solid #66877c;box-shadow:5px 7px 0 #50694a20}aside{background:#f6f0e4;color:#30464a;border:1px solid #80958e}.inventory-top{display:grid;grid-template-columns:1.2fr 1fr;gap:18px;margin:18px 0}.inventory-slots{display:grid;gap:10px}.inventory-slots .card{padding:14px}.mail-panel{border:1px solid #93a796;border-radius:18px;padding:18px;margin:15px 0}.form input,.editor-controls input,.editor-controls select,textarea{background:#fffcf4;color:#324b4c;border:1px solid #81978d;border-radius:9px;padding:10px}textarea{width:100%;min-height:110px}.number{color:#718a7c}#avatarPreview{border:2px solid #789188;background:#d8dfd2!important}@media(max-width:700px){.inventory-top{grid-template-columns:1fr}}

/* Flat 2D presentation */
#avatarPreview{cursor:default;background:#e6edda;aspect-ratio:230/195;object-fit:contain;box-shadow:none}#mascot{background:transparent;box-shadow:none}.stage{border:2px solid #5a7970;box-shadow:0 8px 0 #243d3820}.hero{background:#e5ecd8}.hero h1{color:#304e46}.hero p,.hero .eyebrow{color:#57756a}

/* One palette per theme, including forms, navigation and dialogs. */
:root{color-scheme:light;--page:#f0ede0;--surface:#fbf8ef;--panel:#e6eddd;--text:#2d4945;--muted:#60776c;--line:#93aa96;--accent:#aed0b3;--field:#fffdf5;--hero:#dce8d3;--shadow:#36594316}
:root[data-theme=dark]{color-scheme:dark;--page:#17272d;--surface:#21363c;--panel:#2c4549;--text:#e5eddf;--muted:#b1c5b9;--line:#52716c;--accent:#87b7a2;--field:#172e34;--hero:#294248;--shadow:#00000024}
body{background:var(--page);color:var(--text)}header{background:var(--surface);border-color:var(--line)}.brand{color:var(--text)}button,nav button{background:var(--panel);color:var(--text);border-color:var(--line);box-shadow:none}button:hover{background:var(--accent);color:#253e38;filter:none}button.primary,button.active,.gold{background:var(--accent);color:#223e35;border-color:var(--line)}.card,aside,.mail-panel{background:var(--surface);color:var(--text);border-color:var(--line);box-shadow:2px 3px 0 var(--shadow)}.equipped{background:var(--panel);border-color:var(--accent)}.card h3,.sectionhead h2,.hero h1,.hero h2{color:var(--text)}.card p,.hint,.hero p,.hero .eyebrow,label,footer,.number,.card .number{color:var(--muted)}.hero{background:var(--hero)}.hero em{color:var(--text)}input,select,textarea,.form input,.editor-controls input,.editor-controls select{background:var(--field);color:var(--text);border-color:var(--line)}dialog{background:var(--surface);color:var(--text);border-color:var(--line)}dialog p{color:var(--muted)}#avatarPreview{background:var(--hero)!important;border-color:var(--line)}#themeToggle{font-size:12px;white-space:nowrap}.wheel-wrap:after{color:var(--text)}.hud{color:#eff6e9}#toast{background:var(--accent);color:#203e35}.mobile-controls{display:none}button:focus-visible{outline:3px solid #d69748;outline-offset:3px}
@media(pointer:coarse),(max-width:700px){
 body[data-game-mode=play] .touch{display:none}.mobile-controls{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:12px max(6px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));user-select:none;-webkit-user-select:none;touch-action:none}
 .move-zone{text-align:center;flex:0 0 130px}.move-zone small{font-size:9px;color:var(--muted)}.move-pad{width:124px;height:108px;border:2px solid var(--line);background:var(--panel);border-radius:45%;position:relative;touch-action:none;margin:auto}.move-guide{position:absolute;inset:0;display:grid;place-items:center;letter-spacing:45px;padding-left:40px;color:var(--muted);opacity:.5}.move-knob{position:absolute;left:calc(50% - 24px);top:calc(50% - 24px);width:48px;height:48px;background:var(--accent);border:2px solid var(--line);border-radius:50%;pointer-events:none}
 .mobile-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;width:min(46%,220px)}.mobile-actions button{min-height:47px;padding:8px;font-size:12px;touch-action:none}.mobile-actions .jump-button{grid-column:1 / -1;min-height:65px;background:var(--accent);color:#234136;font-size:16px;font-weight:700}.held{filter:brightness(1.13);outline:2px solid var(--accent)}.move-pad.held{outline:none}.mobile-actions .held{transform:scale(.96)}.stage{touch-action:none}.strip button{min-height:42px}.hud{gap:3px}.hud span{font-size:10px}
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){
 body[data-game-mode=play] header{display:none}body[data-game-mode=play] #play{padding:6px 10px}body[data-game-mode=play] .strip{margin-bottom:5px}body[data-game-mode=play] .game-layout{display:block}body[data-game-mode=play] aside{display:none}body[data-game-mode=play] .stage{height:calc(100dvh - 180px);min-height:140px}body[data-game-mode=play] #world{height:100%;aspect-ratio:auto}body[data-game-mode=play] .mobile-controls{padding-top:5px;padding-bottom:0}.move-pad{height:82px;width:125px}.move-zone small{display:none}.mobile-actions{grid-template-columns:1fr 1fr 1.5fr;width:310px}.mobile-actions .jump-button{grid-column:auto;min-height:70px}body[data-game-mode=play] .game-layout>section>p.hint{display:none}
}
/* CapCoin collection */
.cap-balance{font-size:22px;font-weight:800;color:#d59b2f}.pay-link{display:inline-block;padding:12px 18px;border-radius:12px;background:#f9d264;color:#182e32;text-decoration:none;font-weight:700}.wheel{background:conic-gradient(#f4d878 0 60deg,#8fd0b5 60deg 120deg,#8bb7dc 120deg 180deg,#baa0da 180deg 240deg,#e89d87 240deg 300deg,#b7efd8 300deg)}.wheel span{font-size:17px}
