/* 欧陆 1914 · 游戏 APP 外壳（仅横屏：手机横屏 / 平板横屏）
   所有边框、按钮、徽章等都是 uikit.html 里用 three.js 建模后烘焙出来的 PNG（img/ui/*.png）。
   尺寸单位统一用 rem；根字号随视口缩放：手机横屏 ≈ 10–11px，平板横屏 ≈ 17–20px。设计基准 ≥ 69rem × 38rem。 */
:root { --gold: #e8cf8a; --gold2: #c9a24a; --ink: #2a2118; --paper: #efe2c0; --cp: #6a6a60; --en: #3d6fb6; --neu: #a08a5a; --out: #4a3a34;
  --serif: "Noto Serif CJK SC", "Songti SC", serif; --sans: "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); }
html { font-size: min(2.6vh, 1.45vw); }
html, body { margin: 0; height: 100%; overflow: hidden; background: #120f0c; color: #eadfc4; font-family: var(--sans); -webkit-user-select: none; user-select: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
* { box-sizing: border-box; }
button { font-family: inherit; color: inherit; }
img { -webkit-user-drag: none; }
.serif { font-family: var(--serif); }

/* ---------------- rotate overlay (portrait not supported) */
#rotate { display: none; position: fixed; inset: 0; z-index: 999; background: radial-gradient(#3a3128, #120f0c); color: var(--gold); flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; font-size: 16px; }
#rotate .ph { width: 64px; height: 110px; border: 4px solid var(--gold2); border-radius: 12px; animation: rot 2s ease-in-out infinite; }
#rotate small { color: #a99a78; font-size: 13px; }
@keyframes rot { 0%, 20% { transform: rotate(0) } 50%, 80% { transform: rotate(-90deg) } 100% { transform: rotate(0) } }
@media (orientation: portrait) { #rotate { display: flex; } #app { visibility: hidden; } }

/* ---------------- shell */
#app { position: fixed; inset: 0; overflow: hidden; }
#bg { position: absolute; inset: 0; background: #1a1612 url(../img/ui/title_bg.jpg) center / cover no-repeat; transition: filter .5s, transform 8s ease-out; }
#bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 50%, transparent 30%, rgba(10,8,6,.55) 100%); }
body[data-s="title"] #bg { transform: scale(1.04); }
body:not([data-s="title"]) #bg { filter: brightness(.5) saturate(.8) blur(2px); }
body[data-s="menu"] #bg { filter: brightness(.82) saturate(.95); }
.scr { position: absolute; inset: 0; padding: calc(var(--st) + .8rem) calc(var(--sr) + 1.4rem) calc(var(--sb) + .8rem) calc(var(--sl) + 1.4rem);
  display: none; flex-direction: column; opacity: 0; transition: opacity .25s; }
.scr.on { display: flex; }
.scr.vis { opacity: 1; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #8a6a2a transparent; touch-action: pan-y; }
.hscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; touch-action: pan-x; }
.hscroll::-webkit-scrollbar { display: none; }

/* ---------------- baked 3D components → CSS */
.plaque { position: relative; border: 1.5rem solid transparent; border-image: url(../img/ui/plaque.png) 44 50 fill / 1.5rem 1.7rem stretch; background: none;
  min-height: 4.6rem; padding: 0 .8rem; display: flex; align-items: center; justify-content: center; gap: .6rem; cursor: pointer;
  font: 900 1.7rem/1 var(--serif); letter-spacing: .3em; color: #f6e6b4; text-shadow: 0 .12rem .2rem #000, 0 0 .6rem rgba(0,0,0,.6); transition: transform .08s, filter .15s; text-decoration: none; }
.plaque:hover { border-image-source: url(../img/ui/plaque_hover.png); }
.plaque:active { border-image-source: url(../img/ui/plaque_pressed.png); transform: translateY(.12rem) scale(.985); }
.plaque[disabled], .plaque.disabled { border-image-source: url(../img/ui/plaque_disabled.png); color: #a49a88; cursor: not-allowed; transform: none; }
.plaque small { font: 400 1rem var(--sans); letter-spacing: .05em; color: #d8c69a; }
.plaque .ico { width: 2rem; height: 2rem; object-fit: contain; filter: drop-shadow(0 .1rem .1rem #000); }
.plaque.sm { min-height: 3.6rem; border-width: 1.1rem; border-image-width: 1.1rem 1.25rem; font-size: 1.35rem; letter-spacing: .15em; }
.back { width: 7.2rem; height: 3.5rem; background: url(../img/ui/back.png) center / contain no-repeat; border: 0; cursor: pointer; flex: none; transition: transform .08s; }
.back:active { transform: scale(.94); }
.ibtn { width: 4.2rem; height: 4.2rem; flex: none; border: 0; background: url(../img/ui/icon_btn.png) center / contain no-repeat; cursor: pointer; display: grid; place-items: center;
  font-size: 1.6rem; color: var(--gold); text-shadow: 0 .1rem .2rem #000; position: relative; transition: transform .08s; }
.ibtn:active { transform: scale(.92); }
.ibtn i { position: absolute; bottom: -1.1rem; left: 50%; transform: translateX(-50%); font: 700 .9rem var(--sans); font-style: normal; white-space: nowrap; color: #e6d6ac; text-shadow: 0 1px 2px #000; }
.ibtn .dot { position: absolute; top: .3rem; right: .3rem; width: .8rem; height: .8rem; border-radius: 50%; background: #c0262a; box-shadow: 0 0 0 .12rem #2a1a10; }
.panel { position: relative; border: 2.4rem solid transparent; border-image: url(../img/ui/panel.png) 96 fill / 2.4rem stretch; padding: .3rem .6rem; min-height: 0; }
.panel.parch { border-image-source: url(../img/ui/panel_parch.png); color: var(--ink); }
.panel > .in { margin: -1rem -1rem; }
.ribbon { height: 3.6rem; padding: 0 5rem; display: inline-flex; align-items: center; justify-content: center; background: url(../img/ui/ribbon.png) center / 100% 100% no-repeat;
  font: 900 1.5rem var(--serif); letter-spacing: .4em; color: #fbecc4; text-shadow: 0 .1rem .2rem #3a0a06; white-space: nowrap; margin-top: -.6rem; }
.scrollbanner { height: 4.2rem; padding: 0 3.6rem; display: inline-flex; align-items: center; justify-content: center; background: url(../img/ui/scroll.png) center / 100% 100% no-repeat;
  font: 900 1.7rem var(--serif); letter-spacing: .3em; color: var(--ink); white-space: nowrap; }
.tabs { display: flex; gap: .2rem; align-items: flex-end; }
.tab { width: 9rem; height: 3.3rem; border: 0; background: url(../img/ui/tab.png) center / 100% 100% no-repeat; cursor: pointer; font: 800 1.2rem var(--serif); letter-spacing: .15em;
  color: #c8b48a; text-shadow: 0 .1rem .15rem #000; padding-top: .5rem; flex: none; }
.tab.on { background-image: url(../img/ui/tab_on.png); color: #fff1c8; height: 3.6rem; }
.tab small { font: 400 .85rem var(--sans); color: inherit; opacity: .8; margin-left: .2rem; letter-spacing: 0; }
.slot { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; height: 2.9rem; min-width: 8rem; padding: 0 1.2rem; background: url(../img/ui/slot.png) center / 100% 100% no-repeat;
  font: 800 1.2rem var(--sans); color: #f0deac; white-space: nowrap; }
.slot img { height: 1.6rem; }
.slot small { font-weight: 400; color: #b8a47a; font-size: .9rem; }
.progress { position: relative; height: 1.9rem; background: url(../img/ui/progress.png) center / 100% 100% no-repeat; }
.bar { position: relative; height: 1.1rem; border-radius: .6rem; background: #1a1612; box-shadow: inset 0 .1rem .3rem #000, 0 0 0 .15rem #8a6a2a, 0 0 0 .25rem #2a1e12; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: .6rem; background: linear-gradient(#f0d48a, #b8862a 60%, #8a5a1a); box-shadow: inset 0 .1rem .1rem rgba(255,255,255,.4); }
.bar.red > i { background: linear-gradient(#e8806a, #a8322a 60%, #6a1a12); }
.bar.green > i { background: linear-gradient(#a8d08a, #4a8a3a 60%, #2a5a1a); }
.bar.blue > i { background: linear-gradient(#9ab8e8, #3d6fb6 60%, #1d3f7f); }
.stars { display: inline-flex; gap: .1rem; vertical-align: middle; }
.stars img { width: 1.3rem; height: 1.3rem; }
.stars img.off { filter: grayscale(1) brightness(.35); }
.lockico { width: 2.4rem; height: 2.4rem; background: url(../img/ui/lock.png) center / contain no-repeat; }
.toggle { width: 6rem; height: 4rem; border: 0; background: url(../img/ui/toggle_off.png) center / contain no-repeat; cursor: pointer; flex: none; }
.toggle.on { background-image: url(../img/ui/toggle_on.png); }
.rng { -webkit-appearance: none; appearance: none; width: 17rem; height: 3rem; background: transparent; cursor: pointer; }
.rng::-webkit-slider-runnable-track { height: .9rem; border-radius: .5rem; background: linear-gradient(90deg, #c9a24a var(--v, 50%), #2a2420 var(--v, 50%)); box-shadow: inset 0 .1rem .3rem #000, 0 0 0 .15rem #5a4220; }
.rng::-webkit-slider-thumb { -webkit-appearance: none; width: 2.6rem; height: 2.6rem; margin-top: -.85rem; border: 0; background: url(../img/ui/coin.png) center / contain no-repeat; }
.rng::-moz-range-track { height: .9rem; border-radius: .5rem; background: #2a2420; }
.rng::-moz-range-progress { height: .9rem; border-radius: .5rem; background: #c9a24a; }
.rng::-moz-range-thumb { width: 2.6rem; height: 2.6rem; border: 0; background: url(../img/ui/coin.png) center / contain no-repeat; }
.seg { display: inline-flex; gap: .3rem; }
.seg button { border: 0; height: 3rem; min-width: 5.4rem; padding: 0 .8rem; background: url(../img/ui/slot.png) center / 100% 100% no-repeat; font: 700 1.1rem var(--sans); color: #a8987a; cursor: pointer; }
.seg button.on { color: #fff1c8; filter: brightness(1.25) drop-shadow(0 0 .3rem rgba(232,207,138,.6)); }

/* ---------------- top HUD (shared) */
.hud { display: flex; align-items: center; gap: .8rem; height: 4.6rem; flex: none; margin-bottom: .4rem; }
.hud .ttl { font: 900 1.9rem var(--serif); letter-spacing: .35em; color: #f6e6b4; text-shadow: 0 .15rem .3rem #000; white-space: nowrap; }
.hud .ttl small { font: 400 1rem var(--sans); letter-spacing: .1em; color: #b8a47a; margin-left: .6rem; }
.hud .sp { flex: 1; }
.hudbar { height: 4rem; display: flex; align-items: center; gap: .8rem; padding: 0 3.6rem; border: 0; background: url(../img/ui/hudbar.png) center / 100% 100% no-repeat; }
.res { display: inline-flex; align-items: center; gap: .3rem; font: 800 1.15rem var(--sans); color: #f0deac; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.res img { width: 2.1rem; height: 2.1rem; object-fit: contain; }
.res small { color: #a99a78; font-weight: 400; font-size: .85rem; }

/* ---------------- title */
#s-title { align-items: center; justify-content: flex-end; padding-bottom: calc(var(--sb) + 2.6rem); }
.logo { position: absolute; right: calc(var(--sr) + 4rem); top: 12%; text-align: center; }
.logo h1 { margin: 0; font: 900 6.2rem/1 var(--serif); letter-spacing: .25em; color: #f4e2ae; text-shadow: 0 .3rem 0 #5a3a14, 0 .5rem 1.4rem rgba(0,0,0,.85); padding-left: .25em; }
.logo h2 { margin: .8rem 0 0; font: 700 1.6rem var(--serif); letter-spacing: 1.1em; color: #d8c28a; text-shadow: 0 .1rem .4rem #000; padding-left: 1.1em; }
.logo .rib { margin-top: 1.4rem; }
.tap { font: 700 1.6rem var(--serif); letter-spacing: .6em; color: #f4e2ae; text-shadow: 0 .1rem .5rem #000; animation: blink 1.6s ease-in-out infinite; cursor: pointer; padding: 1rem 2rem; }
@keyframes blink { 50% { opacity: .35 } }
.loadbox { width: 34rem; text-align: center; }
.loadbox p { margin: .5rem 0 0; font-size: 1rem; color: #c8b890; text-shadow: 0 1px 2px #000; }
.ver { position: absolute; left: calc(var(--sl) + 1.2rem); bottom: calc(var(--sb) + .6rem); font-size: .9rem; color: #9a8a6a; text-shadow: 0 1px 2px #000; }

/* ---------------- main menu */
#s-menu .body { flex: 1; display: flex; gap: 1.6rem; min-height: 0; }
.menu-col { width: 25rem; display: flex; flex-direction: column; gap: .5rem; justify-content: center; flex: none; }
.menu-col .plaque { justify-content: flex-start; padding-left: 1.4rem; }
.menu-col .plaque small { margin-left: auto; }
.menu-side { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; gap: 1.2rem; }
.menu-icons { display: flex; gap: 1.2rem; padding-bottom: 1.2rem; }
.notice { width: 25rem; }
.notice h4 { margin: 0 0 .3rem; font: 900 1.25rem var(--serif); letter-spacing: .2em; color: #5a2a12; }
.notice p { margin: 0; font-size: 1rem; line-height: 1.55; }

/* ---------------- campaign: side select */
.sides { flex: 1; display: flex; gap: 2.4rem; align-items: center; justify-content: center; min-height: 0; }
.side-card { width: 30rem; height: 100%; max-height: 30rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; text-align: center; cursor: pointer; transition: transform .15s; }
.side-card:active { transform: scale(.98); }
.side-card img.emb { height: 10rem; filter: drop-shadow(0 .4rem .6rem rgba(0,0,0,.7)); transition: transform .2s; }
.side-card:hover img.emb { transform: scale(1.06) rotate(-2deg); }
.side-card h3 { margin: 0; font: 900 2.2rem var(--serif); letter-spacing: .4em; color: #f6e6b4; text-shadow: 0 .1rem .3rem #000; padding-left: .4em; }
.side-card p { margin: 0; font-size: 1.05rem; color: #cbb98e; line-height: 1.5; }
.side-card .meta { display: flex; gap: .6rem; margin-top: .4rem; }

/* ---------------- campaign list */
.clist { flex: 1; display: flex; gap: 1.2rem; align-items: stretch; padding: .4rem .2rem 1rem; min-height: 0; }
.ccard { flex: none; width: 16.5rem; display: flex; flex-direction: column; position: relative; cursor: pointer; padding: 1.3rem 1.3rem 1.2rem;
  background: url(../img/ui/card.png) center / 100% 100% no-repeat; transition: transform .15s; }
.ccard:active { transform: scale(.98); }
.ccard .pic { flex: 1; min-height: 0; border-radius: .2rem; background: linear-gradient(160deg, rgba(255,240,200,.08), rgba(0,0,0,.4)), var(--pic, #2a241c) center / cover; display: flex; flex-direction: column; justify-content: space-between; padding: .7rem; position: relative; overflow: hidden; }
.ccard .pic::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.08) 0 2px, transparent 2px 4px); pointer-events: none; }
.ccard .play-tag { position: absolute; top: .55rem; right: .55rem; z-index: 2; font: 800 .8rem var(--sans); letter-spacing: .1em; color: #2a1a08; background: linear-gradient(#f0d48a, #c9a24e); padding: .15rem .55rem; border-radius: .2rem; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.ccard .yr { font: 700 .95rem var(--sans); color: #d8c69a; }
.ccard .fr { align-self: flex-start; font: 700 .9rem var(--sans); padding: .15rem .6rem; border-radius: 1rem; background: rgba(0,0,0,.45); color: #f0deac; border: 1px solid #8a6a2a; }
.ccard h3 { margin: 0; font: 900 1.45rem/1.25 var(--serif); color: #fff1c8; text-shadow: 0 .1rem .3rem #000; }
.ccard .np { height: 3.4rem; display: flex; align-items: center; justify-content: center; gap: .4rem; font: 800 1rem var(--sans); color: #3a2410; text-shadow: 0 1px 0 rgba(255,240,200,.6); margin-top: .1rem; }
.ccard .np .bar { flex: 1; max-width: 6rem; height: .8rem; }
.ccard .medal { position: absolute; top: -.4rem; right: .8rem; width: 2.6rem; filter: drop-shadow(0 .2rem .2rem #000); }
.ccard.locked .pic { filter: grayscale(.8) brightness(.55); }
.ccard.locked .lockico { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: 4rem; height: 4rem; }

/* ---------------- chapter map */
#s-chapters .body, #s-brief .body, #s-nation .body, #s-settings .body, #s-codex .body, #s-saves .body, #s-era .body { flex: 1; display: flex; gap: 1.2rem; min-height: 0; }
.intro { width: 22rem; flex: none; display: flex; flex-direction: column; }
.intro .in { display: flex; flex-direction: column; height: 100%; }
.intro h3 { margin: 0 0 .2rem; font: 900 1.6rem var(--serif); color: #3a1a0a; }
.intro .sub { font-size: .95rem; color: #6a5030; margin-bottom: .5rem; }
.intro p { margin: 0; font-size: 1.02rem; line-height: 1.6; }
.intro .foot { margin-top: auto; padding-top: .6rem; display: flex; gap: .6rem; align-items: center; justify-content: space-between; font-size: .95rem; color: #5a4020; }
.chmap { flex: 1; position: relative; min-width: 0; }
.chmap .in { position: absolute; inset: -1rem; overflow: hidden; border-radius: .3rem;
  background: radial-gradient(ellipse at 50% 50%, rgba(239,226,192,.0), rgba(90,60,30,.35)), url(../img/ui/panel_parch.png) center / 160% 160%; }
.chmap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pinb { position: absolute; transform: translate(-50%, -88%); display: flex; flex-direction: column; align-items: center; cursor: pointer; border: 0; background: none; padding: 0; }
.pinb img.p { width: 2.6rem; filter: drop-shadow(.2rem .3rem .2rem rgba(0,0,0,.5)); transition: transform .15s; }
.pinb:hover img.p { transform: translateY(-.3rem); }
.pinb .lbl { margin-top: -.2rem; background: rgba(42,33,24,.88); color: #f0deac; font: 700 .95rem var(--sans); padding: .2rem .6rem; border-radius: .3rem; white-space: nowrap; border: 1px solid #8a6a2a; }
.pinb .lbl b { color: var(--gold); margin-right: .3rem; }
.pinb .lockico { position: absolute; top: .2rem; width: 1.8rem; height: 1.8rem; }
.pinb.locked img.p { filter: grayscale(1) brightness(.7); }
.pinb.on .lbl { background: #8a2a22; }
.compass { position: absolute; right: 1rem; bottom: 1rem; width: 6rem; opacity: .5; }

/* ---------------- briefing */
.brief { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.brief .in { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.brief h3 { margin: 0; font: 900 1.9rem var(--serif); color: #3a1a0a; letter-spacing: .1em; }
.brief .sub { font-size: 1rem; color: #6a5030; margin: .2rem 0 .6rem; display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; }
.brief .txt { flex: 1; min-height: 0; padding-right: .6rem; }
.brief dl { margin: 0; display: grid; grid-template-columns: 5.6rem 1fr; gap: .45rem .8rem; font-size: 1.02rem; line-height: 1.55; }
.brief dt { font: 900 1rem var(--serif); color: #7a3a1a; letter-spacing: .2em; padding-top: .1rem; }
.brief dd { margin: 0; }
.brief .win { color: #2a5a1a; } .brief .lose { color: #8a1a12; }
.mode-tag { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .7rem; border-radius: 1rem; background: #3a2a1a; color: #f0deac; font: 700 .9rem var(--sans); }
.side-col { width: 23rem; flex: none; display: flex; flex-direction: column; gap: .6rem; min-height: 0; }
.side-col .panel { flex: 1; min-height: 0; }
.side-col .panel .in { height: 100%; display: flex; flex-direction: column; }
.ph { font: 900 1.15rem var(--serif); letter-spacing: .3em; color: var(--gold); margin-bottom: .5rem; display: flex; align-items: center; gap: .5rem; }
.ph small { font: 400 .85rem var(--sans); letter-spacing: 0; color: #a99a78; margin-left: auto; }
.gens { display: flex; gap: .7rem; flex-wrap: wrap; }
.gen { width: 6.2rem; text-align: center; text-decoration: none; color: inherit; }
.gen .fr { width: 6.2rem; height: 8rem; background: url(../img/ui/portrait.png) center / contain no-repeat; display: flex; align-items: center; justify-content: center; position: relative; }
.gen .fr span { font: 900 2.2rem var(--serif); color: #e8d6a8; margin-top: -1.2rem; text-shadow: 0 .1rem .2rem #000; }
.gen .fr em { position: absolute; bottom: .55rem; font: 700 .72rem var(--sans); font-style: normal; color: #3a2410; }
.gen b { display: block; font-size: .9rem; color: #f0deac; margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gen small { font-size: .8rem; color: #a99a78; }
.units { display: flex; gap: .5rem; flex-wrap: wrap; }
.dog { width: 6.4rem; height: 4.1rem; background: url(../img/ui/dogtag.png) center / contain no-repeat; display: flex; align-items: center; justify-content: center; font: 800 .95rem var(--sans); color: #2a2a2a; text-shadow: 0 1px 0 rgba(255,255,255,.5); padding-left: .6rem; }
.go { display: flex; gap: .6rem; align-items: center; }
.go .plaque { flex: 1; }

/* ---------------- conquest: eras */
.eras { display: flex; gap: 1.2rem; justify-content: center; align-items: flex-start; padding: .6rem 0 .2rem; flex: none; }
.era { width: 9rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; cursor: pointer; border: 0; background: none; padding: 0; transition: transform .15s; }
.era .cn { width: 7.4rem; height: 7.4rem; background: url(../img/ui/coin.png) center / contain no-repeat; display: grid; place-items: center; font: 900 1.7rem var(--serif); color: #4a300c;
  text-shadow: 0 1px 0 rgba(255,240,190,.7), 0 -1px 0 rgba(0,0,0,.3); filter: drop-shadow(0 .3rem .4rem rgba(0,0,0,.6)) grayscale(.5) brightness(.75); transition: filter .2s, transform .2s; }
.era b { font: 800 1rem var(--serif); color: #c8b48a; letter-spacing: .1em; white-space: nowrap; }
.era.on .cn { filter: drop-shadow(0 0 .8rem rgba(255,210,120,.65)) drop-shadow(0 .3rem .4rem rgba(0,0,0,.6)); transform: scale(1.1); }
.era.on b { color: #fff1c8; }
.era-info { flex: 1; min-height: 0; display: flex; gap: 1.2rem; }
.era-info .panel { flex: 1; }
.era-info h3 { margin: 0 0 .1rem; font: 900 1.8rem var(--serif); color: #3a1a0a; }
.era-info .date { color: #6a5030; font-size: 1rem; margin-bottom: .5rem; }
.era-info p { margin: 0 0 .6rem; font-size: 1.05rem; line-height: 1.65; }
.tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.tags span { padding: .15rem .7rem; border-radius: 1rem; background: #5a2a1a; color: #f6e6c0; font-size: .9rem; }
.balance { width: 23rem; flex: none; }
.balance .row { display: grid; grid-template-columns: 6.5rem 1fr 2.4rem; gap: .5rem; align-items: center; margin-bottom: .45rem; font-size: .95rem; }
.balance .row b { text-align: right; color: var(--gold); }
.tug { display: flex; height: 1.4rem; border-radius: .7rem; overflow: hidden; box-shadow: 0 0 0 .15rem #8a6a2a, inset 0 .1rem .3rem #000; margin: .3rem 0 .8rem; }
.tug i { display: block; height: 100%; }

/* ---------------- conquest: nation picker */
.cmap { flex: 1; min-width: 0; position: relative; }
.cmap .in { position: absolute; inset: -1rem; display: flex; align-items: center; justify-content: center; background: #2a3a48; border-radius: .3rem; overflow: hidden; }
.cmap canvas { max-width: 100%; max-height: 100%; image-rendering: auto; cursor: crosshair; }
.cmap .legend { position: absolute; left: .6rem; bottom: .6rem; display: flex; gap: .7rem; font-size: .9rem; background: rgba(20,16,12,.7); padding: .3rem .7rem; border-radius: .4rem; }
.cmap .legend i { display: inline-block; width: .9rem; height: .9rem; border-radius: .2rem; vertical-align: -.1rem; margin-right: .25rem; }
.nlist { width: 20rem; flex: none; display: flex; flex-direction: column; min-height: 0; }
.nlist .panel { flex: 1; min-height: 0; margin-top: -.25rem; }
.nlist .panel .in { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.nat { display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem; border-radius: .4rem; cursor: pointer; }
.nat:hover { background: rgba(255,240,200,.06); }
.nat.on { background: linear-gradient(90deg, rgba(201,162,74,.35), rgba(201,162,74,.05)); box-shadow: inset .25rem 0 0 var(--gold2); }
.nat .fl { width: 2.6rem; height: 1.7rem; border-radius: .15rem; box-shadow: 0 0 0 .12rem #8a6a2a, 0 .1rem .2rem #000; flex: none; }
.nat b { font-size: 1.05rem; color: #f0deac; } .nat small { color: #a99a78; font-size: .85rem; }
.nat .pw { margin-left: auto; width: 5rem; }
.nat.out { opacity: .5; }
.ndet { width: 20rem; flex: none; display: flex; flex-direction: column; gap: .6rem; min-height: 0; }
.ndet .panel { flex: 1; min-height: 0; }
.ndet .panel .in { height: 100%; display: flex; flex-direction: column; }
.ndet h3 { margin: 0; font: 900 1.7rem var(--serif); color: #3a1a0a; display: flex; align-items: center; gap: .6rem; }
.ndet .fl { width: 3.2rem; height: 2.1rem; border-radius: .15rem; box-shadow: 0 0 0 .12rem #8a6a2a; }
.ndet .side { font-size: .95rem; color: #6a5030; margin: .2rem 0 .5rem; }
.ndet .st { display: grid; grid-template-columns: 4rem 1fr 2rem; gap: .35rem .5rem; align-items: center; font-size: .95rem; margin-bottom: .5rem; }
.ndet .st b { text-align: right; }
.ndet .note { font-size: 1rem; line-height: 1.55; flex: 1; min-height: 0; }
.ndet .ng { font-size: .9rem; color: #6a5030; margin-top: .4rem; }

/* ---------------- game board placeholder (conquest / battle HUD) */
#s-board { padding: 0; }
#s-board .field { position: absolute; inset: 0; background: radial-gradient(ellipse, #3a4a3a, #1a221a); display: grid; place-items: center; }
#s-board .field .ph0 { text-align: center; color: #9aaa8a; font-size: 1.2rem; }
#s-board .field .ph0 b { display: block; font: 900 2.4rem var(--serif); letter-spacing: .4em; color: #cbd6b4; margin-bottom: .6rem; }
.b-top { position: absolute; left: calc(var(--sl) + .8rem); right: calc(var(--sr) + .8rem); top: calc(var(--st) + .5rem); display: flex; gap: .8rem; align-items: center; }
.b-top .hudbar { flex: 1; justify-content: space-around; }
.b-turn { position: absolute; right: calc(var(--sr) + 1rem); top: calc(var(--st) + 5.6rem); display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.b-turn .g { width: 7rem; height: 7rem; background: url(../img/ui/gauge.png) center / contain no-repeat; }
.b-turn b { font: 900 1.1rem var(--serif); color: var(--gold); text-shadow: 0 1px 2px #000; }
.b-left { position: absolute; left: calc(var(--sl) + .8rem); top: calc(var(--st) + 5.6rem); width: 19rem; }
.b-left .panel { min-height: 14rem; }
.b-bot { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--sb) + 1.6rem); display: flex; gap: 1.6rem; }
.b-end { position: absolute; right: calc(var(--sr) + 1rem); bottom: calc(var(--sb) + 1rem); width: 15rem; }
.b-end .plaque { white-space: nowrap; letter-spacing: .12em; font-size: 1.45rem; }
.minimap { position: absolute; left: calc(var(--sl) + .8rem); bottom: calc(var(--sb) + .8rem); width: 15rem; height: 10rem; }
.minimap .in { position: absolute; inset: 0; border-radius: .3rem; background: #2a3a48; display: grid; place-items: center; color: #8aa0b0; font-size: .9rem; }
.minimap.panel { border-width: 1.6rem; border-image-width: 1.6rem; }

/* ---------------- settings / codex / saves */
.set { flex: 1; min-width: 0; }
.set .in { height: 100%; }
.set .grp { font: 900 1.15rem var(--serif); letter-spacing: .3em; color: var(--gold); margin: .2rem 0 .4rem; }
.set .row { display: flex; align-items: center; gap: 1rem; padding: .3rem 0; border-bottom: 1px solid rgba(201,162,74,.15); min-height: 4rem; }
.set .row > span { flex: 1; font-size: 1.1rem; }
.set .row > span small { display: block; color: #a99a78; font-size: .85rem; }
.set .row output { width: 3rem; text-align: right; color: var(--gold); font-weight: 800; }
.codex-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.2rem; align-content: start; padding: .4rem; min-height: 0; }
.cx { display: flex; flex-direction: column; text-decoration: none; color: inherit; padding: 1.3rem 1.3rem 1.3rem; background: url(../img/ui/card.png) center / 100% 100% no-repeat; height: 15rem; transition: transform .15s; }
.cx:active { transform: scale(.98); }
.cx .pic { flex: 1; background: var(--pic) center / cover; border-radius: .2rem; margin-bottom: .9rem; }
.cx .np { height: 2.1rem; margin-bottom: .1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 900 1.15rem var(--serif); color: #3a2410; letter-spacing: .2em; }
.cx .np small { font: 400 .8rem var(--sans); letter-spacing: 0; color: #5a4020; }
.saves { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; min-height: 0; }
.save .in { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; text-align: center; }
.save .in b { font: 900 1.5rem var(--serif); color: var(--gold); letter-spacing: .2em; }
.save .in p { margin: 0; color: #a99a78; font-size: 1rem; }

/* ---------------- modal / toast */
#modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; background: rgba(8,6,4,.6); backdrop-filter: blur(2px); }
#modal.on { display: flex; }
#modal .panel { width: 36rem; max-width: 90vw; }
#modal .in { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; padding: .6rem 0; }
#modal h3 { margin: 0; font: 900 1.7rem var(--serif); letter-spacing: .25em; color: #3a1a0a; }
#modal p { margin: 0; font-size: 1.1rem; line-height: 1.6; }
#modal .seal { width: 5rem; height: 5rem; background: url(../img/ui/seal.png) center / contain no-repeat; margin-top: -3.6rem; filter: drop-shadow(0 .2rem .3rem rgba(0,0,0,.5)); }
#modal .acts { display: flex; gap: 1rem; }
#modal .acts .plaque { min-width: 12rem; }
#toast { position: fixed; left: 50%; top: calc(var(--st) + 1rem); transform: translate(-50%, -200%); z-index: 60; transition: transform .25s; pointer-events: none; }
#toast.on { transform: translate(-50%, 0); }
#toast .slot { height: 3.6rem; padding: 0 2rem; font-size: 1.1rem; }
.empty { color: #a99a78; font-size: 1rem; text-align: center; padding: 1rem; border: 1px dashed rgba(201,162,74,.35); border-radius: .4rem; }
.panel.parch .empty { color: #7a6040; border-color: rgba(90,60,30,.35); }
/* short landscape phones (≤ 380px tall) */
@media (max-height: 380px) { .hud { height: 4rem; } .menu-col .plaque { min-height: 4rem; } }
