/* 三国志Ⅱ · 霸王的大陆 — 「古战玄漆 · 虎符点兵」
 * Crafted strictly with real carved-bronze & dark-lacquer game textures.
 * Zero flat CSS gradients, zero SaaS cards.
 */
:root {
  color-scheme: dark;
  --ink: #0a0807;
  --lacquer-deep: #14100d;
  --lacquer-mid: #1d1713;
  --parchment: #f0e3c8;
  --gold: #d9b46e;
  --gold-bright: #f7e3b2;
  --ash: #a5947b;
  --cinnabar: #8f261d;
  --cinnabar-bright: #c94735;
  --shu-jade: #6ea78f;
  --wei-steel: #7d9ab8;
  --wu-amber: #c98f4a;
  --serif: "Songti SC", "STSong", "Hiragino Mincho ProN", "Noto Serif CJK SC", "SimSun", Georgia, serif;
  --body: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --ui-frame: url("/assets/ui/skins/carved-bronze/frame.png");
  --ui-panel: url("/assets/ui/skins/carved-bronze/panel-bg.png");
  --ui-socket: url("/assets/ui/skins/carved-bronze/socket.png");
  --ui-socket-active: url("/assets/ui/skins/carved-bronze/socket-active.png");
  --ui-plaque: url("/assets/ui/skins/carved-bronze/stat-plaque.png");
  --ui-btn: url("/assets/ui/skins/carved-bronze/button-wide.png");
  --ui-btn-active: url("/assets/ui/skins/carved-bronze/button-wide-active.png");
  --ui-portrait-frame: url("/assets/ui/skins/carved-bronze/portrait-frame.png");
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* ---- Full-Bleed Historical Pass Backdrop ---- */
.stage {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  isolation: isolate;
}

.stage-backdrop {
  position: fixed;
  inset: -24px;
  z-index: -3;
  background: var(--ink) url("/assets/muster-pass.png") center 32% / cover no-repeat;
  filter: brightness(0.46) contrast(1.12) saturate(0.84);
  animation: pass-breathe 26s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes pass-breathe {
  0% { transform: scale(1.02) translate3d(0, 0, 0); }
  100% { transform: scale(1.07) translate3d(-10px, -6px, 0); }
}

.stage-vignette {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-color: rgba(10, 8, 7, 0.42);
  box-shadow:
    inset 0 0 140px 56px rgba(8, 6, 5, 0.94),
    inset 0 90px 90px -40px rgba(7, 5, 4, 0.88),
    inset 0 -130px 110px -30px rgba(7, 5, 4, 0.96);
}

#ember-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ---- Quiet Archival Top Strip ---- */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(20px, 4vw, 48px) 0;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--ash);
}

.topbar-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-crest {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0.88;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 32px);
}

.ink-link {
  color: var(--parchment);
  text-decoration: none;
  opacity: 0.78;
  transition: opacity 0.2s ease, color 0.2s ease;
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.14em;
}

.ink-link:hover, .ink-link:focus-visible {
  opacity: 1;
  color: var(--gold-bright);
  outline: none;
}

/* ---- Central Hero Composition ---- */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 470px);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 4vh, 48px) clamp(20px, 4vw, 48px);
}

.title-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.seal-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cinnabar-seal {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background-color: var(--cinnabar);
  color: #f9e4cc;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.28em;
  box-shadow:
    inset 0 0 0 1px rgba(244, 200, 165, 0.35),
    inset 0 0 12px rgba(45, 7, 4, 0.55),
    0 4px 12px rgba(0, 0, 0, 0.6);
}

.era-note {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.monument-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.08;
  color: var(--gold-bright);
  text-shadow:
    0 2px 0 #3a2611,
    0 8px 28px rgba(0, 0, 0, 0.92);
}

.monument-title small {
  display: block;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 600;
  letter-spacing: 0.42em;
  color: var(--gold);
  margin-bottom: 10px;
}

.monument-title span {
  display: block;
  font-size: clamp(44px, 6.2vw, 76px);
  letter-spacing: 0.14em;
}

.monument-lead {
  margin: 4px 0 6px;
  max-width: 520px;
  font-family: var(--serif);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.85;
  letter-spacing: 0.08em;
  color: #e4d5ba;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.monument-pillars {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 4px;
  padding: 0;
  list-style: none;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: #cbb896;
}

.monument-pillars li {
  position: relative;
  padding-left: 16px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.monument-pillars li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold);
  font-size: 10px;
  line-height: 1.9;
}

/* ---- Carved-Bronze Command Desk (Real Game Textures) ---- */
.command-desk {
  position: relative;
  padding: 24px 26px 26px;
  background: var(--lacquer-mid) var(--ui-panel) center / 192px repeat;
  border: 10px solid transparent;
  border-image: var(--ui-frame) 30 / 10px round;
  box-shadow:
    inset 0 0 26px rgba(6, 4, 3, 0.85),
    0 24px 64px rgba(0, 0, 0, 0.86);
}

.desk-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(217, 180, 110, 0.22);
}

.desk-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--gold-bright);
}

.desk-head span {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ash);
}

/* Scenario Tallies */
.scenario-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.tally-btn {
  appearance: none;
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
  color: #d6c5a7;
  background: rgba(15, 11, 9, 0.72);
  border: 5px solid transparent;
  border-image: var(--ui-socket) 19 / 5px round;
  font-family: var(--serif);
  transition: color 0.16s ease, transform 0.12s ease;
}

.tally-btn strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 2px;
}

.tally-btn small {
  display: block;
  font-family: var(--body);
  font-size: 11px;
  color: var(--ash);
  letter-spacing: 0.04em;
}

.tally-btn:hover {
  color: var(--gold-bright);
  border-image-source: var(--ui-socket-active);
}

.tally-btn[aria-pressed="true"] {
  color: var(--gold-bright);
  background: rgba(45, 29, 17, 0.88);
  border-image-source: var(--ui-socket-active);
}

.tally-btn[aria-pressed="true"] small {
  color: #dfc38e;
}

/* Scenario Brief + Authentic 1992 ROM Portrait Roster */
.brief-plaque {
  padding: 12px 14px;
  margin-bottom: 14px;
  background: rgba(12, 9, 7, 0.65);
  border: 7px solid transparent;
  border-image: var(--ui-plaque) 26 fill / 7px stretch;
}

.brief-text {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.65;
  color: #e1d2b6;
}

.roster-duel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.roster-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.roster-side.right {
  align-items: flex-end;
}

.roster-label {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.portrait-strip {
  display: flex;
  gap: 6px;
}

.portrait-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.portrait-frame-wrap {
  width: 44px;
  height: 52px;
  padding: 4px;
  background: #100c0a;
  border: 4px solid transparent;
  border-image: var(--ui-portrait-frame) 28 / 4px round;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portrait-canvas {
  width: 32px;
  height: 40px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.portrait-name {
  font-size: 11px;
  color: #cbb99a;
  letter-spacing: 0.06em;
}

.roster-vs {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--cinnabar-bright);
  letter-spacing: 0.08em;
}

/* Faction Tiger Tally Selector */
.faction-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.faction-btn {
  appearance: none;
  cursor: pointer;
  padding: 9px 10px;
  background: rgba(14, 11, 9, 0.78);
  color: #cbb897;
  border: 5px solid transparent;
  border-image: var(--ui-socket) 19 / 5px round;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  transition: color 0.16s ease;
}

.faction-btn:hover {
  color: var(--gold-bright);
  border-image-source: var(--ui-socket-active);
}

.faction-btn[aria-pressed="true"] {
  color: var(--gold-bright);
  background: rgba(58, 25, 19, 0.85);
  border-image-source: var(--ui-socket-active);
}

/* Monumental Primary CTA using real carved button texture */
.launch-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 15px 18px;
  text-decoration: none;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  border: 9px solid transparent;
  border-image: var(--ui-btn) 22 fill / 9px stretch;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.16s ease;
}

.launch-cta:hover, .launch-cta:focus-visible {
  border-image-source: var(--ui-btn-active);
  color: #fff6dc;
  filter: brightness(1.08);
  transform: translateY(-1px);
  outline: none;
}

.launch-cta:active {
  transform: translateY(1px);
}

.desk-foot {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--ash);
}

.desk-foot a {
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.08em;
}

.desk-foot a:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

/* ---- Understated Archival Footer ---- */
.bottombar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  padding: 16px clamp(20px, 4vw, 48px) 22px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--ash);
}

.bottom-entries {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
}

.bottom-sep {
  opacity: 0.35;
}

.bottom-stamp {
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.72;
}

/* ---- Carved-Bronze Modal (Desktop Collector's Edition) ---- */
dialog.lacquer-dialog {
  max-width: 560px;
  width: calc(100vw - 32px);
  padding: 26px 28px;
  color: var(--parchment);
  background: var(--lacquer-mid) var(--ui-panel) center / 192px repeat;
  border: 10px solid transparent;
  border-image: var(--ui-frame) 30 / 10px round;
  box-shadow: 0 32px 88px rgba(0, 0, 0, 0.92);
}

dialog.lacquer-dialog::backdrop {
  background: rgba(6, 5, 4, 0.8);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(217, 180, 110, 0.24);
}

.modal-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.2em;
  color: var(--gold-bright);
}

.modal-close {
  appearance: none;
  background: none;
  border: none;
  color: var(--ash);
  font-size: 22px;
  cursor: pointer;
  padding: 2px 8px;
}

.modal-close:hover { color: var(--gold-bright); }

.modal-lead {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.75;
  color: #dfd0b4;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.download-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 16px;
  background: rgba(11, 8, 7, 0.7);
  border: 6px solid transparent;
  border-image: var(--ui-socket) 19 / 6px round;
}

.download-item h4 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
}

.download-item p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ash);
  flex: 1;
}

.download-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  border: 7px solid transparent;
  border-image: var(--ui-btn) 22 fill / 7px stretch;
}

.download-action:hover {
  border-image-source: var(--ui-btn-active);
  color: #fff6dc;
}

.download-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ash);
}

/* ---- Responsive ---- */
@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 18px;
  }
  .topbar-nav { gap: 14px; }
}

@media (max-width: 560px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .download-grid { grid-template-columns: 1fr; }
  .roster-duel { grid-template-columns: 1fr; gap: 8px; }
  .roster-vs { display: none; }
  .roster-side.right { align-items: flex-start; }
}
