@font-face {
  font-family: "HistoryZhengKai";
  src: url("/src/assets/fonts/LXGWZhenKaiGB-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #f6efe2;
  --muted: #c9baa1;
  --paper: #241d1a;
  --panel: rgba(40, 33, 29, 0.9);
  --line: rgba(238, 207, 157, 0.22);
  --ally: #53c878;
  --enemy: #e45d4f;
  --swing: #c88b45;
  --gold: #e7bd72;
  --blue: #5f9bd8;
  --font-body: "HistoryZhengKai", "Kaiti SC", "STKaiti", "KaiTi", "DFKai-SB", "FangSong", "Songti SC", serif;
  --font-title: "HistoryZhengKai", "STLiti", "LiSu", "STKaiti", "Kaiti SC", "KaiTi", "DFKai-SB", "FangSong", "Songti SC", serif;
  --font-brush: "HistoryZhengKai", "Kaiti SC", "STKaiti", "KaiTi", "DFKai-SB", "FangSong", "Songti SC", serif;
  --font-readable: "HistoryZhengKai", "Kaiti SC", "STKaiti", "KaiTi", "DFKai-SB", "FangSong", "Songti SC", serif;
  --font-number: "DIN Alternate", "Avenir Next Condensed", "Arial Black", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(95, 155, 216, 0.22), transparent 32%),
    linear-gradient(135deg, #17191d 0%, #2b211e 46%, #111418 100%);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px 18px 72px;
}

.site-legal-links {
  position: fixed;
  right: 12px;
  bottom: 10px;
  left: 12px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(238, 207, 157, 0.18);
  border-radius: 999px;
  background: rgba(17, 20, 24, 0.72);
  backdrop-filter: blur(8px);
}

.site-legal-links a {
  color: rgba(246, 239, 226, 0.76);
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
}

.site-legal-links a:hover,
.site-legal-links a:focus-visible {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.phone {
  position: relative;
  width: min(100vw, 430px);
  aspect-ratio: 9 / 16;
  max-height: calc(100vh - 28px);
  min-height: 720px;
  overflow: hidden auto;
  border: 1px solid rgba(231, 189, 114, 0.24);
  border-radius: 28px;
  background:
    linear-gradient(rgba(20, 18, 17, 0.7), rgba(20, 18, 17, 0.86)),
    url("data:image/svg+xml,%3Csvg width='240' height='240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
  padding: 18px;
}

.phone.danger-pressure {
  border-color: rgba(228, 93, 79, 0.46);
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.42),
    inset 0 0 34px rgba(228, 93, 79, 0.12);
}

.phone.critical-pressure {
  border-color: rgba(228, 93, 79, 0.74);
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.48),
    inset 0 0 48px rgba(228, 93, 79, 0.24);
}

.phone.recent-impact .stage-panel::after {
  content: "";
  font-size: 16px;
  font-weight: 800;
  color: rgba(231, 189, 114, 0.68);
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at 55% 40%, rgba(231, 189, 114, 0.18), transparent 28%),
    rgba(228, 93, 79, 0.08);
  animation: impact-flash 620ms ease-out both;
}

.topbar,
.mission-strip,
.scene-panel,
.intel-button,
.stats-panel,
.decision-panel,
.ending-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.kicker,
.scene-panel small,
.section-title,
.stat-copy span {
  color: var(--muted);
  font-size: 12px;
}

.kicker,
h1,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: 20px;
  letter-spacing: 0;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #312720;
  color: var(--gold);
  cursor: pointer;
}

.mission-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
}

.mission-strip img {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(231, 189, 114, 0.42);
  border-radius: 8px;
  object-fit: cover;
  object-position: center top;
}

.mission-strip div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mission-strip strong {
  font-size: 14px;
  color: var(--gold);
}

.mission-strip span {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-panel {
  position: relative;
  margin-top: 10px;
  padding: 11px 12px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(32, 25, 22, 0.96) 0%, rgba(32, 25, 22, 0.82) 62%, rgba(32, 25, 22, 0.42) 100%),
    url("./assets/stages/hongmen-banquet-scene.png") center / cover;
}
.scene-panel p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.45;
}

.scene-panel small {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: #e8c37f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-panel {
  position: relative;
  min-height: 248px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(231, 189, 114, 0.28);
  border-radius: 10px;
  background: #191715;
}
.stage-panel.danger-pressure {
  border-color: rgba(228, 93, 79, 0.44);
}

.stage-panel.critical-pressure .stage-bg {
  filter: saturate(1.12) brightness(0.72);
}

.stage-panel.scene-tense .stage-bg {
  filter: saturate(0.88) brightness(0.82);
}

.stage-panel.scene-danger .stage-bg {
  filter: saturate(1.18) brightness(0.66);
}

.stage-panel.scene-escape-window .stage-bg {
  filter: saturate(0.96) brightness(0.94);
}

.stage-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 11, 10, 0.05), rgba(12, 11, 10, 0.88)),
    url("./assets/stages/hongmen-banquet-scene.png") center / cover;
  filter: saturate(0.92);
}

.stage-bg::after {
  content: "";
  font-size: 16px;
  font-weight: 800;
  color: rgba(231, 189, 114, 0.68);
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: transparent;
}

.stage-panel.scene-tense .stage-bg::after {
  background: radial-gradient(circle at 82% 38%, rgba(228, 93, 79, 0.18), transparent 26%);
}

.stage-panel.scene-danger .stage-bg::after {
  background:
    radial-gradient(circle at 82% 38%, rgba(228, 93, 79, 0.32), transparent 30%),
    linear-gradient(180deg, rgba(55, 11, 8, 0.16), rgba(10, 8, 8, 0.18));
}

.stage-panel.scene-escape-window .stage-bg::after {
  background: radial-gradient(circle at 16% 72%, rgba(83, 200, 120, 0.22), transparent 24%);
}

.stage-topline,
.stage-cast,
.stage-story {
  position: relative;
  z-index: 1;
}
.stage-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 0;
}

.stage-topline span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.stage-topline b {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-cast {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 10px;
  align-items: end;
  min-height: 142px;
  padding: 8px 10px 0;
}

.stage-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(231, 189, 114, 0.36);
  border-radius: 10px;
  background: rgba(13, 13, 12, 0.72);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
}
.stage-card.impact-bad,
.visual-stat.impact-bad {
  animation: impact-bad 520ms cubic-bezier(0.2, 0.9, 0.22, 1.18) both;
}

.stage-card.impact-good,
.visual-stat.impact-good {
  animation: impact-good 520ms cubic-bezier(0.2, 0.9, 0.22, 1.18) both;
}

.stage-card img {
  display: block;
  object-fit: contain;
  object-position: center top;
  background: rgba(8, 8, 7, 0.66);
}

.player-card {
  display: grid;
  grid-template-columns: 56% 44%;
  align-items: stretch;
  height: 138px;
}

.player-card img {
  width: 100%;
  height: 138px;
}

.player-card div {
  display: grid;
  align-content: end;
  gap: 4px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(67, 45, 26, 0.1), rgba(67, 45, 26, 0.74)),
    rgba(17, 15, 14, 0.58);
}

.player-card span,
.threat-card span {
  color: var(--muted);
  font-size: 11px;
}

.player-card strong {
  color: var(--gold);
  font-size: 22px;
}

.player-card small,
.threat-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.stage-card.mood-humble img {
  filter: brightness(0.92) saturate(0.9);
}

.stage-card.mood-alarmed {
  border-color: rgba(228, 93, 79, 0.48);
}

.stage-card.mood-alarmed img {
  filter: brightness(0.78) saturate(0.92);
}

.stage-card.mood-escaping {
  border-color: rgba(83, 200, 120, 0.42);
  box-shadow: inset 0 0 18px rgba(83, 200, 120, 0.14);
}

.stage-card.mood-escaping img {
  filter: brightness(1.04) saturate(1.04);
}

.threat-stack {
  display: grid;
  gap: 8px;
}

.threat-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  height: 65px;
}

.threat-card img {
  width: 56px;
  height: 65px;
}

.threat-card span {
  position: static;
  display: block;
  padding: 0 8px;
  color: #f0d39d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.threat-card.mood-suspicious img {
  filter: brightness(0.86) contrast(1.05);
}

.threat-card.mood-angry,
.threat-card.mood-urging {
  border-color: rgba(228, 93, 79, 0.58);
}

.threat-card.mood-angry img,
.threat-card.mood-urging img {
  filter: brightness(0.78) saturate(1.08);
}

.threat-card.mood-turning,
.threat-card.mood-furious {
  border-color: rgba(228, 93, 79, 0.86);
  box-shadow:
    inset 0 0 24px rgba(228, 93, 79, 0.26),
    0 0 18px rgba(228, 93, 79, 0.18);
}

.threat-card.mood-turning img,
.threat-card.mood-furious img {
  filter: brightness(0.68) saturate(1.22) contrast(1.08);
}

.threat-card.mood-checked {
  border-color: rgba(83, 200, 120, 0.26);
}

.threat-card.mood-checked img {
  filter: brightness(0.84) saturate(0.82);
}

.threat-card.danger {
  border-color: rgba(228, 93, 79, 0.52);
}

.threat-card.warning {
  box-shadow: inset 0 0 18px rgba(228, 93, 79, 0.18);
}

.threat-card.critical {
  border-color: rgba(228, 93, 79, 0.86);
  box-shadow:
    inset 0 0 24px rgba(228, 93, 79, 0.28),
    0 0 18px rgba(228, 93, 79, 0.18);
}

.stage-story {
  margin: 8px 10px 10px;
  padding: 9px 10px;
  border: 1px solid rgba(238, 207, 157, 0.16);
  border-radius: 8px;
  background: rgba(18, 16, 15, 0.82);
  animation: story-enter 360ms ease-out both;
}

.stage-story p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.42;
}

.stage-story small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--gold);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.danger-alerts {
  position: absolute;
  bottom: 8px;
  left: 50%;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  transform: translateX(-50%);
  pointer-events: none;
  animation: alerts-pulse 2.4s ease-in-out infinite;
}

@keyframes alerts-pulse {
  0%, 100% { opacity: 0.92; }
  50% { opacity: 0.6; }
}

.danger-alerts span {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(228, 93, 79, 0.55);
  border-radius: 4px;
  background: rgba(143, 34, 28, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffd1c8;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.impact-burst {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
  margin-top: -4px;
  pointer-events: none;
}
.impact-burst span {
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  animation: burst-rise 1180ms ease-out var(--delay) both;
}

.impact-burst .bad {
  border: 1px solid rgba(228, 93, 79, 0.46);
  background: rgba(143, 34, 28, 0.84);
  color: #ffd1c8;
}

.impact-burst .good {
  border: 1px solid rgba(83, 200, 120, 0.42);
  background: rgba(37, 91, 56, 0.82);
  color: #d6ffe1;
}

.intel-button,
.stats-panel,
.story-panel,
.action-receipt,
.decision-panel,
.ending-panel {
  margin-top: 10px;
  padding: 10px;
}

.action-receipt {
  border: 1px solid rgba(231, 189, 114, 0.28);
  border-radius: 8px;
  background: rgba(31, 35, 37, 0.92);
}

.receipt-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.receipt-head span {
  color: var(--muted);
  font-size: 12px;
}

.receipt-head b {
  color: var(--gold);
  font-size: 12px;
}

.story-round {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.story-round span {
  color: #e7bd72;
  font-size: 12px;
  font-weight: 900;
}

.story-round b {
  color: rgba(232, 206, 164, 0.76);
  font-size: 11px;
  line-height: 1;
}

.action-receipt p {
  margin-top: 7px;
  color: #ead8b9;
  font-size: 13px;
  line-height: 1.45;
}

.story-panel p {
  margin-top: 7px;
  color: #ead8b9;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.receipt-action,
.receipt-reaction {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.receipt-action {
  -webkit-line-clamp: 1;
}

.receipt-reaction {
  -webkit-line-clamp: 2;
  color: var(--muted) !important;
}

.delta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.delta-list span {
  border-radius: 999px;
  padding: 4px 7px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
}

.delta-list .up {
  color: #ffb09f;
}

.delta-list .down {
  color: #91dfa9;
}

.section-title {
  margin-bottom: 7px;
  font-weight: 700;
}

.intel-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  cursor: pointer;
}

.intel-button span {
  color: var(--muted);
  font-size: 12px;
}

.intel-button b {
  color: var(--gold);
  font-size: 13px;
}

.intel-drawer {
  --intel-drawer-padding-x: clamp(10px, 2vw, 18px);
  --intel-drawer-padding-y: clamp(12px, 2dvh, 18px);
  --intel-sheet-width: 430px;
  --intel-sheet-max-height: min(76dvh, 620px);
  --intel-relation-max-height: min(28dvh, 260px);

  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--intel-drawer-padding-y) var(--intel-drawer-padding-x);
  background: rgba(0, 0, 0, 0.62);
}

.intel-drawer.open {
  display: flex;
}

.intel-sheet {
  position: relative;
  width: min(100%, var(--intel-sheet-width));
  max-height: calc(100vh - 32px);
  max-height: var(--intel-sheet-max-height);
  overflow: auto;
  border: 0;
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.22),
    inset 0 -1px 0 rgba(231, 189, 114, 0.12),
    0 18px 60px rgba(0, 0, 0, 0.5);
  background:
    linear-gradient(rgba(22, 20, 18, 0.86), rgba(22, 20, 18, 0.95)),
    url("./assets/stages/hongmen-banquet-scene.png") center / cover;
  border-radius: 8px;
  padding: 12px;
}


.intel-sheet::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  z-index: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 189, 114, 0.52), transparent);
  pointer-events: none;
}

.intel-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.intel-head .intel-close {
  position: relative;
  z-index: 12;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  pointer-events: auto;
  touch-action: manipulation;
}

.intel-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.intel-head strong {
  display: block;
  margin-top: 2px;
  color: var(--gold);
  font-size: 16px;
}

.relation-map {
  position: relative;
  max-height: none;
  overflow: auto;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 10%, rgba(231, 189, 114, 0.12), transparent 28%),
    linear-gradient(160deg, rgba(28, 20, 13, 0.94), rgba(8, 7, 6, 0.96)),
    url("./assets/stages/hongmen-banquet-scene.png") center / cover;
}

/* Action trace timeline in intel drawer */
.strategy-review {
  margin-top: 12px;
  border: 1px solid rgba(231, 189, 114, 0.18);
  border-radius: 6px;
  background: rgba(8, 7, 6, 0.52);
  padding: 10px;
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.review-head strong {
  color: #e7bd72;
  font-size: 12px;
  font-weight: 900;
}

.review-head small {
  color: #9a8d7a;
  font-size: 10px;
  font-weight: 700;
}

.review-list {
  display: grid;
  gap: 5px;
}

.review-step {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 6px;
  align-items: start;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
  line-height: 1.3;
}

.review-step i {
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 10px;
  color: rgba(83, 200, 120, 0.78);
}

.review-step.fail i {
  color: rgba(228, 93, 79, 0.78);
}

.review-step.fail {
  background: rgba(228, 93, 79, 0.06);
}

.review-step span {
  overflow: hidden;
  color: #d4c098;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-deltas {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.review-deltas b {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.06);
}

.review-deltas b.good {
  color: #91dfa9;
}

.review-deltas b.bad {
  color: #ffb09f;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  background: rgba(16, 18, 18, 0.9);
}

.status-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.visual-stat {
  position: relative;
  min-height: 82px;
  overflow: hidden;
  border: 1px solid rgba(238, 207, 157, 0.18);
  border-radius: 10px;
  background: rgba(18, 18, 17, 0.92);
}
.visual-stat.warning {
  border-color: rgba(231, 189, 114, 0.52);
}

.visual-stat.critical {
  border-color: rgba(228, 93, 79, 0.72);
  box-shadow: inset 0 0 20px rgba(228, 93, 79, 0.18);
}

.visual-stat img,
.visual-stat i {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.visual-stat img {
  object-fit: cover;
  object-position: center top;
  opacity: 0.58;
}

.visual-stat i {
  display: grid;
  place-items: center;
  color: rgba(231, 189, 114, 0.22);
  font-style: normal;
  font-size: 38px;
  font-weight: 900;
}

.visual-stat::after {
  content: "";
  font-size: 16px;
  font-weight: 800;
  color: rgba(231, 189, 114, 0.68);
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.05), rgba(10, 10, 10, 0.86));
}

.visual-stat div {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 7px;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 6px;
}

.visual-stat span {
  color: var(--muted);
  font-size: 11px;
}

.visual-stat strong {
  color: var(--ink);
  font-size: 18px;
}

.visual-stat em {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  width: 4px;
  background: linear-gradient(180deg, var(--gold), var(--enemy));
}

.visual-stat.good em {
  background: linear-gradient(180deg, var(--ally), var(--blue));
}

@keyframes impact-flash {
  0% {
    opacity: 0;
  }
  16% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes impact-bad {
  0% {
    transform: translateX(0);
    box-shadow: inset 0 0 0 rgba(228, 93, 79, 0);
  }
  18% {
    transform: translateX(-3px);
  }
  36% {
    transform: translateX(3px);
    box-shadow: inset 0 0 28px rgba(228, 93, 79, 0.34), 0 0 18px rgba(228, 93, 79, 0.2);
  }
  62% {
    transform: translateX(-1px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes impact-good {
  0% {
    transform: scale(1);
    box-shadow: inset 0 0 0 rgba(83, 200, 120, 0);
  }
  38% {
    transform: scale(1.025);
    box-shadow: inset 0 0 24px rgba(83, 200, 120, 0.24), 0 0 14px rgba(83, 200, 120, 0.16);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes burst-rise {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  18% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

@keyframes story-enter {
  from {
    opacity: 0.72;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone.recent-impact .stage-panel::after,
  .stage-card.impact-bad,
  .stage-card.impact-good,
  .visual-stat.impact-bad,
  .visual-stat.impact-good,
  .impact-burst span,
  .stage-story {
    animation: none;
  }
}

.stat-row {
  grid-template-columns: 34px 1fr;
  align-items: center;
  display: grid;
  gap: 7px;
  min-height: 50px;
  border: 1px solid rgba(238, 207, 157, 0.12);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.stat-copy {
  display: flex;
  justify-content: space-between;
  grid-column: 2;
}

.stat-copy b {
  font-size: 12px;
  color: var(--ink);
}

.meter {
  grid-column: 2;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.stat-portrait,
.stat-mark {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(231, 189, 114, 0.26);
  border-radius: 8px;
  background: rgba(231, 189, 114, 0.12);
}

.stat-portrait {
  object-fit: cover;
  object-position: center top;
}

.stat-mark {
  display: grid;
  place-items: center;
  color: var(--gold);
  font-style: normal;
  font-weight: 800;
}

.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 180ms ease;
}

.meter.good i {
  background: linear-gradient(90deg, var(--blue), var(--ally));
}

.meter.danger i {
  background: linear-gradient(90deg, var(--gold), var(--enemy));
}

.ending-panel p {
  margin-top: 4px;
  color: #ead8b9;
  font-size: 13px;
  line-height: 1.45;
}

.historian-note {
  margin: 8px 0 10px;
  border: 1px solid rgba(231, 189, 114, 0.28);
  background:
    linear-gradient(180deg, rgba(26, 22, 17, 0.94), rgba(12, 10, 9, 0.9));
  padding: 10px 12px;
}

.historian-note span {
  display: block;
  color: #e7bd72;
  font-size: 12px;
  font-weight: 900;
}

.historian-note p {
  margin-top: 5px;
  color: #f2dfbb;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.48;
}

.option-grid {
  display: grid;
  gap: 8px;
}

.option-button,
.free-form button,
.improvise-button,
.restart-wide {
  border: 1px solid rgba(231, 189, 114, 0.28);
  border-radius: 8px;
  background: #3a2b22;
  color: var(--ink);
  cursor: pointer;
}

.option-button {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  text-align: left;
  font-size: 13px;
}

.option-button span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(231, 189, 114, 0.18);
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}

.option-button strong {
  min-width: 0;
  flex: 1;
  font-size: 14px;
  font-weight: 700;
}

.option-button b {
  color: var(--gold);
  font-size: 22px;
  line-height: 1;
}

.free-form {
  display: grid;
  grid-template-columns: 76px 1fr 64px;
  gap: 8px;
  margin-top: 10px;
}

.free-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 17, 16, 0.92);
  color: var(--ink);
  padding: 0 11px;
  outline: none;
}

.free-form button,
.improvise-button,
.restart-wide {
  min-height: 42px;
  font-weight: 700;
}

.history-list {
  max-height: 190px;
  overflow: auto;
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.history-list div {
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.history-list span {
  color: var(--gold);
  font-size: 12px;
}

.history-list p {
  margin-top: 3px;
  font-size: 12px;
}

.restart-wide {
  width: 100%;
  margin-top: 10px;
}

/* Concept-art style shell: a playable battle board, not a dashboard. */
.phone {
  padding: 10px;
  border-radius: 10px;
  background:
    linear-gradient(rgba(10, 9, 8, 0.64), rgba(10, 9, 8, 0.88)),
    url("./assets/stages/hongmen-banquet-scene.png") center / cover,
    #15110f;
}

.phone::before {
  content: "";
  font-size: 16px;
  font-weight: 800;
  color: rgba(231, 189, 114, 0.68);
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  position: sticky;
  top: 0;
  z-index: 9;
  display: block;
  height: 0;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(231, 189, 114, 0.36), inset 0 0 0 1px rgba(0, 0, 0, 0.9);
}

.topbar {
  position: relative;
  min-height: 98px;
  align-items: start;
  padding: 13px 58px 10px 54px;
  border-color: rgba(231, 189, 114, 0.34);
  background:
    linear-gradient(90deg, rgba(12, 10, 9, 0.96), rgba(30, 24, 20, 0.75)),
    url("./assets/stages/hongmen-banquet-scene.png") center 34% / cover;
  box-shadow: inset 0 -28px 46px rgba(0, 0, 0, 0.58);
}
.war-seal {
  position: absolute;
  left: 12px;
  top: 0;
  width: 30px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(231, 189, 114, 0.46);
  border-top: 0;
  background: linear-gradient(180deg, rgba(105, 23, 19, 0.94), rgba(65, 19, 15, 0.96));
  color: #e6c17f;
  font-size: 21px;
  font-weight: 900;
  writing-mode: vertical-rl;
}

.topbar h1 {
  margin-top: 4px;
  color: #fff5df;
  font-size: 24px;
  line-height: 1.05;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.72);
}

.topbar small {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: #efd49e;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .icon-button {
  position: absolute;
  right: 14px;
  top: 18px;
  background: rgba(46, 33, 23, 0.72);
}

.stage-panel {
  min-height: 460px;
  margin-top: 8px;
  border-color: rgba(231, 189, 114, 0.42);
  border-radius: 8px;
  background: #100e0c;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.78),
    inset 0 0 34px rgba(231, 189, 114, 0.08);
}

.stage-bg {
  background:
    linear-gradient(180deg, rgba(12, 10, 8, 0.08), rgba(12, 10, 8, 0.58) 54%, rgba(12, 10, 8, 0.94)),
    url("./assets/stages/hongmen-banquet-scene.png") center / cover;
}

.stage-panel.scene-danger {
  animation: danger-breath 1500ms ease-in-out infinite;
}

.scene-titleplate {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 10px 0;
  padding: 8px 10px;
  border: 1px solid rgba(231, 189, 114, 0.28);
  background: rgba(11, 10, 9, 0.72);
}
.scene-titleplate span {
  color: #e8c37f;
  font-size: 12px;
  font-weight: 900;
}

.scene-titleplate b {
  min-width: 0;
  overflow: hidden;
  color: #fff3d3;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feast-map {
  position: relative;
  z-index: 1;
  height: 268px;
  margin: 8px 8px 0;
  border: 1px solid rgba(231, 189, 114, 0.22);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(231, 189, 114, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(10, 9, 8, 0.04), rgba(10, 9, 8, 0.38));
  overflow: hidden;
}
.feast-map::before,
.feast-map::after {
  content: "";
  font-size: 16px;
  font-weight: 800;
  color: rgba(231, 189, 114, 0.68);
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  position: absolute;
  left: 50%;
  top: 50%;
  width: 196px;
  height: 74px;
  transform: translate(-50%, -44%) rotate(-4deg);
  border: 1px solid rgba(231, 189, 114, 0.16);
  background: rgba(36, 26, 18, 0.36);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

.feast-map::after {
  width: 250px;
  height: 20px;
  transform: translate(-50%, -22%) rotate(4deg);
  background: rgba(16, 12, 9, 0.52);
}

.hero-seat,
.seat-card {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  border: 1px solid rgba(231, 189, 114, 0.42);
  background: rgba(10, 9, 8, 0.78);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.46);
}

.hero-seat {
  left: 50%;
  bottom: 20px;
  width: 132px;
  height: 148px;
  transform: translateX(-50%);
  border-color: rgba(231, 189, 114, 0.78);
}

.hero-seat img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% top;
  filter: brightness(0.92) saturate(0.94);
}

.hero-seat div {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.86) 24%, rgba(46, 29, 16, 0.94));
}

.hero-seat span,
.hero-seat small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.hero-seat strong {
  display: block;
  color: var(--gold);
  font-size: 24px;
  line-height: 1;
}

.seat-card {
  width: 78px;
  height: 88px;
  border-radius: 4px;
}

.seat-card img {
  display: block;
  width: 100%;
  height: 60px;
  object-fit: cover;
  object-position: center top;
  filter: brightness(0.86) saturate(0.86);
}

.seat-card span,
.seat-card small {
  position: relative;
  z-index: 1;
  display: block;
  overflow: hidden;
  padding: 0 5px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seat-card span {
  margin-top: 3px;
  color: #eed097;
  font-size: 11px;
  font-weight: 900;
}

.seat-card small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.seat-card.ally {
  border-color: rgba(83, 200, 120, 0.5);
}

.seat-card.enemy {
  border-color: rgba(228, 93, 79, 0.58);
}

.seat-card.swing {
  border-color: rgba(200, 139, 69, 0.6);
}

.seat-zhangliang {
  left: 9px;
  top: 40px;
}

.seat-fankuai {
  left: 9px;
  bottom: 28px;
}

.seat-xiangyu {
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
}

.seat-fanzeng {
  right: 9px;
  top: 48px;
}

.seat-caowushang {
  right: 9px;
  bottom: 52px;
}

.seat-xiangbo {
  right: 15px;
  bottom: 6px;
}

.relation-mark {
  position: absolute;
  z-index: 1;
  color: rgba(231, 189, 114, 0.82);
  font-size: 10px;
  font-weight: 900;
  text-shadow: 0 1px 4px #000;
}

.relation-mark::after {
  content: "";
  font-size: 16px;
  font-weight: 800;
  color: rgba(231, 189, 114, 0.68);
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  position: absolute;
  height: 2px;
  background: currentColor;
  transform-origin: left center;
  opacity: 0.72;
}

.mark-plan {
  left: 84px;
  top: 108px;
  color: #8ad899;
}

.mark-plan::after {
  left: 44px;
  top: 7px;
  width: 72px;
  transform: rotate(28deg);
}

.mark-guard {
  left: 82px;
  bottom: 75px;
  color: #8ad899;
}

.mark-guard::after {
  left: 44px;
  top: 7px;
  width: 66px;
  transform: rotate(-22deg);
}

.mark-watch {
  left: 50%;
  top: 106px;
  transform: translateX(-50%);
}

.mark-watch::after {
  left: 50%;
  top: 15px;
  width: 62px;
  transform: rotate(90deg);
}

.mark-kill {
  right: 90px;
  top: 116px;
  color: #ef7464;
}

.mark-kill::after {
  right: -58px;
  top: 9px;
  width: 68px;
  transform: rotate(142deg);
}

.mark-spy {
  right: 84px;
  bottom: 88px;
  color: #ef7464;
}

.mark-spy::after {
  right: -48px;
  top: 8px;
  width: 54px;
  transform: rotate(204deg);
}

.mark-shelter {
  right: 82px;
  bottom: 42px;
  color: #d6a458;
}

.mark-shelter::after {
  right: -42px;
  top: 7px;
  width: 50px;
  transform: rotate(215deg);
}

.scene-hud {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 7px 8px 0;
}
.hud-stat {
  position: relative;
  min-width: 0;
  min-height: 50px;
  overflow: hidden;
  border: 1px solid rgba(238, 207, 157, 0.18);
  background: rgba(9, 9, 8, 0.82);
  padding: 5px;
}
.hud-stat.warning {
  border-color: rgba(231, 189, 114, 0.58);
}

.hud-stat.critical {
  border-color: rgba(228, 93, 79, 0.82);
  box-shadow: inset 0 0 18px rgba(228, 93, 79, 0.18);
}

.hud-stat i {
  position: absolute;
  right: 4px;
  top: -8px;
  color: rgba(231, 189, 114, 0.16);
  font-style: normal;
  font-size: 30px;
  font-weight: 900;
}

.hud-stat span {
  position: relative;
  z-index: 1;
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hud-stat strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 2px;
  color: #fff6e8;
  font-size: 16px;
  line-height: 1;
}
.hud-stat em {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.hud-stat b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7bcf84, #e7bd72, #e45d4f);
}

.stage-story {
  margin: 7px 8px 8px;
  border-color: rgba(231, 189, 114, 0.32);
  background:
    linear-gradient(rgba(44, 33, 23, 0.92), rgba(23, 18, 14, 0.94)),
    url("data:image/svg+xml,%3Csvg width='180' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='180' height='80' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

.stage-story p {
  font-size: 13px;
  -webkit-line-clamp: 2;
}

.danger-alerts {
  bottom: 6px;
}

.intel-button {
  border-color: rgba(231, 189, 114, 0.28);
  background: rgba(28, 22, 18, 0.88);
}

.status-board {
  display: none;
}

.decision-panel,
.action-receipt,
.ending-panel {
  border-color: rgba(231, 189, 114, 0.3);
  background: rgba(31, 22, 18, 0.9);
}

.option-button {
  min-height: 56px;
  border-color: rgba(231, 189, 114, 0.34);
  background: rgba(60, 43, 31, 0.9);
}

.free-form button {
  background: linear-gradient(180deg, rgba(152, 51, 39, 0.92), rgba(95, 34, 28, 0.96));
}

@keyframes danger-breath {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.78),
      inset 0 0 34px rgba(231, 189, 114, 0.08);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.78),
      inset 0 0 46px rgba(228, 93, 79, 0.22),
      0 0 16px rgba(228, 93, 79, 0.18);
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding: 0;
    align-items: stretch;
  }

  .phone {
    width: 100vw;
    min-height: 100vh;
    max-height: none;
    border-radius: 0;
    border: 0;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .stage-panel {
    min-height: 458px;
  }

  .topbar {
    min-height: 98px;
  }

  .feast-map {
    height: 268px;
  }

  .seat-card {
    width: 76px;
  }

  .hero-seat {
    width: 130px;
  }
}

/* Full-screen visual novel card-battle treatment. */
.phone {
  position: relative;
  padding: 0;
  overflow: hidden auto;
  border-radius: 12px;
  background: #090807;
}
.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 8;
  min-height: 104px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(6, 5, 4, 0.86), rgba(6, 5, 4, 0.36) 72%, transparent);
  box-shadow: none;
  padding: 16px 14px 0;
}

.brand-title {
  position: absolute;
  left: 14px;
  top: 16px;
  color: #c9a46b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 3px 12px #000;
}

.round-hud {
  width: 168px;
  margin: 0 auto;
  text-align: center;
}

.round-hud b {
  display: block;
  color: #ecd5a6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1;
  text-shadow: 0 2px 8px #000;
}

.danger-meter {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.danger-meter span {
  color: #d9c099;
  font-size: 13px;
  font-weight: 900;
}

.danger-meter em {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(231, 189, 114, 0.5);
  border-radius: 999px;
  background: rgba(6, 5, 4, 0.78);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.8);
}

.danger-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #bd302a, #ee604f);
  box-shadow: 0 0 10px rgba(238, 96, 79, 0.62);
}

.war-button {
  position: absolute;
  border: 1px solid rgba(231, 189, 114, 0.42);
  background: rgba(15, 12, 10, 0.56);
  color: #e7c17d;
  cursor: pointer;
}

.war-button {
  right: 12px;
  top: 12px;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 28%, rgba(231, 189, 114, 0.2), transparent 36%),
    rgba(10, 8, 7, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(231, 189, 114, 0.32),
    0 8px 20px rgba(0, 0, 0, 0.3);
}

.war-button strong {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 0;
  color: #f0cf8b;
  font-size: 18px;
  line-height: 1;
}

.war-button span {
  margin-top: -8px;
  font-size: 10px;
  font-weight: 900;
}

.stage-panel {
  min-height: 532px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #0a0908;
  box-shadow: inset 0 -54px 72px rgba(0, 0, 0, 0.52);
}

.stage-panel.is-ending {
  min-height: 468px;
  box-shadow: inset 0 -120px 110px rgba(0, 0, 0, 0.92);
}

.stage-panel.is-ending .cinematic-cast {
  height: 468px;
}

.stage-bg {
  background:
    radial-gradient(circle at 77% 23%, rgba(231, 189, 114, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(6, 5, 4, 0.02), rgba(6, 5, 4, 0.1) 46%, rgba(6, 5, 4, 0.42)),
    url("./assets/stages/hongmen-banquet-scene.png") center / cover;
  filter: saturate(1.04) contrast(1.02) brightness(1.08);
}

.stage-panel.critical-pressure .stage-bg,
.stage-panel.scene-tense .stage-bg,
.stage-panel.scene-danger .stage-bg {
  filter: saturate(1.08) contrast(1.04) brightness(0.96);
}

.cinematic-cast {
  position: relative;
  z-index: 2;
  height: 396px;
}
.role-figure {
  position: absolute;
  overflow: visible;
  --role-flip: 1;
  --role-art-scale: 1;
}

.role-figure[role="button"] {
  cursor: pointer;
  outline: none;
}

.role-figure[role="button"]:focus-visible .role-plate,
.role-figure[role="button"]:hover .role-plate {
  border-color: rgba(246, 211, 136, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 181, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.36);
}

.role-figure.mirror-x {
  --role-flip: -1;
}

.role-art {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(var(--role-flip)) scale(var(--role-art-scale));
  transform-origin: center bottom;
}

.role-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  background: transparent;
}

.role-figure::after {
  content: "";
  font-size: 16px;
  font-weight: 800;
  color: rgba(231, 189, 114, 0.68);
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  position: absolute;
  left: 14%;
  right: 10%;
  bottom: 4%;
  z-index: -1;
  height: 34%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.52);
  filter: blur(18px);
}

.role-figure.xiangyu {
  right: -18px;
  top: 74px;
  width: 176px;
  height: 238px;
}

.role-figure.liubang {
  left: -28px;
  top: 236px;
  width: 202px;
  height: 220px;
}

.role-figure.fanzeng {
  right: -10px;
  top: 290px;
  width: 154px;
  height: 176px;
}

.role-figure.xiangyu img {
  object-position: center bottom;
}

.role-figure.liubang img {
  object-position: center bottom;
}

.role-figure.fanzeng img {
  object-position: center bottom;
}

.role-plate {
  position: absolute;
  min-width: 132px;
  border: 1px solid rgba(231, 189, 114, 0.36);
  background:
    linear-gradient(180deg, rgba(28, 24, 19, 0.92), rgba(12, 10, 9, 0.9));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.72), 0 8px 18px rgba(0, 0, 0, 0.46);
  padding: 7px 10px 8px 42px;
}

.role-plate i {
  position: absolute;
  left: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(231, 189, 114, 0.34);
  border-radius: 999px;
  color: #d0ae76;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}

.role-plate strong,
.role-plate span,
.role-plate b {
  display: block;
  white-space: nowrap;
}

.role-plate strong {
  color: #e6c17f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1;
}

.role-plate span {
  margin-top: 3px;
  color: #bda98d;
  font-size: 11px;
  font-weight: 800;
}

.role-plate b {
  margin-top: 6px;
  border-top: 1px solid rgba(231, 189, 114, 0.12);
  padding-top: 5px;
  color: #65b86f;
  font-size: 12px;
}

.xiangyu .role-plate {
  right: 76px;
  bottom: 22px;
}

.fanzeng .role-plate {
  right: 32px;
  bottom: 18px;
}

.liubang .role-plate {
  left: 52px;
  bottom: 20px;
}

.xiangyu .role-plate i,
.fanzeng .role-plate i {
  border-color: rgba(228, 93, 79, 0.52);
  color: #d85a4f;
}

.xiangyu .role-plate b,
.fanzeng .role-plate b {
  color: #df5b4d;
}

.role-figure.mood-turning img,
.role-figure.mood-furious img,
.role-figure.mood-angry img,
.role-figure.mood-urging img {
  opacity: 0.9;
}

.role-figure.mood-escaping img {
  opacity: 0.98;
}

/* Role mood atmosphere effects */
.role-figure.mood-furious::after,
.role-figure.mood-turning::after {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, rgba(228, 93, 79, 0.22), transparent 70%);
  animation: mood-glow-pulse 1.8s ease-in-out infinite;
}

.role-figure.mood-angry::after,
.role-figure.mood-urging::after {
  content: "";
  position: absolute;
  inset: -6px;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 45%, rgba(228, 93, 79, 0.14), transparent 65%);
  animation: mood-glow-subtle 2.4s ease-in-out infinite;
}

.role-figure.mood-escaping::after {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 45%, rgba(83, 200, 120, 0.16), transparent 65%);
  animation: mood-glow-pulse 2.6s ease-in-out infinite;
}

@keyframes mood-glow-pulse {
  0%, 100% { opacity: 0.42; }
  50% { opacity: 0.84; }
}

@keyframes mood-glow-subtle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

.dialogue-box {
  position: relative;
  z-index: 5;
  min-height: 104px;
  margin: -18px 14px 0;
  border: 1px solid rgba(231, 189, 114, 0.4);
  background:
    linear-gradient(180deg, rgba(18, 15, 12, 0.9), rgba(7, 7, 6, 0.94));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.9), 0 12px 26px rgba(0, 0, 0, 0.56);
  padding: 20px 18px 16px;
}
.dialogue-box span {
  position: absolute;
  left: 18px;
  top: -18px;
  min-width: 108px;
  border: 1px solid rgba(231, 189, 114, 0.32);
  background: rgba(25, 21, 17, 0.96);
  color: #d8bd8b;
  padding: 6px 22px;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

.dialogue-box p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: #ead8b9;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.54;
}

.dialogue-box small {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: #e7bd72;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.danger-alerts {
  bottom: 4px;
  gap: 3px;
}

.danger-alerts span {
  font-size: 10px;
  padding: 3px 6px;
}

.impact-burst {
  z-index: 7;
  justify-content: center;
  margin-top: -18px;
}

.action-receipt {
  display: none;
}

.decision-panel {
  position: relative;
  z-index: 6;
  margin: -2px 10px 0;
  border: 0;
  background: transparent;
  padding: 0 0 12px;
}
.action-points {
  width: max-content;
  max-width: calc(100% - 24px);
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 auto 8px;
  border: 1px solid rgba(231, 189, 114, 0.18);
  border-radius: 999px;
  background: rgba(10, 9, 8, 0.84);
  padding: 7px 14px;
  color: #cdb68c;
  font-size: 12px;
  font-weight: 900;
}

.action-points b {
  color: #72bf73;
  font-size: 17px;
}

.action-points i {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(231, 189, 114, 0.34);
  background: radial-gradient(circle at 38% 30%, #8fcb83, #38693e);
  box-shadow: 0 0 8px rgba(114, 191, 115, 0.38);
}

.option-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.option-button {
  position: relative;
  min-height: 112px;
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 7px;
  overflow: hidden;
  border-radius: 0;
  border-color: rgba(231, 189, 114, 0.36);
  background:
    linear-gradient(180deg, rgba(45, 39, 28, 0.88), rgba(20, 18, 14, 0.96));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.86), 0 8px 18px rgba(0, 0, 0, 0.36);
  padding: 11px 7px 12px;
  text-align: center;
}
.option-button::before {
  content: "";
  font-size: 16px;
  font-weight: 800;
  color: rgba(231, 189, 114, 0.68);
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background: url("data:image/svg+xml,%3Csvg width='160' height='160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

.option-button.card-1 {
  border-color: rgba(83, 200, 120, 0.32);
  background: linear-gradient(180deg, rgba(36, 54, 36, 0.9), rgba(17, 22, 18, 0.96));
}

.option-button.card-3 {
  border-color: rgba(228, 93, 79, 0.36);
  background: linear-gradient(180deg, rgba(67, 31, 24, 0.9), rgba(24, 14, 12, 0.96));
}

.option-button span {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(231, 189, 114, 0.12);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.option-button strong {
  position: relative;
  z-index: 1;
  flex: none;
  color: #ead8b9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.1;
}
.option-button small {
  position: relative;
  z-index: 1;
  color: #a7cb84;
  font-size: 13px;
  font-weight: 900;
}
.option-button.card-2 small {
  color: #d1b071;
}

.option-button.card-3 small {
  color: #d66a5a;
}

.free-form {
  grid-template-columns: 1fr 56px;
  margin: 8px 4px 0;
}

.free-form input {
  min-height: 48px;
  border-radius: 0;
  background: rgba(9, 8, 7, 0.78);
}

.free-form button {
  min-height: 48px;
  border-radius: 0;
}

.intel-drawer {
  z-index: 30;
}

@media (max-width: 480px) {
  .phone {
    width: 100vw;
    min-height: 100vh;
    border-radius: 0;
  }

  .stage-panel {
    min-height: 532px;
  }

  .stage-panel.is-ending {
    min-height: 468px;
  }

  .role-figure.xiangyu {
    right: -32px;
  }

  .role-figure.liubang {
    left: -44px;
  }

  .option-button {
    min-height: 112px;
  }
}

/* Late-stage mobile game polish: all rules still come from GameState; this is only presentation. */
.phone {
  scrollbar-width: none;
}

.phone::-webkit-scrollbar {
  display: none;
}

@media (min-width: 481px) {
  .phone {
    aspect-ratio: auto;
    min-height: 0;
  }
}

.phone.action-resolving .stage-panel {
  animation: none;
}

.phone.action-resolving .stage-bg {
  filter: none;
}

.phone.impact-high .danger-meter i,
.phone.impact-lethal .danger-meter i {
  background: linear-gradient(90deg, #df3f36, #ff8976);
  box-shadow: 0 0 16px rgba(255, 98, 79, 0.8);
}

.scene-focus {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 96px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.scene-focus span,
.scene-focus b {
  min-width: 0;
  border: 1px solid rgba(231, 189, 114, 0.28);
  background: rgba(8, 7, 6, 0.66);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-focus span {
  flex: 0 0 auto;
  color: #f0c36d;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}

.scene-focus b {
  flex: 1;
  color: #d5c0a0;
  padding: 7px 9px;
  text-align: right;
  font-size: 11px;
  font-weight: 800;
}

.battle-hud {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 142px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  pointer-events: none;
}

.battle-stat {
  position: relative;
  min-width: 0;
  height: 34px;
  overflow: hidden;
  border: 1px solid rgba(231, 189, 114, 0.22);
  background: rgba(8, 7, 6, 0.54);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.58);
  padding: 4px 5px 3px;
}
.battle-stat.warning {
  border-color: rgba(231, 189, 114, 0.58);
}

.battle-stat.critical {
  border-color: rgba(228, 93, 79, 0.78);
  background: rgba(38, 14, 11, 0.76);
}

.battle-stat i {
  position: absolute;
  right: 3px;
  top: -17px;
  color: rgba(231, 189, 114, 0.11);
  font-family: Georgia, "Times New Roman", serif;
  font-style: normal;
  font-size: 28px;
  font-weight: 900;
}

.battle-stat span,
.battle-stat strong {
  position: relative;
  z-index: 1;
  display: block;
}
.battle-stat span {
  overflow: hidden;
  color: #bba98c;
  font-size: 8px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-stat strong {
  margin-top: 0;
  color: #f5e6c9;
  font-size: 14px;
  line-height: 1;
}

.battle-stat em {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 4px;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.battle-stat b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6dbb73, #e7bd72);
  transition: width 220ms ease;
}

.battle-stat.danger b {
  background: linear-gradient(90deg, #e7bd72, #e45d4f);
}

.battle-stat.impact-bad {
  animation: stat-hit 620ms ease-out both;
}

.battle-stat.impact-good {
  animation: stat-boost 620ms ease-out both;
}

.role-figure.xiangyu {
  right: -8px;
  top: 118px;
  width: 184px;
  height: 244px;
}

.role-figure.liubang {
  left: -18px;
  top: 258px;
  width: 206px;
  height: 222px;
}

.role-figure.fanzeng {
  right: 4px;
  top: 310px;
  width: 148px;
  height: 174px;
}

.role-figure.mood-turning,
.role-figure.mood-furious,
.role-figure.mood-angry,
.role-figure.mood-urging {
  animation: threat-pulse 1200ms ease-in-out infinite;
}

.role-figure.impact-bad img {
  animation: figure-hit 520ms ease-out both;
}

.role-figure.impact-good img {
  animation: figure-boost 520ms ease-out both;
}

.xiangyu .role-plate {
  right: 86px;
  bottom: 34px;
}

.fanzeng .role-plate {
  right: 44px;
  bottom: 14px;
}

.liubang .role-plate {
  left: 64px;
  bottom: 20px;
}

.role-plate {
  max-width: 150px;
  padding-right: 8px;
}

.role-plate span,
.role-plate b {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dialogue-box {
  z-index: 6;
  min-height: 88px;
  margin: 8px 12px 0;
  background:
    linear-gradient(180deg, rgba(18, 15, 12, 0.82), rgba(7, 7, 6, 0.9));
  padding: 16px 16px 13px;
}

.dialogue-box p {
  min-height: 38px;
  font-size: 14px;
  line-height: 1.42;
}

.dialogue-box small {
  margin-top: 4px;
  font-size: 12px;
}

.dialogue-box span {
  top: -15px;
  min-width: 92px;
  padding: 5px 18px;
}

.impact-burst {
  display: none;
}

.action-receipt {
  display: block;
  position: relative;
  z-index: 7;
  margin: -4px 14px 8px;
  border-radius: 0;
  border-color: rgba(231, 189, 114, 0.24);
  background:
    linear-gradient(90deg, rgba(12, 10, 9, 0.94), rgba(42, 30, 22, 0.9));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  padding: 9px 10px 10px;
  animation: receipt-slide 420ms ease-out both;
}
.receipt-action {
  font-weight: 800;
}

.delta-list span {
  border-radius: 0;
  font-weight: 900;
}

.option-button {
  transform: translateY(0);
  transition: transform 140ms ease, border-color 140ms ease, filter 140ms ease;
}

.option-button:active,
.option-button.is-selected {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(245, 219, 151, 0.82);
  filter: brightness(1.18);
}

.option-button:disabled,
.free-form button:disabled,
.improvise-button:disabled,
.free-form input:disabled {
  cursor: default;
}

.option-button strong {
  display: -webkit-box;
  min-height: 40px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.free-form {
  margin-left: 0;
  margin-right: 0;
  border: 1px solid rgba(231, 189, 114, 0.18);
  background: rgba(5, 5, 4, 0.62);
  padding: 6px;
}

.free-form input {
  border-color: rgba(231, 189, 114, 0.22);
}

.free-form button.is-selected {
  filter: brightness(1.24);
}

.improvise-button {
  min-width: 0;
  border: 0;
  background:
    linear-gradient(180deg, rgba(65, 45, 28, 0.94), rgba(24, 17, 12, 0.98));
  color: #e9cf97;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.ending-panel {
  position: relative;
  z-index: 7;
  margin: -18px 12px 14px;
  border-radius: 0;
  border-color: rgba(231, 189, 114, 0.42);
  background:
    linear-gradient(180deg, rgba(47, 34, 22, 0.94), rgba(14, 12, 10, 0.96)),
    url("data:image/svg+xml,%3Csvg width='220' height='120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3'/%3E%3C/filter%3E%3Crect width='220' height='120' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E");
  box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.46);
}

.phone.ending-report .ending-panel {
  margin-top: 112px;
}

.ending-panel.war-scroll {
  position: relative;
  padding: 16px;
}
.scroll-seal {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(231, 189, 114, 0.52);
  border-radius: 999px;
  background: rgba(95, 27, 22, 0.82);
  color: #f4d68e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 0 22px rgba(231, 189, 114, 0.16), inset 0 0 12px rgba(0, 0, 0, 0.5);
}

.ending-good .scroll-seal {
  background: rgba(37, 91, 56, 0.82);
  border-color: rgba(83, 200, 120, 0.52);
  color: #b8f5c4;
  box-shadow: 0 0 22px rgba(83, 200, 120, 0.14), inset 0 0 12px rgba(0, 0, 0, 0.5);
}

.scroll-header {
  margin-bottom: 10px;
  min-height: 52px;
  padding-right: 76px;
  display: grid;
  align-content: center;
}

.scroll-header span {
  display: block;
  color: #bba88a;
  font-size: 12px;
  font-weight: 900;
}

.scroll-header strong {
  display: block;
  margin-top: 4px;
  color: #f0c36d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.1;
}

.ending-good .scroll-header strong {
  color: #8dd990;
}

.scroll-tone {
  padding: 10px;
  border-left: 2px solid rgba(231, 189, 114, 0.42);
  background: rgba(60, 40, 22, 0.24);
}

.scroll-tone p {
  color: #f2e3c2;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
  margin: 0;
}

.ending-progress {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(231, 189, 114, 0.2);
  background:
    linear-gradient(90deg, rgba(68, 43, 22, 0.42), rgba(10, 8, 7, 0.28));
}

.ending-progress span {
  color: #e7bd72;
  font-size: 11px;
  font-weight: 900;
}

.ending-progress strong {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 24px;
  border: 1px solid rgba(231, 189, 114, 0.24);
  border-radius: 999px;
  background: rgba(10, 8, 7, 0.54);
  color: #f4d68e;
  font-size: 13px;
  font-weight: 900;
}

.ending-progress p {
  min-width: 0;
  margin: 0;
  color: rgba(234, 216, 185, 0.7);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

.scroll-timeline {
  margin-top: 14px;
  padding: 0 12px;
  border: 1px solid rgba(231, 189, 114, 0.16);
  background:
    linear-gradient(180deg, rgba(24, 17, 12, 0.5), rgba(9, 7, 6, 0.56));
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.scroll-timeline summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 50px;
  border-bottom: 1px solid rgba(231, 189, 114, 0.11);
  cursor: pointer;
  list-style: none;
}

.scroll-timeline:not([open]) summary {
  border-bottom: 0;
}

.scroll-timeline summary::-webkit-details-marker {
  display: none;
}

.scroll-timeline summary span {
  color: #d9b66e;
  font-size: 12px;
  font-weight: 900;
}

.scroll-timeline summary strong {
  color: rgba(234, 216, 185, 0.7);
  font-size: 11px;
  font-weight: 900;
}

.scroll-timeline summary em {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid rgba(231, 189, 114, 0.22);
  border-radius: 999px;
  color: #d9b66e;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
}

.scroll-timeline > summary .when-open {
  display: none;
}

.scroll-timeline[open] > summary .when-closed {
  display: none;
}

.scroll-timeline[open] > summary .when-open {
  display: inline;
}

.scroll-timeline-list {
  max-height: 180px;
  overflow: auto;
  scrollbar-width: none;
}

.scroll-timeline:not([open]) .scroll-timeline-list {
  display: none;
}

.scroll-timeline-list::-webkit-scrollbar {
  display: none;
}

.timeline-step {
  padding: 7px 0;
  border-top: 1px solid rgba(231, 189, 114, 0.1);
}

.timeline-step[open] {
  padding-bottom: 9px;
}

.timeline-step summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  cursor: pointer;
  list-style: none;
}

.timeline-step summary::-webkit-details-marker {
  display: none;
}

.timeline-step i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(231, 189, 114, 0.28);
  border-radius: 999px;
  background: rgba(20, 16, 12, 0.72);
  color: #d0ae76;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}

.timeline-step.invalid-step i {
  border-color: rgba(228, 93, 79, 0.52);
  color: #e45d4f;
}

.timeline-step b {
  display: block;
  color: #ead8b9;
  font-size: 13px;
  line-height: 1.34;
}

.timeline-step small {
  display: none;
  margin-top: 2px;
  color: #9a8d7a;
  font-size: 11px;
  line-height: 1.36;
}

.timeline-step em {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 2px 7px;
  border: 1px solid rgba(231, 189, 114, 0.22);
  border-radius: 999px;
  color: #d9b66e;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
}

.timeline-step[open] em {
  background: rgba(231, 189, 114, 0.1);
  color: #f0d8a5;
}

.timeline-step .when-open {
  display: none;
}

.timeline-step[open] .when-closed {
  display: none;
}

.timeline-step[open] .when-open {
  display: inline;
}

.timeline-step-story {
  margin: 8px 0 0 32px;
  padding: 8px 10px;
  border-left: 2px solid rgba(231, 189, 114, 0.24);
  background: rgba(8, 7, 6, 0.32);
}

.timeline-step-story p {
  margin: 0;
  color: rgba(234, 216, 185, 0.82);
  font-size: 11px;
  line-height: 1.48;
}

.timeline-step-story p + p {
  margin-top: 6px;
}

.timeline-step-story span {
  display: inline-block;
  margin-right: 6px;
  color: #d9b66e;
  font-weight: 900;
}

.ending-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.copy-report-button,
.restart-wide {
  width: 100%;
  height: 50px;
  border-radius: 0;
  min-height: 50px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgba(231, 189, 114, 0.32);
  color: #f2dfb8;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
}

.copy-report-button {
  background:
    linear-gradient(180deg, rgba(70, 50, 30, 0.9), rgba(28, 21, 15, 0.96));
}

.restart-wide {
  background: linear-gradient(180deg, rgba(152, 51, 39, 0.94), rgba(82, 28, 24, 0.98));
}

.report-draft {
  margin-top: 10px;
  padding: 9px;
  border: 1px solid rgba(231, 189, 114, 0.18);
  background: rgba(8, 7, 6, 0.58);
}

.report-draft span {
  display: block;
  margin-bottom: 6px;
  color: #e7bd72;
  font-size: 11px;
  font-weight: 900;
}

.report-draft textarea {
  display: block;
  width: 100%;
  min-height: 92px;
  max-height: 150px;
  resize: vertical;
  border: 1px solid rgba(231, 189, 114, 0.16);
  background: rgba(0, 0, 0, 0.36);
  color: #ead8b9;
  font: 12px/1.45 inherit;
}

.report-image-draft {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid rgba(231, 189, 114, 0.18);
  background: #080706;
}

/* Cinematic transition phases */
.phone.content-hidden .decision-panel {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 150ms ease-in, transform 150ms ease-in;
}

.phone.content-hidden .story-panel {
  opacity: 1;
  transform: none;
  transition: none;
}

.phone.content-hidden .stage-panel {
  opacity: 1;
  transform: none;
  transition: none;
}

.phone.content-hidden::after {
  content: "局势推演中…";
  font-size: 16px;
  font-weight: 800;
  color: rgba(231, 189, 114, 0.68);
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(231, 189, 114, 0.06), transparent 55%);
  animation: history-unfolding 1.4s ease-in-out infinite;
}

.phone.decision-waiting.content-hidden::after {
  display: none;
}

.phone.content-hidden .decision-panel.is-waiting-options {
  opacity: 1;
  transform: translateY(0);
  pointer-events: none;
  transition: none;
}

@keyframes history-unfolding {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.phone.reveal-impact .action-receipt {
  animation: receipt-reveal 480ms 120ms ease-out both;
}

.phone.reveal-impact .decision-panel {
  animation: none;
}

.phone.reveal-impact .story-panel .delta-list span {
  animation: delta-soft-pop 280ms var(--delta-delay, 80ms) cubic-bezier(0.2, 0.9, 0.22, 1.12) both;
}

.phone.reveal-impact .story-panel .delta-list span:nth-child(2) {
  --delta-delay: 120ms;
}

.phone.reveal-impact .story-panel .delta-list span:nth-child(3) {
  --delta-delay: 160ms;
}

.phone.reveal-impact .story-panel .delta-list span:nth-child(4) {
  --delta-delay: 200ms;
}

.phone.reveal-impact .danger-meter i {
  transition: width 680ms cubic-bezier(0.22, 0.86, 0.18, 1.12);
}

.phone.ending-pending .stage-panel:not(.is-ending) .stage-bg {
  filter: saturate(0.96) contrast(1.02) brightness(0.92);
}

.phone.ending-pending .story-panel {
  opacity: 1;
  transform: none;
}

.decision-panel.ending-pending-panel {
  cursor: pointer;
}

.decision-panel.ending-pending-panel .ending-aftermath-card {
  pointer-events: none;
}

.decision-panel.ending-pending-panel .free-form {
  pointer-events: none;
}

.decision-panel.ending-pending-panel .free-form input::placeholder {
  color: rgba(231, 189, 114, 0.72);
}

@keyframes reveal-burst {
  0% {
    transform: scale(0.985);
    filter: brightness(0.6) saturate(1.3);
  }
  38% {
    transform: scale(1.008);
    filter: brightness(1.12) saturate(1.1);
  }
  100% {
    transform: scale(1);
    filter: brightness(1) saturate(1);
  }
}

@keyframes receipt-reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ui-soft-land {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: brightness(0.86);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: brightness(1);
  }
}

@keyframes delta-soft-pop {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes resolve-jolt {
  0% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-5px);
  }
  58% {
    transform: translateX(4px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes threat-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(228, 93, 79, 0));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(228, 93, 79, 0.42));
  }
}

@keyframes figure-hit {
  0% {
    transform: translateX(0);
  }
  28% {
    transform: translateX(-7px);
  }
  56% {
    transform: translateX(5px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes figure-boost {
  0%,
  100% {
    transform: translateY(0);
  }
  44% {
    transform: translateY(-5px);
  }
}

@keyframes stat-hit {
  0% {
    box-shadow: inset 0 0 0 rgba(228, 93, 79, 0);
  }
  42% {
    box-shadow: inset 0 0 22px rgba(228, 93, 79, 0.42), 0 0 14px rgba(228, 93, 79, 0.24);
  }
  100% {
    box-shadow: inset 0 0 0 rgba(228, 93, 79, 0);
  }
}

@keyframes stat-boost {
  0%,
  100% {
    box-shadow: inset 0 0 0 rgba(83, 200, 120, 0);
  }
  44% {
    box-shadow: inset 0 0 20px rgba(83, 200, 120, 0.3), 0 0 12px rgba(83, 200, 120, 0.18);
  }
}

@keyframes hud-stat-bar-change {
  0% {
    filter: brightness(1);
    opacity: 0.86;
    transform: translateY(-50%) scaleX(var(--value-ratio)) scaleY(1);
  }
  36% {
    filter: brightness(1.7);
    opacity: 1;
    transform: translateY(-50%) scaleX(var(--value-ratio)) scaleY(1.8);
  }
  100% {
    filter: brightness(1);
    opacity: 0.86;
    transform: translateY(-50%) scaleX(var(--value-ratio)) scaleY(1);
  }
}

@keyframes hud-stat-bar-bad {
  0% {
    filter: brightness(1);
    opacity: 0.86;
    box-shadow: 0 0 0 rgba(228, 93, 79, 0);
    transform: translateY(-50%) scaleX(var(--value-ratio)) scaleY(1);
  }
  36% {
    filter: brightness(1.75) saturate(1.2);
    opacity: 1;
    box-shadow: 0 0 11px rgba(228, 93, 79, 0.46);
    transform: translateY(-50%) scaleX(var(--value-ratio)) scaleY(1.9);
  }
  100% {
    filter: brightness(1);
    opacity: 0.86;
    box-shadow: 0 0 0 rgba(228, 93, 79, 0);
    transform: translateY(-50%) scaleX(var(--value-ratio)) scaleY(1);
  }
}

@keyframes hud-stat-bar-good {
  0% {
    filter: brightness(1);
    opacity: 0.86;
    box-shadow: 0 0 0 rgba(83, 200, 120, 0);
    transform: translateY(-50%) scaleX(var(--value-ratio)) scaleY(1);
  }
  36% {
    filter: brightness(1.65) saturate(1.2);
    opacity: 1;
    box-shadow: 0 0 11px rgba(83, 200, 120, 0.44);
    transform: translateY(-50%) scaleX(var(--value-ratio)) scaleY(1.9);
  }
  100% {
    filter: brightness(1);
    opacity: 0.86;
    box-shadow: 0 0 0 rgba(83, 200, 120, 0);
    transform: translateY(-50%) scaleX(var(--value-ratio)) scaleY(1);
  }
}

@keyframes receipt-slide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone.action-resolving .stage-panel,
  .role-figure.mood-turning,
  .role-figure.mood-furious,
  .role-figure.mood-angry,
  .role-figure.mood-urging,
  .role-figure.impact-bad img,
  .role-figure.impact-good img,
  .battle-stat.impact-bad,
  .battle-stat.impact-good,
  .phone.reveal-impact .core-stat.impact-bad,
  .phone.reveal-impact .core-stat.impact-good,
  .phone.reveal-impact .stage-panel:not(.is-ending) .core-stat.impact-changed::after,
  .action-receipt,
  .phone.reveal-impact .story-panel .delta-list span,
  .phone.reveal-impact .option-button,
  .phone.reveal-impact .free-form {
    animation: none;
  }
}

@media (max-width: 480px) {
  .scene-focus {
    top: 90px;
  }

  .role-figure.xiangyu {
    right: -26px;
    top: 118px;
  }

  .role-figure.liubang {
    left: -42px;
  }

  .role-figure.fanzeng {
    right: -6px;
  }

  .battle-hud {
    left: 10px;
    right: 10px;
    top: 134px;
  }

  .battle-stat span {
    font-size: 8px;
  }

  .battle-stat strong {
    font-size: 16px;
  }
}

/* Clean layout pass: cinematic stage first, detailed stats live in the intel drawer. */
.stage-panel {
  min-height: 492px;
}

.stage-panel.is-ending {
  min-height: 430px;
}

.stage-panel.is-ending .cinematic-cast {
  height: 430px;
}

.cinematic-cast {
  height: 390px;
}

.scene-focus {
  top: 116px;
}

.scene-focus span,
.scene-focus b {
  background: rgba(8, 7, 6, 0.42);
  box-shadow: none;
}

.scene-focus b {
  max-width: 72%;
}

.core-hud {
  position: absolute;
  left: 122px;
  right: 28px;
  top: 154px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  pointer-events: none;
}

.core-stat {
  position: relative;
  min-width: 0;
  height: 36px;
  overflow: hidden;
  border: 1px solid rgba(231, 189, 114, 0.18);
  border-radius: 999px;
  background:
    radial-gradient(circle at 18px 50%, rgba(231, 189, 114, 0.16), transparent 24px),
    rgba(7, 6, 5, 0.34);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.48);
  padding: 5px 7px 4px 34px;
}
.core-stat::after {
  content: "";
  font-size: 16px;
  font-weight: 800;
  color: rgba(231, 189, 114, 0.68);
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background:
    conic-gradient(from -90deg, rgba(231, 87, 72, 0.72) var(--value), rgba(255, 255, 255, 0.08) 0);
  opacity: 0.28;
  mask: radial-gradient(circle at 17px 50%, transparent 0 12px, #000 13px 16px, transparent 17px);
}

.core-stat.good::after {
  background:
    conic-gradient(from -90deg, rgba(102, 204, 118, 0.76) var(--value), rgba(255, 255, 255, 0.08) 0);
}

.core-stat i {
  position: absolute;
  left: 7px;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  border: 1px solid rgba(231, 189, 114, 0.32);
  border-radius: 999px;
  background: rgba(20, 16, 12, 0.72);
  color: #e5c17e;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

.core-stat span,
.core-stat strong {
  position: relative;
  z-index: 1;
  display: block;
}
.core-stat span {
  overflow: hidden;
  color: #d5c4a4;
  font-size: 8px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.core-stat strong {
  margin-top: 0;
  color: #f8e8c9;
  font-size: 14px;
  line-height: 1;
}

.core-stat.good i {
  color: #8dd990;
  border-color: rgba(103, 205, 119, 0.34);
}

.phone.reveal-impact .core-stat.impact-bad {
  animation: stat-hit 620ms ease-out both;
}

.phone.reveal-impact .core-stat.impact-good {
  animation: stat-boost 620ms ease-out both;
}

/* Danger HUD pulse when tension rises */
.phone.danger-pressure .core-stat.danger {
  border-color: rgba(228, 93, 79, 0.32);
  animation: hud-danger-pulse 2.6s ease-in-out infinite;
}

.phone.critical-pressure .core-stat.danger {
  border-color: rgba(228, 93, 79, 0.58);
  box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.48),
    0 0 14px rgba(228, 93, 79, 0.14);
  animation: hud-critical-pulse 1.6s ease-in-out infinite;
}

@keyframes hud-danger-pulse {
  0%, 100% { box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.48); }
  50% { box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.48), 0 0 10px rgba(228, 93, 79, 0.12); }
}

@keyframes hud-critical-pulse {
  0%, 100% {
    box-shadow:
      inset 0 0 12px rgba(0, 0, 0, 0.48),
      0 0 14px rgba(228, 93, 79, 0.14);
  }
  50% {
    box-shadow:
      inset 0 0 12px rgba(0, 0, 0, 0.48),
      0 0 22px rgba(228, 93, 79, 0.32);
  }
}

.role-figure.xiangyu {
  top: 132px;
}

.role-figure.liubang {
  top: 258px;
}

.role-figure.fanzeng {
  top: 312px;
}

.role-plate {
  min-width: 118px;
  max-width: 138px;
  background: linear-gradient(180deg, rgba(28, 24, 19, 0.76), rgba(12, 10, 9, 0.78));
  padding: 7px 8px 8px 36px;
}

.role-plate i {
  left: 7px;
  top: 7px;
  width: 23px;
  height: 23px;
}

.role-plate strong {
  font-size: 18px;
}

.dialogue-box {
  min-height: 82px;
  margin-top: 6px;
  border-color: rgba(231, 189, 114, 0.28);
  background: rgba(8, 7, 6, 0.82);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.82);
}

.action-receipt {
  margin: 7px 12px 0;
  padding: 7px 9px;
  background: rgba(18, 13, 10, 0.84);
  box-shadow: none;
}

.receipt-head b,
.receipt-head span {
  font-size: 11px;
}

.action-receipt p {
  margin-top: 4px;
  font-size: 12px;
}

.receipt-reaction {
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  color: #d8c6a6 !important;
}

.delta-list {
  margin-top: 6px;
}

.delta-list span {
  padding: 3px 6px;
  font-size: 10px;
}

.decision-panel {
  margin-top: 8px;
}

.action-points {
  margin-bottom: 7px;
  padding: 6px 12px;
}

.option-button {
  min-height: 98px;
  padding: 9px 6px 10px;
}

.option-button span {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

.option-button strong {
  min-height: 36px;
  font-size: 16px;
}

.option-button small {
  font-size: 12px;
}

.free-form {
  grid-template-columns: 76px 1fr 64px;
  margin-top: 7px;
}

.suggestion-scroll {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  align-items: stretch;
  margin: 7px 0 0;
  padding: 7px;
  background:
    linear-gradient(90deg, rgba(34, 24, 15, 0.92), rgba(12, 9, 7, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.76);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.suggestion-scroll > div {
  min-width: 0;
}

.suggestion-scroll span {
  display: block;
  color: #e6c07f;
  font-size: 11px;
  font-weight: 900;
}

.suggestion-scroll p {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: #ead8b9;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.42;
}

.counsel-reasoning {
  display: block;
  margin-top: 3px;
  color: #a89070;
  font-size: 10px;
  font-style: italic;
  font-weight: 700;
}

.counsel-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.suggestion-scroll button {
  min-width: 0;
  border: 0;
  background: rgba(64, 42, 24, 0.86);
  color: #e9cf97;
  cursor: pointer;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 900;
  clip-path: polygon(7px 0, 100% 0, 100% 100%, 0 100%, 0 7px);
  white-space: nowrap;
}

.suggestion-scroll button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.suggestion-scroll button:last-child {
  background: linear-gradient(180deg, rgba(150, 50, 38, 0.94), rgba(75, 25, 20, 0.98));
  color: #fff1cf;
}

.receipt-action {
  -webkit-line-clamp: 2;
}

.receipt-reaction {
  -webkit-line-clamp: 5;
  max-height: 92px;
}

.action-receipt {
  max-height: 260px;
  overflow: auto;
  scrollbar-width: none;
}

.action-receipt::-webkit-scrollbar {
  display: none;
}

/* Staged cinematic receipt: narration → player line → NPC reaction → consequence */
.staged-receipt .receipt-narration {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: start;
  margin-top: 6px;
  color: #bba88a;
  font-size: 12px;
  font-style: italic;
  line-height: 1.44;
}

.staged-receipt .receipt-player-line {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: start;
  margin-top: 8px;
  padding: 7px 8px;
  background: rgba(67, 45, 26, 0.28);
  color: #f2e3c2;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.44;
}

.staged-receipt .receipt-narration i,
.staged-receipt .receipt-player-line i,
.staged-receipt .receipt-npc-reaction i,
.staged-receipt .receipt-consequence i {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(231, 189, 114, 0.14);
  color: #e6c17f;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.4;
}

.staged-receipt .receipt-narration i {
  color: #bba88a;
}

.staged-receipt .receipt-npc-reaction i {
  background: rgba(228, 93, 79, 0.16);
  color: #e79b8f;
}

.staged-receipt .receipt-consequence i {
  background: rgba(83, 200, 120, 0.12);
  color: #a9d99f;
}

.staged-receipt .receipt-npc-reaction {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: start;
  margin-top: 8px;
  padding: 6px 8px;
  background: rgba(48, 18, 14, 0.22);
  color: #e8c9b8;
  font-size: 12px;
  line-height: 1.44;
}

.staged-receipt .receipt-consequence {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: start;
  margin-top: 7px;
  padding: 5px 8px;
  border: 1px solid rgba(231, 189, 114, 0.16);
  background: rgba(231, 189, 114, 0.06);
  color: #d4c098;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.4;
}

.staged-receipt .delta-list {
/* Staggered fade-in animation for staged receipt sections */@keyframes receipt-enter {  from {    opacity: 0;    transform: translateY(10px);  }  to {    opacity: 1;    transform: translateY(0);  }}.staged-receipt .receipt-narration,.staged-receipt .receipt-player-line,.staged-receipt .receipt-npc-reaction,.staged-receipt .receipt-consequence {  animation: receipt-enter 420ms ease-out both;}.staged-receipt .receipt-player-line {  animation-delay: 100ms;}.staged-receipt .receipt-npc-reaction {  animation-delay: 220ms;}.staged-receipt .receipt-consequence {  animation-delay: 340ms;}
  margin-top: 8px;
}

.delta-list .bad {
  border: 1px solid rgba(228, 93, 79, 0.36);
  background: rgba(143, 34, 28, 0.52);
  color: #ffd1c8;
}

.delta-list .good {
  border: 1px solid rgba(83, 200, 120, 0.32);
  background: rgba(37, 91, 56, 0.48);
  color: #d6ffe1;
}

.intel-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 7px;
}

.intel-stats div {
  position: relative;
  min-width: 0;
  height: 38px;
  overflow: hidden;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(231, 189, 114, 0.14);
  background: rgba(8, 7, 6, 0.58);
  border-radius: 6px;
  padding: 5px 6px;
}
.intel-stats div.critical {
  border-color: rgba(228, 93, 79, 0.72);
}

.intel-stats span,
.intel-stats strong {
  position: relative;
  z-index: 1;
  display: block;
}
.intel-stats span {
  overflow: hidden;
  color: #cbb896;
  font-size: 9.5px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intel-stats strong {
  margin-top: 1px;
  color: #f5e6c9;
  font-size: 15px;
  line-height: 1;
}

.intel-stats em {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 5px;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.intel-stats b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6dbb73, #e7bd72);
}

.intel-stats .danger b {
  background: linear-gradient(90deg, #e7bd72, #e45d4f);
}

.audio-preference,
.briefing-replay {
  display: grid;
  grid-template-columns: 1fr 74px;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  border: 1px solid rgba(231, 189, 114, 0.18);
  background:
    linear-gradient(90deg, rgba(10, 8, 7, 0.78), rgba(42, 28, 16, 0.52));
  box-shadow: inset 0 1px 0 rgba(231, 189, 114, 0.08);
  padding: 9px 10px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.briefing-replay {
  margin-top: -4px;
}

.audio-preference span,
.briefing-replay span {
  display: block;
  color: #f0d49a;
  font-size: 12px;
  font-weight: 900;
}

.audio-preference small,
.briefing-replay small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: rgba(234, 216, 185, 0.66);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-preference button,
.briefing-replay button {
  min-height: 32px;
  border: 0;
  background:
    linear-gradient(180deg, rgba(63, 44, 25, 0.96), rgba(27, 19, 13, 0.98));
  box-shadow: inset 0 0 0 1px rgba(231, 189, 114, 0.2);
  color: #e9cf97;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  clip-path: polygon(7px 0, 100% 0, 100% 100%, 0 100%, 0 7px);
}

.audio-preference button[aria-pressed="true"] {
  background:
    linear-gradient(180deg, rgba(59, 88, 50, 0.94), rgba(24, 39, 24, 0.98));
  color: #d2ecb0;
}

@media (max-width: 480px) {
  .stage-panel {
    min-height: 492px;
  }

  .scene-focus {
    top: 108px;
  }

  .core-hud {
    left: 104px;
    right: 12px;
    top: 146px;
    gap: 5px;
  }

  .core-stat {
    height: 34px;
    padding: 5px 5px 4px 31px;
  }

  .core-stat i {
    left: 6px;
    width: 21px;
    height: 21px;
  }

  .core-stat span {
    font-size: 8px;
  }

  .core-stat strong {
    font-size: 14px;
  }

  .role-figure.xiangyu {
    top: 132px;
  }

  .option-button {
    min-height: 98px;
  }

  .intel-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Game texture pass: replace dashboard rectangles with seals, ribbons, and beveled plates. */
.scene-focus {
  top: 114px;
  align-items: center;
}

.scene-focus span,
.scene-focus b {
  border: 0;
  box-shadow: none;
}

.scene-focus span {
  min-width: 74px;
  background:
    linear-gradient(180deg, rgba(95, 27, 22, 0.78), rgba(34, 15, 12, 0.72));
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  color: #f1d28f;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.scene-focus b {
  position: relative;
  max-width: 68%;
  background:
    linear-gradient(90deg, transparent, rgba(18, 13, 9, 0.52) 12%, rgba(18, 13, 9, 0.72) 82%, transparent);
  color: #f2ddac;
  padding-right: 14px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}
.scene-focus b::before,
.scene-focus b::after {
  content: "";
  font-size: 16px;
  font-weight: 800;
  color: rgba(231, 189, 114, 0.68);
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 189, 114, 0.52), transparent);
}

.scene-focus b::before {
  top: 0;
}

.scene-focus b::after {
  bottom: 0;
}

.role-plate {
  border: 0;
  background:
    linear-gradient(90deg, rgba(8, 7, 6, 0.76), rgba(38, 27, 18, 0.62) 72%, transparent);
  box-shadow: none;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}

.role-plate::before {
  content: "";
  font-size: 16px;
  font-weight: 800;
  color: rgba(231, 189, 114, 0.68);
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(231, 189, 114, 0.8), transparent);
}

.role-plate i {
  background: rgba(16, 12, 9, 0.64);
}

.xiangyu .role-plate,
.fanzeng .role-plate {
  background:
    linear-gradient(90deg, rgba(8, 7, 6, 0.76), rgba(48, 20, 15, 0.58) 72%, transparent);
}

.dialogue-box {
  border: 0;
  background:
    linear-gradient(180deg, rgba(18, 13, 10, 0.78), rgba(5, 5, 4, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.18),
    inset 0 -1px 0 rgba(231, 189, 114, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.3);
  padding-top: 24px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.dialogue-box::before {
  content: "";
  font-size: 16px;
  font-weight: 800;
  color: rgba(231, 189, 114, 0.68);
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 189, 114, 0.62), transparent);
}

.dialogue-box span {
  border: 0;
  background:
    linear-gradient(180deg, rgba(70, 45, 23, 0.94), rgba(27, 18, 12, 0.92));
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.32);
  top: 0;
  left: 16px;
}

.story-panel {
  position: relative;
  z-index: 6;
  margin: 8px 12px 0;
  border: 0;
  background:
    linear-gradient(180deg, rgba(18, 13, 10, 0.78), rgba(5, 5, 4, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.18),
    inset 0 -1px 0 rgba(231, 189, 114, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.3);
  padding: 12px 14px 13px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.story-panel::before {
  content: none;
  display: none;
}

.story-panel.has-resolution {
  background:
    linear-gradient(180deg, rgba(28, 16, 11, 0.86), rgba(7, 6, 5, 0.94));
}

.story-panel p {
  display: block;
  overflow: visible;
  margin-top: 6px;
  color: #ead8b9;
  font-size: 13px;
  font-weight: 780;
  line-height: 1.48;
}

.dialogue-entry {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin-bottom: 6px;
  overflow: hidden;
  color: rgba(232, 206, 164, 0.82);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.42;
}

.dialogue-entry::before {
  content: "承接";
  margin-right: 7px;
  color: rgba(231, 189, 114, 0.92);
  font-size: 11px;
  font-weight: 900;
}

.dialogue-box p {
  -webkit-line-clamp: 4;
  min-height: 0;
  color: #ead8b9;
  font-size: 13px;
  line-height: 1.5;
}

.receipt-story {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
  color: #ead8b9;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.5;
}

.option-button {
  border: 0;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.78),
    0 8px 18px rgba(0, 0, 0, 0.32);
}

.option-button::after {
  content: "";
  font-size: 16px;
  font-weight: 800;
  color: rgba(231, 189, 114, 0.68);
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 189, 114, 0.58), transparent);
}

.option-button span {
  box-shadow: inset 0 0 0 1px rgba(231, 189, 114, 0.22), 0 0 14px rgba(231, 189, 114, 0.08);
}

.free-form {
  grid-template-columns: 76px 1fr 64px;
  border: 0;
  background:
    linear-gradient(90deg, rgba(8, 7, 6, 0.86), rgba(22, 14, 10, 0.72));
  box-shadow: inset 0 1px 0 rgba(231, 189, 114, 0.16);
}

.free-form input {
  border: 0;
  background: rgba(5, 5, 4, 0.68);
}

.free-form button {
  border: 0;
  background:
    linear-gradient(180deg, rgba(178, 62, 45, 0.95), rgba(78, 25, 20, 0.98));
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}

.improvise-button {
  border: 0;
  background:
    linear-gradient(180deg, rgba(74, 53, 32, 0.96), rgba(24, 17, 12, 0.98));
  box-shadow: inset 0 1px 0 rgba(231, 189, 114, 0.2);
}

.suggestion-scroll {
  border: 0;
  background:
    linear-gradient(90deg, rgba(34, 24, 15, 0.92), rgba(12, 9, 7, 0.9));
}

.briefing-modal {
  position: absolute;
  inset: 0;
  z-index: 46;
  display: grid;
  place-items: end center;
  padding: 18px;
}

.briefing-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.58));
}

.briefing-sheet {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid rgba(231, 189, 114, 0.34);
  background:
    radial-gradient(circle at 18% 0, rgba(231, 189, 114, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(39, 26, 15, 0.98), rgba(8, 7, 6, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.22),
    0 -18px 42px rgba(0, 0, 0, 0.58);
  padding: 14px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.briefing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.briefing-head span {
  color: #e7bd72;
  font-size: 12px;
  font-weight: 900;
}

.briefing-head button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(231, 189, 114, 0.22);
  border-radius: 999px;
  background: rgba(10, 8, 7, 0.62);
  color: #ead8b9;
  font-size: 18px;
  line-height: 1;
}

.briefing-sheet > strong {
  display: block;
  color: #f4d68e;
  font-size: 17px;
  line-height: 1.15;
}

.briefing-sheet > p {
  margin-top: 7px;
  color: #ead8b9;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.42;
}

.briefing-story {
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(231, 189, 114, 0.18);
  background:
    linear-gradient(90deg, rgba(10, 8, 6, 0.62), rgba(50, 31, 17, 0.34));
}

.briefing-story b {
  display: block;
  color: #f2cf7b;
  font-size: 12px;
  line-height: 1.2;
}

.briefing-story p {
  margin: 5px 0 0;
  color: rgba(234, 216, 185, 0.86);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.briefing-sigils {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 11px;
}

.briefing-sigils div {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px 1fr;
  grid-template-rows: auto auto;
  gap: 1px 6px;
  align-items: center;
  padding: 7px;
  border: 1px solid rgba(231, 189, 114, 0.18);
  background: rgba(8, 7, 6, 0.48);
}

.briefing-sigils i {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(231, 189, 114, 0.3);
  border-radius: 999px;
  background: rgba(20, 16, 12, 0.76);
  color: #e5c17e;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}

.briefing-sigils span {
  min-width: 0;
  overflow: hidden;
  color: #ead8b9;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.briefing-sigils small {
  min-width: 0;
  overflow: hidden;
  color: rgba(234, 216, 185, 0.68);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.briefing-sheet > em {
  display: block;
  margin-top: 10px;
  color: #bba88a;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.briefing-actions {
  display: grid;
  grid-template-columns: 0.82fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.briefing-actions-split {
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 0.94fr) minmax(0, 1fr);
}

.briefing-actions button {
  min-height: 42px;
  border: 0;
  cursor: pointer;
  padding: 8px;
  color: #ead8b9;
  font-size: 13px;
  font-weight: 900;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}

.briefing-audio {
  background:
    linear-gradient(180deg, rgba(56, 42, 25, 0.96), rgba(23, 17, 12, 0.98));
  box-shadow: inset 0 0 0 1px rgba(231, 189, 114, 0.18);
}

.briefing-audio:disabled {
  color: rgba(210, 236, 176, 0.9);
  cursor: default;
  opacity: 0.82;
}

.briefing-start {
  background:
    linear-gradient(180deg, rgba(168, 57, 42, 0.96), rgba(76, 24, 19, 0.98));
  color: #fff1cf;
  font-size: 15px;
}

.controls-guide {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

.controls-guide-scrim {
  position: fixed;
  inset: 0;
  z-index: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
}

.controls-guide-spotlight {
  position: fixed;
  z-index: 1;
  left: 24px;
  top: 160px;
  width: 280px;
  height: 84px;
  border: 1px solid rgba(255, 221, 142, 0.92);
  border-radius: 12px;
  box-shadow:
    0 0 0 9999px rgba(2, 2, 2, 0.66),
    0 0 0 3px rgba(95, 38, 22, 0.42),
    0 0 28px rgba(231, 189, 114, 0.42),
    inset 0 0 18px rgba(231, 189, 114, 0.14);
  pointer-events: none;
  transition: left 180ms ease, top 180ms ease, width 180ms ease, height 180ms ease;
}

.controls-guide-spotlight::before,
.controls-guide-spotlight::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 14px;
  border: 1px solid rgba(231, 189, 114, 0.32);
  pointer-events: none;
}

.controls-guide-spotlight::after {
  inset: 5px;
  border-color: rgba(255, 241, 196, 0.18);
}

.phone.controls-guide-active .guide-focus {
  scroll-margin: 92px 0;
  filter:
    drop-shadow(0 0 8px rgba(231, 189, 114, 0.32))
    drop-shadow(0 0 18px rgba(228, 93, 79, 0.18));
}

.phone.controls-guide-active .guide-focus,
.phone.controls-guide-active .guide-focus * {
  pointer-events: none;
}

.controls-guide-card {
  position: fixed;
  z-index: 3;
  left: 24px;
  top: 48%;
  width: min(360px, calc(100vw - 48px));
  border: 1px solid rgba(231, 189, 114, 0.42);
  background:
    radial-gradient(circle at 16% 0, rgba(231, 189, 114, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(44, 29, 16, 0.98), rgba(10, 8, 6, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 176, 0.18),
    0 16px 34px rgba(0, 0, 0, 0.5);
  color: #ead8b9;
  padding: 13px 14px 14px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  pointer-events: auto;
}

.controls-guide-card::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 189, 114, 0.68), transparent);
}

.controls-guide-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.controls-guide-kicker span,
.controls-guide-kicker b {
  color: #e7bd72;
  font-size: 12px;
  font-weight: 950;
}

.controls-guide-kicker b {
  font-family: var(--font-number);
}

.controls-guide-card > strong {
  display: block;
  color: #ffe0a0;
  font-size: 17px;
  font-weight: 950;
  line-height: 1.18;
}

.controls-guide-card > p {
  margin-top: 6px;
  color: rgba(234, 216, 185, 0.9);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.44;
}

.controls-guide-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.controls-guide-actions button {
  min-width: 0;
  min-height: 38px;
  border: 0;
  cursor: pointer;
  padding: 8px 10px;
  color: #ead8b9;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}

.controls-guide-skip {
  background:
    linear-gradient(180deg, rgba(54, 40, 24, 0.96), rgba(20, 15, 10, 0.98));
  box-shadow: inset 0 0 0 1px rgba(231, 189, 114, 0.18);
}

.controls-guide-next {
  background:
    linear-gradient(180deg, rgba(166, 58, 42, 0.98), rgba(78, 24, 18, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 221, 142, 0.22),
    0 6px 14px rgba(0, 0, 0, 0.28);
  color: #fff1cf;
}

@media (max-width: 480px) {
  .briefing-actions-split {
    grid-template-columns: 1fr;
  }

  .controls-guide-card {
    padding: 12px 13px 13px;
  }
}

.counsel-modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
}

.counsel-modal.dismissed {
  display: none;
}

.counsel-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(231, 189, 114, 0.08), transparent 32%),
    rgba(0, 0, 0, 0.58);
}

.counsel-sheet {
  position: relative;
  width: min(360px, 100%);
  border: 1px solid rgba(231, 189, 114, 0.34);
  background:
    linear-gradient(180deg, rgba(38, 25, 16, 0.96), rgba(10, 8, 7, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.2),
    0 22px 44px rgba(0, 0, 0, 0.62);
  padding: 14px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.counsel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.counsel-head span {
  color: #e7bd72;
  font-size: 14px;
  font-weight: 900;
}

.counsel-head button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(231, 189, 114, 0.22);
  border-radius: 999px;
  background: rgba(10, 8, 7, 0.62);
  color: #ead8b9;
  font-size: 18px;
  line-height: 1;
}

.counsel-body {
  max-height: min(250px, 40vh);
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: none;
}

.counsel-body::-webkit-scrollbar {
  display: none;
}

.counsel-sheet p {
  color: #f0dfc0;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.55;
}

.counsel-sheet .counsel-reasoning {
  margin-top: 8px;
  color: #b89b70;
  font-size: 12px;
}

.counsel-loading {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 76px;
}

.counsel-loading i {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(231, 189, 114, 0.18);
  border-top-color: rgba(231, 189, 114, 0.9);
  border-radius: 999px;
  animation: counsel-spin 880ms linear infinite;
}

.counsel-loading p {
  color: #d9c6a4;
  font-size: 14px;
  font-weight: 800;
}

@keyframes counsel-spin {
  to {
    transform: rotate(360deg);
  }
}

.counsel-sheet .counsel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
  margin-top: 14px;
}

.counsel-sheet .counsel-actions button {
  min-height: 38px;
  border: 0;
  background: rgba(64, 42, 24, 0.92);
  color: #e9cf97;
  cursor: pointer;
  padding: 8px;
  font-size: 12px;
  font-weight: 900;
  clip-path: polygon(7px 0, 100% 0, 100% 100%, 0 100%, 0 7px);
}

.counsel-sheet .counsel-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.counsel-sheet .counsel-actions button:last-child {
  background: linear-gradient(180deg, rgba(150, 50, 38, 0.96), rgba(75, 25, 20, 0.98));
  color: #fff1cf;
}

.action-receipt {
  border: 0;
  background:
    linear-gradient(90deg, rgba(9, 8, 7, 0.86), rgba(36, 22, 14, 0.7));
  box-shadow: inset 0 1px 0 rgba(231, 189, 114, 0.14);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.story-panel {
  background:
    linear-gradient(180deg, rgba(18, 13, 10, 0.78), rgba(5, 5, 4, 0.92));
}

.delta-list span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.stage-bg {
  background:
    radial-gradient(circle at 50% 38%, rgba(231, 189, 114, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.3)),
    var(--stage-bg) center / cover;
  filter: saturate(1.04) contrast(1.02) brightness(1.08);
}

.stage-panel.critical-pressure .stage-bg,
.stage-panel.scene-tense .stage-bg,
.stage-panel.scene-danger .stage-bg {
  filter: saturate(1.08) contrast(1.04) brightness(0.96);
}

.stage-panel.stage-no-image .stage-bg {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.82)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.72), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.74)),
    repeating-linear-gradient(90deg, rgba(231, 189, 114, 0.08) 0 1px, transparent 1px 86px),
    repeating-linear-gradient(0deg, rgba(231, 189, 114, 0.045) 0 1px, transparent 1px 48px),
    linear-gradient(135deg, var(--stage-accent), rgba(8, 7, 6, 0.98) 54%, rgba(42, 22, 18, 0.68));
}

.stage-panel.stage-no-image .stage-bg::before {
  content: "";
  position: absolute;
  inset: 12px 24px 96px;
  border-top: 1px solid rgba(231, 189, 114, 0.14);
  border-bottom: 1px solid rgba(231, 189, 114, 0.08);
  background:
    linear-gradient(90deg, transparent, rgba(231, 189, 114, 0.05), transparent),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(0, 0, 0, 0.18) 42px 45px);
  opacity: 0.92;
}

.stage-panel.stage-no-image .stage-bg::after {
  background:
    linear-gradient(180deg, transparent 0 54%, rgba(0, 0, 0, 0.36)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent 36%, transparent 64%, rgba(0, 0, 0, 0.22));
}

@media (max-width: 480px) {
  .scene-focus {
    top: 108px;
  }

  .scene-focus span {
    min-width: 70px;
  }

  .scene-focus b {
    max-width: 66%;
  }
}

/* Scale harmonization pass: one mobile-game type/spacing rhythm. */
.topbar {
  min-height: 92px;
  padding-top: 14px;
}

.brand-title {
  top: 14px;
  font-size: 30px;
}

.round-hud {
  width: 154px;
}

.round-hud b {
  font-size: 18px;
}

.danger-meter {
  margin-top: 8px;
}

.war-button {
  width: 58px;
  height: 58px;
}

.war-button strong {
  width: 24px;
  height: 24px;
  font-size: 22px;
  line-height: 0.95;
}

.war-button span {
  font-size: 11px;
}

.ledger-button {
  position: absolute;
  right: 58px;
  top: 76px;
  min-height: 30px;
  border: 1px solid rgba(231, 189, 114, 0.34);
  border-radius: 999px;
  background: rgba(15, 12, 10, 0.56);
  color: #e7c17d;
  cursor: pointer;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 900;
}

.stage-panel {
  min-height: 426px;
}

.stage-panel.is-ending {
  min-height: 386px;
}

.stage-panel.is-ending .cinematic-cast,
.cinematic-cast {
  height: 334px;
}

.scene-focus {
  top: 102px;
}

.scene-focus span {
  min-width: 66px;
  padding: 7px 10px;
  font-size: 12px;
}

.scene-focus b {
  max-width: 64%;
  padding: 7px 12px 7px 10px;
  font-size: 12px;
  line-height: 1.35;
}

.core-hud {
  left: 112px;
  right: 18px;
  top: 126px;
  gap: 5px;
}

.core-stat {
  height: 32px;
  padding: 4px 6px 4px 30px;
}

.core-stat i {
  left: 6px;
  width: 20px;
  height: 20px;
  font-size: 9px;
}

.core-stat span {
  font-size: 8px;
}

.core-stat strong {
  font-size: 13px;
}

.role-figure.xiangyu {
  top: 108px;
  right: -10px;
  width: 160px;
  height: 216px;
}

.role-figure.liubang {
  top: 216px;
  left: -24px;
  width: 184px;
  height: 200px;
}

.role-figure.fanzeng {
  top: 254px;
  right: 2px;
  width: 138px;
  height: 158px;
}

.role-plate {
  min-width: 104px;
  max-width: 124px;
  padding: 6px 7px 7px 31px;
}

.role-plate i {
  left: 6px;
  top: 7px;
  width: 20px;
  height: 20px;
  font-size: 10px;
}

.role-plate strong {
  font-size: 16px;
  line-height: 1.05;
}

.role-plate span {
  margin-top: 2px;
  font-size: 11px;
}

.story-panel {
  margin: 7px 12px 0;
  padding: 10px 12px 11px;
}

.story-round span {
  font-size: 12px;
}

.story-round b {
  font-size: 10px;
}

.story-panel p {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.story-panel .delta-list {
  margin-top: 7px;
}

.delta-list {
  gap: 5px;
}

.delta-list span {
  padding: 3px 7px;
  font-size: 10px;
}

.decision-panel {
  margin: 8px 10px 0;
  padding: 8px;
}

.option-grid {
  gap: 7px;
}

.option-button {
  min-height: 88px;
  gap: 5px;
  padding: 8px 6px 9px;
}

.option-button span {
  width: 34px;
  height: 34px;
  font-size: 15px;
}

.option-button strong {
  min-height: 32px;
  font-size: 15px;
  line-height: 1.12;
}

.option-button small {
  font-size: 11px;
}

.free-form {
  position: relative;
  grid-template-columns: 76px minmax(0, 1fr) 62px;
  gap: 7px;
  margin-top: 9px;
  padding: 7px;
  background:
    linear-gradient(90deg, rgba(42, 27, 17, 0.5), rgba(7, 6, 5, 0.9) 24%, rgba(9, 7, 6, 0.92) 76%, rgba(45, 22, 17, 0.58)),
    radial-gradient(circle at 50% 0, rgba(231, 189, 114, 0.15), transparent 46%);
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.25),
    inset 0 -1px 0 rgba(231, 189, 114, 0.14),
    0 8px 18px rgba(0, 0, 0, 0.26);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.free-form::before {
  content: "";
  pointer-events: none;
  position: absolute;
  left: 7px;
  right: 7px;
  top: 6px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 189, 114, 0.5), transparent);
}

.free-form input,
.free-form button {
  min-height: 46px;
}

.free-form input {
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(3, 3, 3, 0.92), rgba(10, 8, 7, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(231, 189, 114, 0.1),
    inset 0 10px 16px rgba(0, 0, 0, 0.38);
  color: #f1dfbb;
  padding: 0 13px;
  font-size: 14px;
  font-weight: 780;
  letter-spacing: 0;
}

.free-form input::placeholder {
  color: rgba(234, 216, 185, 0.42);
  font-weight: 760;
}

.free-form button {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(118, 49, 32, 0.96), rgba(82, 27, 20, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 222, 158, 0.24),
    inset 0 -1px 0 rgba(0, 0, 0, 0.65),
    0 5px 12px rgba(0, 0, 0, 0.28);
  clip-path: polygon(9px 0, 100% 0, 100% 100%, 0 100%, 0 9px);
  color: #fff1cf;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.free-form button::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 1px;
  border: 1px solid rgba(231, 189, 114, 0.14);
  clip-path: inherit;
}

.free-form .improvise-button {
  background:
    linear-gradient(180deg, rgba(72, 45, 24, 0.98), rgba(40, 25, 14, 0.98));
  color: #f0d49a;
}

.free-form button[type="submit"] {
  background:
    linear-gradient(180deg, rgba(165, 55, 42, 0.98), rgba(94, 29, 22, 0.98));
  font-size: 15px;
}

.scene-focus {
  justify-content: center;
}

.scene-focus span {
  display: none;
}

.scene-focus b {
  max-width: 72%;
}

.option-grid {
  gap: 6px;
}

.option-button,
.option-button.card-1,
.option-button.card-2,
.option-button.card-3 {
  min-height: 66px;
  align-content: center;
  border: 0;
  background:
    radial-gradient(circle at 16% 0%, rgba(231, 189, 114, 0.18), transparent 34%),
    linear-gradient(115deg, rgba(231, 189, 114, 0.16) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(43, 35, 24, 0.9), rgba(15, 13, 11, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 226, 166, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.82),
    inset 4px 0 0 rgba(201, 159, 88, 0.34),
    0 8px 16px rgba(0, 0, 0, 0.34);
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 11px 100%, 0 calc(100% - 11px));
  padding: 9px 9px 9px 12px;
}

.option-button span,
.option-button small {
  display: none;
}

.option-button strong {
  min-height: 0;
  color: #ead8b9;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 850;
  line-height: 1.28;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.78);
}

.option-button::after {
  left: 12px;
  right: 12px;
  background: linear-gradient(90deg, rgba(231, 189, 114, 0.4), rgba(231, 189, 114, 0.08), transparent);
}

.option-button:active,
.option-button.is-selected {
  transform: translateY(1px);
  filter: brightness(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 226, 166, 0.26),
    inset 0 -1px 0 rgba(0, 0, 0, 0.82),
    inset 4px 0 0 rgba(231, 189, 114, 0.42),
    0 5px 10px rgba(0, 0, 0, 0.34);
}

@media (max-width: 480px) {
  .stage-panel {
    min-height: 426px;
  }

  .scene-focus {
    top: 102px;
  }

  .core-hud {
    left: 108px;
    right: 12px;
    top: 126px;
  }

  .role-figure.xiangyu {
    top: 112px;
    right: 4px;
    width: 148px;
    height: 206px;
  }

  .role-figure.liubang {
    top: 226px;
    left: 4px;
    width: 166px;
    height: 190px;
  }

  .role-figure.fanzeng {
    top: 254px;
    right: 8px;
    width: 132px;
    height: 152px;
  }

  .option-button {
    min-height: 66px;
  }
}

/* Visual QA pass: keep mobile stage actors inside the viewport. */
@media (max-width: 420px) {
  .stage-panel {
    overflow: hidden;
  }

  .core-hud {
    left: 102px;
    right: 10px;
  }

  .role-figure.xiangyu {
    right: 6px;
    width: 144px;
  }

  .role-figure.liubang {
    left: 6px;
    width: 160px;
  }

.role-figure.fanzeng {
  right: 10px;
  width: 126px;
}

  .role-plate {
    max-width: 116px;
  }
}

/* MVP visual QA: make the always-visible HUD readable inside the fixed phone shell. */
.topbar {
  min-height: 116px;
}

.core-hud {
  left: 96px;
  right: 12px;
  top: 124px;
  gap: 6px;
}

.core-stat {
  height: 38px;
  padding: 5px 7px 5px 32px;
}

.core-stat i {
  left: 6px;
  width: 22px;
  height: 22px;
  font-size: 10px;
}

.core-stat span {
  font-size: 9.5px;
  line-height: 1.05;
}

.core-stat strong {
  margin-top: 1px;
  font-size: 15px;
}

.role-figure.xiangyu {
  right: 0;
}

.role-figure.fanzeng {
  right: 8px;
}

/* Ending stage becomes backdrop for the war-scroll; keep actors inside the clipped stage. */
.stage-panel.is-ending .role-figure.xiangyu {
  top: 96px;
  right: 4px;
  width: 148px;
  height: 196px;
}

.stage-panel.is-ending .role-figure.liubang {
  top: 178px;
  left: 4px;
  width: 148px;
  height: 156px;
}

.stage-panel.is-ending .role-figure.fanzeng {
  top: 214px;
  right: 10px;
  width: 118px;
  height: 120px;
}

@media (max-width: 420px) {
  .core-hud {
    left: 94px;
    right: 10px;
    top: 124px;
  }

  .core-stat {
    height: 37px;
    padding-right: 6px;
  }
}

/* Single Blade Meeting stage: distinct scene and actor blocking from Hongmen. */
.role-figure.guanyu {
  left: -4px;
  top: 170px;
  width: 202px;
  height: 274px;
}

.role-figure.lusu {
  right: 2px;
  top: 126px;
  width: 156px;
  height: 226px;
}

.role-figure.zhoucang {
  right: 22px;
  top: 254px;
  width: 128px;
  height: 188px;
}

/* Generic crisis chapters now use real cutouts; no emblem backdrop should remain behind actors. */
.role-figure.generic-player {
  left: 4px;
  top: 220px;
  width: 178px;
  height: 178px;
}

.role-figure.generic-opponent {
  right: 4px;
  top: 128px;
  width: 172px;
  height: 178px;
}

.role-figure.generic-advisor {
  right: 20px;
  top: 292px;
  width: 136px;
  height: 140px;
}

.role-figure.generic-player .role-plate {
  left: 42px;
  bottom: 34px;
}

.role-figure.generic-opponent .role-plate {
  right: 58px;
  bottom: 40px;
}

.role-figure.generic-advisor .role-plate {
  right: 34px;
  bottom: 20px;
}

.role-figure.generic-player .role-plate,
.role-figure.generic-opponent .role-plate,
.role-figure.generic-advisor .role-plate {
  z-index: 3;
}

/* Prop-style controls: make primary interactions feel like game objects. */
.scene-book-button {
  position: relative;
  height: 30px;
  min-height: 30px;
  border: 1px solid rgba(199, 152, 82, 0.72);
  background:
    linear-gradient(90deg, rgba(99, 64, 30, 0.92) 0 5px, rgba(39, 25, 14, 0.9) 5px calc(100% - 6px), rgba(141, 91, 37, 0.88) calc(100% - 6px)),
    radial-gradient(circle at 16% 26%, rgba(249, 218, 142, 0.28), transparent 36%);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 174, 0.34),
    inset 0 -1px 0 rgba(25, 13, 6, 0.86),
    0 6px 14px rgba(0, 0, 0, 0.32);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 4px) 100%, 0 100%, 0 8px);
  color: #f4d697;
  padding: 0 13px 0 15px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.78);
}

.scene-book-button::before,
.scene-book-button::after {
  content: "";
  pointer-events: none;
  position: absolute;
  top: 5px;
  bottom: 5px;
  width: 1px;
  background: rgba(237, 190, 103, 0.38);
}

.scene-book-button::before {
  left: 7px;
}

.scene-book-button::after {
  right: 7px;
}

.war-button {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(198, 151, 77, 0.62);
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 225, 147, 0.24), transparent 22%),
    radial-gradient(circle at 50% 52%, rgba(90, 58, 24, 0.96), rgba(24, 17, 10, 0.98) 60%, rgba(4, 3, 2, 0.98));
  box-shadow:
    inset 0 0 0 4px rgba(93, 66, 31, 0.58),
    inset 0 0 0 5px rgba(229, 177, 88, 0.28),
    inset 0 -10px 18px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(15, 9, 3, 0.88),
    0 12px 22px rgba(0, 0, 0, 0.38);
}

.war-button strong {
  width: auto;
  height: auto;
  color: #ffe3a3;
  font-size: 22px;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.8),
    0 0 10px rgba(239, 190, 98, 0.42);
}

.war-button span {
  margin-top: -11px;
  color: #f2d59b;
  font-size: 11px;
  letter-spacing: 0;
}

.option-button,
.option-button.card-1,
.option-button.card-2,
.option-button.card-3 {
  min-height: 72px;
  border: 0;
  background:
    linear-gradient(90deg, rgba(181, 131, 68, 0.52) 0 4px, transparent 4px calc(100% - 5px), rgba(121, 84, 43, 0.52) calc(100% - 5px)),
    repeating-linear-gradient(90deg, rgba(255, 231, 170, 0.04) 0 1px, transparent 1px 17px),
    radial-gradient(circle at 22% 8%, rgba(255, 227, 166, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(58, 46, 30, 0.96), rgba(21, 18, 14, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 178, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.82),
    inset 0 0 0 1px rgba(203, 158, 86, 0.22),
    0 8px 16px rgba(0, 0, 0, 0.36);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 12px 100%, 0 calc(100% - 12px));
}

.option-button::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 5px 7px;
  border-top: 1px solid rgba(232, 187, 104, 0.24);
  border-bottom: 1px solid rgba(70, 45, 22, 0.62);
}

.option-button strong {
  color: #f0dfbd;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.82),
    0 0 9px rgba(224, 178, 92, 0.12);
}

.option-button:active,
.option-button.is-selected {
  transform: translateY(1px);
  filter: brightness(1.08) saturate(1.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 178, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.82),
    inset 0 0 0 1px rgba(231, 189, 114, 0.3),
    0 5px 10px rgba(0, 0, 0, 0.36);
}

.free-form {
  grid-template-columns: 88px minmax(0, 1fr) 68px;
  border: 1px solid rgba(118, 82, 40, 0.52);
  background:
    linear-gradient(90deg, rgba(76, 44, 20, 0.82), rgba(15, 11, 8, 0.94) 22%, rgba(9, 7, 6, 0.98) 74%, rgba(92, 38, 25, 0.82)),
    radial-gradient(circle at 50% 0, rgba(239, 194, 104, 0.18), transparent 48%);
  box-shadow:
    inset 0 1px 0 rgba(242, 202, 124, 0.3),
    inset 0 -1px 0 rgba(25, 11, 5, 0.84),
    0 9px 18px rgba(0, 0, 0, 0.3);
}

.free-form input {
  border: 1px solid rgba(82, 55, 28, 0.66);
  background:
    radial-gradient(circle at 50% 0, rgba(85, 57, 31, 0.24), transparent 42%),
    linear-gradient(180deg, rgba(2, 2, 2, 0.94), rgba(8, 7, 6, 0.98));
  box-shadow:
    inset 0 8px 16px rgba(0, 0, 0, 0.48),
    inset 0 0 18px rgba(72, 46, 24, 0.28);
}

.free-form .improvise-button {
  overflow: visible;
  border: 1px solid rgba(183, 128, 65, 0.5);
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 221, 140, 0.22), transparent 26%),
    linear-gradient(135deg, rgba(104, 58, 25, 0.98), rgba(55, 31, 15, 0.98) 58%, rgba(36, 22, 13, 0.98));
  clip-path: polygon(13px 0, calc(100% - 7px) 0, 100% 9px, 100% 100%, 7px 100%, 0 calc(100% - 9px), 0 13px);
  color: #f8d998;
}

.free-form .improvise-button::before {
  content: "";
  pointer-events: none;
  position: absolute;
  left: 6px;
  right: 6px;
  top: 6px;
  height: 8px;
  border-top: 1px dashed rgba(241, 199, 105, 0.42);
  border-bottom: 1px dashed rgba(75, 40, 16, 0.54);
}

.free-form button[type="submit"] {
  border: 1px solid rgba(227, 168, 99, 0.4);
  border-radius: 1px;
  background:
    radial-gradient(circle at 50% 44%, rgba(150, 26, 22, 0.98) 0 48%, rgba(102, 23, 18, 0.98) 49% 64%, transparent 65%),
    linear-gradient(180deg, rgba(170, 58, 41, 0.95), rgba(86, 25, 19, 0.98));
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 12px);
  color: #fff0c9;
  font-size: 15px;
}

.free-form button[type="submit"]::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 8px 10px;
  border: 1px solid rgba(252, 211, 142, 0.28);
  border-radius: 999px;
  box-shadow: inset 0 0 14px rgba(54, 4, 4, 0.5);
}

@media (max-width: 420px) {
  .free-form {
    grid-template-columns: 82px minmax(0, 1fr) 64px;
    gap: 6px;
  }

  .war-button {
    width: 54px;
    height: 54px;
  }

}

/* Image-backed prop skin. These SVGs are UI textures, not gameplay state. */
.scene-book-button {
  width: 62px;
  height: 42px;
  min-height: 42px;
  border: 0;
  background: url("/src/assets/ui/bamboo-tab.svg") center / 100% 100% no-repeat;
  clip-path: none;
  box-shadow: none;
  color: #2a1709;
  padding: 4px 10px 0;
  font-size: 13px;
  text-shadow: 0 1px 0 rgba(246, 214, 137, 0.42);
}

.scene-book-button::before,
.scene-book-button::after {
  content: none;
}

.war-button {
  width: 68px;
  height: 68px;
  border: 0;
  background: url("/src/assets/ui/bronze-talisman.svg") center / contain no-repeat;
  box-shadow: none;
}

.war-button strong {
  margin-top: 4px;
  color: #ffe9ad;
  font-size: 24px;
}

.war-button span {
  margin-top: -13px;
  color: #ffe2a5;
  font-size: 12px;
}

.story-panel {
  margin: 8px 8px 0;
  border: 0;
  background: url("/src/assets/ui/story-scroll.svg") center / 100% 100% no-repeat;
  box-shadow: none;
  padding: 29px 34px 28px 38px;
  color: #2b180b;
}

.story-panel::before,
.story-panel::after {
  content: none;
}

.story-round {
  top: 22px;
  right: 42px;
  color: rgba(55, 32, 14, 0.75);
}

.story-round b {
  color: rgba(55, 32, 14, 0.74);
  font-size: 11px;
  text-shadow: 0 1px 0 rgba(255, 235, 185, 0.4);
}

.story-panel p {
  margin-top: 5px;
  color: #201107;
  font-size: 13.5px;
  font-weight: 850;
  line-height: 1.48;
  text-shadow: 0 1px 0 rgba(255, 239, 203, 0.42);
}

.story-panel .delta-list {
  margin-top: 9px;
}

.delta-list span {
  border-color: rgba(39, 22, 9, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 239, 197, 0.35),
    0 2px 5px rgba(55, 30, 12, 0.18);
}

.option-grid {
  gap: 10px;
}

.option-button,
.option-button.card-1,
.option-button.card-2,
.option-button.card-3 {
  min-height: 92px;
  padding: 14px 14px 13px;
  background: url("/src/assets/ui/parchment-card.svg") center / 100% 100% no-repeat;
  clip-path: none;
  box-shadow: none;
  filter: drop-shadow(0 7px 9px rgba(0, 0, 0, 0.38));
}

.option-button::before,
.option-button::after {
  content: none;
}

.option-button strong {
  color: #2a180b;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.18;
  text-shadow: 0 1px 0 rgba(255, 235, 189, 0.46);
}

.option-button:active,
.option-button.is-selected {
  transform: translateY(2px);
  filter: brightness(1.04) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.34));
  box-shadow: none;
}

.free-form {
  grid-template-columns: 100px minmax(0, 1fr) 78px;
  min-height: 74px;
  border: 0;
  background: url("/src/assets/ui/scroll-tray.svg") center / 100% 100% no-repeat;
  box-shadow: none;
  clip-path: none;
  padding: 11px 13px;
}

.free-form::before {
  content: none;
}

.free-form input {
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 0, rgba(95, 69, 42, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(7, 7, 6, 0.95), rgba(2, 2, 2, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(119, 83, 43, 0.48),
    inset 0 12px 18px rgba(0, 0, 0, 0.56);
  color: #f2dfbd;
}

.free-form .improvise-button {
  min-height: 52px;
  border: 0;
  background: url("/src/assets/ui/brocade-pouch.svg") center / 100% 100% no-repeat;
  clip-path: none;
  box-shadow: none;
  color: #f9dfa6;
  padding: 2px 11px 0;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.74);
}

.free-form .improvise-button::before,
.free-form .improvise-button::after {
  content: none;
}

.free-form button[type="submit"] {
  min-height: 52px;
  border: 0;
  background: url("/src/assets/ui/wax-seal.svg") center / 100% 100% no-repeat;
  clip-path: none;
  box-shadow: none;
  color: #ffe7ae;
  font-size: 16px;
  text-shadow:
    0 2px 2px rgba(0, 0, 0, 0.62),
    0 0 8px rgba(255, 216, 142, 0.22);
}

.free-form button[type="submit"]::before,
.free-form button[type="submit"]::after {
  content: none;
}

@media (max-width: 420px) {
  .scene-book-button {
    width: 58px;
    height: 39px;
    min-height: 39px;
    font-size: 12px;
  }

  .war-button {
    width: 64px;
    height: 64px;
  }

  .story-panel {
    padding: 27px 29px 26px 33px;
  }

  .option-button {
    min-height: 86px;
    padding: 12px 11px;
  }

  .free-form {
    grid-template-columns: 92px minmax(0, 1fr) 72px;
    min-height: 70px;
    padding: 10px 12px;
  }
}

/* Streaming adjudication should keep situation HUD visible while only decision controls wait. */
.phone.story-streaming .decision-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: none;
  transition: none;
}

.phone.story-streaming .decision-panel.is-waiting-options .option-button,
.phone.story-streaming .decision-panel.is-waiting-options .free-form {
  opacity: 1;
  filter: none;
}

.phone.story-streaming .decision-panel.is-waiting-options .option-button strong,
.phone.story-streaming .decision-panel.is-waiting-options .free-form input::placeholder {
  color: rgba(231, 189, 114, 0.72);
}

.phone.story-streaming .decision-panel.is-waiting-options .option-button strong {
  color: #261407;
}

.story-panel.is-streaming {
  height: var(--story-panel-height);
  overflow: hidden;
}

.story-panel.has-resolution {
  height: var(--story-panel-height);
  max-height: var(--story-panel-height);
  overflow: hidden;
}

.story-panel.has-resolution .story-copy,
.story-panel.is-streaming .story-copy {
  display: block;
  max-height: var(--story-copy-max);
  padding-bottom: var(--story-copy-pad-bottom);
  overflow: hidden auto;
  scrollbar-width: none;
}

.story-panel .story-copy p {
  margin: 0;
}

.story-panel .story-copy p + p {
  margin-top: 0.55em;
}

.story-panel.has-resolution .story-copy::-webkit-scrollbar,
.story-panel.is-streaming .story-copy::-webkit-scrollbar {
  display: none;
}

.story-panel.is-streaming .delta-list {
  display: none;
}

@media (max-width: 420px) {
  .story-panel.is-streaming {
    height: var(--story-panel-height);
  }

  .story-panel.has-resolution {
    height: var(--story-panel-height);
    max-height: var(--story-panel-height);
  }

  .story-panel.has-resolution .story-copy,
  .story-panel.is-streaming .story-copy {
    max-height: var(--story-copy-max);
    padding-bottom: var(--story-copy-pad-bottom);
  }
}

.role-figure.guanyu .role-plate {
  left: 44px;
  bottom: 28px;
}

.role-figure.lusu .role-plate {
  right: 74px;
  bottom: 34px;
}

.role-figure.zhoucang .role-plate {
  right: 46px;
  bottom: 20px;
}

.guanyu .role-plate {
  background:
    linear-gradient(90deg, rgba(8, 7, 6, 0.78), rgba(30, 58, 36, 0.56) 72%, transparent);
}

.lusu .role-plate,
.zhoucang .role-plate {
  background:
    linear-gradient(90deg, rgba(8, 7, 6, 0.78), rgba(48, 36, 18, 0.56) 72%, transparent);
}

.role-figure.guanyu img {
  filter: saturate(1.08) contrast(1.04);
}

.role-figure.lusu img {
  filter: saturate(0.9) contrast(1.02);
}

.role-figure.zhoucang img {
  filter: saturate(0.96) contrast(1.08);
}

/* Stage blocking system: shared rules for every chapter with multiple actors on one side. */
.cinematic-cast {
  isolation: isolate;
}

.stage-panel .role-figure {
  z-index: 3;
}

.stage-panel .role-figure .role-art {
  z-index: 1;
}

.stage-panel .role-figure .role-plate {
  z-index: 12;
}

.stage-panel .role-figure[data-stage-slot$="-lead"] {
  z-index: 2;
}

.stage-panel .role-figure[data-stage-slot$="-support"] {
  z-index: 6;
}

.stage-panel .role-figure[data-stage-slot$="-extra"] {
  z-index: 7;
}

.stage-panel .role-figure[data-stage-slot^="left"] {
  z-index: 5;
}

.stage-panel .role-figure[data-stage-slot="right-support"],
.stage-panel .role-figure[data-stage-slot="right-extra"] {
  right: 18px;
}

.stage-panel .role-figure[data-stage-slot="right-support"] .role-plate,
.stage-panel .role-figure[data-stage-slot="right-extra"] .role-plate {
  right: 50px;
}

@media (max-width: 480px) {
  .stage-panel .role-figure[data-stage-slot="right-support"],
  .stage-panel .role-figure[data-stage-slot="right-extra"] {
    right: 14px;
  }
}

/* Final stage layout is slot-based, not character-specific: this keeps actor scale consistent across chapters. */
.stage-panel:not(.is-ending) .core-hud {
  left: 12px;
  right: auto;
  top: 96px;
  z-index: 9;
  width: 148px;
  grid-template-columns: 1fr;
  gap: 2px;
}

.stage-panel:not(.is-ending) .core-stat {
  height: 20px;
  border-radius: 8px;
  padding: 3px 8px;
}

.stage-panel:not(.is-ending) .core-stat i {
  display: none;
}

.stage-panel:not(.is-ending) .core-stat::before {
  content: "";
  position: absolute;
  left: 58px;
  right: 7px;
  top: 50%;
  height: 5px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(231, 189, 114, 0.1);
}

.stage-panel:not(.is-ending) .core-stat::after {
  left: 58px;
  right: auto;
  top: 50%;
  bottom: auto;
  width: calc(100% - 65px);
  height: 5px;
  transform: translateY(-50%) scaleX(var(--value-ratio));
  transform-origin: left center;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(178, 58, 45, 0.95), rgba(235, 102, 82, 0.95));
  opacity: 0.86;
  mask: none;
}

.phone.reveal-impact .stage-panel:not(.is-ending) .core-stat.impact-changed::after {
  animation: hud-stat-bar-change 720ms cubic-bezier(0.2, 0.86, 0.22, 1) both;
}

.phone.reveal-impact .stage-panel:not(.is-ending) .core-stat.impact-bad::after {
  animation-name: hud-stat-bar-bad;
}

.phone.reveal-impact .stage-panel:not(.is-ending) .core-stat.impact-good::after {
  animation-name: hud-stat-bar-good;
}

.stage-panel:not(.is-ending) .core-stat.good::after {
  background: linear-gradient(90deg, rgba(57, 133, 75, 0.95), rgba(116, 209, 125, 0.95));
}

.stage-panel:not(.is-ending) .core-stat span {
  max-width: 54px;
  font-size: 8px;
  line-height: 14px;
}

.stage-panel:not(.is-ending) .core-stat strong {
  display: none;
}

.phone.debug-mode .stage-panel:not(.is-ending) .core-stat {
  padding-right: 28px;
}

.phone.debug-mode .stage-panel:not(.is-ending) .core-stat::before {
  right: 28px;
}

.phone.debug-mode .stage-panel:not(.is-ending) .core-stat::after {
  width: calc(100% - 86px);
}

.phone.debug-mode .stage-panel:not(.is-ending) .core-stat strong {
  position: absolute;
  right: 7px;
  top: 50%;
  display: block;
  transform: translateY(-50%);
  margin: 0;
  font-size: 10px;
  line-height: 1;
}

.stage-panel:not(.is-ending) .role-plate {
  min-width: 118px;
  max-width: 152px;
  padding: 8px 10px 8px 12px;
}

.stage-panel:not(.is-ending) .role-plate i {
  display: none;
}

.stage-panel:not(.is-ending) .role-figure[data-stage-slot="left-solo"] {
  left: 2px;
  right: auto;
  top: 202px;
  width: 176px;
  height: 206px;
}

.stage-panel:not(.is-ending) .role-figure[data-stage-slot="right-lead"] {
  left: auto;
  right: 4px;
  top: 106px;
  width: 176px;
  height: 206px;
}

.stage-panel:not(.is-ending) .role-figure[data-stage-slot="right-support"],
.stage-panel:not(.is-ending) .role-figure[data-stage-slot="right-extra"] {
  left: auto;
  right: 10px;
  top: 244px;
  width: 152px;
  height: 176px;
}

.stage-panel:not(.is-ending) .role-figure[data-stage-slot="left-solo"] .role-plate {
  left: 46px;
  right: auto;
  bottom: 24px;
}

.stage-panel:not(.is-ending) .role-figure[data-stage-slot="right-lead"] .role-plate {
  left: auto;
  right: 84px;
  bottom: 42px;
}

.stage-panel:not(.is-ending) .role-figure[data-stage-slot="right-support"] .role-plate,
.stage-panel:not(.is-ending) .role-figure[data-stage-slot="right-extra"] .role-plate {
  left: auto;
  right: 48px;
  bottom: 30px;
}

@media (max-width: 480px) {
  .stage-panel:not(.is-ending) .core-hud {
    left: 10px;
    top: 94px;
    width: 146px;
  }

  .stage-panel:not(.is-ending) .role-plate {
    min-width: 114px;
    max-width: 148px;
    padding: 7px 9px 7px 11px;
  }

  .stage-panel:not(.is-ending) .role-figure[data-stage-slot="left-solo"] {
    left: 2px;
    top: 184px;
    width: 168px;
    height: 198px;
  }

  .stage-panel:not(.is-ending) .role-figure[data-stage-slot="right-lead"] {
    right: 4px;
    top: 82px;
    width: 168px;
    height: 198px;
  }

  .stage-panel:not(.is-ending) .role-figure[data-stage-slot="right-support"],
  .stage-panel:not(.is-ending) .role-figure[data-stage-slot="right-extra"] {
    right: 8px;
    top: 224px;
    width: 148px;
    height: 170px;
  }

  .stage-panel:not(.is-ending) .role-figure[data-stage-slot="left-solo"] .role-plate {
    left: 44px;
    bottom: 22px;
  }

  .stage-panel:not(.is-ending) .role-figure[data-stage-slot="right-lead"] .role-plate {
    right: 82px;
    bottom: 40px;
  }

  .stage-panel:not(.is-ending) .role-figure[data-stage-slot="right-support"] .role-plate,
  .stage-panel:not(.is-ending) .role-figure[data-stage-slot="right-extra"] .role-plate {
    right: 46px;
    bottom: 28px;
  }
}

/* Scene selector: a small in-world book, not a separate landing page. */
.topbar {
  min-height: 112px;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(6, 5, 4, 0.9), rgba(6, 5, 4, 0.32) 72%, transparent),
    linear-gradient(90deg, rgba(8, 6, 5, 0.82), rgba(53, 36, 22, 0.4) 34%, rgba(53, 36, 22, 0.34) 66%, rgba(8, 6, 5, 0.76));
}

.topbar::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  height: 84px;
  border-top: 1px solid rgba(231, 189, 114, 0.22);
  border-bottom: 1px solid rgba(231, 189, 114, 0.1);
  background:
    radial-gradient(ellipse at 50% 24%, rgba(231, 189, 114, 0.16), transparent 42%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.16), rgba(126, 76, 36, 0.12) 28%, rgba(126, 76, 36, 0.08) 68%, rgba(0, 0, 0, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 235, 178, 0.06);
  pointer-events: none;
}

.brand-block {
  position: absolute;
  left: 14px;
  top: 18px;
  z-index: 9;
  display: grid;
  width: 138px;
  grid-template-rows: 26px 42px;
  gap: 6px;
  justify-items: start;
}

.brand-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.brand-block .brand-title {
  position: static;
  display: block;
  width: 138px;
  max-width: 138px;
  height: 31px;
  overflow: visible;
  color: #c9a46b;
  font-size: clamp(23px, calc(134px / var(--title-chars, 3)), 30px);
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(39, 21, 8, 0.72), 0 4px 14px rgba(0, 0, 0, 0.86);
}

.round-hud {
  position: absolute;
  left: 50%;
  top: 24px;
  z-index: 9;
  width: 150px;
  margin: 0;
  transform: translateX(-50%);
}

.round-hud b {
  font-size: 18px;
  letter-spacing: 0;
}

.danger-meter {
  grid-template-columns: 34px 1fr;
  gap: 7px;
  margin-top: 8px;
  padding: 4px 7px 5px;
  border: 1px solid rgba(231, 189, 114, 0.18);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(12, 9, 7, 0.68), rgba(5, 4, 3, 0.46));
  box-shadow: inset 0 1px 0 rgba(255, 231, 178, 0.06), 0 5px 16px rgba(0, 0, 0, 0.16);
}

.danger-meter span {
  text-align: right;
  font-size: 12px;
}

.danger-meter em {
  height: 8px;
  background: rgba(5, 4, 3, 0.76);
}

.war-button {
  top: 18px;
}

.scene-focus {
  top: 94px;
  left: 176px;
  right: 12px;
  z-index: 10;
  justify-content: flex-end;
}

.scene-focus b {
  max-width: 100%;
  border: 1px solid rgba(231, 189, 114, 0.22);
  background:
    linear-gradient(90deg, rgba(8, 6, 5, 0.05), rgba(16, 11, 8, 0.76) 14%, rgba(16, 11, 8, 0.84) 86%, rgba(8, 6, 5, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 235, 178, 0.06), 0 5px 14px rgba(0, 0, 0, 0.28);
}

.scene-book-button {
  min-height: 26px;
  border: 1px solid rgba(231, 189, 114, 0.3);
  background:
    linear-gradient(180deg, rgba(68, 45, 24, 0.78), rgba(16, 12, 9, 0.82));
  color: #efcf8d;
  cursor: pointer;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 900;
  clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%, 0 6px);
}

.account-button {
  min-height: 26px;
  border: 1px solid rgba(95, 155, 216, 0.34);
  background:
    linear-gradient(180deg, rgba(37, 58, 69, 0.78), rgba(11, 13, 14, 0.82));
  color: #cde4f4;
  cursor: pointer;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
  clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%, 0 6px);
}

.account-button.bound {
  border-color: rgba(83, 200, 120, 0.4);
  color: #c7f0cf;
}

.scene-drawer {
  position: absolute;
  inset: 0;
  z-index: 42;
  display: none;
  place-items: end center;
  padding: 18px;
}

.scene-drawer.open {
  display: grid;
}

.scene-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(231, 189, 114, 0.1), transparent 30%),
    rgba(0, 0, 0, 0.62);
}

.scene-sheet {
  position: relative;
  width: 100%;
  max-height: min(620px, calc(100vh - 54px));
  overflow: hidden auto;
  border: 1px solid rgba(231, 189, 114, 0.34);
  background:
    linear-gradient(180deg, rgba(37, 25, 16, 0.98), rgba(8, 7, 6, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.22),
    0 -18px 48px rgba(0, 0, 0, 0.64);
  padding: 14px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.scene-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.scene-sheet-head span {
  color: #e7bd72;
  font-size: 12px;
  font-weight: 900;
}

.scene-sheet-head strong {
  display: block;
  margin-top: 3px;
  color: #f4e1bd;
  font-size: 16px;
  line-height: 1.15;
}

.scene-list {
  display: grid;
  gap: 10px;
}

.scene-card {
  position: relative;
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 86px;
  border: 1px solid rgba(231, 189, 114, 0.26);
  background:
    linear-gradient(135deg, rgba(40, 32, 23, 0.92), rgba(12, 10, 8, 0.94));
  color: #ead8b9;
  cursor: pointer;
  padding: 12px 14px;
  text-align: left;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.scene-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 3px;
  background: rgba(231, 189, 114, 0.66);
}

.scene-card.active {
  border-color: rgba(83, 200, 120, 0.44);
  background:
    linear-gradient(135deg, rgba(34, 54, 36, 0.92), rgba(10, 13, 10, 0.95));
  cursor: default;
}

.scene-card span {
  color: #e7bd72;
  font-size: 11px;
  font-weight: 900;
}

.scene-card.active span {
  color: #8fdda0;
}

.scene-card.locked {
  border-color: rgba(164, 121, 62, 0.28);
  background:
    linear-gradient(135deg, rgba(38, 34, 27, 0.82), rgba(11, 10, 9, 0.95));
  color: rgba(234, 216, 185, 0.74);
}

.scene-card.locked::before {
  background: rgba(147, 109, 60, 0.72);
}

.scene-card.locked::after {
  content: "锁";
  position: absolute;
  right: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(231, 189, 114, 0.28);
  border-radius: 999px;
  background: rgba(13, 11, 9, 0.68);
  color: rgba(231, 189, 114, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.scene-card.locked span {
  color: #b99a65;
}

.scene-card.locked strong {
  color: rgba(246, 228, 194, 0.78);
  padding-right: 36px;
}

.scene-card.locked p {
  color: rgba(221, 204, 174, 0.58);
}

.scene-card em {
  justify-self: start;
  margin-top: 2px;
  border: 1px solid rgba(231, 189, 114, 0.26);
  background: rgba(68, 43, 22, 0.42);
  color: #f0cf8b;
  padding: 4px 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.scene-card .scene-progress {
  background: rgba(18, 14, 10, 0.46);
  color: #d6b06d;
}

.ending-library {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(231, 189, 114, 0.16);
  display: grid;
  gap: 8px;
}

.ending-library-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.ending-library-head span {
  color: #e7bd72;
  font-size: 12px;
  font-weight: 900;
}

.ending-library-head strong {
  color: rgba(238, 222, 192, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.ending-library-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  border: 1px solid rgba(231, 189, 114, 0.2);
  background: rgba(10, 8, 7, 0.48);
  color: #ead8b9;
  cursor: pointer;
  padding: 0 12px;
  text-align: left;
}

.ending-library-row span {
  font-size: 13px;
  font-weight: 900;
}

.ending-library-row strong {
  min-width: 42px;
  border: 1px solid rgba(231, 189, 114, 0.24);
  border-radius: 999px;
  color: #f4d68e;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 8px;
  text-align: center;
}

.ending-gallery-modal {
  position: absolute;
  inset: 0;
  z-index: 48;
  display: grid;
  place-items: center;
  padding: 20px;
}

.ending-gallery-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 34%, rgba(231, 189, 114, 0.12), transparent 35%),
    rgba(0, 0, 0, 0.68);
}

.ending-gallery-sheet {
  position: relative;
  width: min(366px, 100%);
  max-height: min(650px, calc(100vh - 48px));
  overflow: hidden auto;
  border: 1px solid rgba(231, 189, 114, 0.34);
  background:
    linear-gradient(180deg, rgba(34, 24, 17, 0.98), rgba(8, 7, 6, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.18),
    0 22px 52px rgba(0, 0, 0, 0.68);
  padding: 14px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.ending-gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ending-gallery-head span {
  color: #e7bd72;
  font-size: 12px;
  font-weight: 900;
}

.ending-gallery-head strong {
  display: block;
  margin-top: 3px;
  color: #f4e1bd;
  font-size: 17px;
  line-height: 1.15;
}

.ending-gallery-head button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  border: 1px solid rgba(231, 189, 114, 0.26);
  border-radius: 999px;
  background: rgba(10, 8, 7, 0.56);
  color: #f2d190;
  font-size: 22px;
}

.ending-gallery-list {
  display: grid;
  gap: 8px;
}

.ending-gallery-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  min-height: 78px;
  border: 1px solid rgba(231, 189, 114, 0.16);
  background: rgba(10, 8, 7, 0.46);
  padding: 10px;
}

.ending-gallery-item i {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(231, 189, 114, 0.22);
  border-radius: 999px;
  color: #bfa36f;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.ending-gallery-item.unlocked {
  border-color: rgba(231, 189, 114, 0.3);
  background:
    linear-gradient(90deg, rgba(68, 43, 22, 0.34), rgba(10, 8, 7, 0.5));
}

.ending-gallery-item.unlocked i {
  background: rgba(68, 43, 22, 0.42);
  color: #f4d68e;
}

.ending-gallery-item strong {
  display: block;
  color: #ead8b9;
  font-size: 14px;
  line-height: 1.2;
}

.ending-gallery-item.locked strong {
  color: rgba(234, 216, 185, 0.48);
}

.ending-gallery-item p {
  margin-top: 5px;
  color: rgba(221, 204, 174, 0.66);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.38;
}

.ending-gallery-item p em {
  display: inline-block;
  margin-right: 6px;
  border: 1px solid rgba(231, 189, 114, 0.22);
  background: rgba(68, 43, 22, 0.34);
  color: #d6b46f;
  padding: 1px 5px;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.4;
}

.scene-card strong {
  color: #f6e4c2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.05;
}

.scene-card p {
  color: rgba(238, 222, 192, 0.76);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.unlock-modal {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
}

.unlock-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(231, 189, 114, 0.12), transparent 34%),
    rgba(0, 0, 0, 0.66);
}

.unlock-sheet {
  position: relative;
  width: min(360px, 100%);
  border: 1px solid rgba(231, 189, 114, 0.34);
  background:
    linear-gradient(180deg, rgba(36, 25, 17, 0.98), rgba(8, 7, 6, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.2),
    0 22px 48px rgba(0, 0, 0, 0.64);
  padding: 14px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.unlock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.unlock-head span {
  color: #e7bd72;
  font-size: 12px;
  font-weight: 900;
}

.unlock-head button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(231, 189, 114, 0.22);
  border-radius: 999px;
  background: rgba(10, 8, 7, 0.62);
  color: #ead8b9;
  font-size: 18px;
  line-height: 1;
}

.unlock-title {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(231, 189, 114, 0.06);
}

.unlock-title i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(231, 189, 114, 0.34);
  border-radius: 999px;
  background: rgba(13, 11, 9, 0.7);
  color: #e7bd72;
  font-style: normal;
  font-weight: 900;
}

.unlock-title strong {
  color: #f6e4c2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.05;
}

.unlock-title p,
.unlock-copy {
  margin: 0;
  color: rgba(238, 222, 192, 0.76);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.45;
}

.unlock-title p {
  margin-top: 4px;
}

.unlock-copy {
  margin-top: 12px;
}

.unlock-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.unlock-benefits span {
  border: 1px solid rgba(231, 189, 114, 0.22);
  background: rgba(68, 43, 22, 0.4);
  color: #f0cf8b;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 900;
}

.unlock-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.unlock-actions button {
  min-height: 40px;
  border: 0;
  background: rgba(64, 42, 24, 0.92);
  color: #e9cf97;
  cursor: pointer;
  padding: 8px;
  font-size: 13px;
  font-weight: 900;
  clip-path: polygon(7px 0, 100% 0, 100% 100%, 0 100%, 0 7px);
}

.unlock-actions button:first-child {
  background: linear-gradient(180deg, rgba(150, 50, 38, 0.96), rgba(75, 25, 20, 0.98));
  color: #fff1cf;
}

.unlock-actions button:disabled {
  background:
    linear-gradient(180deg, rgba(58, 51, 44, 0.78), rgba(23, 21, 19, 0.9));
  color: rgba(234, 216, 185, 0.44);
  cursor: default;
}

.login-modal {
  position: absolute;
  inset: 0;
  z-index: 56;
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 36%, rgba(95, 155, 216, 0.16), transparent 36%),
    rgba(0, 0, 0, 0.68);
}

.login-sheet {
  position: relative;
  width: min(360px, 100%);
  border: 1px solid rgba(135, 178, 210, 0.34);
  background:
    linear-gradient(180deg, rgba(30, 38, 40, 0.98), rgba(8, 8, 7, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(205, 228, 244, 0.16),
    0 22px 48px rgba(0, 0, 0, 0.66);
  padding: 14px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.login-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.login-head span {
  color: #cde4f4;
  font-size: 12px;
  font-weight: 900;
}

.login-head button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(205, 228, 244, 0.22);
  border-radius: 999px;
  background: rgba(10, 8, 7, 0.62);
  color: #eaf2f6;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.login-title {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(95, 155, 216, 0.08);
}

.login-title i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(135, 178, 210, 0.4);
  border-radius: 999px;
  background: rgba(8, 11, 12, 0.72);
  color: #cde4f4;
  font-style: normal;
  font-weight: 900;
}

.login-title strong {
  color: #f2e5c9;
  font-size: 20px;
  line-height: 1.1;
}

.login-title p,
.login-message,
.login-error {
  margin: 0;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.45;
}

.login-title p {
  margin-top: 4px;
  color: rgba(238, 222, 192, 0.76);
}

.login-account-summary {
  margin-top: 12px;
  border: 1px solid rgba(205, 228, 244, 0.18);
  background: rgba(8, 9, 9, 0.48);
  padding: 4px 12px;
}

.login-account-summary dl {
  margin: 0;
}

.login-account-summary div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  border-bottom: 1px solid rgba(238, 222, 192, 0.08);
}

.login-account-summary div:last-child {
  border-bottom: 0;
}

.login-account-summary dt,
.login-account-summary dd {
  margin: 0;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.login-account-summary dt {
  color: rgba(238, 222, 192, 0.66);
}

.login-account-summary dd {
  color: #f6efe2;
  text-align: right;
  overflow-wrap: anywhere;
}

.login-field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.login-field span {
  color: rgba(238, 222, 192, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.login-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(205, 228, 244, 0.24);
  border-radius: 4px;
  background: rgba(7, 8, 8, 0.72);
  color: #f6efe2;
  outline: none;
  padding: 8px 10px;
}

.login-field input:focus {
  border-color: rgba(95, 155, 216, 0.72);
  box-shadow: 0 0 0 2px rgba(95, 155, 216, 0.14);
}

.login-code-row {
  display: grid;
  grid-template-columns: 1fr 74px;
  gap: 8px;
  align-items: end;
}

.login-code-row button,
.login-dev-code,
.login-actions button {
  min-height: 40px;
  border: 0;
  background: rgba(41, 62, 70, 0.92);
  color: #d7edf8;
  cursor: pointer;
  padding: 8px;
  font-size: 13px;
  font-weight: 900;
  clip-path: polygon(7px 0, 100% 0, 100% 100%, 0 100%, 0 7px);
}

.login-code-row button:disabled,
.login-actions button:disabled {
  background: rgba(45, 48, 47, 0.8);
  color: rgba(238, 222, 192, 0.46);
  cursor: default;
}

.login-dev-code {
  width: 100%;
  margin-top: 10px;
  border: 1px dashed rgba(231, 189, 114, 0.4);
  background: rgba(77, 55, 23, 0.58);
  color: #f0cf8b;
}

.login-message {
  margin-top: 10px;
  color: #c7f0cf;
}

.login-error {
  margin-top: 10px;
  color: #ffd0c9;
}

.login-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.login-actions button:first-child {
  background: linear-gradient(180deg, rgba(52, 104, 128, 0.96), rgba(22, 52, 66, 0.98));
  color: #f5fbff;
}

.login-actions button[data-action="logout-account"] {
  background: rgba(45, 48, 47, 0.82);
  color: rgba(238, 222, 192, 0.78);
}

.sponsor-sheet {
  background:
    linear-gradient(180deg, rgba(35, 28, 18, 0.98), rgba(8, 8, 6, 0.98));
}

.sponsor-title i {
  color: #f0cf8b;
}

.sponsor-reading-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.sponsor-reading-list article {
  border: 1px solid rgba(231, 189, 114, 0.18);
  background: rgba(9, 8, 7, 0.46);
  padding: 9px 10px;
}

.sponsor-reading-list strong {
  display: block;
  color: #f6e4c2;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.sponsor-reading-list p {
  margin-top: 4px;
  color: rgba(238, 222, 192, 0.72);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.42;
}

.sponsor-actions {
  grid-template-columns: 1fr 1fr;
}

.sponsor-actions button:first-child {
  background: linear-gradient(180deg, rgba(104, 64, 29, 0.96), rgba(52, 34, 18, 0.98));
}

.ledger-modal {
  position: absolute;
  inset: 0;
  z-index: 52;
  display: grid;
  place-items: center;
  padding: 18px;
}

.ledger-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(231, 189, 114, 0.1), transparent 34%),
    rgba(0, 0, 0, 0.68);
}

.ledger-sheet {
  position: relative;
  width: min(372px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: hidden auto;
  border: 1px solid rgba(231, 189, 114, 0.34);
  background:
    linear-gradient(180deg, rgba(34, 25, 18, 0.98), rgba(8, 7, 6, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.2),
    0 22px 48px rgba(0, 0, 0, 0.64);
  padding: 14px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.ledger-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.ledger-head span,
.ledger-section > span {
  color: #e7bd72;
  font-size: 12px;
  font-weight: 900;
}

.ledger-head strong {
  display: block;
  margin-top: 3px;
  color: #f4e1bd;
  font-size: 16px;
  line-height: 1.15;
}

.ledger-head button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(231, 189, 114, 0.22);
  border-radius: 999px;
  background: rgba(10, 8, 7, 0.62);
  color: #ead8b9;
  font-size: 18px;
  line-height: 1;
}

.person-profile-modal {
  position: absolute;
  inset: 0;
  z-index: 54;
  display: grid;
  place-items: center;
  padding: 18px;
}

.person-profile-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 38%, rgba(231, 189, 114, 0.12), transparent 34%),
    rgba(0, 0, 0, 0.7);
}

.person-profile-sheet {
  position: relative;
  width: min(372px, 100%);
  max-height: min(680px, calc(100vh - 40px));
  overflow: hidden auto;
  border: 1px solid rgba(231, 189, 114, 0.34);
  background:
    linear-gradient(180deg, rgba(38, 27, 17, 0.98), rgba(9, 8, 6, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.2),
    0 24px 56px rgba(0, 0, 0, 0.68);
  padding: 14px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.person-profile-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.person-profile-head span {
  color: #e7bd72;
  font-size: 12px;
  font-weight: 900;
}

.person-profile-head strong {
  display: block;
  margin-top: 3px;
  color: #f4e1bd;
  font-size: 20px;
  line-height: 1.12;
}

.person-profile-head em {
  display: block;
  margin-top: 4px;
  color: rgba(234, 216, 185, 0.68);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.person-profile-head button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: 1px solid rgba(231, 189, 114, 0.22);
  border-radius: 999px;
  background: rgba(10, 8, 7, 0.62);
  color: #ead8b9;
  font-size: 20px;
  line-height: 1;
}

.person-profile-body {
  padding: 12px 13px;
  border: 1px solid rgba(231, 189, 114, 0.14);
  background:
    linear-gradient(180deg, rgba(21, 15, 10, 0.62), rgba(9, 7, 6, 0.56));
}

.person-profile-body p {
  margin: 0;
  color: rgba(244, 225, 189, 0.86);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.7;
}

.ledger-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ledger-metrics div {
  min-height: 56px;
  border: 1px solid rgba(231, 189, 114, 0.18);
  background: rgba(231, 189, 114, 0.06);
  padding: 8px;
}

.ledger-metrics span {
  color: rgba(238, 222, 192, 0.72);
  font-size: 11px;
  font-weight: 800;
}

.ledger-metrics strong {
  display: block;
  margin-top: 4px;
  color: #f6e4c2;
  font-size: 22px;
  line-height: 1;
}

.ledger-section {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  border-top: 1px solid rgba(231, 189, 114, 0.14);
  padding-top: 10px;
}

.ledger-section p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0;
  background: rgba(255, 255, 255, 0.04);
  padding: 7px 8px;
}

.ledger-section b {
  color: #ead8b9;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ledger-section small {
  max-width: 150px;
  color: rgba(238, 222, 192, 0.6);
  font-size: 10px;
  font-weight: 750;
  text-align: right;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ledger-section.recent p {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.ledger-section.recent small {
  max-width: none;
}

.ledger-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.ledger-actions button {
  min-height: 38px;
  border: 0;
  background: rgba(64, 42, 24, 0.92);
  color: #e9cf97;
  cursor: pointer;
  padding: 8px;
  font-size: 12px;
  font-weight: 900;
  clip-path: polygon(7px 0, 100% 0, 100% 100%, 0 100%, 0 7px);
}

.ledger-actions button:first-child {
  background: linear-gradient(180deg, rgba(93, 39, 31, 0.96), rgba(40, 21, 18, 0.98));
}

@media (max-width: 420px) {
  .topbar {
    min-height: 110px;
  }

  .topbar::before {
    left: 6px;
    right: 6px;
    top: 7px;
    height: 84px;
  }

  .brand-block {
    left: 12px;
    width: 106px;
    grid-template-rows: 26px 42px;
  }

  .brand-block .brand-title {
    width: 106px;
    max-width: 106px;
    height: 31px;
    font-size: clamp(21px, calc(106px / var(--title-chars, 3)), 27px);
  }

  .round-hud {
    top: 24px;
    width: 144px;
  }

  .danger-meter {
    margin-top: 7px;
  }

  .war-button {
    top: 18px;
  }

  .scene-focus {
    top: 94px;
    left: 164px;
    right: 12px;
    justify-content: flex-end;
  }

  .scene-focus b {
    max-width: 100%;
  }

  .scene-book-button {
    min-height: 24px;
    padding: 0 9px;
  }
}

/* Commercial reserve slots: post-game only, styled as in-world recommendations. */
.sponsor-slot,
.locked-offer {
  position: relative;
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 13px 14px 14px;
  border: 1px solid rgba(211, 169, 93, 0.34);
  background:
    linear-gradient(135deg, rgba(54, 38, 23, 0.86), rgba(17, 14, 11, 0.94));
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.36);
}
.sponsor-slot::before,
.locked-offer::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 3px;
  background: rgba(236, 193, 101, 0.78);
}

.sponsor-slot span,
.locked-offer span {
  color: #f2c96f;
  font-size: 12px;
  font-weight: 850;
}

.sponsor-slot strong,
.locked-offer strong {
  color: #f6e4c2;
  font-size: 16px;
  line-height: 1.2;
}

.sponsor-slot p,
.locked-offer p {
  margin: 0;
  color: rgba(238, 222, 192, 0.78);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.sponsor-slot button,
.locked-offer button {
  justify-self: start;
  min-height: 36px;
  border: 1px solid rgba(227, 187, 106, 0.45);
  background: rgba(68, 43, 22, 0.82);
  color: #f7ddb1;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 850;
}

.sponsor-slot {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.sponsor-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.sponsor-slot small {
  display: block;
  color: rgba(197, 178, 145, 0.62);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.35;
}

.sponsor-slot button {
  min-width: 76px;
  min-height: 34px;
}

@media (max-width: 420px) {
  .sponsor-slot {
    grid-template-columns: 1fr;
  }

  .sponsor-slot button {
    justify-self: stretch;
  }
}

.locked-offer {
  background:
    linear-gradient(135deg, rgba(43, 48, 38, 0.86), rgba(14, 15, 12, 0.94));
}

.postgame-extras {
  position: relative;
  margin-top: 14px;
  padding: 0 12px 9px;
  background:
    linear-gradient(180deg, rgba(38, 28, 18, 0.58), rgba(11, 9, 7, 0.7));
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.22),
    inset 0 -1px 0 rgba(231, 189, 114, 0.1);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.postgame-extras::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 189, 114, 0.56), transparent);
}

.postgame-extras-body {
  display: grid;
  gap: 0;
}

.postgame-extras .postgame-row,
.postgame-extras .sponsor-slot,
.postgame-extras .locked-offer {
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  clip-path: none;
}

.postgame-extras .postgame-row,
.postgame-extras .sponsor-slot {
  border-bottom: 1px solid rgba(231, 189, 114, 0.11);
}

.postgame-extras .ending-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 0;
}

.postgame-extras .true-history-note {
  padding: 10px 0;
}

.true-history-note summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.true-history-note summary::-webkit-details-marker {
  display: none;
}

.true-history-note summary span,
.true-history-body span {
  color: #e7bd72;
  font-size: 11px;
  font-weight: 900;
}

.true-history-note summary strong {
  display: block;
  margin-top: 3px;
  color: #f3dfb8;
  font-size: 14px;
  line-height: 1.18;
}

.true-history-note summary em {
  color: rgba(244, 225, 189, 0.72);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.true-history-note[open] .when-closed,
.true-history-note:not([open]) .when-open {
  display: none;
}

.true-history-body {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.true-history-body p {
  margin: 0;
  color: rgba(244, 225, 189, 0.84);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.55;
}

.true-history-body p span {
  display: block;
  margin-bottom: 3px;
}

.postgame-extras .ending-progress div {
  min-width: 0;
}

.postgame-extras .ending-progress p {
  margin-top: 3px;
  font-size: 11px;
}

.postgame-extras .ending-progress strong {
  align-self: center;
}

.postgame-extras .sponsor-slot,
.postgame-extras .locked-offer {
  padding: 10px 0;
}

.postgame-extras .sponsor-slot {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 0;
}

.postgame-extras .sponsor-slot .sponsor-copy {
  gap: 2px;
}

.postgame-extras .locked-offer {
  padding-bottom: 2px;
}

.postgame-extras .sponsor-slot::before,
.postgame-extras .locked-offer::before {
  display: none;
}

.postgame-extras .sponsor-slot strong,
.postgame-extras .locked-offer strong {
  font-size: 14px;
}

.postgame-extras .sponsor-slot strong {
  white-space: normal;
}

.postgame-extras .sponsor-slot p,
.postgame-extras .locked-offer p {
  font-size: 11.5px;
}

.postgame-extras .sponsor-slot p,
.postgame-extras .sponsor-slot small {
  display: none;
}

.postgame-extras .sponsor-slot button,
.postgame-extras .locked-offer button {
  border: 1px solid rgba(231, 189, 114, 0.24);
  background:
    linear-gradient(180deg, rgba(69, 45, 24, 0.86), rgba(31, 21, 13, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 228, 168, 0.13);
  clip-path: polygon(7px 0, 100% 0, 100% 100%, 0 100%, 0 7px);
}

.postgame-extras .locked-offer button {
  background:
    linear-gradient(180deg, rgba(57, 68, 43, 0.84), rgba(23, 28, 18, 0.92));
}

.postgame-extras .sponsor-slot button {
  min-width: 72px;
  min-height: 30px;
  justify-self: end;
}

@media (max-width: 420px) {
  .postgame-extras {
    padding: 0 11px 9px;
  }
}

/* Intel drawer polish: action history reads as an in-world dispatch, not a debug log. */
.intel-sheet .strategy-review {
  position: relative;
  margin-top: 12px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(38, 28, 18, 0.62), rgba(8, 7, 6, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.2),
    inset 0 -1px 0 rgba(231, 189, 114, 0.1);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  padding: 11px 10px 10px;
}

.intel-sheet .strategy-review::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 189, 114, 0.52), transparent);
}

.intel-sheet .review-head {
  margin-bottom: 9px;
}

.intel-sheet .review-head strong {
  color: #f0c36d;
  font-size: 13px;
}

.intel-sheet .review-head small {
  color: rgba(234, 216, 185, 0.58);
  font-size: 10.5px;
  font-weight: 850;
}

.intel-sheet .review-list {
  gap: 0;
}

.intel-sheet .review-step {
  position: relative;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border-radius: 0;
  border-top: 1px solid rgba(231, 189, 114, 0.1);
  background: transparent;
  padding: 7px 0;
}

.intel-sheet .review-step:first-child {
  border-top-color: rgba(231, 189, 114, 0.16);
}

.intel-sheet .review-step i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(83, 200, 120, 0.38);
  border-radius: 999px;
  background: rgba(18, 42, 25, 0.72);
  color: #a8e8b0;
  font-size: 11px;
  font-weight: 900;
}

.intel-sheet .review-step.fail i {
  border-color: rgba(228, 93, 79, 0.42);
  background: rgba(72, 24, 20, 0.72);
  color: #ef9b8d;
}

.intel-sheet .review-step.fail {
  background: linear-gradient(90deg, rgba(99, 28, 21, 0.16), transparent 62%);
}

.intel-sheet .review-step span {
  white-space: normal;
  color: #ead8b9;
  font-size: 11.5px;
  font-weight: 850;
  line-height: 1.28;
}

.intel-sheet .review-deltas {
  grid-column: 2;
  margin-top: 3px;
}

.intel-sheet .review-deltas b {
  border: 1px solid rgba(231, 189, 114, 0.14);
  background: rgba(12, 10, 8, 0.52);
  padding: 2px 6px;
  font-size: 9.5px;
}

/* Scene drawer polish: scene entries read like history slips instead of generic cards. */
.scene-sheet .scene-list {
  gap: 8px;
}

.scene-sheet .scene-card {
  grid-template-columns: 54px minmax(0, 1fr) auto;
  grid-template-areas:
    "status title progress"
    "status copy progress";
  align-items: center;
  min-height: 78px;
  gap: 4px 10px;
  padding: 10px 12px 10px 10px;
  background:
    linear-gradient(90deg, rgba(60, 40, 22, 0.42), rgba(13, 10, 8, 0.94) 34%, rgba(17, 12, 9, 0.96)),
    linear-gradient(180deg, rgba(231, 189, 114, 0.08), transparent 42%);
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.scene-sheet .scene-card::before {
  width: 1px;
  height: auto;
  left: 62px;
  top: 10px;
  bottom: 10px;
  background: linear-gradient(180deg, transparent, rgba(231, 189, 114, 0.38), transparent);
}

.scene-sheet .scene-card span {
  grid-area: status;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(231, 189, 114, 0.34);
  border-radius: 999px;
  background: rgba(14, 11, 8, 0.68);
  color: #f0c36d;
  font-size: 10.5px;
  line-height: 1.05;
  text-align: center;
}

.scene-sheet .scene-card strong {
  grid-area: title;
  min-width: 0;
  color: #f4e1bd;
  font-size: 15px;
  line-height: 1.12;
  padding-right: 0;
}

.scene-sheet .scene-card p {
  grid-area: copy;
  min-width: 0;
  margin: 0;
  color: rgba(234, 216, 185, 0.68);
  font-size: 11.5px;
  font-weight: 760;
  line-height: 1.34;
}

.scene-sheet .scene-card em {
  grid-area: progress;
  align-self: center;
  justify-self: end;
  max-width: 76px;
  margin: 0;
  border-radius: 999px;
  background: rgba(12, 10, 8, 0.58);
  padding: 5px 8px;
  text-align: center;
  line-height: 1.15;
}

.scene-sheet .scene-card.active {
  background:
    linear-gradient(90deg, rgba(32, 65, 40, 0.44), rgba(10, 13, 10, 0.95) 34%, rgba(12, 15, 11, 0.96)),
    linear-gradient(180deg, rgba(83, 200, 120, 0.08), transparent 42%);
}

.scene-sheet .scene-card.active span {
  border-color: rgba(83, 200, 120, 0.42);
  color: #a8e8b0;
}

.scene-sheet .scene-card.locked {
  background:
    linear-gradient(90deg, rgba(47, 38, 28, 0.4), rgba(10, 9, 8, 0.95) 34%, rgba(11, 10, 9, 0.96));
}

.scene-sheet .scene-card.locked span {
  color: #c2a06a;
}

.scene-sheet .scene-card.locked strong {
  color: rgba(246, 228, 194, 0.78);
  padding-right: 32px;
}

.scene-sheet .scene-card.locked::after {
  right: 10px;
  top: 9px;
  width: 24px;
  height: 24px;
  font-size: 11px;
}

@media (max-width: 420px) {
  .scene-sheet .scene-card {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas:
      "status title"
      "status copy"
      "status progress";
    min-height: 88px;
  }

  .scene-sheet .scene-card::before {
    left: 56px;
  }

  .scene-sheet .scene-card em {
    justify-self: start;
    max-width: none;
    margin-top: 2px;
  }
}

/* Commercial modal polish: unlock/sponsor sheets read as sealed in-world notices. */
.unlock-modal {
  padding: 18px;
}

.unlock-backdrop {
  background:
    radial-gradient(circle at 50% 35%, rgba(231, 189, 114, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.78));
}

.unlock-sheet {
  width: min(368px, 100%);
  border: 0;
  background:
    linear-gradient(180deg, rgba(46, 31, 19, 0.98), rgba(9, 8, 6, 0.98)),
    url("data:image/svg+xml,%3Csvg width='180' height='120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='2'/%3E%3C/filter%3E%3Crect width='180' height='120' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.24),
    inset 0 -1px 0 rgba(231, 189, 114, 0.12),
    0 24px 52px rgba(0, 0, 0, 0.66);
  padding: 15px;
}

.unlock-sheet::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 189, 114, 0.58), transparent);
}

.unlock-head {
  margin-bottom: 11px;
}

.unlock-head span {
  color: #f0c36d;
  font-size: 12px;
}

.unlock-head button {
  border-color: rgba(231, 189, 114, 0.28);
  background: rgba(12, 10, 8, 0.72);
}

.unlock-title {
  grid-template-columns: 48px minmax(0, 1fr);
  border: 1px solid rgba(231, 189, 114, 0.12);
  background:
    linear-gradient(90deg, rgba(80, 48, 24, 0.34), rgba(11, 9, 7, 0.44));
  box-shadow: inset 0 1px 0 rgba(231, 189, 114, 0.08);
  padding: 11px;
}

.unlock-title i {
  width: 44px;
  height: 44px;
  border-color: rgba(231, 189, 114, 0.4);
  background:
    radial-gradient(circle at 35% 24%, rgba(231, 189, 114, 0.2), transparent 42%),
    rgba(12, 10, 8, 0.74);
  color: #f0c36d;
}

.unlock-title strong {
  font-size: 22px;
}

.unlock-title p,
.unlock-copy {
  color: rgba(238, 222, 192, 0.78);
  font-size: 12px;
}

.unlock-copy {
  border-left: 2px solid rgba(231, 189, 114, 0.28);
  background: rgba(8, 7, 6, 0.36);
  padding: 9px 10px;
}

.unlock-support-copy {
  margin: 10px 0 0;
  color: rgba(246, 229, 190, 0.66);
  font-size: 12px;
  line-height: 1.45;
}

.unlock-support-copy a {
  color: #f0cf8b;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.unlock-benefits {
  gap: 7px;
}

.unlock-benefits span {
  border: 1px solid rgba(231, 189, 114, 0.2);
  background:
    linear-gradient(180deg, rgba(69, 45, 24, 0.58), rgba(18, 13, 9, 0.74));
  color: #edcf94;
  clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%, 0 6px);
}

.unlock-actions {
  gap: 9px;
}

.unlock-actions button {
  min-height: 42px;
  box-shadow: inset 0 1px 0 rgba(255, 228, 168, 0.13);
}

.unlock-actions button:first-child {
  background:
    linear-gradient(180deg, rgba(158, 54, 42, 0.98), rgba(88, 29, 22, 0.98));
}

.locked-scenario-gate {
  min-height: 100svh;
  justify-content: flex-start;
}

.unlock-gate-panel {
  width: min(100% - 28px, 560px);
  margin: clamp(34px, 11vw, 74px) auto 0;
  border: 1px solid rgba(231, 189, 114, 0.22);
  border-radius: 8px;
  padding: clamp(22px, 6vw, 34px);
  background:
    linear-gradient(180deg, rgba(24, 19, 14, 0.92), rgba(12, 10, 8, 0.96)),
    rgba(18, 14, 10, 0.94);
  color: #f7e8c2;
  text-align: center;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.32);
}

.unlock-gate-panel > span {
  display: block;
  margin-bottom: 8px;
  color: #d9a84d;
  font-size: 12px;
  font-weight: 800;
}

.unlock-gate-panel h1 {
  margin: 0;
  color: #fff2ca;
  font-size: clamp(24px, 7vw, 36px);
  line-height: 1.08;
  letter-spacing: 0;
}

.unlock-gate-panel p {
  margin: 14px auto 0;
  max-width: 34em;
  color: rgba(246, 229, 190, 0.78);
  font-size: 14px;
  line-height: 1.72;
}

.unlock-gate-panel .unlock-copy {
  text-align: left;
  font-size: 12px;
  line-height: 1.55;
}

.unlock-gate-panel .unlock-support-copy {
  margin-top: 10px;
  color: rgba(246, 229, 190, 0.66);
  font-size: 12px;
  line-height: 1.45;
}

.unlock-order-status {
  margin: 12px 0 0;
  color: rgba(246, 229, 190, 0.78);
  font-size: 13px;
  line-height: 1.5;
}

.unlock-order-status.is-ok {
  color: #8de0a1;
}

.unlock-order-status.is-error {
  color: #ff958a;
}

.sponsor-sheet {
  background:
    linear-gradient(180deg, rgba(42, 31, 18, 0.98), rgba(8, 8, 6, 0.98)),
    url("data:image/svg+xml,%3Csvg width='180' height='120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='2'/%3E%3C/filter%3E%3Crect width='180' height='120' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
}

.sponsor-reading-list article {
  border: 0;
  background:
    linear-gradient(90deg, rgba(58, 38, 20, 0.34), rgba(9, 8, 7, 0.5));
  box-shadow: inset 0 1px 0 rgba(231, 189, 114, 0.1);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}

@media (max-width: 420px) {
  .unlock-modal {
    padding: 14px;
  }

  .unlock-sheet {
    padding: 13px;
  }

  .unlock-actions {
    grid-template-columns: 1fr;
  }
}

/* Ending gallery polish: collected endings become fate records, locked ones become sealed hints. */
.ending-gallery-sheet {
  border: 0;
  background:
    linear-gradient(180deg, rgba(39, 27, 17, 0.98), rgba(8, 7, 6, 0.98)),
    url("data:image/svg+xml,%3Csvg width='180' height='120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='2'/%3E%3C/filter%3E%3Crect width='180' height='120' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.22),
    inset 0 -1px 0 rgba(231, 189, 114, 0.12),
    0 22px 52px rgba(0, 0, 0, 0.68);
}

.ending-gallery-sheet::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 189, 114, 0.58), transparent);
}

.ending-gallery-list {
  gap: 7px;
}

.ending-gallery-item {
  position: relative;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  min-height: 74px;
  border: 0;
  background:
    linear-gradient(90deg, rgba(52, 35, 19, 0.34), rgba(9, 8, 7, 0.58));
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.42);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.ending-gallery-item::before {
  content: "";
  position: absolute;
  left: 42px;
  top: 9px;
  bottom: 9px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(231, 189, 114, 0.24), transparent);
}

.ending-gallery-item i {
  align-self: center;
  width: 28px;
  height: 28px;
  background: rgba(16, 12, 8, 0.68);
}

.ending-gallery-item.unlocked {
  background:
    linear-gradient(90deg, rgba(73, 47, 22, 0.42), rgba(11, 9, 7, 0.62));
}

.ending-gallery-item.locked {
  background:
    linear-gradient(90deg, rgba(32, 29, 24, 0.4), rgba(8, 8, 7, 0.66));
}

.ending-gallery-status {
  display: inline-block;
  margin-bottom: 4px;
  border: 1px solid rgba(231, 189, 114, 0.2);
  background: rgba(68, 43, 22, 0.34);
  color: #d6b46f;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
}

.ending-gallery-item.unlocked .ending-gallery-status {
  border-color: rgba(83, 200, 120, 0.22);
  background: rgba(24, 53, 31, 0.42);
  color: #9ee0a5;
}

.ending-gallery-item.locked .ending-gallery-status {
  color: rgba(214, 180, 111, 0.58);
}

.ending-gallery-item strong {
  font-size: 13.5px;
}

.ending-gallery-item p {
  font-size: 11.5px;
}

/* Relation board: people grouped by stance instead of a line-heavy compass. */
.intel-sheet .relation-board {
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  max-height: var(--intel-relation-max-height);
  overflow: auto;
  border: 1px solid rgba(231, 189, 114, 0.14);
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 0, rgba(231, 189, 114, 0.12), transparent 30%),
    linear-gradient(160deg, rgba(18, 13, 9, 0.94), rgba(6, 6, 5, 0.96)),
    url("./assets/stages/hongmen-banquet-scene.png") center / cover;
  box-shadow:
    inset 0 1px 0 rgba(231, 189, 114, 0.12),
    inset 0 -1px 0 rgba(231, 189, 114, 0.08);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.relation-board-head {
  display: grid;
  gap: 3px;
}

.relation-board-head strong {
  color: #f5d88d;
  font-size: 13.5px;
  line-height: 1.1;
}

.relation-center {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: fit-content;
  max-width: 100%;
  padding: 7px 18px;
  border: 1px solid rgba(231, 189, 114, 0.22);
  border-radius: 7px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(89, 61, 30, 0.82), rgba(20, 14, 9, 0.9));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.relation-center[role="button"],
.relation-card[role="button"] {
  cursor: pointer;
  outline: none;
}

.relation-center[role="button"]:focus-visible,
.relation-center[role="button"]:hover,
.relation-card[role="button"]:focus-visible,
.relation-card[role="button"]:hover {
  border-color: rgba(246, 211, 136, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 181, 0.18),
    0 10px 22px rgba(0, 0, 0, 0.34);
}

.relation-center strong {
  color: #f6dfaa;
  font-size: 16px;
  line-height: 1.12;
}

.relation-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  align-items: start;
  gap: 6px;
}

.relation-group {
  display: grid;
  gap: 6px;
  padding: 0;
  border: 1px solid rgba(231, 189, 114, 0.12);
  background: transparent;
  border-color: transparent;
}

.relation-group header {
  display: grid;
  gap: 2px;
}

.relation-group header strong {
  color: #f0d49a;
  font-size: 13px;
  line-height: 1.15;
}

.relation-group > div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.relation-card {
  min-width: 0;
  display: grid;
  align-content: center;
  min-height: 42px;
  gap: 3px;
  padding: 7px 8px;
  border: 1px solid rgba(231, 189, 114, 0.12);
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(25, 17, 11, 0.86), rgba(8, 7, 6, 0.78));
}

.relation-card strong {
  color: #f2dfbb;
  font-size: 11.5px;
  line-height: 1.18;
}

.relation-card p {
  margin: 0;
  color: rgba(234, 216, 185, 0.68);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.25;
}

.relation-group.ally {
  border-color: transparent;
}

.relation-group.ally header strong,
.relation-card.ally p {
  color: #9ee0a5;
}

.relation-card.ally {
  border-color: rgba(83, 200, 120, 0.3);
  background:
    linear-gradient(90deg, rgba(15, 59, 32, 0.52), rgba(8, 7, 6, 0.8));
}

.relation-group.enemy {
  border-color: transparent;
}

.relation-group.enemy header strong,
.relation-card.enemy p {
  color: #e89a8d;
}

.relation-card.enemy {
  border-color: rgba(228, 93, 79, 0.34);
  background:
    linear-gradient(90deg, rgba(75, 25, 18, 0.5), rgba(8, 7, 6, 0.8));
}

.relation-group.swing {
  border-color: transparent;
}

.relation-group.swing header strong,
.relation-card.swing p {
  color: #d1b071;
}

.relation-card.swing {
  border-color: rgba(213, 155, 72, 0.34);
  background:
    linear-gradient(90deg, rgba(76, 46, 13, 0.48), rgba(8, 7, 6, 0.8));
}

@media (max-width: 520px) {
  .intel-drawer {
    --intel-drawer-padding-x: 10px;
    --intel-drawer-padding-y: 12px;
    --intel-sheet-width: 430px;
    --intel-sheet-max-height: min(72dvh, 620px);
    --intel-relation-max-height: min(30dvh, 280px);

    padding-bottom: max(var(--intel-drawer-padding-y), env(safe-area-inset-bottom));
  }

  .intel-sheet {
    overflow: auto;
  }

  .intel-sheet .relation-board {
    gap: 8px;
    padding: 10px;
    overflow: auto;
  }

  .relation-board-head strong {
    font-size: 13.5px;
  }

  .relation-groups {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .relation-center {
    width: fit-content;
    padding: 7px 18px;
  }

  .relation-card {
    min-height: 42px;
    padding: 7px 8px;
  }

}

.qa-smoke-result {
  position: fixed;
  z-index: 9999;
  right: 10px;
  bottom: 10px;
  max-width: min(340px, calc(100vw - 20px));
  padding: 8px 10px;
  border: 1px solid rgba(218, 190, 120, 0.55);
  background: rgba(16, 12, 8, 0.92);
  color: #f8e6bb;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.qa-smoke-result.pass {
  border-color: rgba(112, 216, 126, 0.65);
}

.qa-smoke-result.fail {
  border-color: rgba(239, 86, 72, 0.78);
  color: #ffd0c9;
}

/* Final image prop overrides must stay last: later feature skins also touch these selectors. */
.brand-title,
.round-hud,
.round-hud b,
.scene-titleplate b,
.scene-card strong,
.unlock-title strong,
.ending-panel strong,
.scroll-header strong {
  font-family: var(--font-title);
}

.ending-panel p,
.ending-panel .review-card,
.ending-panel .postgame-row,
.intel-sheet,
.scene-drawer,
.ending-gallery-sheet,
.unlock-modal,
.sponsor-sheet,
.login-sheet {
  font-family: var(--font-readable);
}

.scene-book-button,
.war-button,
.war-button strong,
.scene-focus,
.scene-focus span,
.scene-focus b,
.core-hud,
.core-hud span,
.status-pill,
.role-card,
.role-plate,
.role-plate i,
.role-plate strong,
.role-plate span,
.role-plate b,
.story-round,
.option-button,
.free-form button,
.scroll-seal,
.ending-gallery-status,
.stat-mark,
.visual-stat i,
.hud-stat i {
  font-family: var(--font-brush);
}

.visual-stat strong,
.hud-stat strong,
.hud-stat em,
.core-hud strong,
.delta-pill,
.ending-progress strong {
  font-family: var(--font-number);
}

.role-plate strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: clamp(15px, 4vw, 20px);
  line-height: 1.35;
}

.role-plate span,
.role-plate b {
  line-height: 1.16;
}

.scene-book-button {
  display: grid;
  place-items: center;
  width: 68px;
  height: 44px;
  min-height: 44px;
  border: 0;
  background: url("/src/assets/ui/generated/bamboo-tab-direct.png") center / contain no-repeat;
  clip-path: none;
  box-shadow: none;
  color: #231407;
  padding: 0 11px 1px;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 0 rgba(219, 174, 95, 0.36);
}

.scene-book-button span {
  display: grid;
  place-items: center;
  min-width: 32px;
  min-height: 18px;
  text-align: center;
}

.scene-book-button::before,
.scene-book-button::after {
  content: none;
}

.war-button {
  width: 70px;
  height: 70px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: url("/src/assets/ui/generated/bronze-talisman-direct.png") center / contain no-repeat;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.34);
}

.phone {
  --flow-module-gap: 0px;
  --flow-option-gap: clamp(4px, 1.15vw, 6px);
  --story-panel-height: clamp(228px, 58vw, 248px);
  --story-panel-pad-top: clamp(30px, 8.4vw, 36px);
  --story-panel-pad-x: clamp(40px, 10.6vw, 46px);
  --story-panel-pad-bottom: clamp(34px, 8.9vw, 38px);
  --story-copy-max: clamp(126px, 34vw, 140px);
  --story-copy-pad-bottom: clamp(32px, 8.4vw, 36px);
  --story-delta-inset-x: clamp(40px, 10.6vw, 46px);
  --story-delta-bottom: clamp(30px, 7.9vw, 34px);
  --story-round-top: clamp(18px, 5.1vw, 22px);
  --story-round-right: clamp(39px, 10.4vw, 45px);
  --option-card-height: clamp(108px, 26vw, 112px);
  --option-card-pad-y: clamp(10px, 2.6vw, 12px);
  --option-card-pad-x: clamp(10px, 2.8vw, 12px);
  --option-text-max-height: clamp(82px, 20vw, 84px);
  --free-form-height: clamp(56px, 14.2vw, 60px);
  --free-form-pad-y: clamp(7px, 1.9vw, 8px);
  --free-form-pad-x: clamp(18px, 4.8vw, 20px);
  --free-form-gap: clamp(6px, 1.7vw, 8px);
}

.story-panel {
  position: relative;
  margin: var(--flow-module-gap) 9px 0;
  border: 0;
  background: url("/src/assets/ui/generated/story-scroll-direct.png") center / 100% 100% no-repeat;
  box-shadow: none;
  height: var(--story-panel-height);
  min-height: var(--story-panel-height);
  padding: var(--story-panel-pad-top) var(--story-panel-pad-x) var(--story-panel-pad-bottom);
  color: #2b180b;
  clip-path: none;
  overflow: visible;
}

.story-panel.has-resolution {
  background: url("/src/assets/ui/generated/story-scroll-direct.png") center / 100% 100% no-repeat;
  height: var(--story-panel-height);
  max-height: var(--story-panel-height);
}

.story-panel::before,
.story-panel::after {
  content: none;
}

.story-round {
  position: absolute;
  top: var(--story-round-top);
  right: var(--story-round-right);
  z-index: 1;
  margin: 0;
  display: flex;
  justify-content: flex-end;
}

.story-round span,
.story-round b {
  color: #4a2a12;
  font-size: 12px;
  font-weight: 950;
  text-shadow:
    0 1px 0 rgba(255, 238, 196, 0.55),
    0 0 1px rgba(49, 24, 8, 0.32);
}

.story-round b {
  display: block;
  line-height: 1;
}

.story-panel p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #241407;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.54;
  font-family: var(--font-brush);
  text-shadow:
    0 1px 0 rgba(255, 239, 203, 0.46),
    0 0 1px rgba(45, 22, 7, 0.28);
}

.story-panel .delta-list {
  position: absolute;
  left: var(--story-delta-inset-x);
  right: var(--story-delta-inset-x);
  bottom: var(--story-delta-bottom);
  z-index: 1;
  margin: 0;
}

.story-stream-indicator {
  position: absolute;
  top: clamp(42px, 10.8vw, 48px);
  right: clamp(11px, 2.9vw, 14px);
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 26px;
  min-height: 74px;
  padding: 8px 0 7px;
  border: 1px solid rgba(245, 199, 102, 0.72);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(105, 58, 18, 0.98), rgba(36, 17, 6, 0.98)),
    rgba(22, 11, 4, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 234, 170, 0.32),
    0 2px 5px rgba(20, 8, 2, 0.42),
    0 0 0 1px rgba(42, 20, 6, 0.62);
  color: #ffe1a0;
  font-family: var(--font-title);
  font-size: 10.5px;
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
  text-shadow:
    0 1px 1px rgba(8, 4, 1, 0.82),
    0 0 5px rgba(255, 201, 92, 0.34);
}

.story-stream-indicator span {
  writing-mode: vertical-rl;
  letter-spacing: 0;
}

.story-stream-indicator i {
  display: block;
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background: #ffd16d;
  opacity: 0.52;
  animation: stream-dot 950ms ease-in-out infinite;
}

.story-stream-indicator i:nth-child(3) {
  animation-delay: 140ms;
}

.story-stream-indicator i:nth-child(4) {
  animation-delay: 280ms;
}

.story-panel.is-streaming .story-stream-indicator {
  display: inline-flex;
}

.story-panel.is-streaming:not(.is-streaming-pending):not(.is-awaiting-adjudication) .story-copy p:last-child::after {
  content: "";
  display: inline-block;
  width: 0.42em;
  height: 1em;
  margin-left: 0.12em;
  transform: translateY(0.16em);
  border-radius: 999px;
  background: rgba(36, 20, 7, 0.82);
  animation: stream-cursor 820ms ease-in-out infinite;
}

@keyframes stream-dot {
  0%,
  70%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }

  35% {
    opacity: 0.9;
    transform: translateY(-1px);
  }
}

@keyframes stream-cursor {
  0%,
  100% {
    opacity: 0.18;
  }

  45% {
    opacity: 0.9;
  }
}

.decision-panel {
  margin-top: var(--flow-module-gap);
  padding-top: 0;
}

.option-grid {
  gap: var(--flow-option-gap);
}

.option-button,
.option-button.card-1,
.option-button.card-2,
.option-button.card-3 {
  display: grid;
  place-items: center;
  height: var(--option-card-height);
  min-height: var(--option-card-height);
  max-height: var(--option-card-height);
  overflow: hidden;
  padding: var(--option-card-pad-y) var(--option-card-pad-x);
  background: url("/src/assets/ui/generated/action-card-direct.png") center / 100% 100% no-repeat;
  clip-path: none;
  box-shadow: none;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.44));
}

.option-button::before,
.option-button::after {
  content: none;
}

.option-button strong {
  display: -webkit-box;
  max-height: var(--option-text-max-height);
  min-height: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  color: #261407;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.18;
  text-shadow: 0 1px 0 rgba(235, 201, 132, 0.36);
}

.free-form {
  grid-template-columns: 96px minmax(0, 1fr) 76px;
  align-items: center;
  gap: var(--free-form-gap);
  margin-top: var(--flow-module-gap);
  min-height: var(--free-form-height);
  border: 0;
  background: url("/src/assets/ui/generated/command-tray-direct.png") center / 100% 100% no-repeat;
  box-shadow: none;
  clip-path: none;
  padding: var(--free-form-pad-y) var(--free-form-pad-x);
}

.free-form::before {
  content: none;
}

.free-form .improvise-button {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 0;
  background: url("/src/assets/ui/generated/brocade-pouch-direct.png") center / contain no-repeat;
  clip-path: none;
  box-shadow: none;
  color: #f9dfa6;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.02;
  padding: 0;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.58);
}

.free-form .improvise-button span {
  display: grid;
  place-items: center;
  width: 50px;
  min-height: 30px;
  text-align: center;
  transform: translateY(1px);
}

.free-form button[type="submit"] {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 0;
  background: url("/src/assets/ui/generated/wax-seal-direct.png") center / contain no-repeat;
  clip-path: none;
  box-shadow: none;
  color: #ffe7ae;
  font-size: 13.5px;
  font-weight: 950;
  line-height: 1;
  padding: 0;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.52);
}

.free-form button[type="submit"] span {
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 22px;
  text-align: center;
  transform: translateY(-6px);
}

.free-form input {
  min-height: 42px;
  height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #efe0bc;
  padding: 0 12px;
  line-height: 42px;
  font-family: var(--font-brush);
  font-weight: 760;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.72);
}

.free-form input::placeholder {
  font-family: var(--font-brush);
}

.free-form button[type="submit"]::before,
.free-form button[type="submit"]::after,
.free-form .improvise-button::before,
.free-form .improvise-button::after {
  content: none;
}

.free-form .improvise-button:disabled {
  background: url("/src/assets/ui/generated/brocade-pouch-direct.png") center / contain no-repeat;
  color: #f9dfa6;
  cursor: not-allowed;
}

.free-form button[type="submit"]:disabled {
  background: url("/src/assets/ui/generated/wax-seal-direct.png") center / contain no-repeat;
  color: #ffe7ae;
  cursor: not-allowed;
}

.free-form .improvise-button:disabled,
.free-form button[type="submit"]:disabled {
  opacity: 0.42;
  filter: none;
}

@media (max-width: 420px) {
  .stage-panel:not(.is-ending) {
    min-height: 376px;
  }

  .scene-book-button {
    width: 64px;
    height: 42px;
    min-height: 42px;
    padding: 0 10px 1px;
    font-size: 12px;
  }

  .war-button {
    width: 66px;
    height: 66px;
  }

  .story-panel {
    margin-top: var(--flow-module-gap);
    height: var(--story-panel-height);
    min-height: var(--story-panel-height);
    padding: var(--story-panel-pad-top) var(--story-panel-pad-x) var(--story-panel-pad-bottom);
  }

  .story-panel.has-resolution,
  .story-panel.is-streaming {
    height: var(--story-panel-height);
    max-height: var(--story-panel-height);
  }

  .story-panel.has-resolution .story-copy,
  .story-panel.is-streaming .story-copy {
    max-height: var(--story-copy-max);
    padding-bottom: var(--story-copy-pad-bottom);
  }

  .story-panel .delta-list {
    left: var(--story-delta-inset-x);
    right: var(--story-delta-inset-x);
    bottom: var(--story-delta-bottom);
  }

  .story-round {
    top: var(--story-round-top);
    right: var(--story-round-right);
  }

  .decision-panel {
    margin-top: var(--flow-module-gap);
    padding-top: 0;
  }

  .option-button,
  .option-button.card-1,
  .option-button.card-2,
  .option-button.card-3 {
    height: var(--option-card-height);
    min-height: var(--option-card-height);
    max-height: var(--option-card-height);
    padding: var(--option-card-pad-y) var(--option-card-pad-x);
  }

  .option-button strong {
    max-height: var(--option-text-max-height);
    line-height: 1.16;
  }

  .free-form {
    grid-template-columns: 92px minmax(0, 1fr) 74px;
    gap: var(--free-form-gap);
    margin-top: var(--flow-module-gap);
    min-height: var(--free-form-height);
    padding: var(--free-form-pad-y) var(--free-form-pad-x);
  }

  .free-form .improvise-button,
  .free-form button[type="submit"] {
    min-height: 40px;
  }

  .free-form .improvise-button {
    font-size: 11.5px;
    line-height: 0.98;
  }

  .free-form .improvise-button span {
    width: 50px;
    min-height: 30px;
    transform: translateY(0);
  }

  .free-form button[type="submit"] {
    font-size: 13px;
  }

  .free-form button[type="submit"] span {
    width: 42px;
    min-height: 22px;
    transform: translateY(-6px);
  }

  .free-form input {
    min-height: 36px;
    height: 36px;
    line-height: 36px;
    padding: 0 10px;
  }
}
