:root { --ink:#2f2940; --paper:#fffaf0; --rose:#e65e77; --yellow:#f6c64e; --mint:#66b98b; --aqua:#70cbd0; --violet:#756db7; --line:#d7cbba; }
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; color:var(--ink); background:var(--paper); font-family:"Noto Sans SC","Noto Sans JP","Microsoft YaHei",Arial,sans-serif; letter-spacing:0; }
button,input,select { font:inherit; letter-spacing:0; }
a { color:inherit; }
.game-header { height:70px; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:0 28px; border-bottom:1px solid var(--line); background:#fffdf7; }
.game-brand { display:flex; align-items:center; gap:12px; text-decoration:none; }
.brand-gem { width:40px; height:40px; display:grid; place-items:center; transform:rotate(45deg); background:var(--ink); color:var(--yellow); border:2px solid var(--yellow); font:bold 12px Georgia,serif; }
.brand-gem::first-line { transform:rotate(-45deg); }
.game-brand > span:last-child { display:grid; line-height:1; }
.game-brand strong { font:700 16px Georgia,serif; }
.game-brand small { margin-top:6px; font-size:8px; color:#756e7a; }
.header-actions { display:flex; align-items:center; gap:12px; color:#6f6876; font-size:12px; }
.header-actions a { font-weight:800; text-decoration:none; }
.connection-dot { width:8px; height:8px; border-radius:50%; background:var(--mint); box-shadow:0 0 0 4px #dff3e6; }
.game-stage { position:relative; min-height:640px; height:calc(100svh - 70px); max-height:900px; overflow:hidden; background:#a8e1df; }
.game-stage::before { content:""; position:absolute; z-index:1; inset:0; pointer-events:none; background:linear-gradient(115deg,rgba(255,255,255,.18),transparent 28%,transparent 72%,rgba(117,109,183,.12)); mix-blend-mode:screen; }
#phaser-game { position:relative; z-index:0; }
#phaser-game,#phaser-game canvas { width:100%!important; height:100%!important; display:block; }
.game-identity { position:absolute; z-index:4; left:max(24px,calc((100% - 1240px)/2)); top:46px; width:min(430px,calc(100% - 48px)); padding:0; color:var(--ink); pointer-events:none; }
.game-identity .primary-action { pointer-events:auto; }
.guest-label { display:inline-block; padding:5px 8px; background:var(--ink); color:white; font-size:10px; font-weight:800; }
.game-identity h1 { margin:18px 0 4px; font:500 58px/1.02 Georgia,"Songti SC",serif; }
.game-subtitle { margin:0 0 10px; max-width:390px; font-size:18px; font-weight:800; }
.game-identity p:not(.game-subtitle) { max-width:390px; color:#50495a; }
.primary-action { min-height:46px; display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--ink); padding:10px 16px; background:var(--ink); color:white; font-weight:800; text-decoration:none; cursor:pointer; }
.primary-action:hover { background:var(--rose); border-color:var(--rose); }
.game-hud { position:absolute; z-index:4; right:28px; top:26px; display:flex; gap:6px; }
.game-hud div { width:104px; min-height:62px; padding:9px 11px; background:rgba(255,253,247,.93); border:1px solid rgba(47,41,64,.22); }
.game-hud span { display:block; font-size:9px; font-weight:800; color:#766f7d; }
.game-hud strong { display:block; margin-top:2px; font:600 22px Georgia,serif; }
.touch-controls { position:absolute; z-index:5; right:24px; bottom:24px; display:flex; align-items:center; gap:5px; }
.touch-controls[hidden] { display:none; }
.touch-controls div { display:grid; gap:5px; }
.touch-controls button { width:46px; height:46px; border:1px solid rgba(47,41,64,.3); background:rgba(255,255,255,.88); color:var(--ink); font-size:20px; cursor:pointer; }
.touch-controls button:active { background:var(--yellow); transform:translateY(1px); }
.game-message { position:absolute; z-index:6; left:max(24px,calc((100% - 1240px)/2)); bottom:24px; max-width:min(520px,calc(100% - 250px)); padding:11px 14px; border-left:4px solid var(--yellow); background:rgba(47,41,64,.92); color:white; font-size:12px; font-weight:700; opacity:0; transform:translateY(8px); transition:.2s ease; pointer-events:none; }
.game-message.is-visible { opacity:1; transform:translateY(0); }
.game-message { box-shadow:0 10px 28px rgba(36,29,52,.18); }
.game-console { display:grid; grid-template-columns:1.1fr .9fr; gap:0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.character-panel,.quest-panel { padding:56px max(30px,calc((100vw - 1240px)/2)); }
.character-panel { padding-right:48px; background:#fffdf7; }
.quest-panel { padding-left:48px; background:#292337; color:white; }
.section-label,.roadmap-heading > span { color:var(--rose); font-size:10px; font-weight:900; }
.game-console h2,.level-roadmap h2 { margin:10px 0 24px; font:500 34px/1.1 Georgia,"Songti SC",serif; }
.console-fields { display:grid; grid-template-columns:1fr 1fr 88px; gap:10px; margin-bottom:18px; }
.console-fields label { display:grid; gap:6px; font-size:10px; font-weight:800; }
.console-fields select,.console-fields input { width:100%; min-height:44px; border:1px solid #aaa0ac; background:white; padding:8px; color:var(--ink); }
.member-note { margin:18px 0 0; color:#77707b; font-size:12px; }
.quest-panel .section-label { color:#f4c35c; }
.quest-panel ol { margin:0; padding:0; list-style:none; border-top:1px solid rgba(255,255,255,.2); }
.quest-panel li { display:grid; grid-template-columns:45px 1fr; gap:12px; padding:15px 0; border-bottom:1px solid rgba(255,255,255,.2); }
.quest-panel li > span { color:#f4c35c; font:600 20px Georgia,serif; }
.quest-panel strong,.quest-panel small { display:block; }
.quest-panel small { color:rgba(255,255,255,.58); }
.knowledge-dialog { width:min(560px,calc(100% - 32px)); max-height:calc(100svh - 32px); border:0; padding:0; background:#fffdf7; color:var(--ink); box-shadow:0 24px 70px rgba(30,25,45,.28); }
.knowledge-dialog::backdrop { background:rgba(30,25,45,.62); backdrop-filter:blur(3px); }
.level-dialog { width:min(650px,calc(100% - 32px)); max-height:calc(100svh - 32px); border:0; padding:0; background:#fffdf7; color:var(--ink); box-shadow:0 24px 70px rgba(30,25,45,.32); }
.level-dialog::backdrop { background:rgba(30,25,45,.62); backdrop-filter:blur(3px); }
.level-dialog-body { padding:30px 34px 34px; }
.level-dialog-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.dialog-icon-close { width:38px; height:38px; border:1px solid var(--line); background:transparent; color:var(--ink); font-size:24px; cursor:pointer; }
.challenge-status { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:18px; color:#6e6775; font-size:11px; font-weight:800; }
.challenge-status strong { color:var(--rose); font:700 17px Georgia,serif; }
.timer-track { height:6px; margin:9px 0 18px; background:#eee4d8; overflow:hidden; }
.timer-track span { display:block; width:100%; height:100%; transform-origin:left center; background:linear-gradient(90deg,var(--mint),var(--yellow),var(--rose)); transition:transform .2s linear; }
.level-prompt { margin:12px 0 0; font-size:18px; font-weight:800; line-height:1.5; }
.level-options { display:grid; gap:8px; margin:18px 0; }
.level-options label { display:flex; align-items:flex-start; gap:11px; min-height:48px; padding:12px; border:1px solid var(--line); background:white; cursor:pointer; line-height:1.45; }
.level-options label:has(input:checked) { border-color:var(--rose); box-shadow:inset 4px 0 var(--rose); }
.level-options input { margin-top:3px; accent-color:var(--rose); }
.hint-panel { margin:12px 0; padding:11px 13px; border-left:4px solid var(--yellow); background:#fff6dc; color:#5c4c35; font-size:12px; line-height:1.6; }
.level-feedback { min-height:24px; color:#a73b55; font-weight:800; line-height:1.5; }
.level-feedback.is-success { color:#2e8057; }
.dialog-accent { height:8px; background:linear-gradient(90deg,var(--rose) 0 33%,var(--yellow) 33% 66%,var(--mint) 66%); }
.knowledge-dialog-body { padding:34px; }
.knowledge-dialog h2 { margin:9px 0 22px; font:500 32px/1.1 Georgia,"Songti SC",serif; }
.knowledge-prompt { font-size:17px; font-weight:800; }
.knowledge-options { display:grid; gap:8px; margin:20px 0; }
.knowledge-options label { display:flex; align-items:flex-start; gap:11px; min-height:48px; padding:12px; border:1px solid var(--line); background:white; cursor:pointer; }
.knowledge-options label:has(input:checked) { border-color:var(--rose); box-shadow:inset 4px 0 var(--rose); }
.knowledge-options input { margin-top:3px; accent-color:var(--rose); }
.knowledge-feedback { min-height:22px; color:#a73b55; font-weight:800; }
.dialog-actions { display:flex; gap:8px; }
.secondary-action { min-height:46px; border:1px solid var(--ink); padding:10px 16px; background:transparent; color:var(--ink); font-weight:800; cursor:pointer; }
.level-roadmap { padding:100px max(24px,calc((100vw - 1240px)/2)); background:#f2eadb; }
.roadmap-heading { max-width:680px; }
.roadmap-heading p { color:#6f6876; }
.level-roadmap ol { display:grid; grid-template-columns:repeat(5,1fr); margin:42px 0 0; padding:0; list-style:none; border-top:1px solid #cfc2b0; border-left:1px solid #cfc2b0; }
.level-roadmap li { min-height:100px; padding:16px; border-right:1px solid #cfc2b0; border-bottom:1px solid #cfc2b0; background:#fffaf0; }
.level-roadmap li span { display:block; margin-bottom:11px; color:var(--rose); font:600 15px Georgia,serif; }
.level-roadmap li strong { font-size:13px; }
footer { display:flex; justify-content:space-between; gap:20px; padding:24px 28px; background:#171421; color:rgba(255,255,255,.55); font-size:10px; }
@media (max-width:900px) { .game-stage { min-height:620px; } .game-identity h1 { font-size:46px; } .game-console { grid-template-columns:1fr; } .character-panel,.quest-panel { padding:48px 28px; } .level-roadmap ol { grid-template-columns:repeat(4,1fr); } }
@media (max-width:640px) { .game-header { height:62px; padding:0 14px; } .game-brand small { display:none; } .header-actions { gap:8px; } .header-actions span:not(.connection-dot) { display:none; } .header-actions a { width:34px; height:34px; display:grid; place-items:center; overflow:hidden; font-size:0; text-decoration:none; } .header-actions a::before { content:'←'; font-size:20px; line-height:1; } .game-stage { height:calc(100svh - 62px); min-height:580px; } .game-identity { left:18px; top:20px; width:calc(100% - 36px); } .game-identity h1 { margin-top:12px; font-size:38px; } .game-subtitle { font-size:14px; max-width:280px; } .game-identity p:not(.game-subtitle) { max-width:280px; font-size:12px; } .game-hud { top:auto; right:18px; left:18px; bottom:82px; } .game-hud div { min-height:55px; flex:1; width:auto; } .game-hud strong { font-size:19px; } .touch-controls { right:18px; bottom:18px; } .game-message { left:18px; bottom:154px; max-width:calc(100% - 36px); } .console-fields { grid-template-columns:1fr; } .level-roadmap { padding:70px 18px; } .level-roadmap ol { grid-template-columns:repeat(2,1fr); } .knowledge-dialog-body { padding:26px 20px; } .knowledge-dialog h2 { font-size:27px; } footer { display:block; padding:22px 18px; } footer span { display:block; margin:4px 0; } }
@media (max-width:640px) { .level-dialog-body { padding:24px 20px 26px; } .level-dialog h2 { font-size:27px; } .level-prompt { font-size:16px; } }
@media (prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } *,*::before,*::after { animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; } }

.audio-toggle { position:relative; display:flex; align-items:center; gap:7px; min-height:36px; cursor:pointer; font-size:10px; font-weight:800; color:#625b6a; }
.audio-toggle input { position:absolute; width:1px; height:1px; opacity:0; }
.toggle-track { width:34px; height:18px; display:block; padding:2px; border:1px solid #8d8491; background:#ddd6dc; transition:background .18s ease; }
.toggle-track span { width:12px; height:12px; display:block; background:white; box-shadow:0 1px 3px rgba(35,29,45,.25); transition:transform .18s ease; }
.audio-toggle input:checked + .toggle-track { border-color:var(--mint); background:var(--mint); }
.audio-toggle input:checked + .toggle-track span { transform:translateX(16px); }
.audio-toggle input:focus-visible + .toggle-track { outline:3px solid rgba(230,94,119,.32); outline-offset:2px; }

.game-guide { padding:90px max(24px,calc((100vw - 1240px)/2)); background:#fffdf7; border-bottom:1px solid var(--line); }
.guide-heading { max-width:760px; }
.guide-heading > span { color:var(--rose); font-size:10px; font-weight:900; }
.guide-heading h2 { margin:10px 0 16px; font:500 42px/1.08 Georgia,"Songti SC",serif; }
.guide-heading p { max-width:720px; color:#6b6470; line-height:1.75; }
.guide-steps { display:grid; grid-template-columns:repeat(4,1fr); margin:42px 0 0; padding:0; list-style:none; border-top:1px solid var(--line); border-left:1px solid var(--line); }
.guide-steps li { min-height:166px; padding:22px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.guide-steps span { display:block; margin-bottom:18px; color:var(--rose); font:600 18px Georgia,serif; }
.guide-steps strong { font-size:14px; }
.guide-steps p { margin:9px 0 0; color:#716a75; font-size:12px; line-height:1.65; }
.score-rule { margin:18px 0 0; padding:14px 18px; border-left:4px solid var(--yellow); background:#f6f0e5; color:#514a58; font-size:12px; font-weight:700; }

.level-roadmap { padding-top:92px; }
.level-roadmap .level-catalog { display:block; margin-top:44px; border:0; border-top:1px solid #cfc2b0; }
.level-roadmap .level-mission { display:grid; grid-template-columns:72px minmax(240px,.9fr) minmax(330px,1.2fr) 150px; gap:24px; min-height:0; padding:24px 0; border:0; border-bottom:1px solid #cfc2b0; background:transparent; transition:background .18s ease; }
.level-roadmap .level-mission:hover { background:rgba(255,250,240,.72); }
.level-roadmap .level-mission.is-locked { opacity:.58; }
.level-roadmap .level-mission.is-completed { box-shadow:inset 4px 0 var(--mint); padding-left:16px; }
.level-roadmap .level-mission span { display:inline; margin:0; color:inherit; font:inherit; }
.level-index > span { display:block!important; margin-bottom:12px!important; color:var(--rose)!important; font:600 22px Georgia,serif!important; }
.difficulty { display:flex; gap:3px; }
.difficulty i { width:7px; height:7px; display:block; border:1px solid #a99da8; border-radius:50%; }
.difficulty i.is-filled { border-color:var(--rose); background:var(--rose); }
.level-summary { min-width:0; }
.level-summary small { color:#8d4760; font-size:9px; font-weight:900; text-transform:uppercase; }
.level-summary h3 { margin:7px 0 8px; font:500 25px/1.1 Georgia,"Songti SC",serif; }
.level-summary > p { margin:0; color:#5f5865; font-size:12px; line-height:1.65; }
.level-meta { display:flex; flex-wrap:wrap; gap:5px 12px; margin-top:13px; color:#716876; font-size:9px; font-weight:800; }
.level-details { margin:0; display:grid; gap:10px; }
.level-details div { display:grid; grid-template-columns:74px 1fr; gap:10px; }
.level-details dt { color:#8d4760; font-size:9px; font-weight:900; }
.level-details dd { margin:0; color:#5f5865; font-size:11px; line-height:1.55; }
.level-action { display:flex; flex-direction:column; align-items:stretch; justify-content:center; gap:8px; }
.level-state { min-height:14px; color:#756d79!important; font-size:9px!important; font-weight:900!important; text-align:center; }
.level-action .primary-action { width:100%; min-height:42px; padding:8px 10px; font-size:11px; }
.level-action .primary-action:disabled { border-color:#a9a0aa; background:#a9a0aa; cursor:not-allowed; }
.level-action > small { min-height:14px; color:#6e6672; font-size:9px; text-align:center; }

.level-dialog { width:min(680px,calc(100% - 32px)); max-height:calc(100svh - 28px); border:0; padding:0; background:#fffdf7; color:var(--ink); box-shadow:0 24px 70px rgba(30,25,45,.32); }
.level-dialog::backdrop { background:rgba(30,25,45,.68); backdrop-filter:blur(3px); }
.level-dialog-body { padding:30px 34px 34px; }
.level-dialog-head { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; }
.level-dialog h2 { margin:8px 0 18px; font:500 32px/1.08 Georgia,"Songti SC",serif; }
.dialog-icon-close { width:36px; height:36px; flex:0 0 auto; border:1px solid var(--line); background:transparent; color:var(--ink); font-size:24px; cursor:pointer; }
.challenge-status { display:flex; align-items:center; justify-content:space-between; gap:18px; color:#655e69; font-size:10px; font-weight:800; }
.challenge-status strong { color:var(--ink); }
.challenge-status b { color:var(--rose); font:600 18px Georgia,serif; }
.timer-track { height:5px; margin:9px 0 22px; overflow:hidden; background:#ddd4c8; }
.timer-track span { width:100%; height:100%; display:block; background:var(--mint); transform-origin:left center; transition:transform .2s linear,background .2s ease; }
.timer-track span.is-low { background:var(--rose); }
.selection-guide { margin:0 0 8px; color:#8d4760; font-size:10px; font-weight:900; }
.level-prompt { margin:0 0 17px; font-size:17px; font-weight:800; line-height:1.5; }
.level-options { display:grid; gap:8px; }
.level-options label { display:flex; align-items:flex-start; gap:11px; min-height:50px; padding:13px; border:1px solid var(--line); background:white; cursor:pointer; line-height:1.45; }
.level-options label:has(input:checked) { border-color:var(--rose); box-shadow:inset 4px 0 var(--rose); }
.level-options input { margin-top:3px; accent-color:var(--rose); }
.hint-panel { margin-top:15px; padding:13px 15px; border-left:4px solid var(--yellow); background:#f4eddf; color:#554e5a; font-size:12px; line-height:1.6; }
.level-feedback { min-height:24px; margin:14px 0; color:#a73b55; font-weight:800; line-height:1.55; }
.level-feedback.is-success { color:#397653; }

@media (max-width:1000px) {
    .guide-steps { grid-template-columns:repeat(2,1fr); }
    .level-roadmap .level-mission { grid-template-columns:58px 1fr 1.1fr; }
    .level-action { grid-column:2 / -1; flex-direction:row; align-items:center; justify-content:flex-end; }
    .level-action .primary-action { width:auto; min-width:150px; }
}

@media (max-width:640px) {
    .header-guide-link { display:none!important; }
    .audio-toggle { flex:0 0 auto; }
    .audio-toggle strong { display:none; }
    .audio-toggle .toggle-track,.audio-toggle .toggle-track span { display:block!important; }
    .game-guide { padding:66px 18px; }
    .guide-heading h2 { font-size:32px; }
    .guide-steps { grid-template-columns:1fr; }
    .guide-steps li { min-height:0; }
    .level-roadmap .level-mission { grid-template-columns:46px 1fr; gap:14px; padding:22px 0; }
    .level-details,.level-action { grid-column:1 / -1; }
    .level-details div { grid-template-columns:68px 1fr; }
    .level-action { flex-direction:column; align-items:stretch; }
    .level-action .primary-action { width:100%; }
    .level-dialog-body { padding:24px 18px 26px; }
    .level-dialog h2 { font-size:27px; }
    .level-prompt { font-size:15px; }
    .dialog-actions { flex-direction:column-reverse; }
    .dialog-actions button { width:100%; }
}
