/* 입장/지도/결과 muddy 54/81/79%: 왕실 황금 깃발과 양피지 지도를 공통 바탕으로 쓴다. */
:root{color-scheme:light;--bg:#edc64d;--panel:#fff1bc;--line:#a78035;--gold:#825508;--text:#3f2b18;--muted:#6a4c20;--green:#347b37}
body{background:radial-gradient(ellipse at 20% 10%,#ffe59a,transparent 65%),var(--bg)}
.topbar{background:#ffe49a;border-color:var(--line)}
.brand>span{color:#8b3d1d}
.topbar nav button,.topbar nav .account,.brand small,.footer,.eyebrow,.game-title h1 span,.turn-display>span{color:var(--text)}
button,.brand,summary{min-height:44px}
button{min-width:44px}
.topbar .brand{align-items:center}
.entry-card,.entry-card.active,.hero-choice,.hero-choice.active{background:#fff1bc;border-color:#a78035;color:var(--text)}
.entry-card.active{background:#f6d16a;border-color:#80530a}
.entry-quick,.primary,.end-turn{background:#f6cc4d;color:#3f2b18;border-color:#936019}
.entry-quick:hover:not(:disabled),.primary:hover:not(:disabled){background:#ffdf78;color:#3f2b18}
.entry-copy>span,.entry-copy strong small,.entry-goal,.entry-links button,.entry-panel .fine,.entry-progress,.entry-progress li,.entry-progress li.on,.entry-progress li.done{color:#60431c}
.entry-card>svg:last-child,.entry-icon,.entry-progress li.done b{color:#80530a}
.entry-progress li.on b{background:#825508;color:#fff7d7}
.hero-portrait{border-color:#957021}
.secondary,.quiet,.entry-back,.menu-list button{color:var(--text);border-color:var(--line);background:#fff1bc}
.resource-bar,.world-panel,.world-top,.tile-detail,.map-legend,.management,.hero-card,.chronicle,.battle-roster,.battle-commands{background:#fff1bc;border-color:var(--line);color:var(--text)}
.resource small,.resource em,.world-top small,.move-pill,.map-legend small,.tile-detail p,.tile-detail .eyebrow,.chronicle p,.chronicle>span,.hero-card small,.objective label,.objective p,.panel-hint,.army-row small,.keyboard-note{color:#60431c}
.move-pill,.tabs,.build-card,.tile-thumb{background:#f6d979;border-color:var(--line);color:var(--text)}
.build-card small,.tabs button,.tabs button.active,.build-icon{color:var(--text)}
.tabs button.active{background:#ffeaaa}
.objective{background:linear-gradient(140deg,#f6d16a,#fff1bc);border-color:var(--line)}
.map-tools,.map-access,.map-access>div,.map-access button,.map-hint{background:#fff1bc;color:#3f2b18;border-color:#a78035}
.map-tools button,.map-tools button:hover{color:#3f2b18;background:#fff1bc}
.map-tools button{height:44px;min-width:44px}
.map-access summary{display:flex;align-items:center}
.map-access button[aria-pressed=true]{background:#f6d16a;border-color:#80530a}
.canvas-world,.lobby-world{background:#edc64d;border-color:#a78035}
.map-plaque,.map-plaque span,.map-badge,.features p{color:#3f2b18}
.map-badge{background:#fff1bc;border-color:#a78035}
dialog{background:linear-gradient(140deg,#ffe49a,#fff1bc);border-color:#a78035;color:var(--text)}
dialog::backdrop{background:#4e3919a8}
.dialog-head button,.muted,.fine,.brief p,.hero-choice p,.menu-list span,.result-copy,.result-stars small,.hero-best,.next-goal,.result-stats small,.result-seal{color:#60431c}
.brief,.result-score,.result-feats,.result-chronicle,.next-goal,.sound-settings,.save-comparison section{background:#fff1bc;border-color:var(--line)}
.result-stats,.result-stars,.result-grid,.result-chronicle{border-color:#a78035}
.result-stars span{opacity:1;color:#6a4c20}
.result-stars .on{color:#825508}
.result-feedback .gamenow-fb-card{background:#fff1bc;color:#3f2b18;border-color:#a78035}
.battlefield{background:#edc64d;border-color:#a78035}
.combat-unit,.enemies .combat-unit{background:#fff1bc;color:#3f2b18;border-color:#a78035}
.enemies .combat-unit{background:#fbd3b8;border-color:#a23e31}
.combat-unit small,.combat-unit em,.battle-meta strong,.battle-actions .muted{color:#60431c}
.combat-unit.active{border-color:#80530a;box-shadow:inset 0 0 0 2px #80530a}
.battle-undo{background:#fff1bc;color:#3f2b18;border-color:#80530a}
.tutorial-coach,.world-panel>.tutorial-coach{background:#fff1bc;border-color:#a78035;color:#3f2b18}
.tutorial-coach p,.tutorial-coach h3,.tutorial-coach .tutorial-tip,.tutorial-coach .tutorial-head>span{color:#60431c}
body .world-panel>.turn-brief .brief-main,body .world-panel>.turn-brief .brief-next{background:#ffe49a;color:#3f2b18}
body .world-panel>.turn-brief.tone-loss .brief-main,body .world-panel>.turn-brief.tone-warn .brief-main{background:#fbd3b8;color:#6a251b}
.timeline{background:#fff1bc;color:#3f2b18;border-color:#a78035}
.timeline-head span,.timeline li{color:#60431c}
.timeline li.on{background:#825508;color:#fff7d7}
input[type=range],input[type=checkbox]{min-height:44px}
input[type=checkbox]{min-width:44px}
@media(max-width:760px) and (orientation:portrait){
 .tile-detail>button[data-do=move]:disabled{background:#eadab3;color:#6a4c20;border-color:#a78035}
 .battle-undo{position:relative;left:auto;top:auto;display:block;margin:4px 6px}
 .resource-bar{padding-right:48px}
 .resource>div{display:block}
 .resource strong{display:block;font-size:16px}
 .resource em{display:block;font-size:12px}
 .resource-bar{height:54px}
 .entry-copy strong small{font-size:12px}
 .topbar nav button{font-size:12px}
}
/* 320×568: 영웅 셋·첫 안내를 모두 보이게, 설명을 없애지 않고 바깥 여백을 줄인다. */
@media(max-width:360px) and (max-height:620px){
 body:not(:has(.game-layout)) main{padding:8px 12px}
 .entry-main{padding-top:0}
 .entry-title h1{font-size:28px}
 .entry-title p{display:none}
 .entry-panel{margin-top:8px}
 .entry-question{font-size:22px;margin-bottom:8px}
 .entry-progress{margin-bottom:8px}
 .entry-progress li{padding-top:2px;padding-bottom:2px}
 .entry-quick{padding:8px 12px;margin-bottom:6px}
 .entry-quick strong{font-size:16px}
 .entry-quick small{font-size:12px}
 .entry-cards{gap:5px}
 .entry-card{gap:8px;padding:5px 8px;min-height:60px}
 .entry-card .hero-portrait{width:32px;height:40px}
 .entry-copy strong{font-size:16px;gap:4px}
 .entry-copy>span{font-size:12px;line-height:1.3}
 .entry-links{margin-top:4px;gap:0 8px}
}

/* 기존 고유색 규칙보다 우선해 안내·전투의 작은 글도 양피지 위 먹색으로 읽힌다. */
.tutorial-coach button,.tutorial-actions .secondary,.tutorial-actions .quiet{background:#f6d979;color:#3f2b18;border-color:#a78035;min-height:44px}
.tutorial-tip summary,.tutorial-tip p,.tutorial-copy svg{color:#60431c}
.portal-link{min-height:44px;display:flex;align-items:center;justify-content:center}
.chronicle>span{font-size:12px}
.skill-button,.skill-button.armed{background:#f6d979;color:#3f2b18;border-color:#a78035}
.skill-button small,.skill-button em,.battle-log,.battle-dialog .fine{color:#60431c}
.combat-unit,.skill-button,.battle-actions button{overflow-wrap:anywhere}
.result-dialog{background:linear-gradient(140deg,#ffe087,#f6d16a)}
@media(max-width:760px) and (orientation:portrait){
 body .end-turn{padding:8px;min-height:52px}
 body .end-turn small{display:none}
 .tutorial-head>span{letter-spacing:0}
 .topbar #sound{overflow:hidden}
}
.gold-button{background:#f6d979;color:#3f2b18;border-color:#a78035}
.retreat-preview,.retreat-preview.wipe-risk,.retreat-preview .wipe-warn{background:#fff1bc;color:#60431c;border-color:#a78035}
@media(max-width:760px) and (orientation:portrait){
 /* 390px 검수: 고정 명령판이 적 선택 행을 가려 명령판을 문서 흐름에 놓는다. */
 .battle-dialog .battle-canvas,.battle-dialog:has(.tutorial-coach) .battle-canvas{height:auto;aspect-ratio:860/660}
 .battle-roster .combat-unit{grid-template-columns:minmax(0,1fr)}
 .battle-roster .combat-unit strong,.battle-roster .combat-unit small{white-space:normal;overflow-wrap:anywhere}
 .battle-commands{position:relative;bottom:auto;box-shadow:none}
}

.combat-unit .intent{color:#8b3043;white-space:normal}
@media(max-width:760px){
 .topbar{gap:8px;height:auto;min-height:55px}
 .topbar .brand{flex-shrink:0}
 .topbar nav{flex:1;min-width:0;justify-content:flex-end}
 .topbar nav button{min-width:44px;padding:6px;white-space:normal;overflow-wrap:anywhere}
 .topbar #sound{white-space:normal;overflow:visible}
}
.game-title .timeline{background:#fff1bc;border-color:#a78035}
.timeline-head strong,.timeline-head span,.hero-card h3 span,.objective label b{color:#60431c}
.timeline li,.timeline li.ch2,.timeline li.ch3{background:#f6d979;color:#3f2b18}
.timeline li.now{background:#825508;color:#fff7d7;outline-color:#825508}
.objective .counter-note,.feat-head span,.feat-head b,.feat-head small,.feat small,.feat em,.result-grid h3,.result-grid h3 small,.result-chronicle h3,.result-score li small,.result-score li b,.result-chronicle li b,.next-goal b,.hero-best-stars{color:#60431c}
.feat>i{background:#f6d979;color:#60431c}
.feat.done{background:#f6d979;border-color:#a78035}
.feat.done em,.feat.done>i{color:#3f2b18}
.feat.failed{opacity:1}
