:root {
  --paper: #f3e6c9;
  --paper-deep: #dfc08a;
  --ink: #311f18;
  --muted: #5f4b3f;
  --red: #9d1d22;
  --red-deep: #74161c;
  --gold: #c88f31;
  --green: #4f8c55;
  --blue: #2375a8;
  --line: rgba(93, 54, 28, 0.24);
  --shadow: 0 18px 55px rgba(50, 30, 18, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui,
    sans-serif;
  background:
    linear-gradient(rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.42)),
    radial-gradient(circle at 16% 8%, #fff5d7 0 16%, transparent 17%),
    radial-gradient(circle at 86% 16%, rgba(157, 29, 34, 0.16) 0 12%, transparent 13%),
    linear-gradient(135deg, #ead7aa, #f8efd9 45%, #d8b06d);
  min-height: 100vh;
  font-size: 16px;
  font-weight: 500;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
  color: white;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 213, 114, 0.24), transparent 24%),
    radial-gradient(circle at 28% 24%, rgba(35, 117, 168, 0.24), transparent 22%),
    linear-gradient(135deg, #230d10, #71131b 48%, #120b10);
  overflow: hidden;
}

.finale-overlay {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: grid;
  place-items: center;
  padding: 28px;
  color: white;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 230, 146, 0.32), transparent 25%),
    radial-gradient(circle at 18% 76%, rgba(35, 117, 168, 0.22), transparent 26%),
    linear-gradient(135deg, #13090c, #65151b 42%, #a56c21 70%, #160c10);
  overflow: hidden;
}

.intro-overlay[hidden],
.finale-overlay[hidden] {
  display: none;
}

.intro-overlay::before,
.intro-overlay::after,
.finale-overlay::before,
.finale-overlay::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(255, 227, 158, 0.18) 49% 51%, transparent 52%),
    linear-gradient(0deg, transparent 0 48%, rgba(255, 227, 158, 0.12) 49% 51%, transparent 52%);
  background-size: 92px 92px;
  transform: perspective(700px) rotateX(62deg) translateY(18%);
  animation: introGrid 5s linear infinite;
}

.intro-overlay::after,
.finale-overlay::after {
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.2), transparent 3%),
    radial-gradient(circle at 74% 24%, rgba(255, 255, 255, 0.16), transparent 2.6%),
    radial-gradient(circle at 62% 72%, rgba(255, 216, 121, 0.2), transparent 3%);
  transform: none;
  animation: introSpark 2.8s ease-in-out infinite alternate;
}

.finale-overlay::before {
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(255, 230, 150, 0.24) 49% 51%, transparent 52%),
    linear-gradient(0deg, transparent 0 48%, rgba(255, 230, 150, 0.16) 49% 51%, transparent 52%);
  background-size: 78px 78px;
  animation-duration: 3.8s;
}

.intro-scene,
.finale-scene {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 16px;
  max-width: 980px;
  text-align: center;
}

.intro-kicker {
  border-radius: 999px;
  padding: 8px 16px;
  color: #ffe6a0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 226, 160, 0.28);
  font-weight: 900;
}

.intro-scene h2,
.finale-scene h2 {
  font-size: clamp(34px, 6vw, 76px);
  line-height: 1.12;
  text-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.intro-scene p,
.finale-scene p {
  color: rgba(255, 245, 218, 0.92);
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 900;
}

.finale-scene {
  max-width: 1120px;
}

.finale-scene h2 {
  font-size: clamp(38px, 6.4vw, 86px);
}

.finale-scene p {
  color: #ffe7a8;
  font-size: clamp(24px, 3vw, 42px);
  letter-spacing: 0;
}

.finale-scene > strong {
  display: inline-grid;
  place-items: center;
  min-height: 54px;
  border-radius: 999px;
  padding: 0 28px;
  color: #66151a;
  background: linear-gradient(135deg, #fff7d8, #efc263);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34), 0 0 0 10px rgba(255, 230, 150, 0.13);
  font-size: 22px;
  font-weight: 1000;
}

#introCountdown {
  display: grid;
  place-items: center;
  min-width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  color: #70151c;
  background: radial-gradient(circle, #fff6d6, #f3c761);
  box-shadow:
    0 0 0 12px rgba(255, 222, 137, 0.18),
    0 28px 80px rgba(0, 0, 0, 0.38);
  font-size: clamp(42px, 7vw, 86px);
  font-weight: 1000;
}

.intro-overlay.pulse #introCountdown {
  animation: countdownPop 0.44s ease;
}

.intro-overlay.launching .intro-scene {
  animation: launchFade 0.52s ease forwards;
}

.finale-overlay .finale-scene {
  animation: finaleEnter 0.72s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.finale-overlay.leaving .finale-scene {
  animation: launchFade 0.56s ease forwards;
}

button,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(2140px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar,
.setup-panel,
.timeline-panel,
.workspace,
.player-board,
.operations-row,
.production-panel,
.card-library-panel,
.action-dock {
  margin-bottom: 16px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: stretch;
}

.topbar-right {
  display: grid;
  gap: 10px;
  align-content: start;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.top-actions .secondary {
  min-width: 112px;
}

.audio-toggle {
  position: relative;
  overflow: hidden;
}

.audio-toggle.active {
  color: white;
  background: linear-gradient(135deg, #8f1d24, #c88f31);
  border-color: rgba(255, 231, 169, 0.68);
  box-shadow: 0 10px 24px rgba(127, 31, 28, 0.18);
}

.audio-toggle.active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.24), transparent);
  animation: footerSweep 2.6s ease-in-out infinite;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 52px);
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  font-weight: 900;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  gap: 8px;
  min-width: min(720px, 100%);
}

.score-strip div,
.setup-panel,
.turn-card,
.team-card,
.market,
.advisor-card,
.scoreboard-card,
.player-board,
.timeline-panel,
.production-panel,
.card-library-panel,
.action-panel,
.log-panel {
  border: 1px solid var(--line);
  background: rgba(255, 250, 239, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.score-strip div {
  display: grid;
  gap: 2px;
  min-height: 72px;
  padding: 12px;
  border-radius: 8px;
}

.score-strip span,
.turn-card span,
.section-heading span,
.team-card small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.money-note {
  color: #4d3c31;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
}

.score-strip strong {
  font-size: 22px;
}

.setup-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: 16px;
  border-radius: 8px;
}

.setup-panel p {
  color: var(--muted);
  margin-top: 4px;
}

.setup-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.guide-select-label {
  min-width: 100%;
}

.guide-select-label select {
  width: 100%;
}

label {
  display: grid;
  gap: 6px;
  min-width: 150px;
  font-weight: 700;
}

select {
  height: 42px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff8e7;
  padding: 0 12px;
}

.primary,
.secondary,
.action-grid button,
.text-button {
  border-radius: 6px;
  min-height: 42px;
}

.primary {
  background: var(--red);
  color: white;
  padding: 0 22px;
  font-weight: 800;
}

.secondary {
  background: #fff;
  color: var(--red);
  border: 1px solid rgba(157, 29, 34, 0.3);
  font-weight: 700;
}

.text-button {
  background: transparent;
  color: var(--red);
  padding: 0 8px;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(1120px, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.board-zone {
  min-width: 0;
}

.board-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 755 / 790;
  border-radius: 8px;
  overflow: hidden;
  background: #d8ad6e;
  box-shadow: var(--shadow);
}

.board-frame > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gdp-ring {
  position: absolute;
  left: 25%;
  top: 25%;
  width: 7.5%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: white;
  border: 3px solid #f7d480;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.plot {
  position: absolute;
  width: 5.2%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(243, 230, 201, 0.84);
  color: #2d2a1b;
  border: 2px solid rgba(49, 31, 24, 0.44);
  font-weight: 900;
  transform: translate(-50%, -50%);
}

.plot:hover,
.plot.ready {
  background: #fff2a4;
  border-color: var(--red);
}

.plot.done {
  background: #82b36e;
  color: white;
  border-color: #386a3d;
}

.plot.factory::after {
  content: none;
}

.plot-1 {
  left: 47.7%;
  top: 43.6%;
}

.plot-2 {
  left: 48.6%;
  top: 37.2%;
}

.plot-3 {
  left: 47.7%;
  top: 33.3%;
}

.plot-4 {
  left: 46.3%;
  top: 47.6%;
}

.plot-5 {
  left: 45.1%;
  top: 57.4%;
}

.plot-6 {
  left: 55.8%;
  top: 61.2%;
}

.plot-7 {
  left: 66.8%;
  top: 61.8%;
}

.plot-8 {
  left: 66.8%;
  top: 70.4%;
}

.systems-grid {
  position: absolute;
  left: 11.8%;
  top: 55.8%;
  width: 7.9%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5%;
}

.system-dot {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.system-dot.done {
  background: var(--gold);
  box-shadow: inset 0 0 0 2px #fff0bd;
}

.countdown {
  position: absolute;
  right: 9.2%;
  bottom: 15%;
  width: 9.8%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.round-dot {
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(124, 195, 81, 0.65);
  border: 1px solid rgba(41, 93, 35, 0.42);
}

.round-dot.current {
  background: var(--red);
}

.round-dot.past {
  background: rgba(90, 90, 90, 0.28);
}

.resource-stack {
  position: absolute;
  right: 8.4%;
  top: 23%;
  width: 11%;
  display: grid;
  gap: 3.1%;
}

.resource-pill {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  min-height: 32px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 248, 232, 0.85);
  border: 1px solid rgba(93, 54, 28, 0.18);
  font-size: 12px;
  font-weight: 800;
}

.side-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  position: sticky;
  top: 14px;
}

.turn-card,
.market,
.advisor-card,
.scoreboard-card,
.production-panel,
.card-library-panel,
.action-panel,
.log-panel {
  border-radius: 8px;
  padding: 14px;
}

.turn-card {
  display: grid;
  gap: 8px;
}

.turn-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.advisor-card {
  display: grid;
  gap: 10px;
}

.advisor-card p {
  color: var(--muted);
  line-height: 1.55;
}

.advisor-card.active {
  outline: 3px solid rgba(157, 29, 34, 0.22);
}

.advisor-card button:disabled {
  cursor: not-allowed;
  background: #9f938a;
}

.scoreboard-list {
  display: grid;
  gap: 8px;
}

.score-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.score-row.human {
  background: rgba(255, 241, 197, 0.9);
  border-color: rgba(157, 29, 34, 0.28);
}

.score-rank {
  display: grid;
  place-items: center;
  width: 30px;
  aspect-ratio: 1;
  border-radius: 50%;
  color: white;
  background: var(--red);
  font-weight: 900;
}

.score-main {
  display: grid;
  gap: 6px;
}

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

.score-name span {
  color: var(--ink);
  font-weight: 900;
}

.score-bar {
  height: 9px;
  border-radius: 999px;
  background: #dfd2bc;
  overflow: hidden;
}

.score-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c83035, #d99b20);
}

.tutorial-focus {
  outline: 4px solid rgba(255, 205, 86, 0.9) !important;
  box-shadow:
    0 0 0 8px rgba(255, 205, 86, 0.24),
    var(--shadow) !important;
}

.turn-card strong {
  font-size: 28px;
}

.turn-card p {
  color: var(--muted);
  line-height: 1.5;
}

.team-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.team-list::-webkit-scrollbar {
  height: 8px;
}

.team-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(93, 54, 28, 0.24);
}

.team-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.38);
}

.team-list .team-card {
  flex: 0 0 320px;
  scroll-snap-align: start;
}

.team-list .resource-pool-card {
  flex-basis: 390px;
}

.player-command-row {
  grid-template-columns: minmax(280px, 0.7fr) minmax(420px, 1.3fr);
}

.player-board .team-card {
  min-height: 0;
}

.player-board .team-card.member-card {
  align-content: start;
}

.player-board .assignment-block {
  min-height: 74px;
}

.player-board .talent-badge em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-board .hand-block {
  min-height: 88px;
}

.player-board .hand {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.player-board {
  overflow: hidden;
}

.team-card {
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
  border-left: 5px solid rgba(157, 29, 34, 0.35);
}

.player-board {
  border-radius: 8px;
  padding: 14px;
}

.player-board .team-head {
  min-height: 32px;
}

.player-board .token-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.player-board .hand {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-card.active {
  outline: 3px solid rgba(157, 29, 34, 0.22);
  background: rgba(255, 246, 221, 0.96);
}

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

.team-head strong {
  font-size: 20px;
  font-weight: 900;
}

.member-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.member-chip {
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--team-color);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid color-mix(in srgb, var(--team-color) 38%, transparent);
  font-size: 13px;
  font-weight: 900;
}

.muted-chip {
  color: #5d4a3d;
  border-color: rgba(93, 54, 28, 0.22);
}

.member-card {
  border-left-color: var(--team-color, rgba(157, 29, 34, 0.35));
}

.assignment-block {
  display: grid;
  gap: 7px;
  border-radius: 8px;
  border: 1px dashed rgba(93, 54, 28, 0.28);
  background: rgba(255, 255, 255, 0.42);
  padding: 9px;
}

.assignment-list {
  display: grid;
  gap: 6px;
}

.assignment-chip {
  display: block;
  border-radius: 6px;
  border: 1px solid rgba(93, 54, 28, 0.16);
  background: #fff8e7;
  padding: 6px;
  color: #3b2d25;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.token-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.token-grid span,
.talent-row span,
.card-tag {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  padding: 6px;
  font-size: 13px;
  font-weight: 900;
}

.talent-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.resource-badge,
.talent-badge {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
}

.funds-badge {
  grid-template-columns: auto 1fr auto auto 1fr auto;
}

.resource-badge em,
.talent-badge em {
  color: var(--red);
  font-style: normal;
  font-weight: 900;
}

.talent-badge.occupied {
  opacity: 0.72;
  background: rgba(235, 225, 207, 0.72);
}

.resource-pool-card {
  background: linear-gradient(180deg, rgba(255, 250, 230, 0.98), rgba(255, 244, 213, 0.96));
}

.resource-icon {
  display: inline-block;
  width: 22px;
  height: 22px;
}

.resource-icon.blueprint {
  border-radius: 6px 8px 5px 9px;
  background: #1f65c8;
  box-shadow: inset 4px 0 0 rgba(255, 255, 255, 0.22);
}

.resource-icon.execution {
  border-radius: 50%;
  background: #c92d35;
  box-shadow: 9px 0 0 -5px #c92d35, -9px 0 0 -5px #c92d35;
}

.resource-icon.intent {
  border-radius: 9px 5px 9px 5px;
  background: #3fac57;
  transform: skewX(-8deg);
}

.resource-icon.crystal {
  clip-path: polygon(50% 0, 88% 30%, 73% 100%, 27% 100%, 12% 30%);
  background: linear-gradient(135deg, #dff8ff, #56b8df 55%, #167fa6);
}

.resource-icon.ingot {
  height: 16px;
  border-radius: 50% 50% 38% 38%;
  background: linear-gradient(#ffe38d, #d99b20);
  box-shadow: inset 0 -3px 0 rgba(118, 77, 12, 0.18);
}

.talent-piece {
  display: inline-block;
  width: 24px;
  height: 26px;
  background: var(--team-color);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

.talent-piece.senior {
  clip-path: polygon(50% 0, 72% 6%, 80% 27%, 73% 48%, 92% 100%, 62% 100%, 50% 78%, 38% 100%, 8% 100%, 27% 48%, 20% 27%, 28% 6%);
}

.talent-piece.mid {
  clip-path: polygon(50% 0, 61% 31%, 94% 31%, 67% 50%, 79% 84%, 50% 63%, 21% 84%, 33% 50%, 6% 31%, 39% 31%);
}

.talent-piece.junior {
  border-radius: 50% 50% 9px 9px;
  clip-path: polygon(38% 0, 62% 0, 72% 22%, 67% 100%, 33% 100%, 28% 22%);
}

.hand {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.hand-block {
  display: grid;
  gap: 7px;
  border-radius: 8px;
  border: 1px dashed rgba(93, 54, 28, 0.28);
  background: rgba(255, 255, 255, 0.44);
  padding: 9px;
}

.hand-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.owned-card {
  display: grid;
  gap: 2px;
  min-height: 42px;
  border-radius: 7px;
  padding: 7px;
  border: 1px solid rgba(93, 54, 28, 0.18);
  background: #fffaf0;
  color: var(--red-deep);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  text-align: left;
}

.owned-card:hover {
  transform: translateY(-1px);
  border-color: rgba(157, 29, 34, 0.36);
  box-shadow: 0 8px 18px rgba(70, 42, 22, 0.12);
}

.owned-card b {
  color: var(--ink);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owned-card.attract {
  box-shadow: inset 4px 0 0 #b7312c;
}

.owned-card.gain {
  box-shadow: inset 4px 0 0 #2f5f82;
}

.empty-hand {
  color: #5a463b;
  font-size: 13px;
  font-weight: 800;
}

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

.section-heading p {
  color: #4d3c31;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 3px;
  font-weight: 700;
}

.production-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.operations-row {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(620px, 1.05fr);
  gap: 16px;
  align-items: start;
}

.operations-row .purchase-panel,
.operations-row .production-panel {
  min-height: 100%;
}

.operations-row .market-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.operations-row .production-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.operations-row .card {
  min-height: 164px;
}

.operations-row .production-zone header {
  min-height: 48px;
}

.operations-row .production-routes {
  gap: 6px;
  padding: 8px;
}

.operations-row .production-route {
  gap: 6px;
  padding: 8px;
}

.operations-row .route-chip {
  min-height: 46px;
}

.operations-row .route-chip strong {
  font-size: 12px;
}

.production-zone {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.9);
  overflow: hidden;
}

.production-zone header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  padding: 10px 12px;
  color: white;
  background: var(--ink);
}

.production-zone header strong {
  font-size: 18px;
}

.production-zone header span {
  font-size: 13px;
  opacity: 0.95;
  text-align: right;
  font-weight: 800;
}

.production-zone[data-zone="规划建设"] header {
  background: #7d3e24;
}

.production-zone[data-zone="招商引资"] header {
  background: #8d1f2d;
}

.production-zone[data-zone="人才招引"] header {
  background: #2f5f82;
}

.production-zone[data-zone="筹委会"] header {
  background: #486b35;
}

.production-routes {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.production-route {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(93, 54, 28, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
}

.route-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.route-chip {
  display: grid;
  gap: 2px;
  min-height: 54px;
  border-radius: 6px;
  border: 1px solid rgba(93, 54, 28, 0.18);
  background: #fff8e7;
  padding: 8px;
}

.route-chip span {
  color: #5b493b;
  font-size: 12px;
  font-weight: 800;
}

.route-chip strong {
  color: #2f241e;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 900;
}

.route-arrow {
  color: var(--red);
  font-weight: 900;
}

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

.route-meta small {
  color: #4d3c31;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.occupant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.occupant-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--team-color);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid color-mix(in srgb, var(--team-color) 40%, transparent);
  font-size: 13px;
  font-weight: 900;
}

.occupant-chip b {
  color: #3b2d25;
  font-size: 12px;
}

.route-meta button {
  min-width: 70px;
  min-height: 34px;
  border-radius: 6px;
  background: var(--red);
  color: white;
  font-weight: 800;
}

.route-meta button:disabled {
  cursor: not-allowed;
  background: #9f938a;
}

.market-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.purchase-panel {
  border-radius: 8px;
  padding: 14px;
  border-top: 4px solid var(--red);
}

.market-slot {
  display: grid;
  gap: 8px;
  align-content: start;
}

.price-token {
  display: grid;
  place-items: center;
  min-height: 36px;
  border-radius: 6px;
  color: white;
  background: linear-gradient(135deg, #8e1f28, #b7312c 45%, #c58a31);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.card,
.produce-option {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, #fff6e6);
  padding: 10px;
  display: grid;
  gap: 6px;
  text-align: left;
  box-shadow: 0 8px 22px rgba(70, 42, 22, 0.08);
}

.card strong {
  display: block;
  color: var(--red-deep);
  font-size: 17px;
  font-weight: 900;
}

.card p,
.produce-option p {
  color: #4d3c31;
  font-size: 13px;
  line-height: 1.48;
  font-weight: 700;
}

.card button,
.produce-option button,
.inline-form button {
  background: var(--ink);
  color: white;
  min-height: 34px;
  border-radius: 6px;
  padding: 0 10px;
  font-weight: 800;
}

.command-deck {
  display: block;
}

.command-deck .action-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(49, 31, 24, 0.96), rgba(116, 22, 28, 0.92)),
    #311f18;
  color: white;
}

.command-deck .action-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

.command-deck .section-heading,
.command-deck .action-grid {
  position: relative;
  z-index: 1;
}

.command-deck .section-heading p,
.command-deck .section-heading span {
  color: rgba(255, 247, 225, 0.72);
}

.command-deck h2 {
  font-size: 22px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.action-grid button {
  position: relative;
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 118px;
  overflow: hidden;
  text-align: left;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid rgba(255, 235, 188, 0.22);
  padding: 12px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.action-grid button::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -22px;
  width: 74px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(216, 155, 32, 0.18);
}

.action-grid button small {
  color: #f1c45d;
  font-size: 11px;
  letter-spacing: 0;
}

.action-grid button strong {
  font-size: 18px;
}

.action-grid button em {
  color: rgba(255, 247, 225, 0.72);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.action-grid button:hover,
.action-grid button.selected {
  background:
    linear-gradient(145deg, rgba(255, 228, 141, 0.22), rgba(157, 29, 34, 0.68)),
    rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 221, 145, 0.68);
  transform: translateY(-1px);
}

.action-grid button:disabled,
.secondary:disabled {
  cursor: not-allowed;
  background: #b4a69a;
  color: #fff6e6;
  border-color: transparent;
}

.action-detail {
  min-height: 120px;
  max-height: min(72vh, 760px);
  overflow: auto;
  border-radius: 8px;
  border: 1px dashed rgba(255, 233, 186, 0.3);
  padding: 12px;
  background: rgba(255, 250, 238, 0.92);
  color: var(--ink);
}

.action-modal {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 20, 15, 0.52);
  backdrop-filter: blur(6px);
}

.action-modal[hidden] {
  display: none;
}

.action-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1520px, calc(100vw - 48px));
  max-height: min(88vh, 920px);
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255, 234, 188, 0.45);
  background: linear-gradient(180deg, #fffaf0, #f5e6c8);
  box-shadow: 0 30px 90px rgba(20, 10, 4, 0.38);
  padding: 16px;
}

.action-dialog .section-heading {
  margin-bottom: 12px;
}

.action-dialog .action-detail {
  margin: 0;
}

.action-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 246, 221, 0.88);
  border: 1px solid rgba(93, 54, 28, 0.16);
}

.action-context strong {
  color: var(--red-deep);
  font-size: 16px;
}

.action-context span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
}

.action-production-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.action-market-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.action-market-grid .card {
  min-height: 176px;
}

.action-production-grid .production-route {
  box-shadow: none;
}

.action-production-grid .route-chip strong {
  font-size: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.inline-form label {
  min-width: 130px;
}

.log-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.side-log-panel {
  position: sticky;
  top: 14px;
  height: min(620px, calc(100vh - 28px));
  max-height: calc(100vh - 28px);
  background:
    linear-gradient(180deg, rgba(255, 250, 239, 0.96), rgba(255, 245, 222, 0.92));
}

.side-log-panel .section-heading {
  z-index: 2;
  margin: -14px -14px 10px;
  padding: 12px 14px 10px;
  background: rgba(255, 250, 239, 0.96);
  border-bottom: 1px solid var(--line);
}

.side-log-panel #logList {
  padding-right: 4px;
  min-height: 0;
  overflow: auto;
}

.side-log-panel #logList li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(93, 54, 28, 0.12);
}

#logList {
  margin: 0;
  padding: 0 8px 0 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

#logList li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  line-height: 1.45;
  color: #4c392e;
}

#logList li span {
  color: var(--red);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

#logList li p {
  margin: 0;
}

#logList::-webkit-scrollbar {
  width: 8px;
}

#logList::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(93, 54, 28, 0.28);
}

#logList::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.38);
}

.win-state {
  color: #0c6638;
  font-weight: 900;
}

.code-board {
  display: grid;
  grid-template-columns: 180px minmax(740px, 1fr);
  grid-template-rows: minmax(420px, 1fr) auto;
  gap: 12px;
  aspect-ratio: auto;
  min-height: 980px;
  padding: 12px;
  overflow: visible;
  background:
    linear-gradient(90deg, rgba(130, 91, 45, 0.1) 0 1px, transparent 1px 36px),
    linear-gradient(0deg, rgba(130, 91, 45, 0.08) 0 1px, transparent 1px 36px),
    linear-gradient(135deg, #d7a869, #f0d093 45%, #c98d4e);
}

.board-module {
  border: 1px solid rgba(76, 42, 21, 0.28);
  border-radius: 8px;
  background: rgba(255, 249, 235, 0.92);
  box-shadow: 0 14px 34px rgba(60, 35, 18, 0.16);
  overflow: hidden;
}

.board-module header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  color: white;
  background: var(--red);
}

.board-module header span {
  display: grid;
  place-items: center;
  width: 24px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-weight: 900;
}

.module-materials {
  grid-column: 1;
  grid-row: 1;
}

.module-systems {
  grid-column: 1;
  grid-row: 2;
}

.model-shelf {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.model-shelf div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border-radius: 7px;
  padding: 9px;
  background: #fffaf0;
  border: 1px solid var(--line);
  font-weight: 800;
}

.factory-icon,
.gate-icon,
.office-icon {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 42px;
  flex: 0 0 auto;
}

.factory-icon {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 2px, transparent 2px 10px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.18) 0 2px, transparent 2px 12px),
    linear-gradient(#207aa8 0 40%, #39a5c9 40%);
  clip-path: polygon(0 100%, 0 42%, 18% 42%, 18% 24%, 34% 42%, 50% 24%, 66% 42%, 100% 42%, 100% 100%);
}

.gate-icon::before,
.gate-icon::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 17px;
  height: 40px;
  border: 5px solid #9a9a9a;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
}

.gate-icon::before {
  left: 4px;
}

.gate-icon::after {
  right: 4px;
}

.office-icon {
  border-radius: 6px 6px 2px 2px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.66) 0 3px, transparent 3px 10px),
    linear-gradient(#f2f0e8, #c7c1b5);
  box-shadow: 12px 10px 0 -5px #d8d2c5;
}

.code-board .systems-grid {
  position: static;
  width: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px;
}

.code-board .system-dot {
  min-height: 44px;
  border-radius: 7px;
  background: #ddd9cf;
}

.code-board .system-dot.done {
  background: var(--gold);
}

.park-stage {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
  border: 1px solid rgba(76, 42, 21, 0.28);
  border-radius: 8px;
  background: rgba(255, 252, 244, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.map-title {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 72px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.map-title span {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  letter-spacing: 0;
}

.map-title strong {
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1.05;
}

.gdp-track {
  display: grid;
  gap: 10px;
  min-height: 124px;
  padding: 14px 18px 18px;
  border-bottom: 1px solid var(--line);
  background: #f7f1e5;
}

.gdp-meter-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.gdp-meter-head div {
  display: grid;
  gap: 2px;
}

.gdp-meter-head div:last-child {
  text-align: right;
}

.gdp-meter-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.gdp-meter-head strong {
  color: var(--red);
  font-size: 30px;
  line-height: 1;
}

.gdp-meter-bar {
  position: relative;
  height: 28px;
  margin: 8px 0 20px;
  border-radius: 999px;
  background: #dfd2bc;
  box-shadow: inset 0 0 0 1px rgba(93, 54, 28, 0.22);
}

.gdp-meter-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #c83035, #d99b20);
  min-width: 8px;
}

.gdp-meter-bar span {
  position: absolute;
  top: 38px;
  transform: translateX(-50%);
  color: #7a665b;
  font-size: 11px;
  font-weight: 900;
}

.gdp-meter-bar span::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -16px;
  width: 2px;
  height: 10px;
  background: rgba(93, 54, 28, 0.35);
}

.gdp-meter-bar span.done {
  color: var(--red);
}

.gdp-track p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.park-model-shell {
  position: relative;
  min-height: 780px;
  background:
    linear-gradient(90deg, rgba(112, 149, 105, 0.16) 0 1px, transparent 1px 58px),
    linear-gradient(0deg, rgba(112, 149, 105, 0.14) 0 1px, transparent 1px 58px),
    radial-gradient(ellipse at 63% 43%, rgba(23, 151, 190, 0.46) 0 19%, transparent 20%),
    linear-gradient(135deg, #eef0df, #dfe8d2);
}

.park-model-shell::after {
  content: "8个地块平整后可建设厂房，圆点格代表厂房容量";
  position: absolute;
  left: 18px;
  bottom: 14px;
  z-index: 1;
  pointer-events: none;
  width: auto;
  padding: 8px 10px;
  border-radius: 6px;
  color: #5b493b;
  background: rgba(255, 250, 239, 0.84);
  border: 1px solid rgba(93, 54, 28, 0.2);
  font-size: 12px;
  font-weight: 900;
}

#parkModel,
.park-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#parkModel {
  display: none;
}

.park-overlay {
  pointer-events: none;
}

.park-overlay .boundary {
  fill: rgba(184, 207, 138, 0.2);
  stroke: rgba(0, 0, 0, 0.72);
  stroke-width: 0.8;
  stroke-dasharray: 1.5 1;
}

.park-overlay .lake-shape {
  fill: rgba(0, 139, 190, 0.48);
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 0.7;
  filter: drop-shadow(0 0 6px rgba(0, 166, 214, 0.42));
}

.park-overlay .road {
  fill: none;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-linecap: round;
  stroke-width: 1.35;
  filter: drop-shadow(0 1px 1px rgba(54, 44, 35, 0.22));
}

.park-overlay .main-road {
  stroke: rgba(61, 70, 64, 0.78);
  stroke-width: 2;
}

.park-overlay text {
  fill: rgba(37, 42, 39, 0.7);
  font-size: 3.2px;
  font-weight: 800;
}

.traffic-dot {
  position: absolute;
  z-index: 3;
  width: 13px;
  height: 7px;
  border-radius: 999px;
  pointer-events: none;
  background: linear-gradient(90deg, #fff7b0, #d52b30);
  box-shadow:
    0 0 12px rgba(255, 226, 120, 0.8),
    10px 0 14px rgba(213, 43, 48, 0.42);
}

.road-car-a {
  animation: carRunA 6.4s linear infinite;
}

.road-car-b {
  animation: carRunB 7.8s linear infinite 1.6s;
  background: linear-gradient(90deg, #dff8ff, #2375a8);
}

.train-line {
  position: absolute;
  z-index: 2;
  left: 13%;
  top: 25%;
  width: 74%;
  height: 4px;
  border-radius: 999px;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(49, 31, 24, 0.35) 0 6px, transparent 6px 12px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.55), rgba(49, 31, 24, 0.32));
  transform: rotate(-8deg);
}

.train-dot {
  position: absolute;
  z-index: 3;
  left: 13%;
  top: 22.6%;
  width: 42px;
  height: 10px;
  border-radius: 999px 999px 4px 4px;
  pointer-events: none;
  background: linear-gradient(90deg, #f8fbff, #1f65c8 68%, #c83035);
  box-shadow: 0 0 18px rgba(35, 117, 168, 0.5);
  animation: trainRun 8.5s linear infinite;
}

.筹-point {
  position: absolute;
  left: 62%;
  top: 30%;
  display: grid;
  place-items: center;
  width: 60px;
  aspect-ratio: 1.28;
  transform: translate(-50%, -50%) skewX(-8deg);
  border-radius: 8px;
  background: rgba(248, 238, 196, 0.82);
  border: 3px solid rgba(157, 29, 34, 0.75);
  color: #6b4429;
  font-size: 30px;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(88, 52, 23, 0.2);
}

.code-board .plot {
  display: grid;
  gap: 4px;
  place-items: center;
  width: 104px;
  min-height: 72px;
  z-index: 4;
  background: rgba(239, 231, 196, 0.92);
  box-shadow: 0 8px 20px rgba(46, 36, 22, 0.2);
  border-radius: 12px;
  padding: 8px;
  line-height: 1;
  transform: translate(-50%, -50%);
  overflow: visible;
}

.code-board .plot b {
  font-size: 16px;
}

.code-board .plot span {
  color: #5d4a3d;
  font-size: 11px;
  font-weight: 900;
}

.code-board .plot small {
  display: block;
  max-width: 88px;
  color: #2f3b24;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-board .plot em {
  display: grid;
  grid-template-columns: repeat(5, 8px);
  justify-content: center;
  gap: 3px;
  font-style: normal;
}

.code-board .plot em i {
  width: 8px;
  aspect-ratio: 1;
  border-radius: 2px;
  background: rgba(89, 79, 65, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.code-board .plot em i.built {
  background: var(--factory-color, #b6372f);
  box-shadow: 0 0 0 1px rgba(255, 238, 210, 0.9);
}

.plot-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 7px;
  width: 280px;
  max-width: 70vw;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  line-height: 1.35;
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.24);
  background: rgba(255, 250, 239, 0.98);
  box-shadow: 0 18px 48px rgba(40, 24, 14, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.plot-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 12px;
  height: 12px;
  background: rgba(255, 250, 239, 0.98);
  border-right: 1px solid rgba(93, 54, 28, 0.24);
  border-bottom: 1px solid rgba(93, 54, 28, 0.24);
  transform: translate(-50%, -6px) rotate(45deg);
}

.code-board .plot:hover,
.code-board .plot:focus-visible {
  z-index: 20;
}

.code-board .plot:hover .plot-tooltip,
.code-board .plot:focus-visible .plot-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.plot-tooltip strong {
  color: var(--red-deep);
  font-size: 15px;
  line-height: 1.2;
}

.plot-tooltip > span {
  color: #4c392e;
  font-size: 12px;
  font-weight: 900;
}

.factory-tooltip-list {
  display: grid;
  gap: 5px;
  max-height: 150px;
  overflow: auto;
}

.factory-tooltip-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 5px 7px;
  align-items: center;
  border-radius: 6px;
  padding: 6px;
  background: rgba(255, 247, 226, 0.86);
  border: 1px solid rgba(93, 54, 28, 0.12);
}

.factory-tooltip-row i {
  width: 10px;
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--factory-color, #b6372f);
}

.factory-tooltip-row strong {
  color: var(--ink);
  font-size: 12px;
}

.factory-tooltip-row em {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.empty-factory-row {
  grid-template-columns: 1fr;
}

.plot-detail-dialog {
  width: min(760px, calc(100vw - 48px));
}

.plot-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.plot-detail-summary article {
  display: grid;
  gap: 5px;
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.16);
  background: rgba(255, 255, 255, 0.68);
  padding: 12px;
}

.plot-detail-summary span,
.plot-detail-summary em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.plot-detail-summary strong {
  color: var(--red-deep);
  font-size: 20px;
  line-height: 1.25;
}

.factory-detail-list {
  display: grid;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.16);
  background: rgba(255, 250, 239, 0.72);
  padding: 12px;
}

.factory-detail-list h3 {
  margin: 0;
  color: var(--red-deep);
}

.factory-detail-row {
  display: grid;
  grid-template-columns: auto 88px 1fr;
  gap: 7px 10px;
  align-items: center;
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.12);
  background: rgba(255, 255, 255, 0.7);
  padding: 10px;
}

.factory-detail-row i {
  width: 16px;
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--factory-color, #b6372f);
}

.factory-detail-row span {
  color: #4c392e;
  font-weight: 900;
}

.factory-detail-row em {
  grid-column: 2 / -1;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.brand-footer {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  margin-top: 20px;
  border-radius: 10px;
  color: white;
  background:
    linear-gradient(90deg, rgba(255, 216, 119, 0.08), rgba(255, 255, 255, 0.16), rgba(255, 216, 119, 0.08)),
    linear-gradient(135deg, #30100f, #8b1b24 48%, #241010);
  border: 1px solid rgba(255, 220, 145, 0.34);
  box-shadow: 0 18px 48px rgba(63, 27, 17, 0.22);
  overflow: hidden;
}

.brand-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent, rgba(255, 236, 184, 0.28), transparent);
  transform: translateX(-100%);
  animation: footerSweep 4.2s ease-in-out infinite;
}

.brand-footer span,
.brand-footer strong {
  position: relative;
  z-index: 1;
}

.brand-footer span {
  color: #ffe5a2;
  font-size: 13px;
  font-weight: 900;
}

.brand-footer strong {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  font-size: clamp(18px, 2vw, 28px);
  letter-spacing: 0;
}

.brand-footer a,
.brand-footer em {
  color: inherit;
  font-style: normal;
  text-decoration: none;
}

.brand-footer a {
  border-bottom: 1px solid rgba(255, 230, 160, 0.58);
}

.brand-footer a:hover {
  color: #ffe6a0;
}

.code-board .plot.unflat {
  background: rgba(230, 219, 189, 0.78);
  color: #6f6254;
}

.code-board .plot.done {
  background: linear-gradient(180deg, rgba(255, 250, 222, 0.95), rgba(137, 184, 108, 0.92));
  color: #173e22;
}

.code-board .plot-1 { left: 49%; top: 39%; }
.code-board .plot-2 { left: 41%; top: 28%; }
.code-board .plot-3 { left: 33%; top: 19%; }
.code-board .plot-4 { left: 36%; top: 52%; }
.code-board .plot-5 { left: 29%; top: 72%; }
.code-board .plot-6 { left: 53%; top: 75%; }
.code-board .plot-7 { left: 73%; top: 73%; }
.code-board .plot-8 { left: 73%; top: 90%; }

.player-command-row {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(420px, 1.25fr);
  gap: 12px;
  margin-bottom: 12px;
}

.map-scoreboard {
  margin: 0;
  border-radius: 0;
  border-width: 0 0 1px;
  box-shadow: none;
  background: #fff8e8;
}

.map-scoreboard .scoreboard-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@keyframes lakeLight {
  from {
    opacity: 0.35;
    transform: translateX(-1.5%);
  }
  to {
    opacity: 0.7;
    transform: translateX(1.5%);
  }
}

@keyframes introGrid {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 92px 92px;
  }
}

@keyframes introSpark {
  from {
    opacity: 0.55;
    transform: scale(1);
  }
  to {
    opacity: 1;
    transform: scale(1.03);
  }
}

@keyframes countdownPop {
  0% {
    transform: scale(0.82);
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes launchFade {
  to {
    opacity: 0;
    transform: translateY(-12px) scale(1.04);
  }
}

@keyframes finaleEnter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes footerSweep {
  0%,
  35% {
    transform: translateX(-110%);
  }
  70%,
  100% {
    transform: translateX(110%);
  }
}

@keyframes carRunA {
  0% { left: 18%; top: 49%; opacity: 0; }
  10% { opacity: 1; }
  45% { left: 51%; top: 43%; opacity: 1; }
  80% { left: 79%; top: 57%; opacity: 1; }
  100% { left: 86%; top: 62%; opacity: 0; }
}

@keyframes carRunB {
  0% { left: 28%; top: 20%; opacity: 0; }
  12% { opacity: 1; }
  58% { left: 42%; top: 57%; opacity: 1; }
  100% { left: 47%; top: 80%; opacity: 0; }
}

@keyframes trainRun {
  0% { transform: translateX(-18%) rotate(-8deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateX(118%) rotate(-8deg); opacity: 0; }
}

.code-board .resource-stack {
  position: static;
  width: auto;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.code-board .resource-pill {
  min-height: 56px;
  font-size: 14px;
  background: #fffaf0;
}

.exchange-note {
  border-radius: 7px;
  background: rgba(157, 29, 34, 0.08);
  color: var(--red-deep);
  padding: 9px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 800;
}

.timeline-panel {
  padding: 14px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 239, 0.95), rgba(255, 244, 220, 0.9));
  overflow: hidden;
}

.timeline-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
  align-items: stretch;
}

.timeline-track {
  position: relative;
  right: auto;
  bottom: auto;
  width: auto;
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 124px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.18);
  background:
    linear-gradient(135deg, rgba(157, 29, 34, 0.12), rgba(200, 143, 49, 0.16)),
    #fff8e8;
  --timeline-progress: 0%;
}

.time-dial {
  display: grid;
  place-items: center;
  width: 104px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    conic-gradient(var(--red) 0 var(--dial-progress), rgba(93, 54, 28, 0.14) var(--dial-progress) 360deg);
  box-shadow: inset 0 0 0 1px rgba(93, 54, 28, 0.18), 0 10px 26px rgba(70, 42, 22, 0.1);
}

.time-dial-core {
  display: grid;
  place-items: center;
  width: 78px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fffaf0;
  border: 1px solid rgba(93, 54, 28, 0.2);
}

.time-dial-core span,
.time-dial-core small {
  color: #5b493b;
  font-size: 12px;
  font-weight: 900;
}

.time-dial-core strong {
  color: var(--red);
  font-size: 30px;
  line-height: 1;
}

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

.year-pips span {
  display: grid;
  gap: 2px;
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.18);
  background: rgba(255, 255, 255, 0.64);
  padding: 7px 8px;
  color: #5b493b;
  font-weight: 900;
}

.year-pips span.current {
  color: white;
  background: var(--red);
  border-color: #f1c45d;
}

.year-pips span.done {
  background: #7f6f5b;
  color: white;
}

.year-pips b {
  font-size: 14px;
}

.year-pips small {
  font-size: 11px;
  opacity: 0.82;
}

.timeline-story {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 0;
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.2);
  background: rgba(255, 250, 239, 0.88);
  padding: 12px;
}

.timeline-year {
  display: grid;
  gap: 4px;
}

.timeline-year span {
  color: var(--red);
  font-size: 22px;
  font-weight: 900;
}

.timeline-year strong {
  color: var(--ink);
  font-size: 15px;
}

.timeline-story p,
.timeline-story small {
  color: var(--muted);
  line-height: 1.48;
}

.timeline-story small {
  font-size: 12px;
  font-weight: 800;
  justify-self: end;
  white-space: nowrap;
}

.timeline-anecdote {
  color: #5f4737 !important;
  font-weight: 800;
}

.card-library-panel {
  display: grid;
  gap: 12px;
}

.card-library-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  place-items: center;
  padding: 24px;
  background: rgba(31, 20, 15, 0.55);
  backdrop-filter: blur(6px);
}

.card-inspect-modal {
  position: fixed;
  inset: 0;
  z-index: 31;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 20, 15, 0.52);
  backdrop-filter: blur(6px);
}

.card-inspect-modal[hidden] {
  display: none;
}

.card-inspect-dialog,
.info-dialog {
  display: grid;
  gap: 12px;
  width: min(680px, calc(100vw - 48px));
  max-height: min(82vh, 760px);
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 234, 188, 0.45);
  background: linear-gradient(180deg, #fffaf0, #f4e5c6);
  box-shadow: 0 30px 90px rgba(20, 10, 4, 0.38);
  padding: 18px;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 32;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 20, 15, 0.54);
  backdrop-filter: blur(6px);
}

.info-modal[hidden] {
  display: none;
}

.info-dialog {
  width: min(1280px, calc(100vw - 48px));
}

.report-dialog {
  width: min(1080px, calc(100vw - 48px));
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.overview-grid h3,
.report-section h3 {
  margin: 0 0 8px;
  color: var(--red-deep);
  font-size: 17px;
}

.overview-wide {
  grid-column: 1 / -1;
}

.overview-list {
  display: grid;
  gap: 8px;
}

.assignment-card {
  display: grid;
  gap: 10px;
  width: 100%;
  min-height: 132px;
  padding: 12px;
  text-align: left;
  color: var(--ink);
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--team-color) 42%, rgba(93, 54, 28, 0.14));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--team-color) 12%, transparent), transparent 46%),
    linear-gradient(180deg, #fffaf0, #fff2d7);
  box-shadow: inset 5px 0 0 var(--team-color), 0 10px 26px rgba(65, 38, 18, 0.1);
}

.assignment-card:hover {
  transform: translateY(-1px);
  box-shadow: inset 5px 0 0 var(--team-color), 0 16px 34px rgba(65, 38, 18, 0.16);
}

.assignment-card-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.assignment-card-top strong {
  color: var(--team-color);
  font-size: 18px;
  font-weight: 1000;
}

.assignment-card-top em {
  border-radius: 999px;
  padding: 4px 8px;
  color: white;
  background: var(--team-color);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.assignment-card-body {
  display: grid;
  gap: 4px;
}

.assignment-card-body b {
  color: var(--red-deep);
  font-size: 13px;
}

.assignment-card-body small {
  color: #3f3028;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.assignment-card-foot {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--team-color);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid color-mix(in srgb, var(--team-color) 28%, transparent);
  font-size: 12px;
  font-weight: 900;
}

.assignment-detail-dialog {
  width: min(760px, calc(100vw - 48px));
}

.assignment-detail-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  border-radius: 12px;
  padding: 18px;
  color: white;
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 230, 150, 0.22), transparent 24%),
    linear-gradient(135deg, color-mix(in srgb, var(--team-color) 78%, #371413), #32120f);
}

.assignment-detail-hero .talent-piece {
  width: 52px;
  height: 58px;
  background: white;
  opacity: 0.95;
}

.assignment-detail-hero span {
  color: #ffe8ad;
  font-size: 13px;
  font-weight: 900;
}

.assignment-detail-hero strong {
  display: block;
  margin: 3px 0;
  font-size: 30px;
}

.assignment-detail-hero p {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  font-weight: 800;
}

.assignment-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.assignment-detail-grid article,
.assignment-release-note {
  display: grid;
  gap: 5px;
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.16);
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
}

.assignment-detail-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.assignment-detail-grid strong,
.assignment-release-note strong {
  color: var(--red-deep);
  font-size: 18px;
}

.assignment-detail-grid em,
.assignment-release-note p {
  color: #4a382f;
  font-style: normal;
  line-height: 1.5;
  font-weight: 800;
}

.overview-goals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.overview-goals article {
  display: grid;
  gap: 5px;
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.18);
  background: linear-gradient(180deg, rgba(255, 247, 226, 0.96), rgba(255, 255, 255, 0.72));
  padding: 12px;
}

.overview-goals span,
.overview-goals em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.overview-goals strong {
  color: var(--red-deep);
  font-size: 28px;
}

.overview-help {
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.18);
  background: rgba(255, 250, 239, 0.82);
  padding: 12px;
}

.overview-help p {
  color: #4a382f;
  line-height: 1.65;
  font-weight: 800;
}

.overview-production-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.overview-production-zone {
  min-width: 0;
}

.overview-route.occupied {
  background: rgba(238, 229, 211, 0.78);
}

.overview-route .route-meta b {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  color: white;
  background: #4f8c55;
  font-size: 12px;
}

.overview-route.occupied .route-meta b {
  background: #9d1d22;
}

.plot-overview-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-row {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.18);
  background: rgba(255, 255, 255, 0.64);
  padding: 10px;
}

.overview-row strong {
  color: var(--ink);
  font-size: 16px;
}

.overview-row span {
  color: #4c392e;
  font-weight: 900;
}

.overview-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
}

.report-hero {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 18px;
  align-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #5e1719, #a52028 58%, #d19a35);
  color: white;
  padding: 20px;
}

.report-hero span {
  color: #ffe7ac;
  font-weight: 900;
}

.report-hero h3 {
  margin: 4px 0 8px;
  font-size: 30px;
}

.report-hero p {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.65;
  font-weight: 800;
}

.report-hero > strong {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  color: #6b1919;
  background: #fff3c8;
  font-size: 42px;
  box-shadow: inset 0 0 0 8px rgba(209, 154, 53, 0.24);
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.report-metrics article,
.report-section {
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.18);
  background: rgba(255, 255, 255, 0.66);
  padding: 12px;
}

.report-metrics article {
  display: grid;
  gap: 4px;
}

.report-metrics span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.report-metrics strong {
  color: var(--red-deep);
  font-size: 30px;
}

.report-metrics em {
  color: #4c392e;
  font-style: normal;
  font-weight: 800;
}

.report-section p,
.report-section li {
  color: #4a382f;
  line-height: 1.65;
  font-weight: 800;
}

.report-section ul {
  margin: 0;
  padding-left: 18px;
}

.card-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.card-detail-grid span {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.16);
  background: rgba(255, 255, 255, 0.62);
  padding: 10px;
  color: #3b2d25;
  font-weight: 800;
}

.card-detail-grid b {
  color: var(--red-deep);
  font-size: 12px;
}

.card-library-modal[hidden] {
  display: none;
}

.library-dialog {
  display: grid;
  gap: 12px;
  width: min(1280px, calc(100vw - 48px));
  max-height: min(82vh, 860px);
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255, 234, 188, 0.45);
  background: linear-gradient(180deg, #fffaf0, #f4e5c6);
  box-shadow: 0 30px 90px rgba(20, 10, 4, 0.38);
  padding: 18px;
}

.library-dialog .card-library {
  overflow: auto;
  padding-right: 6px;
}

.library-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px;
  gap: 10px;
}

.library-toolbar input {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff8e7;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
}

.card-library {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.library-card {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 186px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf8, #fff5e1);
  padding: 11px;
  box-shadow: 0 8px 22px rgba(70, 42, 22, 0.08);
}

.library-card.attract {
  border-top: 4px solid #9d1d22;
}

.library-card.gain {
  border-top: 4px solid #2f5f82;
}

.library-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.library-card strong {
  display: block;
  margin-top: 2px;
  color: var(--red-deep);
  font-size: 15px;
  line-height: 1.28;
}

.library-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.library-note {
  color: var(--ink) !important;
  font-weight: 800;
}

.empty-library {
  grid-column: 1 / -1;
  color: var(--muted);
  padding: 16px;
}

@media (max-width: 1680px) {
  .workspace {
    grid-template-columns: minmax(760px, 1fr) 340px;
  }

  .side-log-panel {
    grid-column: 2;
    position: static;
    max-height: 320px;
  }

  .map-scoreboard .scoreboard-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .topbar,
  .workspace,
  .action-dock,
  .command-deck {
    grid-template-columns: 1fr;
    display: grid;
  }

  .score-strip {
    min-width: 0;
    grid-template-columns: repeat(5, 1fr);
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .player-command-row,
  .map-scoreboard .scoreboard-list {
    grid-template-columns: 1fr;
  }

  .market {
    grid-column: 1 / -1;
  }

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

  .operations-row {
    grid-template-columns: 1fr;
  }

  .card-library {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .code-board {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .module-materials,
  .module-systems,
  .park-stage {
    grid-column: 1;
    grid-row: auto;
  }

  .timeline-layout {
    grid-template-columns: 1fr;
  }

  .timeline-track {
    grid-template-columns: repeat(9, 1fr);
  }

  .timeline-story {
    grid-template-columns: 1fr;
  }

  .timeline-story small {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 18px, 1720px);
    padding-top: 12px;
  }

  .score-strip,
  .side-panel,
  .production-grid,
  .action-grid,
  .market-cards,
  .card-library,
  .library-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .operations-row,
  .operations-row .production-grid,
  .operations-row .market-cards,
  .timeline-layout {
    grid-template-columns: 1fr;
  }

  .timeline-track {
    grid-template-columns: repeat(6, 1fr);
  }

  .setup-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace {
    overflow: hidden;
  }

  .board-zone {
    overflow-x: auto;
  }

  .board-frame {
    width: 920px;
  }

  .action-dock {
    grid-template-columns: 1fr;
  }

  .action-grid button {
    min-height: 104px;
  }

  .route-flow {
    grid-template-columns: 1fr;
  }

  .route-arrow {
    display: none;
  }
}
