: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;
}

.game-toast {
  position: fixed;
  top: 96px;
  right: 24px;
  z-index: 121;
  display: grid;
  gap: 4px;
  width: min(430px, calc(100vw - 32px));
  padding: 15px 18px 15px 20px;
  color: #fff8e8;
  background:
    linear-gradient(135deg, rgba(49, 31, 24, 0.95), rgba(116, 22, 28, 0.95)),
    radial-gradient(circle at 92% 20%, rgba(255, 217, 126, 0.28), transparent 34%);
  border: 1px solid rgba(255, 236, 185, 0.34);
  border-radius: 18px;
  box-shadow: 0 22px 50px rgba(49, 31, 24, 0.28);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-12px) scale(0.98);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.game-toast::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  border-radius: 18px 0 0 18px;
  background: #f3c566;
}

.game-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.game-toast span {
  color: rgba(255, 226, 160, 0.92);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.game-toast strong {
  color: #fffaf0;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 900;
}

.game-toast.toast-fail {
  background:
    linear-gradient(135deg, rgba(109, 16, 22, 0.97), rgba(180, 45, 49, 0.95)),
    radial-gradient(circle at 92% 20%, rgba(255, 210, 135, 0.24), transparent 34%);
}

.game-toast.toast-fail::before {
  background: #ffcf70;
}

.game-toast.toast-success {
  background:
    linear-gradient(135deg, rgba(31, 89, 55, 0.96), rgba(37, 127, 84, 0.94)),
    radial-gradient(circle at 92% 20%, rgba(248, 221, 136, 0.22), transparent 34%);
}

.game-toast.toast-success::before {
  background: #d7b34d;
}

.game-toast.toast-guide {
  background:
    linear-gradient(135deg, rgba(25, 70, 112, 0.96), rgba(40, 111, 163, 0.94)),
    radial-gradient(circle at 92% 20%, rgba(255, 236, 178, 0.24), transparent 34%);
}

.game-toast.toast-guide::before {
  background: #8fd3ff;
}

.game-toast.toast-info {
  background:
    linear-gradient(135deg, rgba(49, 31, 24, 0.95), rgba(116, 22, 28, 0.95)),
    radial-gradient(circle at 92% 20%, rgba(255, 217, 126, 0.28), transparent 34%);
}

.game-toast.toast-info::before {
  background: #f3c566;
}

.game-toast[hidden] {
  display: none;
}

.execution-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 120;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(920px, calc(100vw - 28px));
  min-height: 68px;
  padding: 12px 18px;
  border-radius: 20px;
  color: #fff8e6;
  background:
    radial-gradient(circle at 8% 20%, color-mix(in srgb, var(--actor-color, #c88f31) 42%, transparent), transparent 35%),
    linear-gradient(135deg, rgba(50, 18, 18, 0.97), rgba(118, 25, 30, 0.96));
  border: 1px solid color-mix(in srgb, var(--actor-color, #c88f31) 62%, rgba(255, 240, 190, 0.4));
  box-shadow:
    0 26px 70px rgba(36, 18, 10, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transform: translateX(-50%);
  pointer-events: none;
}

.execution-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: rgba(255, 248, 230, 0.9);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 234, 188, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  pointer-events: auto;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.execution-close:hover {
  color: #74161c;
  background: linear-gradient(135deg, #fff6d1, #efc263);
  transform: scale(1.06);
}

.execution-close:focus-visible {
  outline: 3px solid rgba(255, 226, 140, 0.8);
  outline-offset: 2px;
}

.execution-banner::before {
  content: "";
  width: 14px;
  height: 42px;
  border-radius: 999px;
  background: var(--actor-color, #c88f31);
  box-shadow: 0 0 22px color-mix(in srgb, var(--actor-color, #c88f31) 68%, transparent);
}

.execution-banner span {
  position: absolute;
  top: 9px;
  left: 48px;
  color: rgba(255, 229, 164, 0.88);
  font-size: 12px;
  font-weight: 1000;
}

.execution-banner strong {
  min-width: 0;
  color: #fff8e6;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 1000;
  padding-top: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.execution-banner em {
  justify-self: end;
  border-radius: 999px;
  padding: 10px 14px;
  color: #fff4c2;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 234, 188, 0.24);
  font-size: 18px;
  font-style: normal;
  font-weight: 1000;
  white-space: nowrap;
}

.execution-advisor-action {
  display: none;
}

.execution-banner.is-ai {
  background:
    radial-gradient(circle at 8% 20%, color-mix(in srgb, var(--actor-color, #2375a8) 42%, transparent), transparent 35%),
    linear-gradient(135deg, rgba(22, 34, 62, 0.97), rgba(35, 96, 133, 0.96));
}

.execution-banner.is-waiting em {
  color: #3a1d10;
  background: linear-gradient(135deg, #fff1b8, #f2bd45);
  border-color: rgba(255, 244, 191, 0.88);
  box-shadow:
    0 0 0 0 rgba(255, 210, 78, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: decisionBadgePulse 1.45s ease-in-out infinite;
}

.execution-banner[hidden] {
  display: none;
}

.ai-guide-toast {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 38px;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 226, 140, 0.2), transparent 28%),
    radial-gradient(circle at 50% 52%, rgba(157, 29, 34, 0.34), transparent 48%),
    linear-gradient(135deg, rgba(22, 10, 9, 0.64), rgba(83, 20, 22, 0.5));
  backdrop-filter: blur(5px) saturate(1.12);
}

.ai-guide-toast[hidden] {
  display: none;
}

.ai-guide-card {
  position: relative;
  display: grid;
  gap: 20px;
  width: min(1180px, calc(100vw - 64px));
  min-height: min(58vh, 560px);
  align-content: center;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid rgba(255, 226, 160, 0.7);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 229, 150, 0.44), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.18), transparent 26%),
    repeating-linear-gradient(90deg, rgba(255, 236, 178, 0.055) 0 1px, transparent 1px 76px),
    repeating-linear-gradient(0deg, rgba(255, 236, 178, 0.04) 0 1px, transparent 1px 54px),
    linear-gradient(135deg, rgba(132, 23, 28, 0.98), rgba(48, 17, 18, 0.99) 56%, rgba(112, 68, 21, 0.96));
  box-shadow:
    0 56px 150px rgba(18, 8, 5, 0.62),
    0 0 0 12px rgba(255, 220, 116, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -32px 80px rgba(20, 8, 6, 0.24);
  padding: clamp(44px, 5vw, 72px);
  color: #fff8df;
  text-align: center;
  transform-origin: 86% 34%;
  animation: aiGuideArrive 0.42s cubic-bezier(0.2, 0.82, 0.2, 1) both;
}

.ai-guide-card::before {
  content: "";
  position: absolute;
  inset: -40% auto -40% -28%;
  width: 42%;
  transform: rotate(15deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.46), transparent);
  animation: wowSweep 2.9s ease-in-out infinite;
}

.ai-guide-card::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 26px;
  border: 1px solid rgba(255, 235, 178, 0.32);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 70px rgba(255, 204, 74, 0.16);
  animation: wowFramePulse 2.4s ease-in-out infinite;
  pointer-events: none;
}

.ai-guide-card span {
  position: relative;
  z-index: 1;
  justify-self: center;
  border-radius: 999px;
  padding: 10px 18px;
  color: #74161c;
  background: linear-gradient(135deg, #fff4c0, #e8b747);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
  font-size: 17px;
  font-weight: 1000;
}

.ai-guide-card strong {
  position: relative;
  z-index: 1;
  font-size: clamp(58px, 7vw, 104px);
  line-height: 1.02;
  font-weight: 1000;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.16),
    0 24px 58px rgba(0, 0, 0, 0.42),
    0 0 36px rgba(255, 204, 74, 0.18);
}

.ai-guide-card p {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  max-width: 860px;
  color: rgba(255, 239, 203, 0.86);
  font-size: clamp(21px, 2.1vw, 32px);
  line-height: 1.62;
  font-weight: 900;
}

.ai-guide-toast.collapsing .ai-guide-card {
  animation: aiGuideDock 0.72s cubic-bezier(0.2, 0.72, 0.18, 1) forwards;
}

#advisorAction.guide-docked {
  animation: advisorButtonDockPulse 1.05s ease both;
}

#advisorAction {
  position: relative;
  overflow: hidden;
  min-height: 64px;
  border-radius: 12px;
  border: 1px solid rgba(255, 226, 140, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 38%),
    linear-gradient(135deg, #c2202a, #8f151d 54%, #6f1018);
  box-shadow:
    0 14px 28px rgba(157, 29, 34, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -5px 0 rgba(85, 9, 15, 0.28);
  font-size: 16px;
  font-weight: 1000;
  letter-spacing: 0;
}

#advisorAction::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: translateX(-120%);
  animation: advisorButtonSweep 4.8s ease-in-out infinite;
  pointer-events: none;
}

#advisorAction::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 8px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #ffe28a, transparent);
  opacity: 0.72;
  animation: advisorButtonEnergy 2.8s ease-in-out infinite;
}

#advisorAction:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 18px 34px rgba(157, 29, 34, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -5px 0 rgba(85, 9, 15, 0.24);
}

#advisorAction:disabled {
  opacity: 0.62;
  box-shadow: none;
}

.story-toast {
  position: fixed;
  inset: 0;
  z-index: 129;
  display: grid;
  place-items: center;
  padding: 38px;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 218, 128, 0.24), transparent 28%),
    radial-gradient(circle at 50% 55%, rgba(58, 20, 16, 0.58), transparent 58%),
    linear-gradient(135deg, rgba(27, 18, 14, 0.34), rgba(116, 22, 28, 0.24));
  backdrop-filter: blur(5px) saturate(1.08);
}

.story-toast[hidden] {
  display: none;
}

.story-toast-card {
  position: relative;
  display: grid;
  gap: 20px;
  width: min(1240px, calc(100vw - 64px));
  min-height: min(62vh, 620px);
  align-content: center;
  overflow: hidden;
  border-radius: 36px;
  border: 1px solid rgba(255, 228, 158, 0.68);
  background:
    radial-gradient(circle at 8% 16%, rgba(187, 38, 43, 0.22), transparent 28%),
    radial-gradient(circle at 86% 16%, rgba(255, 230, 150, 0.32), transparent 28%),
    repeating-linear-gradient(90deg, rgba(157, 29, 34, 0.035) 0 1px, transparent 1px 84px),
    repeating-linear-gradient(0deg, rgba(157, 29, 34, 0.025) 0 1px, transparent 1px 58px),
    linear-gradient(135deg, rgba(255, 250, 235, 0.98), rgba(245, 222, 174, 0.94));
  box-shadow:
    0 56px 150px rgba(34, 17, 10, 0.52),
    0 0 0 12px rgba(255, 220, 116, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -36px 86px rgba(157, 29, 34, 0.06);
  padding: clamp(44px, 5vw, 76px);
  color: var(--ink);
  animation: storyToastEnter 0.52s cubic-bezier(0.18, 0.82, 0.22, 1) both;
}

.story-toast-card::before {
  content: "";
  position: absolute;
  inset: -40% auto -40% -30%;
  width: 48%;
  transform: rotate(16deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.54), transparent);
  animation: storyToastSweep 2.8s ease-in-out infinite;
}

.story-toast-card::after {
  content: "";
  position: absolute;
  right: 34px;
  top: 30px;
  width: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(157, 29, 34, 0.2), transparent 58%),
    conic-gradient(from 180deg, rgba(157, 29, 34, 0.22), rgba(200, 143, 49, 0.22), rgba(157, 29, 34, 0.22));
  opacity: 0.86;
  animation: wowOrbSpin 7s linear infinite;
}

.story-toast-card span,
.story-toast-card strong,
.story-toast-card p,
.story-toast-card em {
  position: relative;
  z-index: 1;
}

.story-toast-card span {
  justify-self: start;
  border-radius: 999px;
  padding: 10px 18px;
  color: #fff7dc;
  background: linear-gradient(135deg, var(--red), #c88f31);
  box-shadow: 0 16px 36px rgba(157, 29, 34, 0.16);
  font-size: 16px;
  font-weight: 1000;
}

.story-toast-card strong {
  color: var(--red-deep);
  font-size: clamp(56px, 6.2vw, 96px);
  line-height: 1.02;
  font-weight: 1000;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.86),
    0 22px 54px rgba(73, 43, 23, 0.18);
}

.story-toast-card p {
  max-width: 930px;
  margin: 0;
  color: #3b2b23;
  font-size: clamp(22px, 2.1vw, 32px);
  line-height: 1.55;
  font-weight: 900;
}

.story-toast-card em {
  display: block;
  max-width: 980px;
  border-radius: 22px;
  border: 1px solid rgba(157, 29, 34, 0.16);
  background: rgba(255, 255, 255, 0.54);
  padding: 18px 22px;
  color: #6a1b20;
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1.58;
  font-style: normal;
  font-weight: 1000;
}

.story-toast.leaving .story-toast-card {
  animation: storyToastLeave 0.44s ease forwards;
}

.achievement-banner {
  position: fixed;
  top: 96px;
  left: 50%;
  z-index: 97;
  display: grid;
  gap: 5px;
  width: min(560px, calc(100vw - 36px));
  padding: 18px 22px;
  color: #fff8e4;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 226, 140, 0.36), transparent 42%),
    linear-gradient(135deg, rgba(67, 22, 17, 0.98), rgba(147, 30, 36, 0.97) 54%, rgba(172, 112, 34, 0.96));
  border: 1px solid rgba(255, 232, 160, 0.48);
  border-radius: 22px;
  box-shadow:
    0 24px 70px rgba(49, 31, 24, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(-14px) scale(0.96);
  transition:
    opacity 0.24s ease,
    transform 0.24s ease;
}

.achievement-banner::before,
.achievement-banner::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 224, 140, 0.9), transparent);
}

.achievement-banner::before {
  left: 16px;
}

.achievement-banner::after {
  right: 16px;
}

.achievement-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.achievement-banner span {
  color: #ffe09a;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.12em;
}

.achievement-banner strong {
  color: #fffdf4;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 1000;
}

.achievement-banner em {
  color: rgba(255, 246, 222, 0.94);
  font-size: 14px;
  line-height: 1.45;
  font-style: normal;
  font-weight: 900;
}

.achievement-banner[hidden] {
  display: none;
}

.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;
  width: min(1120px, 100%);
  max-width: 1120px;
  text-align: center;
}

.intro-scene {
  gap: 14px;
  width: min(1280px, 100%);
  max-width: 1280px;
}

.intro-hero {
  display: grid;
  place-items: center;
  gap: 8px;
  width: min(1180px, 100%);
}

.intro-copy {
  display: grid;
  place-items: center;
  gap: 8px;
  max-width: 920px;
}

.intro-home-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.08fr) minmax(390px, 0.92fr);
  align-items: stretch;
  gap: 16px;
  width: min(1180px, 100%);
}

.intro-home-grid .intro-letter,
.intro-home-grid .intro-config {
  width: 100%;
  margin-top: 0;
}

.intro-home-grid .intro-config {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  padding: 18px;
}

.intro-home-grid .intro-config > div,
.intro-home-grid .leader-name-field,
.intro-home-grid .intro-settings-heading,
.intro-home-grid .intro-start {
  grid-column: 1 / -1;
}

.intro-home-grid .leader-name-field {
  grid-template-columns: 1fr;
  min-height: 64px;
}

.intro-home-grid .leader-name-field input {
  max-width: none;
}

.intro-home-grid .intro-config h3 {
  font-size: 22px;
}

.intro-home-grid .intro-settings-heading {
  align-items: center;
  min-height: 26px;
  padding-top: 6px;
}

.intro-epic-title {
  position: relative;
  isolation: isolate;
  display: inline-grid;
  grid-template-columns: auto;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 0 4px;
  padding: 14px clamp(20px, 3.8vw, 58px) 18px;
  color: transparent;
  font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
  font-size: clamp(42px, 6.2vw, 108px);
  font-weight: 1000;
  line-height: 0.96;
  letter-spacing: 0.05em;
  white-space: nowrap;
  background:
    linear-gradient(180deg, #fffdf0 0%, #fff0a8 18%, #f3bd40 38%, #a94d0a 56%, #ffd777 74%, #fff8d7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter:
    drop-shadow(0 5px 0 rgba(78, 18, 4, 0.9))
    drop-shadow(0 14px 0 rgba(72, 12, 8, 0.34))
    drop-shadow(0 28px 50px rgba(0, 0, 0, 0.42));
  transform: translateZ(0);
  animation: epicTitleFloat 5.2s ease-in-out infinite;
}

.intro-epic-title::before {
  content: "";
  position: absolute;
  z-index: -3;
  inset: -30% -10%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 236, 157, 0.54), transparent 46%),
    conic-gradient(from 120deg, transparent 0 12%, rgba(255, 225, 117, 0.42) 18%, transparent 28%, rgba(64, 160, 255, 0.22) 42%, transparent 54%, rgba(255, 255, 255, 0.28) 70%, transparent 86% 100%);
  filter: blur(6px) saturate(1.35);
  opacity: 0.56;
  animation: epicHaloSpin 8.6s linear infinite;
}

.intro-epic-title::after {
  content: "";
  position: absolute;
  inset: 8% -8%;
  z-index: 4;
  background:
    linear-gradient(105deg, transparent 0 35%, rgba(255, 255, 255, 0.86) 43%, rgba(255, 230, 140, 0.5) 48%, transparent 60% 100%);
  filter: blur(0.4px);
  mix-blend-mode: screen;
  transform: translateX(-120%) skewX(-16deg);
  animation: epicTitleSweep 2.85s ease-in-out infinite;
  pointer-events: none;
}

.intro-epic-title b,
.intro-epic-title i {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: -1;
  display: block;
  pointer-events: none;
}

.intro-epic-title b {
  width: min(1060px, 94vw);
  height: 118px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 8% 28%, rgba(255, 255, 255, 0.92) 0 2px, transparent 3px),
    radial-gradient(circle at 21% 62%, rgba(255, 228, 126, 0.8) 0 2px, transparent 3px),
    radial-gradient(circle at 36% 24%, rgba(255, 255, 255, 0.72) 0 1px, transparent 3px),
    radial-gradient(circle at 63% 72%, rgba(255, 235, 148, 0.82) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 32%, rgba(255, 255, 255, 0.7) 0 1px, transparent 3px),
    radial-gradient(circle at 91% 58%, rgba(255, 224, 112, 0.8) 0 2px, transparent 3px),
    linear-gradient(90deg, transparent, rgba(255, 220, 110, 0.42), rgba(255, 255, 255, 0.24), rgba(255, 220, 110, 0.42), transparent),
    repeating-linear-gradient(90deg, transparent 0 58px, rgba(255, 230, 148, 0.22) 59px 60px, transparent 61px 118px);
  box-shadow:
    0 0 38px rgba(255, 204, 73, 0.22),
    0 0 86px rgba(155, 41, 20, 0.3);
  opacity: 0.68;
  transform: translate(-50%, -58%);
  mask-image: linear-gradient(90deg, transparent, black 16%, black 84%, transparent);
  animation: epicLightBand 5s ease-in-out infinite, epicStarDrift 7s linear infinite;
}

.intro-epic-title i {
  width: min(1000px, 90vw);
  height: 2px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 234, 152, 0.9), rgba(255, 255, 255, 0.95), rgba(255, 195, 75, 0.9), transparent);
  box-shadow:
    0 -34px 22px rgba(255, 214, 98, 0.18),
    0 0 18px rgba(255, 229, 142, 0.85),
    0 34px 22px rgba(255, 214, 98, 0.18);
  transform: translate(-50%, -64%);
  animation: epicBladePulse 2.4s ease-in-out infinite;
}

.intro-epic-title span {
  position: relative;
  display: inline-block;
  padding: 0 0.02em;
  white-space: nowrap;
  -webkit-text-stroke: 1.35px rgba(255, 248, 205, 0.82);
  text-shadow:
    0 1px 0 #fff4c0,
    0 0 8px rgba(255, 244, 180, 0.95),
    0 0 24px rgba(244, 184, 54, 0.74),
    0 0 58px rgba(255, 150, 34, 0.42),
    0 8px 0 rgba(82, 18, 8, 0.9),
    0 18px 30px rgba(0, 0, 0, 0.44);
  animation: epicGlyphPulse 3.8s ease-in-out infinite;
}

.intro-epic-title span::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: 2;
  color: transparent;
  background:
    linear-gradient(112deg, transparent 0 30%, rgba(255, 255, 255, 0.98) 42%, rgba(255, 237, 145, 0.72) 50%, transparent 62% 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  filter: blur(0.2px);
  animation: epicGlyphShine 2.9s ease-in-out infinite;
}

.intro-epic-title span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 92%;
  height: 5px;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.94), rgba(255, 218, 103, 0.58) 34%, transparent 68%),
    linear-gradient(90deg, transparent, rgba(255, 232, 135, 0.98), transparent);
  transform: translateX(-50%);
  box-shadow:
    0 0 18px rgba(255, 212, 91, 0.92),
    0 0 46px rgba(255, 157, 32, 0.42);
  animation: epicUnderlinePulse 2.35s ease-in-out infinite;
}

.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-producer {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  justify-self: center;
  width: fit-content;
  max-width: min(920px, 100%);
  margin: 4px 0 2px;
  border: 1px solid rgba(255, 222, 126, 0.66);
  border-radius: 999px;
  padding: 14px 28px;
  color: #fff6cf;
  text-decoration: none;
  background:
    radial-gradient(circle at 18% 50%, rgba(255, 255, 255, 0.3), transparent 28%),
    linear-gradient(135deg, rgba(110, 59, 7, 0.78), rgba(236, 174, 54, 0.42), rgba(94, 43, 8, 0.74));
  box-shadow:
    0 0 0 1px rgba(255, 239, 180, 0.2),
    0 0 48px rgba(244, 190, 75, 0.58),
    0 20px 68px rgba(72, 18, 10, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  text-shadow:
    0 0 10px rgba(255, 231, 150, 0.74),
    0 2px 10px rgba(50, 10, 8, 0.42);
}

.intro-producer::before {
  content: "";
  position: absolute;
  inset: -30% auto -30% -55%;
  width: 44%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: skewX(-18deg);
  animation: introProducerSweep 3.6s ease-in-out infinite;
}

.intro-producer span,
.intro-producer strong {
  position: relative;
  z-index: 1;
}

.intro-producer span {
  border-radius: 999px;
  padding: 7px 13px;
  color: #5f2706;
  background: linear-gradient(135deg, #fff6cf, #f1c35d);
  font-size: clamp(14px, 1.1vw, 18px);
  font-weight: 1000;
}

.intro-producer strong {
  color: #fff8df;
  font-size: clamp(24px, 2.3vw, 38px);
  font-weight: 1000;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.intro-producer:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(255, 239, 180, 0.3),
    0 0 46px rgba(244, 190, 75, 0.58),
    0 20px 58px rgba(72, 18, 10, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.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;
}

.intro-scene h2 {
  font-size: clamp(34px, 4.8vw, 66px);
  line-height: 1.08;
}

.intro-scene p {
  font-size: clamp(16px, 1.45vw, 22px);
}

.intro-music-unlock {
  position: fixed;
  top: 26px;
  right: 30px;
  z-index: 6;
  display: inline-grid;
  grid-template-columns: auto;
  place-items: center;
  gap: 2px;
  min-width: 136px;
  min-height: 54px;
  border: 1px solid rgba(255, 229, 164, 0.74);
  border-radius: 999px;
  padding: 7px 20px;
  color: #5f1217;
  background:
    linear-gradient(135deg, rgba(255, 252, 224, 0.98), rgba(242, 190, 75, 0.96)),
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.7), transparent 38%);
  box-shadow:
    0 16px 34px rgba(75, 11, 16, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  font-weight: 1000;
  letter-spacing: 0;
  cursor: pointer;
}

.intro-music-unlock span {
  font-size: 11px;
  opacity: 0.78;
}

.intro-music-unlock strong {
  font-size: 18px;
  line-height: 1.1;
}

.intro-music-unlock[hidden] {
  display: none;
}

.intro-music-unlock:hover {
  transform: translateY(-1px);
  box-shadow:
    0 20px 42px rgba(75, 11, 16, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.intro-music-unlock[data-state="loading"] {
  color: #5f1217;
  background:
    linear-gradient(110deg, rgba(255, 246, 203, 0.98), rgba(244, 194, 77, 0.92), rgba(255, 246, 203, 0.98));
  background-size: 220% 100%;
  animation: musicButtonFlow 1.2s linear infinite;
}

.intro-music-unlock[data-state="playing"] {
  color: #fff8df;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.28), transparent 32%),
    linear-gradient(135deg, #1f8a59, #0f6d4a);
  border-color: rgba(205, 255, 226, 0.72);
}

.intro-music-unlock[data-state="error"] {
  color: #fff8df;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.22), transparent 32%),
    linear-gradient(135deg, #a81e28, #6b1118);
  border-color: rgba(255, 210, 186, 0.64);
}

.intro-letter {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0;
  width: min(1120px, 100%);
  min-height: 220px;
  border-radius: 24px;
  padding: 16px 18px 42px;
  color: #442418;
  text-align: left;
  perspective: 1200px;
  background: linear-gradient(135deg, rgba(64, 17, 16, 0.28), rgba(255, 219, 130, 0.12));
  border: 1px solid rgba(255, 226, 160, 0.4);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.intro-letter::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 20px;
  pointer-events: none;
  border: 1px solid rgba(255, 226, 160, 0.2);
  background:
    linear-gradient(90deg, transparent, rgba(255, 220, 127, 0.18), transparent),
    repeating-linear-gradient(90deg, rgba(255, 226, 160, 0.08) 0 1px, transparent 1px 186px);
  animation: screenGlow 4.8s ease-in-out infinite alternate;
}

.intro-letter::after {
  content: "";
  position: absolute;
  top: -34%;
  left: -18%;
  width: 34%;
  height: 178%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255, 243, 188, 0.52), transparent);
  transform: rotate(10deg);
  animation: screenLightSweep 5.6s ease-in-out infinite;
}

.intro-letter-seal {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 104px;
  aspect-ratio: 1;
  align-self: center;
  justify-self: center;
  border-radius: 50%;
  color: #fff4d6;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.24), transparent 32%),
    linear-gradient(135deg, #b8242a, #741017);
  border: 4px solid rgba(255, 218, 128, 0.8);
  box-shadow:
    0 15px 34px rgba(87, 16, 18, 0.32),
    inset 0 0 0 2px rgba(255, 247, 210, 0.2);
  font-size: 26px;
  font-weight: 1000;
  animation: sealPulse 3.4s ease-in-out infinite;
}

.intro-letter-paper {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 9px;
  min-width: 0;
  min-height: 164px;
  align-content: center;
  padding: 20px 26px;
  transform-style: preserve-3d;
  border-radius: 18px;
  border: 1px solid rgba(126, 59, 29, 0.24);
  background:
    linear-gradient(90deg, rgba(112, 42, 24, 0.1) 0 1px, transparent 1px 16.66%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.44), rgba(255, 244, 211, 0.82) 14%, rgba(234, 195, 128, 0.74) 16.7%, rgba(255, 247, 219, 0.9) 17%, rgba(255, 237, 190, 0.8) 33%, rgba(209, 161, 84, 0.72) 33.4%, rgba(255, 244, 211, 0.88) 34%, rgba(255, 237, 190, 0.8) 50%, rgba(209, 161, 84, 0.72) 50.4%, rgba(255, 244, 211, 0.88) 51%, rgba(255, 237, 190, 0.8) 66%, rgba(209, 161, 84, 0.72) 66.4%, rgba(255, 244, 211, 0.88) 67%, rgba(255, 237, 190, 0.8) 83%, rgba(209, 161, 84, 0.72) 83.4%, rgba(255, 244, 211, 0.88) 84%),
    #fff0c8;
  box-shadow:
    0 24px 48px rgba(57, 18, 13, 0.26),
    inset 0 0 0 1px rgba(255, 255, 255, 0.62),
    inset 0 -20px 42px rgba(141, 72, 27, 0.12);
}

.intro-letter-paper::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(16.66% - 2px), rgba(92, 38, 22, 0.2) calc(16.66% - 1px) 16.66%),
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.52), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), transparent 42%);
  mix-blend-mode: multiply;
}

.intro-letter-paper::after {
  content: "SIP";
  position: absolute;
  right: 22px;
  bottom: 12px;
  color: rgba(157, 29, 34, 0.16);
  font-size: 42px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  letter-spacing: 0;
}

.intro-letter-paper.unfolding {
  animation: screenUnfold 0.88s cubic-bezier(0.16, 0.84, 0.2, 1) both;
}

.intro-letter-paper span {
  position: relative;
  z-index: 1;
  color: #9d1d22;
  font-size: 14px;
  font-weight: 1000;
}

.intro-letter-paper strong {
  position: relative;
  z-index: 1;
  color: #2d201a;
  font-size: clamp(28px, 2.5vw, 42px);
  line-height: 1.05;
  font-weight: 1000;
}

.intro-letter-paper p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #4a3429;
  font-size: 18px;
  line-height: 1.55;
  font-weight: 900;
  text-shadow: none;
}

.intro-letter-paper em {
  position: relative;
  z-index: 1;
  color: #7a4e32;
  font-size: 16px;
  line-height: 1.45;
  font-style: normal;
  font-weight: 900;
}

.intro-letter-years {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.intro-letter-years i {
  display: grid;
  place-items: center;
  min-height: 28px;
  border-radius: 999px;
  color: rgba(75, 45, 31, 0.62);
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(122, 77, 45, 0.12);
  font-style: normal;
  font-size: 12px;
  font-weight: 1000;
}

.intro-letter-years i.active {
  color: #fff7de;
  background: linear-gradient(135deg, #b8242a, #d19a34);
  box-shadow: 0 8px 20px rgba(157, 29, 34, 0.26);
}

.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-config {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) minmax(170px, 0.8fr);
  gap: 12px;
  width: min(1120px, 100%);
  margin-top: 2px;
  border-radius: 18px;
  border: 1px solid rgba(255, 226, 160, 0.26);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 219, 128, 0.14), transparent 35%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  padding: 16px;
  backdrop-filter: blur(14px);
}

.intro-config > div {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
}

.intro-config h3 {
  margin: 0;
  color: #fff8df;
  font-size: 23px;
  line-height: 1.1;
}

.intro-config span {
  color: rgba(255, 232, 178, 0.82);
  font-size: 14px;
  font-weight: 900;
}

.intro-config label {
  position: relative;
  display: grid;
  gap: 7px;
  color: rgba(255, 239, 202, 0.9);
  text-align: left;
  font-size: 13px;
  font-weight: 1000;
}

.intro-config select,
.intro-config input {
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid rgba(255, 226, 160, 0.3);
  color: #fff8e6;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
    rgba(35, 13, 16, 0.62);
  padding: 0 12px;
  font-weight: 1000;
  outline: none;
}

.intro-config input::placeholder {
  color: rgba(255, 239, 202, 0.56);
}

.intro-config select:focus-visible,
.intro-config input:focus-visible {
  border-color: rgba(255, 226, 160, 0.82);
  box-shadow: 0 0 0 4px rgba(255, 208, 92, 0.18);
}

.intro-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.intro-select {
  position: relative;
  z-index: 20;
}

.intro-select.open {
  z-index: 80;
}

.intro-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(255, 226, 160, 0.32);
  border-radius: 12px;
  color: #fff8e6;
  background:
    radial-gradient(circle at 82% 22%, rgba(255, 219, 128, 0.16), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
    rgba(35, 13, 16, 0.66);
  padding: 0 14px;
  text-align: left;
  font-weight: 1000;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 26px rgba(33, 8, 12, 0.16);
}

.intro-select-trigger i {
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255, 239, 202, 0.9);
  border-bottom: 2px solid rgba(255, 239, 202, 0.9);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.18s ease;
}

.intro-select.open .intro-select-trigger {
  border-color: rgba(255, 226, 160, 0.86);
  box-shadow:
    0 0 0 4px rgba(255, 208, 92, 0.16),
    0 16px 34px rgba(33, 8, 12, 0.24);
}

.intro-select.open .intro-select-trigger i {
  transform: rotate(225deg) translate(-2px, -2px);
}

.intro-select-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 226, 160, 0.36);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 246, 214, 0.16), rgba(255, 255, 255, 0.04)),
    rgba(59, 19, 23, 0.98);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  padding: 8px;
  backdrop-filter: blur(18px);
}

.intro-select-list[hidden] {
  display: none;
}

.intro-select-option {
  min-height: 42px;
  border-radius: 10px;
  color: #fff4d5;
  background: transparent;
  padding: 0 12px;
  text-align: left;
  font-weight: 1000;
}

.intro-select-option:hover,
.intro-select-option.selected {
  color: #601117;
  background:
    linear-gradient(135deg, rgba(255, 246, 209, 0.98), rgba(238, 187, 82, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.leader-name-field {
  position: relative;
  grid-column: 1 / -1;
  grid-template-columns: 150px minmax(280px, 1fr);
  align-items: center;
  min-height: 70px;
  border-radius: 14px;
  border: 1px solid rgba(255, 226, 160, 0.24);
  background:
    radial-gradient(circle at 8% 50%, rgba(255, 220, 118, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
  padding: 10px 12px;
  font-size: 14px;
}

.leader-name-field input {
  max-width: 640px;
  font-size: 20px;
  color: #fff4c7;
  background:
    radial-gradient(circle at 88% 50%, rgba(255, 220, 118, 0.18), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)),
    rgba(35, 13, 16, 0.68);
}

.intro-settings-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  border-top: 1px solid rgba(255, 226, 160, 0.16);
  padding-top: 8px;
  text-align: left;
}

.intro-settings-heading strong {
  color: #fff8df;
  font-size: 18px;
}

.intro-settings-heading span {
  color: rgba(255, 232, 178, 0.78);
}

.intro-start {
  align-self: end;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  border-radius: 14px;
  color: #6b1419;
  background: linear-gradient(135deg, #fff5c8, #e8b747);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  font-size: 16px;
  font-weight: 1000;
}

.intro-start:disabled {
  cursor: wait;
  opacity: 0.74;
}

.intro-overlay.setup-mode #introCountdown {
  display: none;
}

.intro-overlay.countdown-mode .intro-config {
  display: none;
}

.intro-overlay.countdown-mode .intro-letter {
  display: none;
}

.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,
.mission-strip,
.timeline-panel,
.workspace,
.player-board,
.operations-row,
.production-panel,
.card-library-panel,
.action-dock {
  margin-bottom: 16px;
}

.topbar {
  display: grid;
  position: relative;
  grid-template-columns: minmax(360px, 0.78fr) minmax(520px, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(200, 143, 49, 0.26);
  border-radius: 22px;
  background:
    linear-gradient(120deg, rgba(255, 252, 243, 0.96), rgba(246, 229, 194, 0.88), rgba(255, 250, 235, 0.95)),
    repeating-linear-gradient(90deg, rgba(157, 29, 34, 0.04) 0 1px, transparent 1px 88px);
  background-size: 180% 100%, 88px 100%;
  box-shadow:
    0 22px 70px rgba(73, 43, 23, 0.17),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  overflow: hidden;
  animation: commandSurfaceDrift 14s ease-in-out infinite alternate;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: -30% -20%;
  background:
    linear-gradient(110deg, transparent 12%, rgba(255, 255, 255, 0.36) 34%, transparent 48%),
    linear-gradient(rgba(93, 54, 28, 0.035) 1px, transparent 1px);
  background-size: 260% 100%, 100% 30px;
  pointer-events: none;
  animation: commandSweep 7.5s ease-in-out infinite;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 226, 150, 0.38);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    inset 0 -20px 46px rgba(157, 29, 34, 0.05);
  pointer-events: none;
}

.topbar > section {
  position: relative;
  z-index: 1;
}

.brand-panel {
  position: relative;
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 132px;
  padding: 14px 18px;
  overflow: hidden;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 252, 243, 0.82), rgba(255, 245, 219, 0.38)),
    repeating-linear-gradient(135deg, rgba(157, 29, 34, 0.05) 0 1px, transparent 1px 24px);
  border: 1px solid rgba(200, 143, 49, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 12px 30px rgba(73, 43, 23, 0.08);
}

.brand-panel::before {
  content: "";
  position: absolute;
  left: -20%;
  right: -20%;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #9d1d22, #f2c762, transparent);
  animation: commandLineRun 5.2s linear infinite;
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: auto 18px 16px;
  height: 1px;
  background: linear-gradient(90deg, rgba(157, 29, 34, 0.34), rgba(200, 143, 49, 0.7), transparent);
  transform-origin: left;
  animation: commandPulseLine 3.2s ease-in-out infinite;
}

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

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

.top-actions .secondary {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 1000;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 247, 226, 0.72));
  border: 1px solid rgba(157, 29, 34, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(73, 43, 23, 0.08);
}

.top-actions .secondary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.46), transparent);
  transform: translateX(-120%);
  animation: controlSweep 6s ease-in-out infinite;
  pointer-events: none;
}

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

.audio-toggle.active,
.mp3-toggle.active,
.speed-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,
.mp3-toggle.active::after,
.speed-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 {
  position: relative;
  justify-self: start;
  margin: 0 0 10px;
  border-radius: 999px;
  padding: 6px 10px;
  color: #8f1d24;
  background: rgba(157, 29, 34, 0.08);
  border: 1px solid rgba(157, 29, 34, 0.16);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 1000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.producer-line {
  position: relative;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid rgba(200, 143, 49, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 248, 224, 0.84), rgba(255, 255, 255, 0.46)),
    radial-gradient(circle at 8% 50%, rgba(157, 29, 34, 0.1), transparent 36%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 8px 22px rgba(73, 43, 23, 0.08);
  padding: 7px 13px;
  color: #6f1018;
  overflow: hidden;
}

.producer-line:hover {
  transform: translateY(-1px);
  border-color: rgba(200, 143, 49, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 12px 26px rgba(73, 43, 23, 0.12);
}

.producer-line:focus-visible {
  outline: 3px solid rgba(200, 143, 49, 0.48);
  outline-offset: 3px;
}

.producer-line::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: translateX(-120%);
  animation: producerLineSweep 6.6s ease-in-out infinite;
  pointer-events: none;
}

.producer-line span,
.producer-line strong {
  position: relative;
  z-index: 1;
}

.producer-line span {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: #fff7dc;
  background: linear-gradient(135deg, var(--red), #b56f22);
  font-size: 12px;
  font-weight: 1000;
}

.producer-line strong {
  color: #6f1018;
  font-size: clamp(15px, 1.05vw, 18px);
  line-height: 1.2;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  position: relative;
  width: fit-content;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
  color: #311f18;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.72),
    0 14px 34px rgba(73, 43, 23, 0.12);
}

h1::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0 28%, rgba(255, 255, 255, 0.82) 42%, transparent 58% 100%);
  mix-blend-mode: screen;
  transform: translateX(-120%);
  animation: titleGleam 5.8s ease-in-out infinite;
  pointer-events: none;
}

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

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

.score-strip div,
.setup-panel,
.mission-strip,
.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 {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 2px;
  min-height: 66px;
  padding: 10px 12px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 252, 244, 0.92), rgba(246, 231, 197, 0.78)),
    repeating-linear-gradient(90deg, rgba(157, 29, 34, 0.035) 0 1px, transparent 1px 28px);
  border-color: rgba(200, 143, 49, 0.24);
  box-shadow:
    0 12px 28px rgba(73, 43, 23, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  animation: metricFloat 5.2s ease-in-out infinite;
}

.score-strip div:nth-child(2) {
  animation-delay: -0.6s;
}

.score-strip div:nth-child(3) {
  animation-delay: -1.2s;
}

.score-strip div:nth-child(4) {
  animation-delay: -1.8s;
}

.score-strip div:nth-child(5) {
  animation-delay: -2.4s;
}

.score-strip div::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 12%, rgba(255, 255, 255, 0.58) 34%, transparent 52%);
  transform: translateX(-120%);
  animation: metricScan 6.4s ease-in-out infinite;
  pointer-events: none;
}

.score-strip div::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 7px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), var(--gold), transparent);
  opacity: 0.42;
  transform-origin: left;
  animation: metricPulseLine 3.6s ease-in-out infinite;
}

.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;
}

.funds-ledger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-radius: 10px;
  border: 1px solid rgba(200, 143, 49, 0.34);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 229, 146, 0.34), transparent 34%),
    linear-gradient(135deg, rgba(255, 248, 222, 0.94), rgba(247, 228, 178, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 10px 22px rgba(93, 54, 28, 0.09);
  padding: 10px;
}

.funds-ledger div {
  display: grid;
  gap: 2px;
}

.funds-ledger span,
.funds-ledger em {
  color: #6d5545;
  font-size: 12px;
  line-height: 1.25;
  font-style: normal;
  font-weight: 900;
}

.funds-ledger strong {
  color: var(--red-deep);
  font-size: 28px;
  line-height: 1;
  font-weight: 1000;
}

.funds-ledger p {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 7px 10px;
  color: #4b382d;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(93, 54, 28, 0.12);
  font-size: 12px;
  white-space: nowrap;
  font-weight: 1000;
}

.funds-ledger b {
  color: var(--red);
}

.mission-strip {
  display: grid;
  grid-template-columns: minmax(210px, 0.78fr) minmax(420px, 1.5fr) minmax(380px, 1.32fr) minmax(300px, 1fr);
  gap: 10px;
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(48, 16, 15, 0.95), rgba(139, 27, 36, 0.9)),
    #3a1714;
  color: white;
}

.mission-strip article {
  display: grid;
  gap: 5px;
  min-height: 70px;
  border-radius: 7px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 232, 168, 0.18);
}

.mission-strip article:nth-child(2) {
  background:
    radial-gradient(circle at 92% 18%, rgba(255, 213, 114, 0.18), transparent 34%),
    rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 221, 136, 0.34);
}

.mission-strip span {
  color: #f2c762;
  font-size: 12px;
  font-weight: 1000;
}

.mission-strip strong {
  color: #fff8e8;
  font-size: 15px;
  line-height: 1.38;
  font-weight: 1000;
  overflow-wrap: anywhere;
}

.mission-strip em {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  color: #fff5d5;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 232, 168, 0.2);
  font-size: 12px;
  line-height: 1.2;
  font-style: normal;
  font-weight: 1000;
}

.mission-strip em.pace-good {
  color: #eaffdf;
  background: rgba(61, 143, 82, 0.28);
  border-color: rgba(170, 238, 156, 0.36);
}

.mission-strip em.pace-warn {
  color: #fff5d7;
  background: rgba(200, 143, 49, 0.28);
  border-color: rgba(255, 224, 142, 0.4);
}

.mission-strip em.pace-danger {
  color: #ffe5e5;
  background: rgba(157, 29, 34, 0.34);
  border-color: rgba(255, 178, 178, 0.38);
}

#missionNextBreakthrough {
  color: #fff8e6;
  background: rgba(255, 226, 140, 0.13);
  border-color: rgba(255, 226, 140, 0.28);
}

.score-strip strong {
  position: relative;
  color: #281913;
  font-size: 25px;
  line-height: 1.05;
  font-weight: 1000;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.78);
}

.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) 390px;
  gap: 16px;
  align-items: start;
}

.board-zone {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.map-player-board {
  grid-column: 1;
  grid-row: 2;
  margin-bottom: 0;
}

.side-log-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.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 {
  position: relative;
  display: grid;
  gap: 8px;
}

.turn-card::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 210, 78, 0.36);
  opacity: 0;
  pointer-events: none;
  animation: decisionSoftRing 2.2s ease-in-out infinite;
}

.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-card.acting-seat {
  position: relative;
  outline: 3px solid color-mix(in srgb, var(--team-color) 42%, rgba(255, 214, 94, 0.6));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--team-color) 10%, transparent), transparent 48%),
    rgba(255, 249, 231, 0.98);
  box-shadow:
    0 0 0 5px rgba(255, 211, 92, 0.14),
    0 18px 34px rgba(70, 42, 22, 0.16);
}

.team-card.acting-seat::after {
  content: "当前行动";
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff8e4;
  background: linear-gradient(135deg, var(--team-color), var(--red-deep));
  font-size: 11px;
  line-height: 1;
  font-weight: 1000;
  box-shadow: 0 8px 18px rgba(70, 42, 22, 0.18);
  animation: decisionBadgePulse 1.55s ease-in-out infinite;
}

.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);
}

.acting-chip {
  color: #fff8e4;
  background: linear-gradient(135deg, var(--team-color), var(--red-deep));
  border-color: rgba(255, 244, 210, 0.64);
  animation: decisionBadgePulse 1.55s ease-in-out infinite;
}

.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-mini-card {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 84px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--team-color) 34%, rgba(93, 54, 28, 0.18));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--team-color) 12%, transparent), transparent 48%),
    #fffaf0;
  box-shadow: inset 4px 0 0 var(--team-color);
  padding: 9px;
  text-align: left;
  color: var(--ink);
}

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

.assignment-mini-card .talent-piece {
  width: 18px;
  height: 20px;
}

.assignment-mini-card b,
.assignment-mini-card em,
.assignment-mini-card small,
.assignment-mini-card strong {
  overflow-wrap: anywhere;
}

.assignment-mini-card b {
  color: var(--team-color);
  font-size: 13px;
  font-weight: 1000;
}

.assignment-mini-card em {
  justify-self: end;
  color: #6a5546;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.assignment-mini-card strong {
  color: var(--red-deep);
  font-size: 14px;
  line-height: 1.25;
}

.assignment-mini-card small {
  color: #4d3c31;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
}

.assignment-mini-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--team-color) 56%, rgba(93, 54, 28, 0.2));
  box-shadow: inset 4px 0 0 var(--team-color), 0 10px 22px rgba(70, 42, 22, 0.13);
}

.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-column: 1 / -1;
  grid-template-columns: auto 1fr auto;
}

.funds-badge small {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #6d5545;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 900;
}

.funds-badge small .resource-icon {
  width: 14px;
  height: 14px;
}

.funds-badge small .resource-icon.ingot {
  height: 10px;
}

.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.funds {
  border-radius: 7px;
  background:
    radial-gradient(circle at 36% 30%, #fff4bd 0 18%, transparent 19%),
    linear-gradient(135deg, #e7bc45, #a76519);
  box-shadow: inset 0 -4px 0 rgba(108, 70, 14, 0.2);
}

.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;
}

.option-status {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  color: #4d3c31;
  background: rgba(93, 54, 28, 0.09);
  border: 1px solid rgba(93, 54, 28, 0.12);
  font-size: 12px;
  font-weight: 1000;
}

.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);
}

.produce-option.recommended-option {
  position: relative;
  border-color: rgba(196, 136, 36, 0.72);
  background:
    linear-gradient(135deg, rgba(255, 222, 139, 0.28), transparent 42%),
    linear-gradient(180deg, #fffdf8, #fff4d8);
  box-shadow: 0 14px 32px rgba(142, 91, 24, 0.16);
  animation: recommendedCardGlow 1.9s ease-in-out infinite;
}

.recommended-option:not(.produce-option) {
  position: relative;
  border-color: rgba(196, 136, 36, 0.72) !important;
  background:
    linear-gradient(135deg, rgba(255, 222, 139, 0.28), transparent 42%),
    linear-gradient(180deg, #fffdf8, #fff4d8) !important;
  box-shadow: 0 14px 32px rgba(142, 91, 24, 0.16);
  animation: recommendedCardGlow 1.9s ease-in-out infinite;
}

.produce-option.recommended-option .option-status {
  color: #3b2112;
  background: linear-gradient(135deg, #ffe8a2, #f4bd43);
  border-color: rgba(255, 239, 178, 0.9);
  animation: decisionBadgePulse 1.45s ease-in-out infinite;
}

.recommended-option:not(.produce-option) span:first-child {
  display: inline-grid;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  color: #3b2112;
  background: linear-gradient(135deg, #ffe8a2, #f4bd43);
  border: 1px solid rgba(255, 239, 178, 0.9);
  animation: decisionBadgePulse 1.45s ease-in-out infinite;
}

.produce-option.option-ready:not(.recommended-option) .option-status {
  color: #145d37;
  background: rgba(52, 151, 78, 0.14);
  border-color: rgba(52, 151, 78, 0.22);
}

.produce-option.option-blocked:not(.recommended-option) {
  background: linear-gradient(180deg, #fffaf0, #f2eadc);
}

.produce-option.option-blocked:not(.recommended-option) .option-status {
  color: #7a5840;
  background: rgba(122, 88, 64, 0.12);
}

.produce-option button:disabled {
  cursor: not-allowed;
  background: #9f938a;
}

.ai-preview-target {
  position: relative;
  outline: 3px solid rgba(255, 205, 86, 0.95) !important;
  box-shadow:
    0 0 0 7px rgba(255, 205, 86, 0.2),
    0 18px 38px rgba(70, 42, 22, 0.18) !important;
  animation: aiPreviewPulse 0.72s ease-in-out infinite alternate;
}

.ai-preview-target::after {
  content: "AI 即将执行";
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  border-radius: 999px;
  padding: 5px 9px;
  color: #3a1d10;
  background: linear-gradient(135deg, #ffe7a4, #f2bd45);
  border: 1px solid rgba(255, 244, 191, 0.8);
  font-size: 11px;
  line-height: 1;
  font-weight: 1000;
  pointer-events: none;
}

.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-output-block {
  display: grid;
  gap: 5px;
  margin-top: 2px;
}

.card-output-block > span {
  color: var(--red-deep);
  font-size: 12px;
  font-weight: 1000;
}

.card-output-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card-output-list li {
  position: relative;
  padding-left: 14px;
  color: #4d3c31;
  font-size: 13px;
  line-height: 1.38;
  font-weight: 800;
}

.card-output-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  transform: translateY(-50%);
}

.factory-output-list {
  display: grid;
  gap: 3px;
  grid-column: 2 / -1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.factory-output-list li {
  position: relative;
  padding-left: 13px;
  color: #4d3c31;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 850;
}

.factory-output-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  transform: translateY(-50%);
}

.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;
}

#confirmSystem:disabled,
#confirmLand:disabled,
.card button:disabled,
.produce-option button:disabled,
.inline-form button:disabled {
  cursor: not-allowed;
  background: #9f938a;
  color: #fff6e6;
}

.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.action-recommended {
  border-color: rgba(255, 220, 116, 0.82) !important;
  animation: recommendedActionPulse 1.65s ease-in-out infinite;
}

.action-grid button.action-recommended .action-status {
  color: #3a1d10;
  background: linear-gradient(135deg, #ffe7a4, #f2bd45);
  border-color: rgba(255, 244, 191, 0.8);
  animation: decisionBadgePulse 1.45s ease-in-out infinite;
}

.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;
  margin-top: 10px;
}

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

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

.factory-target-picker label {
  display: grid;
  gap: 5px;
  color: #4d3c31;
  font-size: 13px;
  font-weight: 900;
}

.factory-target-picker select {
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid rgba(93, 54, 28, 0.22);
  background: #fffaf0;
  color: var(--ink);
  padding: 0 10px;
  font-weight: 900;
}

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

.decision-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
  min-height: 108px;
  border-radius: 12px;
  border: 1px solid rgba(93, 54, 28, 0.15);
  background:
    radial-gradient(circle at 4% 0%, rgba(200, 143, 49, 0.16), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 246, 224, 0.94));
  padding: 14px;
}

.decision-hero > div:first-child {
  display: grid;
  align-content: center;
  gap: 5px;
}

.decision-hero span,
.flow-input span,
.flow-output span,
.decision-option span,
.recall-summary-grid span,
.recall-assignment span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 1000;
}

.decision-hero strong {
  color: var(--ink);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.08;
  font-weight: 1000;
}

.decision-hero p {
  max-width: 780px;
  margin: 0;
  color: #5c493b;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
}

.decision-meter {
  display: grid;
  place-items: center;
  align-content: center;
  min-width: 128px;
  border-radius: 10px;
  color: #fff8df;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 232, 150, 0.26), transparent 48%),
    linear-gradient(135deg, var(--red-deep), var(--red));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.decision-meter b {
  font-size: 34px;
  line-height: 1;
  font-weight: 1000;
}

.decision-meter em {
  color: rgba(255, 245, 220, 0.9);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.upgraded-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

.upgraded-flow > b {
  display: grid;
  place-items: center;
  width: 42px;
  border-radius: 10px;
  color: var(--red);
  background: rgba(255, 246, 224, 0.84);
  border: 1px solid rgba(93, 54, 28, 0.12);
  font-size: 22px;
}

.flow-input,
.flow-output {
  display: grid;
  gap: 6px;
  min-height: 104px;
  border-radius: 12px;
  border: 1px solid rgba(93, 54, 28, 0.14);
  background: rgba(255, 250, 240, 0.86);
  padding: 14px;
}

.flow-input strong,
.flow-output strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 1000;
}

.flow-input em,
.flow-output em {
  color: #6b5747;
  font-size: 13px;
  line-height: 1.4;
  font-style: normal;
  font-weight: 800;
}

.decision-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.decision-option {
  display: grid;
  gap: 5px;
  min-height: 116px;
  border-radius: 12px;
  border: 1px solid rgba(93, 54, 28, 0.16);
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(255, 247, 229, 0.88)),
    radial-gradient(circle at 100% 0%, rgba(79, 140, 85, 0.12), transparent 42%);
  padding: 13px;
  box-shadow: 0 12px 24px rgba(73, 43, 23, 0.06);
}

.decision-option strong {
  color: var(--red-deep);
  font-size: 20px;
  line-height: 1.1;
  font-weight: 1000;
}

.decision-option em,
.decision-option i {
  color: #5d493b;
  font-size: 12px;
  line-height: 1.35;
  font-style: normal;
  font-weight: 900;
}

.decision-option:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.decision-primary {
  justify-self: start;
  min-height: 48px;
  border-radius: 12px;
  padding: 0 22px;
  color: #fff7df;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  box-shadow: 0 14px 30px rgba(116, 22, 28, 0.22);
  font-weight: 1000;
}

.decision-primary:disabled {
  cursor: not-allowed;
  color: rgba(76, 57, 46, 0.58);
  background: rgba(93, 54, 28, 0.13);
  box-shadow: none;
}

.system-progress-board {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
}

.system-progress-board span {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 10px;
  color: #7a6250;
  background: rgba(255, 250, 240, 0.82);
  border: 1px solid rgba(93, 54, 28, 0.14);
  font-size: 14px;
  font-weight: 1000;
}

.system-progress-board span.done {
  color: #fff8df;
  background: linear-gradient(135deg, var(--green), #2f713c);
  border-color: rgba(194, 235, 174, 0.44);
}

.system-progress-board span.next {
  color: #3f2317;
  background: linear-gradient(135deg, #ffe6a0, #d7a23a);
  border-color: rgba(255, 240, 184, 0.88);
  box-shadow: 0 0 0 3px rgba(215, 162, 58, 0.16);
}

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

.recall-summary-grid article {
  display: grid;
  gap: 4px;
  border-radius: 12px;
  border: 1px solid rgba(93, 54, 28, 0.13);
  background: rgba(255, 250, 240, 0.86);
  padding: 12px;
}

.recall-summary-grid strong {
  color: var(--red);
  font-size: 26px;
  line-height: 1;
}

.recall-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.recall-assignment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-radius: 12px;
  border: 1px solid rgba(93, 54, 28, 0.14);
  background: rgba(255, 250, 240, 0.9);
  padding: 12px;
}

.recall-assignment div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.recall-assignment strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 1000;
}

.recall-assignment em {
  color: #6b5747;
  font-size: 12px;
  line-height: 1.35;
  font-style: normal;
  font-weight: 800;
}

.log-panel {
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  overflow: hidden;
}

.side-log-panel {
  position: sticky;
  top: 14px;
  min-height: 0;
  height: auto;
  max-height: none;
  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: 0 -14px 10px;
  padding: 12px 14px 10px;
  background: rgba(255, 250, 239, 0.96);
  border-bottom: 1px solid var(--line);
}

.side-timeline {
  width: 100%;
  margin: -2px 0 12px;
  border: 1px solid rgba(93, 54, 28, 0.14);
  border-radius: 12px;
}

.side-timeline .timeline-story {
  grid-template-columns: 86px minmax(0, 1fr);
  min-height: 0;
  padding: 10px;
}

.side-timeline .timeline-current {
  min-height: 0;
  padding-right: 10px;
}

.side-timeline .timeline-current span {
  font-size: 19px;
}

.side-timeline .timeline-current strong {
  font-size: 12px;
}

.side-timeline .timeline-current em {
  font-size: 10px;
}

.side-timeline .timeline-copy {
  gap: 5px;
}

.side-timeline .timeline-story p {
  font-size: 11px;
  line-height: 1.36;
}

.side-timeline .timeline-inline-progress {
  grid-column: 1 / -1;
  border-left: 0;
  border-top: 1px solid rgba(93, 54, 28, 0.12);
  padding-left: 0;
  padding-top: 8px;
}

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

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

.side-command-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 10px -4px 0;
  padding-top: 10px;
  border-top: 1px solid rgba(93, 54, 28, 0.16);
}

.side-command-row .turn-card,
.side-command-row .advisor-card {
  padding: 10px;
  box-shadow: none;
  background: rgba(255, 250, 239, 0.82);
}

.side-command-row .turn-card strong {
  font-size: 28px;
  line-height: 1.05;
}

.side-command-row .advisor-card {
  gap: 8px;
  border-color: rgba(157, 29, 34, 0.2);
  background: linear-gradient(180deg, rgba(255, 250, 239, 0.94), rgba(255, 244, 222, 0.9));
}

.side-command-row .advisor-card .section-heading {
  margin-bottom: 2px;
}

.advisor-heading {
  align-items: start;
}

.advisor-heading > div {
  display: grid;
  gap: 2px;
}

.advisor-heading h2 {
  font-size: 18px;
}

.compact-guide-select {
  display: grid;
  min-width: 142px;
}

.compact-guide-select select {
  min-height: 34px;
  border-radius: 7px;
  border: 1px solid rgba(157, 29, 34, 0.34);
  background: #fffaf0;
  color: var(--ink);
  padding: 0 8px;
  font-size: 13px;
  font-weight: 900;
}

.side-command-row .advisor-card p,
.side-command-row .turn-card p {
  font-size: 13px;
  line-height: 1.42;
}

.side-action-dock {
  display: grid;
  min-height: 0;
  margin: 10px -4px 0;
}

.side-action-dock .action-panel {
  display: grid;
  grid-template-rows: auto auto;
  min-height: 0;
  padding: 10px;
  border-radius: 12px;
  box-shadow: none;
  background:
    linear-gradient(180deg, rgba(67, 22, 17, 0.98), rgba(91, 26, 24, 0.97));
}

.side-action-dock .section-heading {
  margin-bottom: 8px;
}

.side-action-dock h2 {
  font-size: 18px;
}

.side-action-dock .section-heading p,
.side-action-dock .section-heading span {
  font-size: 12px;
  line-height: 1.35;
}

.side-action-dock .action-grid {
  grid-template-columns: 1fr;
  grid-template-rows: repeat(6, 86px);
  gap: 8px;
  height: auto;
  align-content: start;
}

.action-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 232, 168, 0.16);
}

.tool-button {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 88px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 232, 168, 0.24);
  color: #fff7df;
  text-align: left;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 223, 130, 0.24), transparent 30%),
    linear-gradient(135deg, rgba(255, 250, 238, 0.16), rgba(255, 250, 238, 0.06));
  padding: 13px 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 28px rgba(20, 10, 4, 0.14);
}

.tool-button::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 232, 168, 0.36);
  background:
    linear-gradient(135deg, rgba(255, 232, 168, 0.28), rgba(255, 255, 255, 0.04));
  transform: translateY(-50%);
}

.tool-button span {
  color: #f2c762;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 1000;
}

.tool-button strong {
  color: #fffaf0;
  font-size: 18px;
  line-height: 1.12;
  font-weight: 1000;
}

.tool-button em {
  max-width: calc(100% - 32px);
  color: rgba(255, 244, 220, 0.78);
  font-size: 12px;
  line-height: 1.35;
  font-style: normal;
  font-weight: 850;
}

.tool-button:hover,
.tool-button:focus-visible {
  border-color: rgba(255, 220, 116, 0.72);
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 223, 130, 0.32), transparent 30%),
    linear-gradient(135deg, rgba(255, 250, 238, 0.22), rgba(255, 250, 238, 0.08));
  transform: translateY(-1px);
}

.card-tool {
  box-shadow:
    inset 4px 0 0 rgba(242, 199, 98, 0.88),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 28px rgba(20, 10, 4, 0.14);
}

.situation-tool {
  box-shadow:
    inset 4px 0 0 rgba(113, 176, 115, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 28px rgba(20, 10, 4, 0.14);
}

.side-action-dock .action-grid button {
  min-height: 86px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  grid-template-rows: 1fr;
  gap: 10px;
  padding: 14px 14px;
  align-content: center;
  align-items: center;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 250, 238, 0.13), rgba(255, 250, 238, 0.05)),
    rgba(255, 255, 255, 0.06);
}

.side-action-dock .action-grid button::after {
  display: none;
}

.side-action-dock .action-grid button small {
  grid-row: 1;
  grid-column: 1;
  display: grid;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(255, 232, 161, 0.16);
  font-size: 11px;
}

.side-action-dock .action-grid button strong {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  font-size: 17px;
  line-height: 1.12;
}

.side-action-dock .action-grid button em {
  display: none;
}

.side-action-dock .action-status {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  min-width: 56px;
  border-radius: 999px;
  padding: 6px 9px;
  color: rgba(255, 250, 230, 0.94);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 1000;
  text-align: center;
  white-space: nowrap;
}

.side-action-dock .action-ready .action-status {
  color: #ecffe9;
  background: rgba(42, 128, 69, 0.34);
  border-color: rgba(172, 235, 160, 0.36);
}

.side-action-dock .action-blocked .action-status {
  color: #fff4da;
  background: rgba(116, 91, 64, 0.34);
  border-color: rgba(255, 226, 176, 0.2);
}

.side-action-dock .action-done .action-status {
  color: #eef7ff;
  background: rgba(58, 91, 128, 0.34);
  border-color: rgba(179, 216, 255, 0.28);
}

.side-action-dock .action-recommended {
  border-color: rgba(255, 220, 116, 0.82) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 3px rgba(255, 204, 74, 0.18);
  animation: recommendedActionPulse 1.65s ease-in-out infinite;
}

.side-action-dock .action-recommended .action-status {
  color: #3a1d10;
  background: linear-gradient(135deg, #ffe7a4, #f2bd45);
  border-color: rgba(255, 244, 191, 0.8);
  animation: decisionBadgePulse 1.45s ease-in-out infinite;
}

#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: 1fr;
  grid-template-rows: auto;
  gap: 0;
  aspect-ratio: auto;
  min-height: 0;
  padding: 10px;
  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: 2;
}

.module-systems {
  grid-column: auto;
  grid-row: auto;
}

.model-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  padding: 8px;
}

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

.factory-icon,
.gate-icon,
.office-icon {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 30px;
  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: 12px;
  height: 28px;
  border: 4px 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;
  counter-reset: system-step;
  width: min(620px, 42vw);
  height: auto;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 5px;
  padding: 0;
}

.code-board .system-dot {
  position: relative;
  min-height: 18px;
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent),
    rgba(255, 248, 231, 0.26);
  box-shadow:
    inset 0 0 0 1px rgba(255, 238, 191, 0.3),
    0 3px 7px rgba(60, 20, 14, 0.18);
}

.code-board .system-dot::after {
  content: counter(system-step);
  counter-increment: system-step;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 250, 232, 0.72);
  font-size: 10px;
  font-weight: 1000;
}

.code-board .system-dot.done {
  background:
    linear-gradient(135deg, #f4cf68, #c88f31),
    var(--gold);
}

.code-board .system-dot.done::after {
  color: #fff8dd;
}

.park-stage {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  border: 1px solid rgba(76, 42, 21, 0.24);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.96), rgba(248, 237, 214, 0.9));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.62),
    0 18px 48px rgba(80, 47, 22, 0.14);
  overflow: hidden;
}

.systems-strip {
  border-width: 0 0 1px;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.systems-strip header {
  display: grid;
  grid-template-columns: auto auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 14px;
  background:
    linear-gradient(90deg, #8d2218, #ad2229 52%, #c3852a);
}

.systems-strip header span {
  width: 22px;
  font-size: 12px;
}

.systems-strip header em {
  margin-left: auto;
  color: rgba(255, 245, 218, 0.86);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.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: 7px;
  min-height: 104px;
  padding: 12px 18px 14px;
  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: 28px;
  line-height: 1;
}

.gdp-meter-bar {
  position: relative;
  height: 24px;
  margin: 5px 0 18px;
  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;
  margin: 0;
}

.park-model-shell {
  position: relative;
  min-height: 940px;
  perspective: 1300px;
  transform-style: preserve-3d;
  background:
    radial-gradient(ellipse at 62% 42%, rgba(11, 166, 208, 0.62) 0 17%, rgba(16, 112, 165, 0.4) 18%, transparent 22%),
    radial-gradient(ellipse at 61% 42%, rgba(255, 255, 255, 0.42) 0 4%, transparent 26%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.42) 0 1px, transparent 1px 72px),
    linear-gradient(30deg, rgba(96, 126, 90, 0.18) 0 1px, transparent 1px 58px),
    linear-gradient(135deg, #f2efd9, #dce8cd 48%, #c4d6b7);
  isolation: isolate;
}

.park-model-shell::before {
  content: "";
  position: absolute;
  inset: 44px 38px 36px;
  pointer-events: none;
  border-radius: 38px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.38), transparent 25%),
    radial-gradient(ellipse at 58% 45%, rgba(255, 255, 255, 0.28), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(70, 101, 54, 0.08));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.52),
    inset 0 -28px 60px rgba(80, 115, 62, 0.12),
    0 48px 90px rgba(83, 55, 24, 0.18);
  transform: rotateX(5deg);
}

.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;
  z-index: 2;
  transform: translateZ(20px);
}

.park-overlay .boundary {
  fill: rgba(194, 216, 145, 0.26);
  stroke: rgba(43, 31, 23, 0.78);
  stroke-width: 0.9;
  stroke-dasharray: 1.8 1.1;
  filter: drop-shadow(0 6px 4px rgba(69, 46, 24, 0.18));
}

.park-overlay .lake-shape {
  fill: rgba(0, 139, 190, 0.6);
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 0.9;
  filter:
    drop-shadow(0 4px 0 rgba(14, 90, 135, 0.36))
    drop-shadow(0 16px 20px rgba(0, 93, 136, 0.2));
}

.park-overlay .road {
  fill: none;
  stroke: rgba(255, 255, 255, 0.98);
  stroke-linecap: round;
  stroke-width: 1.5;
  filter:
    drop-shadow(0 2px 0 rgba(80, 68, 50, 0.2))
    drop-shadow(0 5px 6px rgba(54, 44, 35, 0.16));
}

.park-overlay .main-road {
  stroke: rgba(55, 66, 59, 0.82);
  stroke-width: 2.3;
}

.park-overlay text {
  fill: rgba(37, 42, 39, 0.76);
  font-size: 3.2px;
  font-weight: 1000;
  paint-order: stroke;
  stroke: rgba(255, 250, 239, 0.72);
  stroke-width: 0.35px;
}

.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;
  grid-template-rows: auto auto auto auto 1fr auto;
  gap: 3px;
  place-items: center;
  width: 148px;
  min-height: 128px;
  z-index: 4;
  color: #173e22;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 38%),
    linear-gradient(180deg, #f4edba 0%, #aeca78 62%, #75a65f 100%);
  box-shadow:
    0 15px 0 color-mix(in srgb, var(--plot-owner-color, #516734) 42%, rgba(81, 103, 52, 0.42)),
    0 30px 48px rgba(52, 34, 18, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  border: 2px solid var(--plot-owner-color, rgba(49, 31, 24, 0.52));
  border-radius: 16px;
  padding: 10px;
  line-height: 1;
  transform: translate(-50%, -50%) rotateX(15deg) rotateZ(-1deg);
  overflow: visible;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.code-board .plot::after {
  content: "";
  position: absolute;
  inset: auto 8px -13px;
  height: 14px;
  border-radius: 0 0 12px 12px;
  background: color-mix(in srgb, var(--plot-owner-color, #516734) 35%, #3f3325);
  filter: brightness(0.78);
  z-index: -1;
}

.plot-owner-badge {
  position: absolute;
  left: 50%;
  top: -18px;
  transform: translateX(-50%);
  min-width: 48px;
  border-radius: 999px;
  padding: 5px 9px;
  color: white;
  background: var(--plot-owner-color, #9d1d22);
  border: 2px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 20px rgba(49, 31, 24, 0.24);
  font-size: 12px;
  line-height: 1;
  font-weight: 1000;
  text-align: center;
}

.code-board .plot b {
  color: #21351f;
  font-size: 18px;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.code-board .plot span {
  color: #31412b;
  font-size: 12px;
  font-weight: 900;
}

.code-board .plot .plot-meta {
  border-radius: 999px;
  padding: 4px 8px;
  color: #20351f;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(49, 31, 24, 0.12);
}

.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, minmax(0, 1fr));
  justify-content: center;
  gap: 4px;
  width: 100%;
  margin-top: 2px;
  font-style: normal;
}

.code-board .plot em i {
  width: auto;
  height: 13px;
  border-radius: 4px 4px 2px 2px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(216, 210, 192, 0.78));
  border: 1px solid rgba(49, 31, 24, 0.2);
  box-shadow: inset 0 -2px 0 rgba(80, 58, 33, 0.12);
}

.code-board .plot em i.built {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 36%),
    var(--factory-color, #b6372f);
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.12),
    0 5px 0 rgba(55, 39, 25, 0.22);
}

.factory-owner-tags {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

.factory-owner-tags mark {
  border-radius: 999px;
  padding: 3px 6px;
  color: white;
  background: var(--factory-owner-color, #9d1d22);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 9px rgba(49, 31, 24, 0.16);
  font-size: 10px;
  line-height: 1;
  font-weight: 1000;
}

.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;
  transform: translate(-50%, -56%) rotateX(15deg) rotateZ(-1deg) scale(1.05);
  outline: 4px solid rgba(255, 205, 86, 0.62);
  filter: saturate(1.08);
}

.code-board .plot.ready-build {
  border-color: rgba(32, 117, 67, 0.88);
  box-shadow:
    0 18px 0 rgba(69, 115, 49, 0.4),
    0 0 0 5px rgba(80, 172, 92, 0.16),
    0 34px 50px rgba(52, 34, 18, 0.24);
}

.code-board .plot.ready-build::before {
  content: "可投产";
  position: absolute;
  right: -8px;
  top: -9px;
  border-radius: 999px;
  padding: 4px 7px;
  color: white;
  background: #1f7b4a;
  border: 1px solid rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 1000;
  box-shadow: 0 6px 14px rgba(20, 74, 41, 0.25);
}

.code-board .plot.full-build {
  filter: saturate(0.82);
}

.code-board .plot.full-build::before {
  content: "满产";
  position: absolute;
  right: -8px;
  top: -9px;
  border-radius: 999px;
  padding: 4px 7px;
  color: white;
  background: #8f1d24;
  border: 1px solid rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 1000;
}

.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(980px, calc(100vw - 48px));
}

.enlarged-plot-card {
  position: relative;
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  border-radius: 18px;
  border: 2px solid var(--plot-owner-color, rgba(93, 54, 28, 0.32));
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.5), transparent 34%),
    linear-gradient(180deg, rgba(255, 250, 222, 0.98), rgba(134, 181, 102, 0.94));
  box-shadow:
    0 18px 0 color-mix(in srgb, var(--plot-owner-color, #6f8c51) 34%, #52633a),
    0 34px 58px rgba(55, 35, 18, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  padding: 18px;
  transform: rotateX(4deg);
  transform-origin: center bottom;
  overflow: hidden;
}

.enlarged-plot-card.unflat {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), transparent 42%),
    linear-gradient(180deg, #dfd8c5, #b9ae99);
  box-shadow:
    0 16px 0 rgba(115, 104, 87, 0.34),
    0 30px 52px rgba(55, 35, 18, 0.2);
}

.enlarged-plot-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(rgba(67, 104, 52, 0.12) 1px, transparent 1px);
  background-size: 44px 44px;
  mix-blend-mode: soft-light;
}

.enlarged-plot-head,
.enlarged-plot-slots {
  position: relative;
  z-index: 1;
}

.enlarged-plot-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.enlarged-plot-head span {
  border-radius: 999px;
  padding: 8px 12px;
  color: white;
  background: var(--plot-owner-color, #9d1d22);
  border: 2px solid rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 1000;
}

.enlarged-plot-head strong {
  color: #1f321d;
  font-size: 24px;
  line-height: 1.1;
}

.enlarged-plot-head em {
  justify-self: end;
  border-radius: 999px;
  padding: 7px 12px;
  color: #38281f;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(93, 54, 28, 0.14);
  font-style: normal;
  font-weight: 1000;
}

.enlarged-plot-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(154px, 1fr));
  gap: 10px;
}

.enlarged-factory-slot {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 8px;
  align-items: start;
  min-height: 112px;
  border-radius: 12px;
  border: 1px solid rgba(93, 54, 28, 0.16);
  background: rgba(255, 250, 239, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 10px 20px rgba(70, 42, 22, 0.1);
  padding: 11px;
}

.enlarged-factory-slot i {
  grid-row: 1 / span 3;
  width: 28px;
  height: 38px;
  border-radius: 6px 6px 3px 3px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(214, 208, 190, 0.78));
  border: 1px solid rgba(93, 54, 28, 0.18);
  box-shadow: 0 6px 0 rgba(80, 58, 33, 0.14);
}

.enlarged-factory-slot.built {
  border-color: color-mix(in srgb, var(--factory-color, #9d1d22) 46%, rgba(93, 54, 28, 0.18));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--factory-color, #9d1d22) 12%, transparent), transparent 46%),
    rgba(255, 250, 239, 0.86);
}

.enlarged-factory-slot.built i {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.3), transparent 38%),
    var(--factory-color, #9d1d22);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 -7px 0 rgba(0, 0, 0, 0.12),
    0 7px 0 rgba(55, 39, 25, 0.2);
}

.enlarged-factory-slot span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 1000;
}

.enlarged-factory-slot strong {
  color: var(--red-deep);
  font-size: 16px;
  line-height: 1.22;
  font-weight: 1000;
}

.enlarged-factory-slot em {
  color: #4d3c31;
  font-size: 12px;
  line-height: 1.35;
  font-style: normal;
  font-weight: 900;
}

.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 {
  color: #6f6254;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.26), transparent 44%),
    linear-gradient(180deg, #dfd8c5, #b9ae99);
  box-shadow:
    0 14px 0 rgba(115, 104, 87, 0.34),
    0 26px 38px rgba(52, 34, 18, 0.2);
}

.code-board .plot.done {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 38%),
    linear-gradient(180deg, rgba(255, 250, 222, 0.95), rgba(137, 184, 108, 0.96));
  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;
}

.side-log-panel .side-command-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 12px -4px 0;
  padding-top: 12px;
  border-top: 1px solid rgba(93, 54, 28, 0.16);
}

.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));
}

.map-command-bar {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(320px, 1.35fr) minmax(170px, 0.7fr);
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid rgba(93, 54, 28, 0.18);
  background:
    linear-gradient(90deg, rgba(49, 31, 24, 0.92), rgba(117, 31, 29, 0.9)),
    #311f18;
}

.map-command-bar article {
  display: grid;
  gap: 4px;
  min-height: 66px;
  border-radius: 7px;
  padding: 10px 12px;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 232, 168, 0.18);
}

.map-command-bar span {
  color: #f2c762;
  font-size: 12px;
  font-weight: 1000;
}

.map-command-bar strong {
  color: #fff8e8;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 1000;
  overflow-wrap: anywhere;
}

.map-command-bar em {
  color: rgba(255, 248, 232, 0.8);
  font-size: 12px;
  line-height: 1.32;
  font-style: normal;
  font-weight: 850;
}

.map-command-main {
  background:
    linear-gradient(135deg, rgba(255, 204, 101, 0.18), rgba(255, 255, 255, 0.08)) !important;
  border-color: rgba(255, 213, 128, 0.36) !important;
}

@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 screenUnfold {
  0% {
    opacity: 0;
    transform: rotateY(-72deg) scaleX(0.28) translateX(-8%);
    filter: brightness(0.82) saturate(0.82);
  }
  38% {
    opacity: 1;
    transform: rotateY(18deg) scaleX(1.04) translateX(1%);
  }
  68% {
    transform: rotateY(-7deg) scaleX(0.99);
  }
  100% {
    opacity: 1;
    transform: rotateY(0deg) scaleX(1);
    filter: brightness(1) saturate(1);
  }
}

@keyframes screenLightSweep {
  0%, 36% {
    transform: translateX(0) rotate(10deg);
    opacity: 0;
  }
  50% {
    opacity: 0.95;
  }
  80%, 100% {
    transform: translateX(410%) rotate(10deg);
    opacity: 0;
  }
}

@keyframes screenGlow {
  from {
    opacity: 0.66;
  }
  to {
    opacity: 1;
  }
}

@keyframes sealPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 15px 34px rgba(87, 16, 18, 0.32),
      inset 0 0 0 2px rgba(255, 247, 210, 0.2);
  }
  50% {
    transform: scale(1.035);
    box-shadow:
      0 18px 42px rgba(157, 29, 34, 0.38),
      0 0 0 8px rgba(255, 217, 126, 0.12),
      inset 0 0 0 2px rgba(255, 247, 210, 0.26);
  }
}

@keyframes aiGuideArrive {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes aiGuideDock {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dock-x, 32vw), var(--dock-y, 18vh)) scale(0.16);
  }
}

@keyframes advisorButtonDockPulse {
  0%,
  100% {
    box-shadow: none;
  }
  35% {
    outline: 4px solid rgba(255, 211, 92, 0.72);
    box-shadow:
      0 0 0 10px rgba(255, 211, 92, 0.22),
      0 18px 48px rgba(157, 29, 34, 0.32);
    transform: translateY(-1px) scale(1.02);
  }
}

@keyframes advisorButtonSweep {
  0%,
  62% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes advisorButtonEnergy {
  0%,
  100% {
    transform: scaleX(0.34);
    opacity: 0.38;
  }
  50% {
    transform: scaleX(1);
    opacity: 0.86;
  }
}

@keyframes decisionBadgePulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 210, 78, 0.32);
  }
  50% {
    transform: scale(1.045);
    box-shadow:
      0 0 0 6px rgba(255, 210, 78, 0.12),
      0 8px 20px rgba(157, 29, 34, 0.18);
  }
}

@keyframes decisionSoftRing {
  0%,
  100% {
    opacity: 0.16;
    box-shadow: inset 0 0 0 0 rgba(255, 210, 78, 0);
  }
  50% {
    opacity: 1;
    box-shadow:
      inset 0 0 0 1px rgba(255, 210, 78, 0.22),
      0 0 24px rgba(255, 210, 78, 0.16);
  }
}

@keyframes recommendedCardGlow {
  0%,
  100% {
    box-shadow:
      0 14px 32px rgba(142, 91, 24, 0.16),
      0 0 0 0 rgba(255, 210, 78, 0);
  }
  50% {
    box-shadow:
      0 18px 38px rgba(142, 91, 24, 0.22),
      0 0 0 4px rgba(255, 210, 78, 0.18);
  }
}

@keyframes recommendedActionPulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      0 0 0 3px rgba(255, 204, 74, 0.18);
  }
  50% {
    transform: translateY(-1px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.24),
      0 0 0 5px rgba(255, 204, 74, 0.24),
      0 14px 28px rgba(255, 204, 74, 0.14);
  }
}

@keyframes storyToastEnter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes storyToastLeave {
  to {
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
  }
}

@keyframes storyToastSweep {
  0%,
  42% {
    transform: translateX(0) rotate(16deg);
    opacity: 0;
  }
  58% {
    opacity: 0.8;
  }
  100% {
    transform: translateX(310%) rotate(16deg);
    opacity: 0;
  }
}

@keyframes wowSweep {
  0%,
  38% {
    transform: translateX(0) rotate(15deg);
    opacity: 0;
  }
  52% {
    opacity: 0.86;
  }
  100% {
    transform: translateX(360%) rotate(15deg);
    opacity: 0;
  }
}

@keyframes wowFramePulse {
  0%,
  100% {
    opacity: 0.42;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.012);
  }
}

@keyframes wowOrbSpin {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes commandSurfaceDrift {
  from {
    background-position: 0% 50%, 0 0;
  }
  to {
    background-position: 100% 50%, 88px 0;
  }
}

@keyframes commandSweep {
  0%,
  30% {
    background-position: -180% 0, 0 0;
    opacity: 0.48;
  }
  58% {
    opacity: 0.84;
  }
  100% {
    background-position: 180% 0, 0 30px;
    opacity: 0.48;
  }
}

@keyframes commandLineRun {
  from {
    transform: translateX(-40%);
  }
  to {
    transform: translateX(40%);
  }
}

@keyframes commandPulseLine {
  0%,
  100% {
    transform: scaleX(0.42);
    opacity: 0.42;
  }
  50% {
    transform: scaleX(1);
    opacity: 0.88;
  }
}

@keyframes controlSweep {
  0%,
  72% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes musicButtonFlow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 220% 50%;
  }
}

@keyframes introProducerSweep {
  0%,
  48% {
    left: -55%;
  }
  76%,
  100% {
    left: 116%;
  }
}

@keyframes epicTitleFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.018);
  }
}

@keyframes epicHaloSpin {
  0% {
    transform: rotate(0deg) scale(0.9);
  }
  50% {
    transform: rotate(180deg) scale(0.98);
  }
  100% {
    transform: rotate(360deg) scale(0.9);
  }
}

@keyframes epicTitleSweep {
  0%,
  42% {
    transform: translateX(-130%) skewX(-16deg);
    opacity: 0;
  }
  52% {
    opacity: 1;
  }
  76%,
  100% {
    transform: translateX(130%) skewX(-16deg);
    opacity: 0;
  }
}

@keyframes epicLightBand {
  0%,
  100% {
    opacity: 0.38;
    transform: translate(-50%, -58%) scaleX(0.9);
  }
  50% {
    opacity: 0.68;
    transform: translate(-50%, -58%) scaleX(1);
  }
}

@keyframes epicStarDrift {
  0% {
    background-position:
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0;
  }
  100% {
    background-position:
      24px -18px,
      -18px 20px,
      16px 14px,
      -22px -16px,
      18px -14px,
      -14px 18px,
      0 0,
      118px 0;
  }
}

@keyframes epicBladePulse {
  0%,
  100% {
    opacity: 0.4;
    transform: translate(-50%, -64%) scaleX(0.7);
  }
  48% {
    opacity: 1;
    transform: translate(-50%, -64%) scaleX(1.06);
  }
}

@keyframes epicGlyphPulse {
  0%,
  100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.24) saturate(1.18);
  }
}

@keyframes epicGlyphShine {
  0%,
  42% {
    background-position: 180% 50%;
    opacity: 0;
  }
  54% {
    opacity: 1;
  }
  82%,
  100% {
    background-position: -60% 50%;
    opacity: 0;
  }
}

@keyframes epicUnderlinePulse {
  0%,
  100% {
    opacity: 0.62;
    transform: translateX(-50%) scaleX(0.82);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scaleX(1.08);
  }
}

@keyframes titleGleam {
  0%,
  54% {
    transform: translateX(-120%);
  }
  82%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes producerLineSweep {
  0%,
  68% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes metricFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes metricScan {
  0%,
  68% {
    transform: translateX(-125%);
  }
  100% {
    transform: translateX(125%);
  }
}

@keyframes metricPulseLine {
  0%,
  100% {
    transform: scaleX(0.32);
    opacity: 0.32;
  }
  50% {
    transform: scaleX(1);
    opacity: 0.72;
  }
}

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

@keyframes aiPreviewPulse {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-2px);
  }
}

@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: 12px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.98), rgba(255, 246, 226, 0.92));
  overflow: hidden;
}

.topbar-timeline {
  margin-bottom: 0;
  min-width: 0;
  padding: 12px;
  border-color: rgba(93, 54, 28, 0.14);
  box-shadow: 0 12px 30px rgba(73, 43, 23, 0.06);
}

.topbar-timeline .section-heading {
  margin-bottom: 9px;
}

.topbar-timeline .section-heading h2 {
  font-size: 17px;
  line-height: 1.15;
}

.topbar-timeline .section-heading p,
.topbar-timeline .section-heading span {
  font-size: 11px;
}

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

.topbar-timeline .timeline-story {
  min-height: 92px;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(255, 250, 239, 0.9)),
    radial-gradient(circle at 0% 0%, rgba(200, 143, 49, 0.1), transparent 44%);
}

.topbar-timeline .timeline-current span {
  font-size: 22px;
}

.topbar-timeline .timeline-current strong {
  font-size: 13px;
}

.topbar-timeline .timeline-current em {
  font-size: 11px;
}

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

.topbar-timeline .timeline-anecdote {
  display: none;
}

.topbar-timeline .timeline-track {
  display: none;
  grid-template-columns: 1fr;
  min-height: 88px;
  padding: 12px;
  gap: 8px;
  border-radius: 12px;
}

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

.topbar-timeline .year-pips span {
  min-height: 30px;
  padding: 5px 6px;
  border-radius: 7px;
}

.topbar-timeline .year-pips b {
  font-size: 10px;
}

.topbar-timeline .year-pips small {
  font-size: 9px;
}

.timeline-panel .section-heading {
  margin-bottom: 7px;
}

.timeline-panel .section-heading h2 {
  font-size: 18px;
}

.timeline-panel .section-heading p,
.timeline-panel .section-heading span {
  font-size: 12px;
  line-height: 1.35;
}

.timeline-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: stretch;
}

.timeline-track {
  position: relative;
  right: auto;
  bottom: auto;
  width: auto;
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 10px;
  min-height: 88px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.14);
  background:
    linear-gradient(135deg, rgba(157, 29, 34, 0.08), rgba(200, 143, 49, 0.12)),
    rgba(255, 248, 232, 0.88);
  --timeline-progress: 0%;
}

.timeline-progress-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2px 10px;
}

.timeline-progress-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 1000;
}

.timeline-progress-head strong {
  color: var(--red);
  font-size: 18px;
  line-height: 1;
  font-weight: 1000;
}

.timeline-progress-head em {
  grid-column: 1 / -1;
  color: #6d5747;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.timeline-progress-rail {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(93, 54, 28, 0.12);
  overflow: hidden;
}

.timeline-progress-rail i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold));
  box-shadow: 0 0 0 1px rgba(255, 245, 220, 0.3) inset;
}

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

.year-pips span {
  display: grid;
  gap: 2px;
  min-height: 36px;
  border-radius: 7px;
  border: 1px solid rgba(93, 54, 28, 0.13);
  background: rgba(255, 255, 255, 0.62);
  padding: 5px 7px;
  color: #5b493b;
  font-weight: 900;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.year-pips span.current {
  color: white;
  background: linear-gradient(135deg, var(--red), #b4292e);
  border-color: rgba(241, 196, 93, 0.84);
  transform: translateY(-1px);
}

.year-pips span.done {
  background: rgba(79, 140, 85, 0.14);
  border-color: rgba(79, 140, 85, 0.28);
  color: #355f39;
}

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

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

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

.timeline-current {
  display: grid;
  gap: 5px;
  align-content: center;
  min-height: 64px;
  border-right: 1px solid rgba(93, 54, 28, 0.12);
  padding-right: 12px;
}

.timeline-current span {
  color: var(--red);
  font-size: 24px;
  line-height: 1;
  font-weight: 1000;
}

.timeline-current strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

.timeline-current em {
  color: #755e4c;
  font-size: 12px;
  line-height: 1.25;
  font-style: normal;
  font-weight: 900;
}

.timeline-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.timeline-inline-progress {
  display: grid;
  gap: 8px;
  min-width: 0;
  border-left: 1px solid rgba(93, 54, 28, 0.12);
  padding-left: 12px;
}

.timeline-story p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.38;
  min-width: 0;
}

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

.side-timeline .timeline-story {
  grid-template-columns: 94px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 12px;
}

.side-timeline .timeline-current {
  min-height: 116px;
  padding-right: 12px;
}

.side-timeline .timeline-current span {
  font-size: 26px;
}

.side-timeline .timeline-current strong {
  font-size: 15px;
  line-height: 1.25;
}

.side-timeline .timeline-current em {
  font-size: 12px;
  line-height: 1.35;
}

.side-timeline .timeline-copy {
  gap: 8px;
}

.side-timeline .timeline-story p {
  display: block;
  overflow: visible;
  color: #4b382d;
  font-size: 14px;
  line-height: 1.55;
  -webkit-line-clamp: initial;
  -webkit-box-orient: initial;
}

.side-timeline .timeline-anecdote {
  display: block;
  color: #6a1b20 !important;
  font-size: 14px !important;
  line-height: 1.55;
  font-weight: 1000;
}

.side-timeline .timeline-inline-progress {
  grid-column: 1 / -1;
  border-left: 0;
  border-top: 1px solid rgba(93, 54, 28, 0.12);
  padding: 8px 0 0;
}

.side-timeline .timeline-progress-head {
  grid-template-columns: 1fr auto;
}

.side-timeline .timeline-progress-head strong {
  font-size: 17px;
}

.side-timeline .timeline-progress-head em,
.side-timeline .year-pips {
  display: none;
}

.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));
}

#assignmentOverviewModal .info-dialog {
  width: min(1540px, calc(100vw - 32px));
  max-height: min(90vh, 980px);
  gap: 16px;
  border-radius: 14px;
  padding: 24px;
}

#assignmentOverviewModal .section-heading h2,
.library-dialog .section-heading h2 {
  font-size: 28px;
}

#assignmentOverviewModal .section-heading p,
.library-dialog .section-heading p {
  font-size: 15px;
  line-height: 1.5;
}

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

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

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

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

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

.assignment-card {
  display: grid;
  gap: 10px;
  width: 100%;
  min-height: 148px;
  padding: 15px;
  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: 20px;
  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: 15px;
}

.assignment-card-body small {
  color: #3f3028;
  font-size: 16px;
  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-flow-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.assignment-flow-card > b {
  display: grid;
  place-items: center;
  color: var(--red);
  font-size: 28px;
  font-weight: 1000;
}

.assignment-flow-card article {
  display: grid;
  gap: 7px;
  min-height: 124px;
  border-radius: 8px;
  padding: 14px;
  border: 1px solid rgba(93, 54, 28, 0.18);
  box-shadow: 0 10px 24px rgba(70, 42, 22, 0.08);
}

.assignment-flow-card span {
  color: #5b493b;
  font-size: 13px;
  font-weight: 1000;
}

.assignment-flow-card strong {
  color: var(--red-deep);
  font-size: 24px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.assignment-flow-card em {
  color: #4d3c31;
  font-size: 13px;
  font-style: normal;
  line-height: 1.42;
  font-weight: 850;
}

.flow-input {
  background: linear-gradient(180deg, #fff8e7, #f4e1c2);
}

.flow-output {
  background: linear-gradient(180deg, #f4ffe9, #d8efc3);
  border-color: rgba(57, 112, 48, 0.24) !important;
}

.flow-output strong {
  color: #17643b;
}

.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;
}

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

.assignment-linked-card h3 {
  margin: 0;
  color: var(--red-deep);
  font-size: 17px;
}

.assignment-linked-card .card {
  box-shadow: none;
}

.route-linked-card article {
  display: grid;
  gap: 6px;
  border-radius: 8px;
  border: 1px solid rgba(93, 54, 28, 0.16);
  background: #fff8e7;
  padding: 12px;
}

.route-linked-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.route-linked-card strong {
  color: var(--red-deep);
  font-size: 18px;
}

.route-linked-card p {
  color: #4d3c31;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 800;
}

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

.overview-actions {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 8px;
}

.overview-actions .secondary {
  min-height: 36px;
  padding: 0 14px;
}

.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: 16px;
}

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

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

.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-size: 16px;
  font-weight: 800;
}

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

.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: 13px;
}

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

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

.overview-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 15px;
  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-diagnosis {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
}

.report-metrics article,
.report-diagnosis 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,
.report-diagnosis article {
  display: grid;
  gap: 4px;
}

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

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

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

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

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

.report-section ul,
.report-diagnosis 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: 16px;
  width: min(1560px, calc(100vw - 32px));
  max-height: min(90vh, 980px);
  overflow: hidden;
  border-radius: 14px;
  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: 24px;
}

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

.library-toolbar {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 220px;
  gap: 12px;
}

.library-toolbar input,
.library-toolbar select {
  min-height: 52px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff8e7;
  padding: 0 16px;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 900;
}

.card-library {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-height: min(66vh, 690px);
  overflow: auto;
  padding-right: 4px;
}

.library-card {
  display: grid;
  gap: 9px;
  align-content: start;
  min-height: 232px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf8, #fff5e1);
  padding: 15px;
  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: 13px;
  font-weight: 900;
}

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

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

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

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

@media (max-width: 1680px) {
  .topbar {
    grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1fr);
  }

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

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

  .topbar-timeline .timeline-story {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .topbar-timeline .timeline-inline-progress {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid rgba(93, 54, 28, 0.12);
    padding-left: 0;
    padding-top: 10px;
  }

  .workspace {
    grid-template-columns: minmax(760px, 1fr) 390px;
  }

  .side-log-panel {
    grid-column: 2;
    position: static;
    min-height: 0;
    height: auto;
    max-height: none;
  }

  .side-action-dock .action-grid button {
    min-height: 86px;
  }

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

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

@media (max-width: 1180px) {
  .intro-home-grid {
    grid-template-columns: 1fr;
  }

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

  .intro-start {
    grid-column: 1 / -1;
  }

  .topbar,
  .workspace,
  .action-dock,
  .command-deck {
    grid-template-columns: 1fr;
    display: grid;
  }

  .brand-panel {
    min-height: auto;
  }

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

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

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

  .board-zone,
  .map-player-board,
  .side-log-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .side-log-panel {
    min-height: auto;
  }

  .player-command-row,
  .mission-strip,
  .map-scoreboard .scoreboard-list,
  .map-command-bar {
    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: 1fr;
  }

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

  .timeline-current {
    border-right: 0;
    border-bottom: 1px solid rgba(93, 54, 28, 0.12);
    padding-right: 0;
    padding-bottom: 10px;
  }

  .timeline-inline-progress {
    border-left: 0;
    padding-left: 0;
  }

  .systems-strip header {
    grid-template-columns: auto auto 1fr;
  }

  .systems-strip header em {
    display: none;
  }

  .code-board .systems-grid {
    width: auto;
  }
}

@media (max-width: 760px) {
  .intro-overlay {
    padding: 18px;
    align-items: start;
    overflow: auto;
  }

  .intro-scene {
    gap: 12px;
    padding: 26px 0;
  }

  .intro-hero {
    gap: 6px;
  }

  .intro-copy {
    gap: 5px;
  }

  .intro-home-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
  }

  .intro-epic-title {
    grid-template-columns: auto;
    gap: 0;
    padding-inline: 14px;
    font-size: clamp(30px, 9.2vw, 58px);
    letter-spacing: 0.01em;
    white-space: nowrap;
  }

  .intro-epic-title b {
    width: 92vw;
    height: 82px;
  }

  .intro-epic-title i {
    width: 86vw;
  }

  .intro-music-unlock {
    top: 14px;
    right: 14px;
    min-width: 112px;
    min-height: 46px;
    padding: 6px 14px;
  }

  .intro-music-unlock span {
    font-size: 10px;
  }

  .intro-music-unlock strong {
    font-size: 15px;
  }

  .intro-letter {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .intro-letter-seal {
    width: 68px;
    justify-self: center;
    font-size: 18px;
  }

  .intro-letter-paper {
    padding: 0;
    text-align: center;
  }

  .intro-letter-paper p {
    font-size: 14px;
  }

  .intro-letter-years {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .intro-config {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .intro-config > div {
    display: grid;
    gap: 6px;
  }

  .leader-name-field {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .leader-name-field input {
    max-width: none;
  }

  .intro-settings-heading {
    display: grid;
    gap: 4px;
  }

  .intro-config select,
  .intro-config input,
  .intro-start {
    min-height: 48px;
  }

  .intro-overlay {
    overflow: hidden;
    padding: 6px;
  }

  .intro-scene {
    width: min(100vw - 12px, 1120px);
    height: calc(100dvh - 12px);
    min-height: 0;
    align-content: center;
    gap: 6px;
    padding: 4px 0;
  }

  .intro-kicker {
    padding: 4px 10px;
    font-size: 11px;
  }

  .intro-epic-title {
    margin: 0;
    padding: 4px 18px 8px;
    font-size: clamp(25px, 4.4vw, 44px);
    line-height: 0.92;
  }

  .intro-epic-title b {
    height: 58px;
  }

  .intro-epic-title span::after {
    bottom: -8px;
    height: 3px;
  }

  .intro-scene h2 {
    margin: 0;
    font-size: clamp(18px, 3.1vw, 28px);
    line-height: 1.08;
  }

  .intro-scene > p,
  .intro-copy p {
    display: none;
  }

  .intro-music-unlock {
    top: 8px;
    right: 8px;
    min-width: 104px;
    min-height: 38px;
    padding: 4px 12px;
  }

  .intro-letter {
    grid-template-columns: 74px minmax(0, 1fr);
    width: min(860px, 100%);
    min-height: 104px;
    padding: 8px 10px 30px;
    border-radius: 16px;
  }

  .intro-letter::before {
    inset: 6px;
    border-radius: 12px;
  }

  .intro-letter-seal {
    width: 62px;
    border-width: 2px;
    font-size: 16px;
  }

  .intro-letter-paper {
    min-height: 74px;
    gap: 3px;
    padding: 8px 14px;
    border-radius: 12px;
  }

  .intro-letter-paper span {
    font-size: 11px;
  }

  .intro-letter-paper strong {
    font-size: clamp(19px, 3vw, 28px);
  }

  .intro-letter-paper p,
  .intro-letter-paper em {
    font-size: 12px;
    line-height: 1.3;
  }

  .intro-letter-paper::after {
    right: 12px;
    bottom: 4px;
    font-size: 28px;
  }

  .intro-letter-years {
    gap: 5px;
  }

  .intro-letter-years i {
    min-height: 20px;
    font-size: 10px;
  }

  .intro-config {
    grid-template-columns: minmax(130px, 1.15fr) repeat(4, minmax(92px, 0.72fr)) minmax(120px, 0.8fr);
    width: min(1040px, 100%);
    gap: 6px;
    padding: 8px;
    border-radius: 14px;
  }

  .intro-config > div {
    grid-column: 1 / 2;
    display: grid;
    align-content: center;
    gap: 3px;
  }

  .intro-config h3 {
    font-size: 15px;
    line-height: 1.12;
  }

  .intro-config span {
    font-size: 10px;
    line-height: 1.25;
  }

  .leader-name-field,
  .intro-settings-heading {
    grid-column: auto;
  }

  .leader-name-field {
    min-height: 48px;
    grid-template-columns: 1fr;
    padding: 6px;
    font-size: 11px;
  }

  .leader-name-field input {
    max-width: none;
    font-size: 14px;
  }

  .intro-settings-heading {
    display: none;
  }

  .intro-config label {
    gap: 3px;
    font-size: 10px;
  }

  .intro-config select,
  .intro-config input,
  .intro-select-trigger {
    min-height: 38px;
    border-radius: 9px;
    padding: 0 8px;
    font-size: 12px;
  }

  .intro-start {
    min-height: 46px;
    border-radius: 10px;
    font-size: 14px;
  }

  .intro-producer {
    width: min(620px, 100%);
    min-height: 34px;
    gap: 8px;
    margin: 0;
    padding: 6px 14px;
  }

  .intro-producer span {
    padding: 4px 9px;
    font-size: 11px;
  }

  .intro-producer strong {
    font-size: clamp(15px, 2.2vw, 20px);
    letter-spacing: 0.02em;
  }

  .execution-banner {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    min-height: 76px;
    padding: 12px 14px;
  }

  .execution-banner strong {
    font-size: 22px;
  }

  .execution-banner em {
    grid-column: 2;
    justify-self: start;
    padding: 6px 10px;
    font-size: 13px;
  }

  .ai-guide-card {
    width: min(100vw - 28px, 760px);
    min-height: min(62vh, 520px);
    padding: 34px 22px;
  }

  .ai-guide-card strong {
    font-size: clamp(40px, 11vw, 64px);
  }

  .ai-guide-card p {
    font-size: 18px;
  }

  .story-toast-card {
    width: min(100vw - 28px, 780px);
    min-height: min(64vh, 560px);
    padding: 34px 22px;
  }

  .story-toast-card strong {
    font-size: clamp(38px, 10vw, 62px);
  }

  .story-toast-card p {
    font-size: 18px;
  }

  .story-toast-card em {
    font-size: 17px;
  }

  .game-toast {
    top: 104px;
    right: 14px;
  }

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

  .score-strip,
  .top-actions,
  .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: 1fr;
  }

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

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

  .decision-hero,
  .upgraded-flow,
  .recall-summary-grid {
    grid-template-columns: 1fr;
  }

  .decision-meter {
    min-height: 92px;
  }

  .upgraded-flow > b {
    width: auto;
    min-height: 38px;
  }

  .system-progress-board {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

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

  .workspace {
    overflow: visible;
  }

  .board-zone {
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }

  .board-frame {
    width: 100%;
    min-width: 0;
  }

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

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

  .side-action-dock .action-grid button {
    min-height: 86px;
  }

  .side-action-dock .action-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(6, 86px);
  }

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

  .route-arrow {
    display: none;
  }

  html,
  body {
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
  }

  body {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    min-height: 100dvh;
    overscroll-behavior-y: auto;
    touch-action: pan-y;
  }

  * {
    -webkit-tap-highlight-color: rgba(157, 29, 34, 0.14);
  }

  button,
  select,
  input {
    font-size: 16px;
    touch-action: manipulation;
  }

  .app-shell {
    width: calc(100vw - 12px);
    max-width: 520px;
    padding: 8px 0 20px;
    gap: 12px;
  }

  .topbar {
    display: grid;
    gap: 10px;
    padding: 10px;
    border-radius: 18px;
  }

  .brand-panel {
    min-height: auto;
    padding: 14px 12px 12px;
    border-radius: 14px;
  }

  .brand-panel .eyebrow {
    width: fit-content;
    max-width: 100%;
    font-size: 11px;
    white-space: normal;
  }

  .brand-panel h1 {
    font-size: clamp(28px, 8.6vw, 40px);
    line-height: 1.08;
    word-break: keep-all;
  }

  .producer-line {
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    text-align: left;
  }

  .producer-line strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.02em;
    font-size: clamp(12px, 3.15vw, 15px);
  }

  .topbar-right {
    gap: 8px;
  }

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

  .top-actions .secondary {
    min-height: 46px;
    padding: 0 8px;
    border-radius: 9px;
    font-size: 13px;
  }

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

  .score-strip div {
    min-height: 58px;
    padding: 9px 10px;
    border-radius: 10px;
  }

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

  .score-strip div:nth-child(3) {
    grid-column: 1 / -1;
  }

  .mission-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mission-strip article {
    min-height: auto;
    padding: 12px;
  }

  .mission-strip strong {
    font-size: 16px;
    line-height: 1.35;
  }

  .workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    overflow: visible;
  }

  .side-log-panel {
    order: 2;
  }

  .board-zone {
    order: 1;
  }

  .map-player-board {
    order: 3;
  }

  .board-zone {
    overflow: visible;
  }

  .board-frame {
    width: 100%;
    min-width: 0;
    aspect-ratio: auto;
    border-radius: 14px;
  }

  .code-board {
    width: 100%;
    min-width: 0;
    padding: 6px;
    overflow: hidden;
  }

  .park-stage {
    border-radius: 12px;
  }

  .systems-strip header {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px;
    padding: 8px 10px;
  }

  .systems-strip header strong {
    font-size: 13px;
    line-height: 1.3;
  }

  .code-board .systems-grid {
    grid-column: 1 / -1;
    width: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .map-title {
    min-height: 58px;
    padding: 8px 10px;
  }

  .map-title span {
    font-size: 12px;
  }

  .map-title strong {
    font-size: clamp(21px, 6.4vw, 30px);
  }

  .gdp-track {
    min-height: auto;
    padding: 10px 12px 12px;
  }

  .gdp-meter-head strong {
    font-size: 22px;
  }

  .gdp-meter-bar {
    height: 18px;
    margin-bottom: 8px;
  }

  .gdp-meter-bar span,
  .gdp-track p {
    display: none;
  }

  .park-model-shell {
    min-height: min(118vw, 590px);
    border-radius: 0 0 12px 12px;
  }

  .park-model-shell::before {
    inset: 18px 10px 16px;
    border-radius: 18px;
  }

  .park-model-shell::after {
    left: 10px;
    right: 10px;
    bottom: 8px;
    width: auto;
    padding: 7px 8px;
    font-size: 10px;
  }

  .筹-point {
    width: 38px;
    border-width: 2px;
    font-size: 20px;
  }

  .traffic-dot {
    width: 9px;
    height: 5px;
  }

  .train-dot {
    width: 28px;
    height: 7px;
  }

  .code-board .plot {
    width: clamp(58px, 17.2vw, 78px);
    min-height: clamp(58px, 17vw, 78px);
    gap: 1px;
    border-radius: 10px;
    padding: 6px 4px;
    box-shadow:
      0 8px 0 color-mix(in srgb, var(--plot-owner-color, #516734) 42%, rgba(81, 103, 52, 0.42)),
      0 16px 28px rgba(52, 34, 18, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }

  .code-board .plot::after {
    inset: auto 5px -8px;
    height: 9px;
  }

  .plot-owner-badge {
    top: -13px;
    min-width: 32px;
    padding: 3px 6px;
    border-width: 1px;
    font-size: 9px;
  }

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

  .code-board .plot span,
  .code-board .plot .plot-meta,
  .code-board .plot small {
    font-size: 9px;
  }

  .code-board .plot small {
    max-width: 52px;
  }

  .plot-capacity-grid {
    gap: 2px;
    max-width: 54px;
  }

  .capacity-dot {
    width: 6px;
    height: 6px;
  }

  .plot-tooltip {
    display: none;
  }

  .map-command-bar,
  .map-scoreboard .scoreboard-list,
  .systems-overview,
  .production-grid,
  .market-cards,
  .operations-row .production-grid,
  .operations-row .market-cards {
    grid-template-columns: 1fr;
  }

  .player-board,
  .map-player-board,
  .log-panel,
  .side-log-panel,
  .side-timeline,
  .card-library-panel {
    padding: 12px;
    border-radius: 14px;
  }

  .side-log-panel {
    display: grid;
    gap: 10px;
    background:
      linear-gradient(180deg, rgba(255, 250, 239, 0.98), rgba(255, 246, 226, 0.94));
  }

  .side-log-panel > .side-command-row {
    order: 2;
  }

  .side-log-panel > .side-action-dock {
    order: 1;
  }

  .side-log-panel > .side-timeline {
    order: 3;
  }

  .side-log-panel > .section-heading {
    order: 4;
  }

  .side-log-panel > #logList {
    order: 5;
  }

  .team-list,
  #teamList,
  .ranking-list,
  .player-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .team-card,
  .resource-pool-card,
  .rank-card {
    width: 100%;
    min-width: 0;
  }

  .team-list {
    overflow: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }

  .team-list .team-card,
  .team-list .resource-pool-card {
    flex: initial;
    flex-basis: auto;
    scroll-snap-align: none;
  }

  .team-card {
    padding: 12px;
  }

  .team-card header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .team-card h3,
  .team-card strong {
    overflow-wrap: anywhere;
  }

  .token-grid,
  .resource-grid,
  .hand-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-log-panel {
    grid-column: auto;
    grid-row: auto;
    position: static;
  }

  .side-command-row,
  .action-tools,
  .library-toolbar {
    grid-template-columns: 1fr;
  }

  .side-command-row {
    margin: 0;
    padding: 0;
    border-top: 0;
  }

  .side-command-row .turn-card {
    display: none;
  }

  .side-command-row .advisor-card {
    padding: 12px;
    border-radius: 14px;
    box-shadow:
      0 14px 34px rgba(72, 32, 19, 0.12),
      inset 0 0 0 1px rgba(255, 238, 191, 0.72);
  }

  .advisor-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .compact-guide-select {
    min-width: 118px;
  }

  .compact-guide-select select {
    min-height: 42px;
    border-radius: 10px;
  }

  #advisorAction {
    min-height: 58px;
    border-radius: 12px;
    font-size: 17px;
    box-shadow:
      0 10px 0 rgba(103, 15, 20, 0.46),
      0 18px 34px rgba(157, 29, 34, 0.26);
  }

  .side-action-dock .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 8px;
  }

  .side-action-dock .action-grid button,
  .action-grid button {
    min-height: 96px;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 7px;
    padding: 12px 10px;
    text-align: left;
  }

  .side-action-dock .action-grid button strong,
  .action-grid button strong {
    font-size: 17px;
    line-height: 1.15;
  }

  .side-action-dock .action-grid button small,
  .action-grid button small {
    grid-column: 1;
    grid-row: 1;
    width: 30px;
    font-size: 10px;
  }

  .side-action-dock .action-grid button strong,
  .action-grid button strong {
    grid-column: 1;
    grid-row: 2;
  }

  .side-action-dock .action-grid button em,
  .action-grid button em {
    display: none;
  }

  .action-status {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
    min-width: 0;
    font-size: 11px;
  }

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

  .tool-button {
    min-height: 82px;
    padding: 12px;
    border-radius: 12px;
  }

  .tool-button strong {
    font-size: 16px;
  }

  .tool-button em {
    display: none;
  }

  #logList {
    max-height: 180px;
    overflow: auto;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
  }

  #logList li {
    grid-template-columns: 28px 1fr;
    gap: 8px;
  }

  .action-modal,
  .info-modal,
  .card-library-modal,
  .card-inspect-modal {
    align-items: stretch;
    place-items: stretch;
    padding: 0;
    background: rgba(31, 20, 15, 0.46);
    backdrop-filter: blur(7px);
  }

  .action-dialog,
  .info-dialog,
  #assignmentOverviewModal .info-dialog,
  .library-dialog,
  .card-inspect-dialog,
  .assignment-detail-dialog,
  .plot-detail-dialog,
  .report-dialog {
    align-self: end;
    width: 100%;
    max-width: none;
    max-height: calc(92dvh - env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    padding: 14px 12px calc(16px + env(safe-area-inset-bottom));
    animation: mobileSheetIn 0.22s ease-out both;
  }

  .action-dialog .section-heading,
  .library-dialog .section-heading,
  .info-dialog .section-heading {
    grid-template-columns: 1fr auto;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 4;
    margin: -14px -12px 12px;
    padding: 14px 12px 10px;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(180deg, #fffaf0, rgba(255, 250, 240, 0.95));
    border-bottom: 1px solid rgba(93, 54, 28, 0.12);
  }

  .action-dialog .section-heading h2,
  #assignmentOverviewModal .section-heading h2,
  .library-dialog .section-heading h2 {
    font-size: 22px;
    line-height: 1.2;
  }

  .action-dialog .text-button,
  .library-dialog .text-button,
  .info-dialog .text-button {
    min-height: 42px;
    border-radius: 999px;
    padding: 0 14px;
    background: rgba(157, 29, 34, 0.1);
   }

  .action-dialog .action-detail,
  .library-dialog .card-library {
    max-height: calc(92dvh - 150px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .card-library {
    grid-template-columns: 1fr;
    max-height: none;
    padding-right: 0;
  }

  .library-toolbar input,
  .library-toolbar select {
    min-height: 48px;
  }

  .decision-hero,
  .upgraded-flow,
  .recall-summary-grid,
  .action-production-grid,
  .action-market-grid,
  .detail-grid,
  .decision-options,
  .recall-list,
  .overview-grid,
  .overview-goals,
  .overview-production-grid,
  .plot-overview-list,
  .report-metrics,
  .report-diagnosis,
  .assignment-detail-grid,
  .assignment-flow-card,
  .card-detail-grid,
  .factory-target-picker,
  .plot-detail-summary {
    grid-template-columns: 1fr;
  }

  .assignment-flow-card > b {
    min-height: 28px;
    transform: rotate(90deg);
  }

  .report-hero,
  .assignment-detail-hero {
    grid-template-columns: 1fr;
  }

  .overview-wide {
    grid-column: auto;
  }

  .intro-overlay {
    padding: 12px 8px;
  }

  .intro-scene {
    width: min(100%, 520px);
    min-height: auto;
    padding: 18px 0 28px;
  }

  .intro-scene h2 {
    font-size: clamp(25px, 7vw, 38px);
    line-height: 1.18;
  }

  .intro-letter {
    width: 100%;
    border-radius: 16px;
    padding: 14px;
  }

  .intro-config {
    width: 100%;
    gap: 10px;
    border-radius: 16px;
  }

  .intro-producer {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    text-align: center;
  }

  .intro-producer strong {
    white-space: nowrap;
    letter-spacing: 0.03em;
    font-size: clamp(17px, 4.6vw, 25px);
  }

  .execution-banner {
    grid-template-columns: 14px minmax(0, 1fr) minmax(118px, 0.72fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 5px 10px;
    left: 8px;
    right: 8px;
    top: 8px;
    width: auto;
    min-height: 96px;
    padding: 12px 56px 12px 14px;
    transform: none;
    border-radius: 18px;
    box-shadow:
      0 18px 50px rgba(51, 18, 15, 0.26),
      inset 0 0 0 1px rgba(255, 232, 168, 0.24);
  }

  .execution-banner::before {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 14px;
    height: 58px;
  }

  .execution-banner span {
    left: 38px;
    top: 10px;
    font-size: 11px;
  }

  .execution-banner strong {
    grid-column: 2;
    grid-row: 1;
    padding-top: 16px;
    font-size: 20px;
  }

  .execution-banner em {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    padding: 7px 10px;
    max-width: 100%;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .execution-advisor-action {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: stretch;
    display: grid;
    place-items: center;
    min-height: 58px;
    padding: 8px 10px;
    border-radius: 14px;
    color: #5b220c;
    background:
      linear-gradient(180deg, rgba(255, 247, 207, 0.98), rgba(244, 190, 71, 0.98));
    border: 1px solid rgba(255, 245, 196, 0.72);
    box-shadow:
      0 10px 0 rgba(123, 46, 14, 0.28),
      0 16px 24px rgba(18, 8, 4, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.72);
    font-size: 12px;
    line-height: 1.25;
    font-weight: 1000;
    pointer-events: auto;
    white-space: normal;
  }

  .execution-advisor-action:disabled {
    color: rgba(255, 248, 230, 0.58);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 234, 188, 0.18);
    box-shadow: none;
  }

  .execution-close {
    width: 42px;
    height: 42px;
  }

  .workspace,
  .board-zone,
  .board-frame,
  .code-board {
    max-width: 100%;
  }

  .workspace,
  .board-zone {
    overflow-x: hidden;
    overflow-y: visible;
  }

  .board-zone,
  .board-frame {
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }

  @keyframes mobileSheetIn {
    from {
      opacity: 0;
      transform: translateY(28px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 1280px) {
  html,
  body {
    overflow-y: auto;
  }

  body {
    overscroll-behavior-y: auto;
  }

  .execution-banner {
    grid-template-columns: 14px minmax(0, 1fr) minmax(108px, 0.58fr);
    grid-template-rows: auto auto;
    gap: 4px 9px;
    left: 8px;
    right: 8px;
    top: 8px;
    width: auto;
    min-height: 104px;
    padding: 12px 52px 12px 14px;
    transform: none;
    pointer-events: none;
  }

  .execution-banner::before {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 14px;
    height: 62px;
  }

  .execution-banner span {
    left: 38px;
    top: 10px;
    font-size: 11px;
  }

  .execution-banner strong {
    grid-column: 2;
    grid-row: 1;
    padding-top: 16px;
    font-size: 20px;
  }

  .execution-banner em {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    max-width: 100%;
    padding: 6px 9px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .execution-advisor-action {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: stretch;
    display: grid;
    place-items: center;
    min-height: 64px;
    padding: 8px 9px;
    border-radius: 14px;
    color: #5b220c;
    background: linear-gradient(180deg, rgba(255, 247, 207, 0.98), rgba(244, 190, 71, 0.98));
    border: 1px solid rgba(255, 245, 196, 0.72);
    box-shadow:
      0 9px 0 rgba(123, 46, 14, 0.26),
      0 14px 24px rgba(18, 8, 4, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.72);
    font-size: 12px;
    line-height: 1.25;
    font-weight: 1000;
    white-space: normal;
    pointer-events: auto;
  }

  .execution-advisor-action:disabled {
    color: rgba(255, 248, 230, 0.6);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 234, 188, 0.18);
    box-shadow: none;
  }

  .execution-close {
    width: 38px;
    height: 38px;
  }
}

@media (orientation: landscape) and (max-height: 640px) and (max-width: 1280px) {
  html,
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  body {
    font-size: 13px;
    touch-action: auto;
  }

  .app-shell {
    width: calc(100% - 12px);
    max-width: none;
    gap: 8px;
    padding: 6px 0 12px;
  }

  .topbar {
    grid-template-columns: minmax(220px, 0.64fr) minmax(420px, 1.36fr);
    gap: 8px;
    padding: 8px;
    border-radius: 14px;
  }

  .brand-panel {
    min-height: auto;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .brand-panel .eyebrow {
    max-width: 100%;
    padding: 4px 8px;
    font-size: 10px;
    white-space: nowrap;
  }

  .brand-panel h1 {
    font-size: clamp(24px, 3.1vw, 34px);
    line-height: 1;
    white-space: nowrap;
  }

  .producer-line {
    min-height: 30px;
    padding: 4px 8px;
    gap: 6px;
  }

  .producer-line span {
    padding: 2px 6px;
    font-size: 10px;
  }

  .producer-line strong {
    font-size: clamp(11px, 1.55vw, 13px);
    letter-spacing: 0.01em;
  }

  .topbar-right {
    gap: 6px;
  }

  .top-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .top-actions .secondary {
    min-height: 34px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 12px;
  }

  .score-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .score-strip div,
  .score-strip div:nth-child(3) {
    grid-column: auto;
    min-height: 46px;
    padding: 6px 8px;
    border-radius: 9px;
  }

  .score-strip span {
    font-size: 10px;
  }

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

  .mission-strip {
    display: none;
  }

  .workspace {
    grid-template-columns: minmax(300px, 0.72fr) minmax(460px, 1.28fr);
    gap: 8px;
    align-items: start;
    overflow: visible;
  }

  .side-log-panel {
    order: 1;
    grid-column: 1;
    grid-row: 1;
    max-height: none;
    overflow: visible;
    padding: 8px;
    border-radius: 12px;
    touch-action: auto;
  }

  .side-log-panel > .side-command-row {
    order: 1;
  }

  .side-log-panel > .side-action-dock {
    order: 2;
  }

  .side-log-panel > .side-timeline {
    order: 3;
  }

  .side-log-panel > .section-heading {
    order: 4;
  }

  .side-log-panel > #logList {
    order: 5;
  }

  .board-zone {
    order: 2;
    grid-column: 2;
    grid-row: 1;
    overflow-x: hidden;
    overflow-y: visible;
    touch-action: auto;
  }

  .map-player-board {
    order: 3;
    grid-column: 1 / -1;
    grid-row: 2;
    max-height: none;
    overflow: visible;
    padding: 8px;
    border-radius: 12px;
    touch-action: auto;
  }

  .side-command-row {
    grid-template-columns: 1fr;
    gap: 6px;
    margin: 0;
    padding: 0;
    border-top: 0;
  }

  .side-command-row .turn-card {
    display: none;
  }

  .side-command-row .advisor-card {
    gap: 6px;
    padding: 8px;
    border-radius: 12px;
  }

  .advisor-heading h2 {
    font-size: 15px;
  }

  .compact-guide-select {
    min-width: 108px;
  }

  .compact-guide-select select {
    min-height: 34px;
    font-size: 12px;
  }

  .side-command-row .advisor-card p {
    display: none;
  }

  #advisorAction {
    min-height: 42px;
    border-radius: 10px;
    font-size: 14px;
    box-shadow:
      0 6px 0 rgba(103, 15, 20, 0.42),
      0 12px 22px rgba(157, 29, 34, 0.2);
  }

  .side-action-dock {
    margin: 6px 0 0;
  }

  .side-action-dock .action-panel {
    padding: 8px;
    border-radius: 12px;
  }

  .side-action-dock .section-heading {
    display: none;
  }

  .side-action-dock .action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 6px;
    height: auto;
  }

  .side-action-dock .action-grid button,
  .action-grid button {
    min-height: 66px;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 3px;
    padding: 8px;
    border-radius: 9px;
  }

  .side-action-dock .action-grid button small,
  .action-grid button small {
    grid-column: 1;
    grid-row: 1;
    width: 24px;
    font-size: 9px;
  }

  .side-action-dock .action-grid button strong,
  .action-grid button strong {
    grid-column: 1;
    grid-row: 2;
    font-size: 14px;
  }

  .side-action-dock .action-grid button em,
  .action-grid button em {
    display: none;
  }

  .action-status {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
    padding: 4px 7px;
    font-size: 10px;
  }

  .side-action-dock .action-status {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
  }

  .action-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
  }

  .tool-button {
    min-height: 48px;
    padding: 8px;
    border-radius: 9px;
  }

  .tool-button span,
  .tool-button em,
  .tool-button::after {
    display: none;
  }

  .tool-button strong {
    font-size: 14px;
  }

  .side-timeline {
    display: none;
  }

  .side-log-panel > .section-heading {
    margin: 4px 0 0;
    padding: 8px 2px 4px;
    border: 0;
    background: transparent;
  }

  .side-log-panel > .section-heading h2 {
    font-size: 15px;
  }

  .side-log-panel > .section-heading span {
    display: none;
  }

  #logList {
    max-height: none;
    font-size: 11px;
    overflow: visible;
  }

  #logList li {
    grid-template-columns: 24px 1fr;
    gap: 6px;
    padding: 6px 0;
  }

  .board-frame {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
  }

  .code-board {
    padding: 5px;
  }

  .map-title {
    min-height: 40px;
    padding: 6px 8px;
  }

  .map-title span {
    display: none;
  }

  .map-title strong {
    font-size: clamp(18px, 2.8vw, 26px);
  }

  .gdp-track,
  .map-scoreboard,
  .map-command-bar {
    display: none;
  }

  .systems-strip header {
    min-height: 32px;
    padding: 6px 8px;
  }

  .systems-strip header strong {
    font-size: 12px;
  }

  .code-board .systems-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 3px;
  }

  .code-board .system-dot {
    min-height: 14px;
  }

  .park-model-shell {
    min-height: max(310px, calc(100dvh - 176px));
  }

  .park-model-shell::before {
    inset: 14px 10px 12px;
    border-radius: 16px;
  }

  .park-model-shell::after {
    display: none;
  }

  .筹-point {
    width: 34px;
    font-size: 18px;
  }

  .code-board .plot {
    width: clamp(46px, 6.6vw, 66px);
    min-height: clamp(46px, 6.6vw, 66px);
    padding: 5px 3px;
    border-radius: 9px;
  }

  .plot-owner-badge {
    top: -11px;
    font-size: 8px;
  }

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

  .code-board .plot span,
  .code-board .plot .plot-meta,
  .code-board .plot small {
    font-size: 8px;
  }

  .capacity-dot {
    width: 5px;
    height: 5px;
  }

  .team-list,
  #teamList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .team-card {
    gap: 7px;
    padding: 8px;
  }

  .team-head strong {
    font-size: 16px;
  }

  .member-chip {
    min-height: 24px;
    padding: 4px 8px;
    font-size: 11px;
  }

  .token-grid,
  .resource-grid,
  .hand-list,
  .player-board .token-grid,
  .player-board .hand {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .execution-banner {
    grid-template-columns: 12px minmax(0, 1fr) minmax(150px, 0.45fr);
    min-height: 72px;
    padding: 8px 48px 8px 12px;
    border-radius: 16px;
  }

  .execution-banner::before {
    width: 12px;
    height: 44px;
  }

  .execution-banner span {
    left: 34px;
    top: 7px;
    font-size: 10px;
  }

  .execution-banner strong {
    padding-top: 13px;
    font-size: 18px;
  }

  .execution-banner em {
    padding: 5px 8px;
    font-size: 11px;
  }

  .execution-advisor-action {
    min-height: 46px;
    padding: 6px 8px;
    border-radius: 12px;
    font-size: 11px;
  }

  .execution-close {
    top: 7px;
    right: 8px;
    width: 34px;
    height: 34px;
  }

  .action-dialog,
  .info-dialog,
  #assignmentOverviewModal .info-dialog,
  .library-dialog,
  .card-inspect-dialog,
  .assignment-detail-dialog,
  .plot-detail-dialog,
  .report-dialog {
    max-height: calc(100dvh - 8px);
    width: min(920px, calc(100vw - 12px));
    justify-self: center;
    border-radius: 16px;
    padding: 12px;
  }

  .action-dialog .action-detail,
  .library-dialog .card-library {
    max-height: calc(100dvh - 120px);
  }

  .intro-scene {
    width: min(100vw - 14px, 1060px);
    padding: 10px 0 16px;
    gap: 8px;
  }

  .intro-epic-title {
    font-size: clamp(32px, 6vw, 58px);
  }

  .intro-scene h2 {
    font-size: clamp(22px, 4vw, 34px);
  }

  .intro-letter {
    padding: 10px;
  }

  .intro-config {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .intro-config > div,
  .leader-name-field,
  .intro-settings-heading {
    grid-column: 1 / -1;
  }

  .intro-start {
    min-height: 48px;
  }

  .workspace,
  .side-log-panel,
  .board-zone,
  .map-player-board,
  .board-frame,
  .code-board {
    overflow-y: visible;
    touch-action: auto;
  }
}

@media (orientation: landscape) and (max-height: 640px) and (max-width: 1280px) {
  #introOverlay {
    overflow: hidden;
    padding: 4px !important;
  }

  #introOverlay .intro-scene {
    width: min(100vw - 8px, 1120px) !important;
    height: calc(100dvh - 8px) !important;
    max-height: calc(100dvh - 8px) !important;
    min-height: 0 !important;
    align-content: center;
    gap: 4px !important;
    padding: 0 !important;
    overflow: hidden;
  }

  #introOverlay .intro-hero {
    gap: 2px !important;
  }

  #introOverlay .intro-kicker {
    display: none;
  }

  #introOverlay .intro-epic-title {
    margin: 0 !important;
    padding: 3px 16px 7px !important;
    font-size: clamp(24px, 4vw, 42px) !important;
    line-height: 0.92 !important;
  }

  #introOverlay .intro-epic-title b {
    height: 50px !important;
  }

  #introOverlay .intro-epic-title i {
    width: min(740px, 80vw) !important;
  }

  #introOverlay .intro-epic-title span::after {
    bottom: -7px !important;
    height: 3px !important;
  }

  #introOverlay .intro-scene h2 {
    margin: 0 !important;
    font-size: clamp(18px, 3vw, 26px) !important;
    line-height: 1.05 !important;
  }

  #introOverlay .intro-scene > p,
  #introOverlay .intro-copy p {
    display: none !important;
  }

  #introOverlay .intro-home-grid {
    grid-template-columns: minmax(280px, 0.82fr) minmax(500px, 1.18fr) !important;
    align-items: stretch !important;
    width: min(1040px, 100%) !important;
    gap: 5px !important;
  }

  #introOverlay .intro-letter {
    grid-template-columns: 62px minmax(0, 1fr) !important;
    width: 100% !important;
    min-height: 92px !important;
    max-height: 102px !important;
    padding: 6px 8px !important;
    border-radius: 14px !important;
  }

  #introOverlay .intro-letter-seal {
    width: 52px !important;
    border-width: 2px !important;
    font-size: 14px !important;
  }

  #introOverlay .intro-letter-paper {
    min-height: 70px !important;
    gap: 2px !important;
    padding: 6px 10px !important;
    border-radius: 10px !important;
  }

  #introOverlay .intro-letter-paper span {
    font-size: 10px !important;
  }

  #introOverlay .intro-letter-paper strong {
    font-size: clamp(18px, 2.7vw, 25px) !important;
  }

  #introOverlay .intro-letter-paper p,
  #introOverlay .intro-letter-paper em {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    font-size: 11px !important;
    line-height: 1.22 !important;
  }

  #introOverlay .intro-letter-paper::after {
    right: 8px !important;
    bottom: 2px !important;
    font-size: 24px !important;
  }

  #introOverlay .intro-letter-years {
    display: none !important;
  }

  #introOverlay .intro-config {
    grid-template-columns: minmax(138px, 1.25fr) repeat(4, minmax(82px, 0.72fr)) minmax(108px, 0.8fr) !important;
    width: 100% !important;
    gap: 5px !important;
    margin: 0 !important;
    padding: 6px !important;
    border-radius: 12px !important;
  }

  #introOverlay .intro-config > div:first-child {
    grid-column: 1 / 2 !important;
    display: grid !important;
    align-content: center;
    gap: 2px !important;
  }

  #introOverlay .intro-config h3 {
    font-size: 14px !important;
    line-height: 1.08 !important;
  }

  #introOverlay .intro-config span {
    font-size: 10px !important;
    line-height: 1.18 !important;
  }

  #introOverlay .leader-name-field,
  #introOverlay .intro-config label,
  #introOverlay .intro-start {
    grid-column: auto !important;
    min-width: 0;
  }

  #introOverlay .leader-name-field {
    min-height: 40px !important;
    grid-template-columns: 1fr !important;
    padding: 5px 6px !important;
    font-size: 10px !important;
  }

  #introOverlay .leader-name-field input {
    max-width: none !important;
    font-size: 13px !important;
  }

  #introOverlay .intro-settings-heading {
    display: none !important;
  }

  #introOverlay .intro-config label {
    gap: 2px !important;
    font-size: 10px !important;
  }

  #introOverlay .intro-config select,
  #introOverlay .intro-config input,
  #introOverlay .intro-select-trigger {
    min-height: 34px !important;
    border-radius: 8px !important;
    padding: 0 7px !important;
    font-size: 11px !important;
  }

  #introOverlay .intro-start {
    align-self: end;
    min-height: 40px !important;
    border-radius: 9px !important;
    font-size: 13px !important;
  }

  #introOverlay .intro-producer {
    width: min(560px, 100%) !important;
    min-height: 30px !important;
    gap: 7px !important;
    margin: 0 !important;
    padding: 5px 12px !important;
  }

  #introOverlay .intro-producer span {
    padding: 3px 8px !important;
    font-size: 10px !important;
  }

  #introOverlay .intro-producer strong {
    font-size: clamp(14px, 2vw, 18px) !important;
    letter-spacing: 0.02em !important;
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  body::before {
    content: none;
    display: none;
  }

  html,
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .intro-overlay {
    align-items: start;
    overflow: auto;
    padding: calc(14px + env(safe-area-inset-top)) 10px calc(22px + env(safe-area-inset-bottom));
  }

  .intro-scene {
    width: min(100%, 520px);
    height: auto;
    min-height: calc(100dvh - 36px);
    align-content: start;
    gap: 12px;
    padding: 54px 0 18px;
  }

  .intro-hero {
    gap: 8px;
  }

  .intro-copy {
    gap: 7px;
  }

  .intro-epic-title {
    padding: 8px 12px 12px;
    font-size: clamp(31px, 9.2vw, 46px);
    line-height: 1;
    letter-spacing: 0.02em;
  }

  .intro-epic-title b {
    width: 96vw;
    height: 74px;
  }

  .intro-epic-title i {
    width: 88vw;
  }

  .intro-kicker {
    padding: 6px 12px;
    font-size: 12px;
  }

  .intro-scene h2 {
    width: min(100%, 380px);
    font-size: clamp(24px, 6.6vw, 32px);
    line-height: 1.16;
  }

  .intro-copy p {
    display: block;
    margin: 0;
    font-size: 14px;
  }

  .intro-home-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
  }

  .intro-letter {
    grid-template-columns: 1fr;
    min-height: auto;
    max-height: none;
    padding: 12px;
    border-radius: 18px;
  }

  .intro-letter-seal {
    width: 68px;
    margin-bottom: -4px;
    border-width: 2px;
    font-size: 18px;
  }

  .intro-letter-paper {
    min-height: auto;
    gap: 7px;
    padding: 16px 15px 26px;
    border-radius: 14px;
    text-align: left;
  }

  .intro-letter-paper span {
    font-size: 12px;
  }

  .intro-letter-paper strong {
    font-size: clamp(24px, 7vw, 32px);
  }

  .intro-letter-paper p,
  .intro-letter-paper em {
    display: block;
    overflow: visible;
    font-size: 13px;
    line-height: 1.48;
    -webkit-line-clamp: initial;
  }

  .intro-letter-paper::after {
    right: 12px;
    bottom: 6px;
    font-size: 30px;
  }

  .intro-letter-years {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .intro-letter-years i {
    min-height: 26px;
  }

  .intro-config,
  .intro-home-grid .intro-config {
    grid-template-columns: 1fr;
    width: 100%;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
  }

  .intro-config > div,
  .intro-home-grid .intro-config > div,
  .leader-name-field,
  .intro-settings-heading,
  .intro-config label,
  .intro-start {
    grid-column: 1 / -1;
  }

  .intro-config > div,
  .intro-home-grid .intro-config > div {
    display: grid;
    gap: 5px;
  }

  .intro-config h3,
  .intro-home-grid .intro-config h3 {
    font-size: 20px;
    line-height: 1.18;
  }

  .intro-config span {
    font-size: 12px;
    line-height: 1.4;
  }

  .leader-name-field {
    min-height: 58px;
    grid-template-columns: 1fr;
    padding: 9px 10px;
    font-size: 12px;
  }

  .leader-name-field input {
    max-width: none;
    font-size: 16px;
  }

  .intro-settings-heading {
    display: grid;
    gap: 3px;
    min-height: auto;
  }

  .intro-config label {
    gap: 5px;
    font-size: 12px;
  }

  .intro-config select,
  .intro-config input,
  .intro-select-trigger,
  .intro-start {
    min-height: 48px;
    border-radius: 12px;
    font-size: 15px;
  }

  .intro-select-list {
    max-height: min(46dvh, 260px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .intro-producer {
    width: 100%;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    margin-top: 0;
    padding: 9px 12px;
    border-radius: 18px;
  }

  .intro-producer strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(16px, 4.5vw, 22px);
    letter-spacing: 0.02em;
  }

  .intro-music-unlock {
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
    min-width: 104px;
    min-height: 40px;
  }

  .side-command-row .advisor-card {
    position: static;
    z-index: auto;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
  }

  .advisor-heading {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .side-command-row .advisor-card .section-heading {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

  .compact-guide-select select {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    padding: 0 38px 0 12px;
    font-size: 15px;
  }

  #advisorAction {
    min-height: 60px;
    border-radius: 14px;
    font-size: 16px;
  }

  .side-command-row .advisor-card p {
    display: block;
    font-size: 13px;
    line-height: 1.46;
  }

  .side-action-dock .action-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .side-action-dock .action-grid button,
  .action-grid button {
    min-height: 66px;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 4px 9px;
    padding: 9px 10px;
    text-align: left;
  }

  .side-action-dock .action-grid button small,
  .action-grid button small {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 32px;
    height: 32px;
  }

  .side-action-dock .action-grid button strong,
  .action-grid button strong {
    grid-column: 2;
    grid-row: 1;
    font-size: 16px;
  }

  .action-status,
  .side-action-dock .action-status {
    grid-column: 2 / 4;
    grid-row: 2;
    justify-self: start;
  }

  .map-player-board .section-heading {
    position: static;
  }

  .team-list,
  #teamList {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .team-card {
    padding: 12px;
  }

  .team-head small {
    max-width: 132px;
  }

  .board-frame {
    border-radius: 12px;
  }

  .code-board {
    padding: 5px;
  }

  .park-stage {
    border-radius: 10px;
  }

  .map-title {
    min-height: 44px;
    padding: 7px 9px;
  }

  .map-title span {
    display: none;
  }

  .map-title strong {
    font-size: clamp(18px, 5.1vw, 24px);
  }

  .gdp-track,
  .map-scoreboard,
  .map-command-bar {
    display: none;
  }

  .systems-strip header {
    min-height: 30px;
    gap: 5px;
    padding: 5px 7px;
  }

  .systems-strip header strong,
  .systems-strip header em {
    display: none;
  }

  .systems-strip header span {
    width: 20px;
    font-size: 11px;
  }

  .code-board .systems-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 2px;
  }

  .code-board .system-dot {
    min-height: 12px;
    border-radius: 4px;
  }

  .park-model-shell {
    min-height: clamp(330px, 86vw, 455px);
  }

  .park-model-shell::before {
    inset: 12px 9px 10px;
    border-radius: 16px;
  }

  .park-model-shell::after {
    display: none;
  }

  .code-board .plot {
    width: clamp(50px, 14.8vw, 66px);
    min-height: clamp(50px, 14.6vw, 66px);
    border-radius: 10px;
    padding: 5px 3px;
  }

  .plot-capacity-grid {
    max-width: 48px;
  }

  .capacity-dot {
    width: 5px;
    height: 5px;
  }

  .board-zone {
    order: 1;
  }

  .side-log-panel {
    order: 2;
  }

  .map-player-board {
    order: 3;
  }

  .side-log-panel > .side-action-dock {
    order: 1;
  }

  .side-log-panel > .side-command-row {
    order: 2;
  }

  .side-log-panel > .side-timeline {
    order: 3;
  }

  .side-action-dock {
    margin: 0;
  }

  .side-action-dock .action-panel {
    padding: 10px;
    border-radius: 14px;
  }

  .side-action-dock .section-heading {
    margin-bottom: 8px;
  }

  .side-action-dock .section-heading p {
    display: none;
  }

  .side-action-dock .section-heading span {
    min-height: 24px;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
  }

  .side-command-row {
    margin-top: 8px;
  }
}

@media (max-width: 760px),
  (orientation: landscape) and (max-height: 640px) and (max-width: 1280px) {
  .ai-guide-toast,
  .story-toast {
    inset: calc(12px + env(safe-area-inset-top)) 10px auto;
    display: block;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .ai-guide-card,
  .story-toast-card {
    width: min(440px, calc(100vw - 20px));
    min-height: 0;
    max-height: min(58dvh, 360px);
    margin: 0 auto;
    gap: 8px;
    overflow: hidden;
    border-radius: 20px;
    padding: 17px 18px 18px;
    box-shadow:
      0 18px 42px rgba(35, 18, 12, 0.34),
      0 0 0 4px rgba(255, 220, 116, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.32);
  }

  .ai-guide-card::after,
  .story-toast-card::after {
    inset: 10px;
    border-radius: 16px;
    width: auto;
    aspect-ratio: auto;
    background: transparent;
    opacity: 1;
    animation: none;
  }

  .ai-guide-card span,
  .story-toast-card span {
    padding: 6px 10px;
    font-size: 12px;
  }

  .ai-guide-card strong,
  .story-toast-card strong {
    font-size: clamp(25px, 7.2vw, 36px);
    line-height: 1.08;
  }

  .ai-guide-card p,
  .story-toast-card p,
  .story-toast-card em {
    max-width: none;
    font-size: 13px;
    line-height: 1.42;
  }

  .story-toast-card em {
    border-radius: 12px;
    padding: 8px 10px;
  }

  .map-player-board .section-heading {
    position: sticky;
    top: 4px;
    z-index: 2;
    border-radius: 12px;
    padding: 9px 10px;
    background:
      linear-gradient(135deg, rgba(255, 250, 238, 0.94), rgba(247, 227, 182, 0.9));
    box-shadow: 0 10px 24px rgba(73, 43, 23, 0.12);
  }

  .team-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-left: 0;
    border: 1px solid color-mix(in srgb, var(--team-color, #9d1d22) 32%, rgba(93, 54, 28, 0.22));
    border-radius: 15px;
    background:
      linear-gradient(135deg, color-mix(in srgb, var(--team-color, #9d1d22) 12%, transparent), transparent 42%),
      linear-gradient(180deg, rgba(255, 251, 239, 0.98), rgba(248, 233, 195, 0.94));
    box-shadow:
      inset 5px 0 0 var(--team-color, #9d1d22),
      0 12px 26px rgba(70, 42, 22, 0.12);
  }

  .team-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
      repeating-linear-gradient(90deg, rgba(93, 54, 28, 0.045) 0 1px, transparent 1px 18px),
      repeating-linear-gradient(0deg, rgba(93, 54, 28, 0.035) 0 1px, transparent 1px 18px);
    opacity: 0.72;
  }

  .team-card.active {
    outline: 2px solid color-mix(in srgb, var(--team-color, #9d1d22) 28%, rgba(255, 214, 94, 0.72));
    box-shadow:
      inset 5px 0 0 var(--team-color, #9d1d22),
      0 0 0 4px rgba(255, 211, 92, 0.12),
      0 14px 30px rgba(70, 42, 22, 0.14);
  }

  .team-card.acting-seat {
    outline: 2px solid color-mix(in srgb, var(--team-color, #9d1d22) 54%, #ffd66c);
    animation: mobileSeatGlow 1.8s ease-in-out infinite;
  }

  .team-card.acting-seat::after {
    top: 8px;
    right: 8px;
    padding: 5px 8px;
    font-size: 10px;
  }

  .team-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    align-items: center;
  }

  .team-head strong {
    min-width: 0;
    color: var(--team-color, #9d1d22) !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.78);
  }

  .team-head small {
    max-width: 128px;
    border-radius: 999px;
    padding: 5px 8px;
    color: #fff8e4;
    background: linear-gradient(135deg, var(--team-color, #9d1d22), var(--red-deep));
    box-shadow: 0 8px 18px rgba(70, 42, 22, 0.14);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 1000;
  }

  .member-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .member-chip {
    display: grid;
    place-items: center;
    min-height: 28px;
    padding: 5px 6px;
    border-radius: 999px;
    color: color-mix(in srgb, var(--team-color, #9d1d22) 84%, #311f18);
    background: rgba(255, 255, 255, 0.66);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .acting-chip {
    color: #fff8e4;
  }

  .talent-row {
    gap: 5px;
  }

  .talent-badge,
  .resource-badge {
    min-height: 34px;
    border-radius: 10px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.68);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }

  .talent-badge b,
  .resource-badge b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .talent-badge em,
  .resource-badge em {
    justify-self: end;
    min-width: 26px;
    border-radius: 999px;
    padding: 3px 6px;
    background: rgba(157, 29, 34, 0.1);
    text-align: center;
  }

  .talent-piece {
    width: 20px;
    height: 22px;
  }

  .resource-icon {
    width: 20px;
    height: 20px;
  }

  .funds-ledger {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    border-radius: 12px;
    padding: 8px;
  }

  .funds-ledger strong {
    font-size: 24px;
  }

  .funds-ledger p {
    justify-self: start;
    max-width: 100%;
    white-space: normal;
  }

  .assignment-block,
  .hand-block {
    border-radius: 12px;
    border-style: solid;
    background: rgba(255, 255, 255, 0.58);
  }

  .assignment-mini-card,
  .owned-card {
    border-radius: 10px;
    background:
      linear-gradient(135deg, color-mix(in srgb, var(--team-color, #9d1d22) 8%, transparent), transparent 48%),
      rgba(255, 250, 240, 0.96);
  }
}

@media (orientation: landscape) and (max-height: 640px) and (max-width: 1280px) {
  .ai-guide-toast,
  .story-toast {
    inset: calc(10px + env(safe-area-inset-top)) auto auto 50%;
    width: min(520px, 54vw);
    transform: translateX(-50%);
  }

  .ai-guide-card,
  .story-toast-card {
    width: 100%;
    max-height: min(72dvh, 330px);
    padding: 16px 18px;
  }

  .ai-guide-card strong,
  .story-toast-card strong {
    font-size: clamp(24px, 3.6vw, 36px);
  }

  .map-player-board {
    padding-top: 10px;
  }

  .team-list,
  #teamList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .resource-pool-card {
    grid-column: span 2;
  }

  .team-card {
    min-height: 0;
    padding: 10px;
  }

  .team-head strong {
    font-size: 16px;
  }

  .assignment-mini-card {
    min-height: 64px;
  }

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

@media (max-width: 760px) and (orientation: portrait) {
  .board-zone {
    order: 1;
  }

  .side-log-panel {
    order: 2;
    gap: 9px;
    padding: 10px;
  }

  .map-player-board {
    order: 3;
  }

  .side-log-panel > .side-action-dock {
    order: 1;
  }

  .side-log-panel > .side-command-row {
    order: 2;
  }

  .side-log-panel > .side-timeline {
    order: 3;
  }

  .side-log-panel > .section-heading {
    order: 4;
  }

  .side-log-panel > #logList {
    order: 5;
  }

  .map-player-board .section-heading {
    position: static;
  }

  .team-list,
  #teamList {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .resource-pool-card {
    grid-column: auto;
  }

  .side-action-dock .action-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .side-action-dock .action-grid button,
  .action-grid button {
    min-height: 66px;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 4px 9px;
    padding: 9px 10px;
  }

  .side-action-dock .action-grid button small,
  .action-grid button small {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 32px;
    height: 32px;
  }

  .side-action-dock .action-grid button strong,
  .action-grid button strong {
    grid-column: 2;
    grid-row: 1;
    font-size: 16px;
  }

  .action-status,
  .side-action-dock .action-status {
    grid-column: 2 / 4;
    grid-row: 2;
    justify-self: start;
  }

  .advisor-heading {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .compact-guide-select select {
    width: 100%;
    min-height: 48px;
    padding: 0 38px 0 12px;
    font-size: 15px;
  }

  .side-command-row .advisor-card {
    position: static;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
  }

  #advisorAction {
    min-height: 54px;
    font-size: 15px;
  }

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

  .map-player-board .section-heading {
    margin-bottom: 8px;
    padding: 8px 9px;
    border-radius: 12px;
    box-shadow: none;
  }

  .map-player-board .section-heading p,
  .map-player-board .section-heading span {
    display: none;
  }

  .map-player-board .section-heading h2 {
    font-size: 18px;
  }

  .team-card {
    gap: 6px;
    padding: 9px;
    border-radius: 12px;
  }

  .team-card.acting-seat::after {
    top: 6px;
    right: 6px;
    padding: 4px 7px;
    font-size: 9px;
  }

  .team-head {
    gap: 6px;
    min-height: 0;
  }

  .team-head strong {
    font-size: 15px;
  }

  .team-head small {
    max-width: 116px;
    padding: 4px 7px;
    font-size: 9px;
  }

  .member-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .member-chip {
    min-height: 24px;
    padding: 4px 5px;
    font-size: 10px;
  }

  .resource-pool-card .member-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .funds-ledger {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    padding: 7px;
  }

  .funds-ledger span,
  .funds-ledger em {
    font-size: 10px;
  }

  .funds-ledger em,
  .money-note {
    display: none;
  }

  .funds-ledger strong {
    font-size: 20px;
  }

  .funds-ledger p {
    justify-self: end;
    max-width: 150px;
    padding: 5px 7px;
    font-size: 10px;
    line-height: 1.25;
  }

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

  .resource-badge,
  .talent-badge {
    min-height: 28px;
    gap: 4px;
    border-radius: 9px;
    padding: 5px;
    font-size: 11px;
  }

  .resource-icon {
    width: 16px;
    height: 16px;
  }

  .resource-icon.ingot {
    height: 12px;
  }

  .talent-piece {
    width: 17px;
    height: 19px;
  }

  .talent-badge b,
  .resource-badge b {
    font-size: 11px;
  }

  .talent-badge em,
  .resource-badge em {
    min-width: 22px;
    padding: 2px 5px;
    font-size: 10px;
  }

  .assignment-block,
  .hand-block {
    gap: 5px;
    padding: 7px;
    border-radius: 10px;
  }

  .hand-title {
    font-size: 11px;
  }

  .empty-hand {
    min-height: 22px;
    display: grid;
    align-items: center;
    font-size: 11px;
  }

  .assignment-mini-card {
    min-height: 56px;
    gap: 4px;
    padding: 7px;
  }

  .assignment-mini-card strong {
    font-size: 13px;
  }

  .assignment-mini-card small {
    display: none;
  }

  .owned-card {
    min-height: 36px;
    padding: 6px;
    font-size: 10px;
  }

  .owned-card b {
    font-size: 11px;
  }

  .side-log-panel > .section-heading {
    margin: 2px 0 0;
    padding: 7px 2px 3px;
  }

  .side-log-panel > .section-heading h2 {
    font-size: 16px;
  }

  #logList {
    min-height: 110px;
    max-height: 168px;
    font-size: 11px;
  }

  #logList li {
    grid-template-columns: 24px 1fr;
    gap: 6px;
    padding: 7px 0;
  }

  .topbar {
    gap: 7px;
    margin-bottom: 8px;
    padding: 7px;
    border-radius: 14px;
  }

  .brand-panel {
    gap: 5px;
    padding: 9px 10px;
    border-radius: 12px;
  }

  .brand-panel .eyebrow {
    display: none;
  }

  .brand-panel h1 {
    font-size: clamp(23px, 7vw, 30px);
    line-height: 1;
    white-space: nowrap;
  }

  .producer-line {
    min-height: 30px;
    margin-top: 0;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
  }

  .producer-line span {
    padding: 2px 6px;
    font-size: 10px;
  }

  .producer-line strong {
    font-size: clamp(11px, 3vw, 13px);
    letter-spacing: 0.01em;
  }

  .topbar-right {
    gap: 6px;
  }

  .top-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .top-actions .secondary {
    min-height: 34px;
    padding: 0 4px;
    border-radius: 8px;
    font-size: 11px;
  }

  .score-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .score-strip div,
  .score-strip div:nth-child(3) {
    grid-column: auto;
    min-height: 42px;
    padding: 5px 6px;
    border-radius: 9px;
  }

  .score-strip span {
    font-size: 9px;
  }

  .score-strip strong {
    font-size: 15px;
    line-height: 1;
  }

  .mission-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
    padding: 6px;
    border-radius: 14px;
  }

  .mission-strip article {
    min-height: 58px;
    padding: 8px;
    border-radius: 10px;
  }

  .mission-strip span {
    font-size: 10px;
  }

  .mission-strip strong {
    font-size: 13px;
    line-height: 1.2;
  }

  .mission-strip em {
    display: none;
  }

  .workspace {
    gap: 8px;
  }

  .intro-scene {
    gap: 9px;
    min-height: 0;
    padding: 50px 0 14px;
  }

  .intro-hero {
    gap: 5px;
  }

  .intro-copy {
    gap: 5px;
  }

  .intro-copy p {
    display: none;
  }

  .intro-scene h2 {
    font-size: clamp(20px, 5.4vw, 25px);
    line-height: 1.12;
  }

  .intro-kicker {
    padding: 5px 10px;
    font-size: 11px;
  }

  .intro-epic-title {
    padding: 6px 9px 9px;
    font-size: clamp(27px, 7.6vw, 36px);
  }

  .intro-epic-title b {
    height: 58px;
  }

  .intro-home-grid {
    gap: 9px;
  }

  .intro-letter {
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 10px;
  }

  .intro-letter-seal {
    width: 56px;
    margin: 0;
    font-size: 15px;
  }

  .intro-letter-paper {
    gap: 4px;
    min-width: 0;
    padding: 12px 12px 16px;
  }

  .intro-letter-paper strong {
    font-size: clamp(21px, 6vw, 28px);
  }

  .intro-letter-paper p,
  .intro-letter-paper em {
    font-size: 12px;
    line-height: 1.38;
  }

  .intro-letter-years {
    grid-column: 1 / -1;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
  }

  .intro-letter-years i {
    min-height: 22px;
    font-size: 9px;
  }

  .intro-config,
  .intro-home-grid .intro-config {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
  }

  .intro-config > div,
  .intro-home-grid .intro-config > div,
  .leader-name-field,
  .intro-settings-heading,
  .intro-start {
    grid-column: 1 / -1;
  }

  .intro-config label:not(.leader-name-field),
  .intro-home-grid .intro-config label:not(.leader-name-field) {
    grid-column: auto;
  }

  .intro-config h3,
  .intro-home-grid .intro-config h3 {
    font-size: 18px;
  }

  .intro-config > div span,
  .intro-settings-heading span {
    display: none;
  }

  .leader-name-field {
    min-height: 52px;
    padding: 7px 9px;
  }

  .leader-name-field input {
    min-height: 38px;
  }

  .intro-settings-heading {
    min-height: 22px;
    padding-top: 4px;
  }

  .intro-config label {
    gap: 4px;
    min-width: 0;
  }

  .intro-config select,
  .intro-config input,
  .intro-select-trigger,
  .intro-start {
    min-height: 42px;
    font-size: 13px;
  }

  .intro-config select,
  .intro-config input,
  .compact-guide-select select {
    font-size: 16px;
  }

  .intro-start {
    min-height: 50px;
    font-size: 15px;
  }
}

@keyframes mobileLandscapeTipPulse {
  0%,
  100% {
    opacity: 0.86;
    transform: translateX(-50%) translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-3px);
  }
}

@keyframes mobileSeatGlow {
  0%,
  100% {
    box-shadow:
      inset 5px 0 0 var(--team-color, #9d1d22),
      0 0 0 4px rgba(255, 211, 92, 0.12),
      0 14px 30px rgba(70, 42, 22, 0.14);
  }

  50% {
    box-shadow:
      inset 5px 0 0 var(--team-color, #9d1d22),
      0 0 0 6px rgba(255, 211, 92, 0.2),
      0 18px 34px rgba(70, 42, 22, 0.18);
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  .execution-banner {
    position: sticky;
    top: calc(6px + env(safe-area-inset-top));
    left: auto;
    right: auto;
    z-index: 30;
    grid-template-columns: 10px minmax(0, 1fr) minmax(84px, 0.42fr);
    gap: 3px 8px;
    width: calc(100% - 12px);
    min-height: 76px;
    margin: 6px auto 8px;
    padding: 8px 42px 8px 10px;
    border-radius: 14px;
    transform: none;
    box-shadow:
      0 10px 26px rgba(51, 18, 15, 0.18),
      inset 0 0 0 1px rgba(255, 232, 168, 0.22);
  }

  .execution-banner::before {
    width: 10px;
    height: 44px;
  }

  .execution-banner span {
    top: 7px;
    left: 28px;
    max-width: calc(100% - 152px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  .execution-banner strong {
    padding-top: 12px;
    font-size: 18px;
  }

  .execution-banner em {
    max-width: 100%;
    padding: 5px 8px;
    font-size: 11px;
  }

  .execution-advisor-action {
    min-height: 48px;
    padding: 6px 7px;
    border-radius: 11px;
    font-size: 11px;
    box-shadow:
      0 6px 0 rgba(123, 46, 14, 0.24),
      0 10px 18px rgba(18, 8, 4, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }

  .execution-close {
    top: 7px;
    right: 8px;
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

  .topbar {
    margin-top: 0;
    gap: 5px;
    padding: 6px;
  }

  .brand-panel {
    gap: 3px;
    padding: 7px 9px;
  }

  .brand-panel h1 {
    font-size: clamp(21px, 6.4vw, 27px);
  }

  .producer-line {
    min-height: 26px;
    padding: 3px 7px;
  }

  .producer-line span {
    padding: 1px 6px;
    font-size: 9px;
  }

  .producer-line strong {
    font-size: clamp(10px, 2.9vw, 12px);
  }

  .topbar-right {
    gap: 5px;
  }

  .top-actions .secondary {
    min-height: 30px;
    font-size: 10px;
  }

  .score-strip div,
  .score-strip div:nth-child(3) {
    min-height: 36px;
    padding: 4px 5px;
  }

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

  .mission-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    padding: 5px;
  }

  .mission-strip article {
    min-height: 46px;
    gap: 2px;
    padding: 6px 7px;
  }

  .mission-strip span {
    font-size: 9px;
  }

  .mission-strip strong {
    overflow: hidden;
    display: -webkit-box;
    font-size: 11px;
    line-height: 1.18;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .mission-strip article:nth-child(n + 3) {
    min-height: 38px;
  }

  .intro-producer {
    min-height: 34px;
    padding: 5px 9px;
  }

  .intro-producer span {
    padding: 2px 7px;
    font-size: 10px;
  }

  .intro-producer strong {
    font-size: clamp(15px, 4vw, 20px);
  }

  .side-log-panel {
    gap: 7px;
  }

  .side-action-dock .action-panel {
    padding: 8px;
    border-radius: 13px;
  }

  .side-action-dock .section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
  }

  .side-action-dock .section-heading h2 {
    font-size: 16px;
    line-height: 1.1;
  }

  .side-action-dock .section-heading span {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 10px;
  }

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

  .side-action-dock .action-grid button,
  .action-grid button {
    min-height: 58px;
    grid-template-columns: 28px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 3px 7px;
    padding: 7px;
    border-radius: 12px;
  }

  .side-action-dock .action-grid button.action-recommended,
  .action-grid button.action-recommended {
    grid-column: 1 / -1;
    min-height: 62px;
  }

  .side-action-dock .action-grid button small,
  .action-grid button small {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 26px;
    height: 26px;
    font-size: 10px;
  }

  .side-action-dock .action-grid button strong,
  .action-grid button strong {
    grid-column: 2;
    grid-row: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }

  .side-action-dock .action-grid button em,
  .action-grid button em {
    display: none;
  }

  .action-status,
  .side-action-dock .action-status {
    grid-column: 2;
    grid-row: 2;
    max-width: 100%;
    min-height: 20px;
    padding: 2px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  .side-command-row {
    margin-top: 0;
  }

  .side-command-row .turn-card {
    display: none;
  }

  .side-command-row .advisor-card {
    gap: 7px;
    padding: 9px;
    border-radius: 13px;
  }

  .side-command-row .advisor-card .section-heading {
    gap: 6px;
    margin: 0;
    padding: 0;
    border-bottom: 0;
    background: transparent;
  }

  .side-command-row .advisor-card h2 {
    font-size: 17px;
    line-height: 1.1;
  }

  .side-command-row .advisor-card p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .compact-guide-select select {
    min-height: 42px;
  }

  #advisorAction {
    min-height: 48px;
    border-radius: 12px;
    font-size: 14px;
  }

  .action-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 7px;
    padding-top: 7px;
  }

  .tool-button {
    min-height: 44px;
    gap: 0;
    padding: 7px 8px;
    border-radius: 10px;
  }

  .tool-button span,
  .tool-button em,
  .tool-button::after {
    display: none;
  }

  .tool-button strong {
    font-size: 14px;
    line-height: 1.1;
    text-align: center;
  }

  .side-timeline {
    margin: 0;
    padding: 8px;
    border-radius: 12px;
  }

  .side-timeline .section-heading {
    margin: 0 0 6px;
    padding: 0;
    border-bottom: 0;
    background: transparent;
  }

  .side-timeline .section-heading h2 {
    font-size: 14px;
  }

  .side-timeline .section-heading p,
  .side-timeline .section-heading span {
    display: none;
  }

  .side-timeline .timeline-story {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 7px;
    min-height: 82px;
    padding: 8px;
  }

  .side-timeline .timeline-current {
    padding-right: 6px;
  }

  .side-timeline .timeline-current span {
    font-size: 17px;
  }

  .side-timeline .timeline-current strong {
    font-size: 11px;
  }

  .side-timeline .timeline-current em {
    display: none;
  }

  .side-timeline .timeline-story p {
    font-size: 11px;
    line-height: 1.32;
    -webkit-line-clamp: 2;
  }

  .side-timeline .timeline-inline-progress,
  .side-timeline .timeline-anecdote {
    display: none;
  }

  .team-list,
  #teamList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .resource-pool-card {
    grid-column: 1 / -1;
  }

  .map-player-board {
    padding: 8px;
  }

  .map-player-board .section-heading {
    margin-bottom: 7px;
    padding: 7px 8px;
  }

  .team-card {
    gap: 5px;
    padding: 7px;
    border-radius: 12px;
  }

  .resource-pool-card .member-row {
    display: none;
  }

  .resource-pool-card .funds-ledger {
    min-height: 0;
    padding: 6px;
  }

  .resource-pool-card .funds-ledger strong {
    font-size: 18px;
  }

  .resource-pool-card .funds-ledger p {
    max-width: 140px;
    padding: 4px 6px;
  }

  .resource-pool-card .token-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .resource-pool-card .resource-badge {
    min-height: 26px;
    padding: 4px;
  }

  .resource-pool-card .hand-block {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 0;
    gap: 6px;
    padding: 5px 6px;
  }

  .resource-pool-card .hand-block .hand-title {
    white-space: nowrap;
  }

  .resource-pool-card .hand {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resource-pool-card .empty-hand {
    min-height: 20px;
    text-align: right;
  }

  .member-card {
    min-height: 0;
  }

  .member-card .team-head {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .member-card .team-head strong {
    font-size: 13px;
  }

  .member-card .team-head small {
    justify-self: start;
    max-width: 100%;
    padding: 3px 6px;
    font-size: 8px;
  }

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

  .member-card .member-chip:not(.acting-chip) {
    display: none;
  }

  .member-card .talent-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }

  .member-card .talent-badge {
    min-height: 34px;
    grid-template-columns: 1fr;
    place-items: center;
    gap: 2px;
    padding: 4px 3px;
  }

  .member-card .talent-piece {
    width: 14px;
    height: 15px;
  }

  .member-card .talent-badge b {
    display: none;
  }

  .member-card .talent-badge em {
    min-width: 0;
    padding: 1px 5px;
    font-size: 9px;
  }

  .member-card .assignment-block {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 0;
    gap: 3px;
    padding: 5px;
  }

  .member-card .assignment-list {
    min-width: 0;
  }

  .member-card .assignment-block:has(.assignment-mini-card) {
    grid-template-columns: 1fr;
    min-height: 46px;
  }

  .member-card .hand-title {
    font-size: 10px;
    white-space: nowrap;
  }

  .member-card .empty-hand {
    min-height: 18px;
    font-size: 10px;
    text-align: right;
  }

  .member-card .assignment-mini-card {
    min-height: 46px;
    padding: 5px;
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  .topbar {
    gap: 4px;
    padding: 5px;
  }

  .brand-panel {
    gap: 2px;
    padding: 6px 8px;
  }

  .brand-panel h1 {
    font-size: clamp(20px, 6vw, 25px);
  }

  .producer-line {
    min-height: 24px;
    padding: 2px 7px;
  }

  .producer-line span {
    font-size: 8px;
  }

  .producer-line strong {
    font-size: clamp(10px, 2.7vw, 12px);
  }

  .topbar-right {
    gap: 4px;
  }

  .top-actions {
    gap: 4px;
  }

  .top-actions .secondary {
    min-height: 28px;
    border-radius: 8px;
    font-size: 9px;
  }

  .score-strip {
    gap: 4px;
  }

  .score-strip div,
  .score-strip div:nth-child(3) {
    min-height: 32px;
    padding: 4px;
    border-radius: 8px;
  }

  .score-strip div::after {
    left: 5px;
    right: 5px;
    bottom: 4px;
  }

  .score-strip span {
    font-size: 8px;
  }

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

  .mission-strip {
    display: flex;
    gap: 6px;
    min-width: 0;
    margin-bottom: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px;
    border-radius: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .mission-strip::-webkit-scrollbar {
    display: none;
  }

  .mission-strip article {
    flex: 0 0 min(70vw, 252px);
    min-height: 52px;
    gap: 2px;
    padding: 7px 9px;
    scroll-snap-align: start;
  }

  .mission-strip article:first-child {
    flex-basis: min(62vw, 232px);
  }

  .mission-strip span {
    font-size: 9px;
  }

  .mission-strip strong {
    font-size: 12px;
    line-height: 1.22;
    -webkit-line-clamp: 2;
  }

  .map-title {
    min-height: 40px;
  }

  .map-title strong {
    font-size: clamp(17px, 4.8vw, 22px);
  }

  .side-log-panel {
    display: contents;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
  }

  .side-action-dock {
    order: 1;
    width: 100%;
    margin: 0;
  }

  .board-zone {
    order: 2;
  }

  .side-command-row {
    order: 3;
    width: 100%;
  }

  .side-timeline {
    order: 4;
    width: 100%;
  }

  .side-log-panel > .section-heading {
    order: 5;
    width: 100%;
    margin: 0;
    padding: 7px 2px 3px;
  }

  .side-log-panel > #logList {
    order: 6;
    width: 100%;
  }

  .map-player-board {
    order: 7;
  }

  .execution-banner {
    grid-template-columns: 8px minmax(0, 1fr) minmax(76px, 0.36fr);
    min-height: 64px;
    margin: 5px auto 7px;
    padding: 6px 38px 6px 9px;
    border-radius: 13px;
  }

  .execution-banner::before {
    width: 8px;
    height: 38px;
  }

  .execution-banner span {
    top: 6px;
    left: 24px;
    max-width: calc(100% - 136px);
    font-size: 9px;
  }

  .execution-banner strong {
    padding-top: 10px;
    font-size: 16px;
  }

  .execution-banner em {
    padding: 4px 7px;
    font-size: 10px;
  }

  .execution-advisor-action {
    min-height: 42px;
    padding: 5px 6px;
    border-radius: 10px;
    font-size: 10px;
  }

  .execution-close {
    top: 6px;
    right: 7px;
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .side-action-dock .action-panel {
    position: relative;
    overflow: hidden;
    padding: 8px;
    border-radius: 16px;
    background:
      radial-gradient(circle at 12% 0%, rgba(255, 220, 116, 0.18), transparent 32%),
      radial-gradient(circle at 92% 100%, rgba(113, 176, 115, 0.14), transparent 34%),
      linear-gradient(180deg, rgba(73, 24, 19, 0.98), rgba(78, 19, 18, 0.98));
  }

  .side-action-dock .action-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      linear-gradient(90deg, rgba(255, 232, 168, 0.055) 1px, transparent 1px),
      linear-gradient(rgba(255, 232, 168, 0.045) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.72;
  }

  .side-action-dock .section-heading,
  .side-action-dock .action-grid,
  .side-action-dock .action-tools {
    position: relative;
    z-index: 1;
  }

  .side-action-dock .section-heading {
    min-height: 34px;
    margin-bottom: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 232, 168, 0.16);
    background:
      linear-gradient(135deg, rgba(157, 29, 34, 0.58), rgba(61, 18, 16, 0.82));
    padding: 7px 9px;
  }

  .side-action-dock .section-heading h2 {
    color: #fff8e8;
    font-size: 15px;
    text-shadow: 0 2px 8px rgba(20, 5, 3, 0.28);
  }

  .side-action-dock .section-heading p {
    color: rgba(255, 244, 214, 0.76);
  }

  .side-action-dock .section-heading span {
    min-height: 20px;
    padding: 2px 7px;
    color: #3a1d10;
    background: linear-gradient(135deg, #ffe7a4, #f2bd45);
    border: 1px solid rgba(255, 244, 191, 0.5);
  }

  .side-action-dock .action-grid {
    gap: 5px;
  }

  .side-action-dock .action-grid button,
  .action-grid button {
    min-height: 50px;
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 2px 7px;
    padding: 6px 7px;
    border-radius: 12px;
  }

  .side-action-dock .action-grid button.action-recommended,
  .action-grid button.action-recommended {
    min-height: 62px;
    background:
      linear-gradient(135deg, rgba(255, 220, 116, 0.22), rgba(157, 29, 34, 0.52)),
      rgba(255, 255, 255, 0.08);
  }

  .side-action-dock .action-grid button:active,
  .tool-button:active,
  #advisorAction:active {
    transform: scale(0.985);
  }

  .side-action-dock .action-grid button small,
  .action-grid button small {
    width: 25px;
    height: 25px;
  }

  .side-action-dock .action-grid button strong,
  .action-grid button strong {
    font-size: 13px;
  }

  .action-status,
  .side-action-dock .action-status {
    min-height: 18px;
    padding: 2px 6px;
    font-size: 9px;
  }

  .action-tools {
    gap: 5px;
    margin-top: 6px;
    padding-top: 6px;
  }

  .tool-button {
    min-height: 38px;
    padding: 6px 8px;
    border-radius: 11px;
  }

  .tool-button strong {
    font-size: 13px;
  }

  .resource-pool-card {
    gap: 4px;
  }

  .resource-pool-card .team-head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
  }

  .resource-pool-card .team-head strong {
    font-size: 13px;
  }

  .resource-pool-card .team-head small {
    max-width: 116px;
    padding: 3px 6px;
    font-size: 8px;
  }

  .resource-pool-card .funds-ledger {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px;
    padding: 5px 6px;
  }

  .resource-pool-card .funds-ledger span {
    font-size: 9px;
  }

  .resource-pool-card .funds-ledger strong {
    font-size: 17px;
  }

  .resource-pool-card .funds-ledger p {
    display: inline-flex;
    justify-self: end;
    max-width: none;
    padding: 3px 6px;
    font-size: 9px;
    line-height: 1.15;
  }

  .resource-pool-card .token-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
  }

  .resource-pool-card .resource-badge {
    min-height: 24px;
    gap: 2px;
    padding: 3px;
  }

  .resource-pool-card .resource-icon {
    width: 13px;
    height: 13px;
  }

  .resource-pool-card .resource-badge b {
    font-size: 9px;
  }

  .resource-pool-card .resource-badge em {
    min-width: 18px;
    padding: 1px 4px;
    font-size: 9px;
  }

  .resource-pool-card .hand-block {
    gap: 4px;
    padding: 4px 5px;
  }

  .resource-pool-card .owned-card {
    min-height: 30px;
  }

  .intro-overlay {
    padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom));
  }

  .intro-scene {
    min-height: calc(100dvh - 20px);
    gap: 8px;
    padding: 44px 0 10px;
  }

  .intro-epic-title {
    padding-bottom: 7px;
    font-size: clamp(25px, 7.1vw, 34px);
  }

  .intro-epic-title b {
    height: 50px;
  }

  .intro-scene h2 {
    font-size: clamp(19px, 5.1vw, 24px);
  }

  .intro-home-grid {
    gap: 7px;
  }

  .intro-letter {
    gap: 7px;
    padding: 8px;
    border-radius: 16px;
  }

  .intro-letter-paper {
    padding: 10px 11px 13px;
  }

  .intro-letter-paper strong {
    font-size: clamp(20px, 5.7vw, 26px);
  }

  .intro-letter-paper p,
  .intro-letter-paper em {
    font-size: 11px;
    line-height: 1.34;
  }

  .intro-letter-years i {
    min-height: 20px;
  }

  .intro-config,
  .intro-home-grid .intro-config {
    gap: 7px;
    padding: 10px;
    border-radius: 16px;
  }

  .leader-name-field {
    min-height: 46px;
  }

  .intro-config select,
  .intro-config input,
  .intro-select-trigger {
    min-height: 40px;
  }

  .intro-start {
    min-height: 48px;
  }

  .intro-producer {
    min-height: 30px;
    padding: 4px 8px;
  }

  .intro-producer strong {
    font-size: clamp(14px, 3.7vw, 18px);
  }

  .ai-guide-toast,
  .story-toast {
    inset: auto 10px calc(12px + env(safe-area-inset-bottom));
  }

  .ai-guide-card,
  .story-toast-card {
    max-height: min(42dvh, 320px);
    padding: 14px 15px 15px;
  }

  .ai-guide-card strong,
  .story-toast-card strong {
    font-size: clamp(22px, 6.2vw, 31px);
  }

  .action-dialog,
  .info-dialog,
  #assignmentOverviewModal .info-dialog,
  .library-dialog,
  .card-inspect-dialog,
  .assignment-detail-dialog,
  .plot-detail-dialog,
  .report-dialog {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: calc(88dvh - env(safe-area-inset-bottom));
    gap: 8px;
    overflow: hidden;
    padding: 10px 10px calc(12px + env(safe-area-inset-bottom));
  }

  .action-dialog .section-heading,
  .library-dialog .section-heading,
  .info-dialog .section-heading {
    min-height: 0;
    margin: -10px -10px 6px;
    padding: 10px 10px 8px;
  }

  .action-dialog .section-heading h2,
  #assignmentOverviewModal .section-heading h2,
  .library-dialog .section-heading h2,
  .info-dialog .section-heading h2 {
    font-size: 19px;
    line-height: 1.16;
  }

  .action-dialog .section-heading p,
  #assignmentOverviewModal .section-heading p,
  .library-dialog .section-heading p,
  .info-dialog .section-heading p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .action-dialog .text-button,
  .library-dialog .text-button,
  .info-dialog .text-button {
    min-width: 48px;
    min-height: 38px;
    padding: 0 10px;
    font-size: 13px;
  }

  .action-dialog .action-detail,
  .library-dialog .card-library,
  #assignmentOverviewBody,
  #plotDetailBody,
  #assignmentDetailBody,
  #cardInspectBody,
  #reportBody {
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding: 0 3px calc(12px + env(safe-area-inset-bottom)) 0;
    -webkit-overflow-scrolling: touch;
  }

  .library-dialog {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .library-toolbar {
    gap: 7px;
  }

  .library-toolbar input,
  .library-toolbar select {
    min-height: 42px;
    border-radius: 10px;
    padding: 0 12px;
  }

  .card-library {
    align-content: start;
    grid-auto-rows: minmax(178px, max-content);
    gap: 8px;
  }

  .library-card {
    min-height: 178px;
    height: auto;
    gap: 6px;
    padding: 10px;
    border-radius: 10px;
  }

  .library-card span {
    font-size: 11px;
  }

  .library-card strong {
    font-size: 17px;
  }

  .library-card p {
    font-size: 13px;
    line-height: 1.42;
  }

  #assignmentOverviewBody {
    display: grid;
    gap: 10px;
  }

  .overview-actions {
    justify-content: stretch;
    margin: -2px 0 0;
  }

  .overview-actions .secondary {
    width: 100%;
    min-height: 34px;
  }

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

  .overview-goals article {
    min-height: 70px;
    gap: 3px;
    padding: 8px;
  }

  .overview-goals span,
  .overview-goals em {
    font-size: 10px;
    line-height: 1.2;
  }

  .overview-goals strong {
    font-size: 23px;
    line-height: 1;
  }

  .overview-grid,
  .overview-production-grid,
  .plot-overview-list {
    gap: 8px;
  }

  .overview-grid h3,
  .report-section h3 {
    margin-bottom: 5px;
    font-size: 16px;
  }

  .assignment-card {
    min-height: 92px;
    gap: 6px;
    padding: 10px;
    border-radius: 10px;
  }

  .assignment-card-top {
    gap: 6px;
  }

  .assignment-card-top strong {
    font-size: 16px;
  }

  .assignment-card-top em,
  .assignment-card-foot {
    padding: 3px 7px;
    font-size: 10px;
  }

  .assignment-card-body small {
    font-size: 13px;
    line-height: 1.3;
  }

  .overview-row,
  .overview-help,
  .factory-detail-list,
  .assignment-detail-grid article,
  .assignment-release-note {
    padding: 9px;
    border-radius: 9px;
  }

  .overview-row strong,
  .route-linked-card strong {
    font-size: 15px;
  }

  .overview-row span,
  .overview-row em,
  .overview-help p {
    font-size: 12px;
    line-height: 1.35;
  }

  .enlarged-plot-card {
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
  }

  .enlarged-plot-head {
    grid-template-columns: 1fr auto;
    gap: 6px;
  }

  .enlarged-plot-head span {
    grid-column: 1 / -1;
    justify-self: start;
    padding: 5px 9px;
    font-size: 12px;
  }

  .enlarged-plot-head strong {
    font-size: 20px;
  }

  .enlarged-plot-head em {
    padding: 5px 9px;
    font-size: 12px;
  }

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

  .enlarged-factory-slot {
    min-height: 86px;
    gap: 4px 6px;
    padding: 8px;
    border-radius: 10px;
  }

  .enlarged-factory-slot i {
    width: 20px;
    height: 28px;
    border-radius: 5px 5px 3px 3px;
  }

  .enlarged-factory-slot span,
  .enlarged-factory-slot em {
    font-size: 10px;
  }

  .enlarged-factory-slot strong {
    font-size: 13px;
  }

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

  .plot-detail-summary article {
    gap: 3px;
    padding: 8px;
  }

  .plot-detail-summary span,
  .plot-detail-summary em {
    font-size: 10px;
    line-height: 1.25;
  }

  .plot-detail-summary strong {
    font-size: 15px;
  }

  .factory-detail-row {
    grid-template-columns: auto 1fr;
    gap: 4px 7px;
    padding: 8px;
  }

  .factory-detail-row em {
    grid-column: 2;
  }

  .action-context {
    display: grid;
    gap: 5px;
    padding: 8px;
  }

  .action-context strong {
    font-size: 15px;
  }

  .action-context span {
    text-align: left;
    font-size: 11px;
  }

  .decision-panel {
    gap: 9px;
  }

  .decision-hero {
    min-height: 0;
    gap: 8px;
    padding: 10px;
  }

  .decision-hero strong {
    font-size: 22px;
  }

  .decision-hero p {
    font-size: 12px;
    line-height: 1.35;
  }

  .decision-meter {
    min-width: 86px;
  }

  .decision-meter b {
    font-size: 26px;
  }

  .production-zone,
  .production-route,
  .card,
  .decision-option {
    border-radius: 10px;
  }

  .production-zone header,
  .production-route,
  .decision-option {
    padding: 8px;
  }

  .route-chip,
  .flow-input,
  .flow-output {
    min-height: 0;
    padding: 9px;
  }

  .upgraded-flow {
    gap: 7px;
  }

  .upgraded-flow > b,
  .assignment-flow-card > b {
    width: auto;
    min-height: 26px;
  }
}

@media (max-width: 380px) and (orientation: portrait) {
  .topbar {
    padding: 4px;
  }

  .brand-panel h1 {
    font-size: clamp(19px, 5.8vw, 23px);
  }

  .top-actions .secondary {
    min-height: 26px;
    font-size: 8px;
  }

  .score-strip div,
  .score-strip div:nth-child(3) {
    min-height: 30px;
    padding: 3px 4px;
  }

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

  .mission-strip {
    min-height: 66px;
    padding: 5px;
  }

  .mission-strip article {
    flex-basis: min(68vw, 226px);
    min-height: 48px;
    padding: 6px 8px;
  }

  .mission-strip article:first-child {
    flex-basis: min(58vw, 208px);
  }

  .map-title {
    min-height: 34px;
    padding: 5px 8px;
  }

  .map-title strong {
    font-size: 17px;
  }

  .systems-strip header {
    min-height: 24px;
    padding: 4px 6px;
  }

  .code-board .system-dot {
    min-height: 10px;
  }

  .park-model-shell {
    min-height: clamp(292px, 80vw, 340px);
  }

  .park-model-shell::before {
    inset: 9px 7px 8px;
  }

  .code-board .plot {
    width: clamp(43px, 13vw, 54px);
    min-height: clamp(44px, 13vw, 56px);
    padding: 3px 2px;
    border-radius: 9px;
  }

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

  .code-board .plot span,
  .code-board .plot .plot-meta,
  .code-board .plot small {
    font-size: 8px;
  }

  .plot-capacity-grid {
    max-width: 38px;
    gap: 1px;
  }

  .capacity-dot {
    width: 4px;
    height: 4px;
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  html,
  body {
    height: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  html {
    overflow-y: hidden;
  }

  body {
    min-height: 100dvh;
    overflow-y: hidden;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  .app-shell {
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  body:has(.execution-banner:not([hidden])) .app-shell {
    padding-top: calc(74px + env(safe-area-inset-top));
  }

  .workspace {
    gap: 6px;
    overflow: visible;
  }

  .topbar {
    gap: 3px;
    padding: 2px;
    border-radius: 12px;
  }

  .brand-panel {
    grid-template-columns: minmax(0, 1fr) minmax(116px, auto);
    align-items: center;
    gap: 4px;
    min-height: 0;
    padding: 3px 5px;
    border-radius: 10px;
  }

  .brand-panel .eyebrow {
    display: none;
  }

  .brand-panel h1 {
    overflow: hidden;
    font-size: clamp(17px, 5.2vw, 21px);
    line-height: 1.02;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .producer-line {
    justify-self: end;
    max-width: 100%;
    min-height: 20px;
    gap: 0;
    margin-top: 0;
    padding: 2px 6px;
  }

  .producer-line span {
    display: none;
  }

  .producer-line strong {
    overflow: hidden;
    max-width: min(190px, 40vw);
    font-size: clamp(9px, 2.45vw, 11px);
    line-height: 1.08;
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-right,
  .top-actions,
  .score-strip {
    gap: 4px;
  }

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

  .top-actions .secondary {
    min-height: 26px;
    padding: 3px 5px;
    border-radius: 7px;
    font-size: 9px;
    white-space: nowrap;
  }

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

  .score-strip div,
  .score-strip div:nth-child(3) {
    min-height: 27px;
    padding: 2px 4px;
    border-radius: 7px;
  }

  .score-strip span {
    font-size: 7px;
  }

  .score-strip strong {
    font-size: 11px;
    line-height: 1.05;
  }

  .mission-strip {
    display: grid;
    grid-template-columns: minmax(0, 0.76fr) minmax(0, 1.24fr);
    gap: 4px;
    min-height: 0;
    overflow: visible;
    padding: 3px;
    scroll-snap-type: none;
  }

  .mission-strip article,
  .mission-strip article:first-child {
    flex: initial;
    min-width: 0;
    min-height: 46px;
    padding: 4px 6px;
  }

  .mission-strip article:nth-child(n + 3) {
    display: none;
  }

  .mission-strip article:nth-child(2) {
    border-color: rgba(255, 220, 116, 0.42);
    background:
      linear-gradient(135deg, rgba(255, 232, 168, 0.2), rgba(157, 29, 34, 0.2)),
      rgba(255, 255, 255, 0.08);
  }

  .mission-strip strong {
    font-size: 9px;
    line-height: 1.18;
    white-space: normal;
    -webkit-line-clamp: 2;
  }

  .mission-strip article:nth-child(2) strong {
    font-size: 10px;
    line-height: 1.2;
    -webkit-line-clamp: 2;
  }

  .mission-strip em {
    font-size: 8px;
    line-height: 1.1;
  }

  .map-player-board {
    order: 4;
    padding: 6px;
    border-radius: 14px;
  }

  .side-log-panel > .side-command-row {
    order: 3;
  }

  .side-log-panel > .side-timeline {
    order: 5;
  }

  .side-log-panel > .section-heading {
    order: 6;
  }

  .side-log-panel > #logList {
    order: 7;
  }

  .map-player-board .section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 28px;
    gap: 5px;
    margin-bottom: 4px;
    padding: 5px 7px;
    border-radius: 10px;
  }

  .map-player-board .section-heading h2 {
    font-size: 14px;
  }

  .map-player-board .section-heading p {
    display: none;
  }

  .map-player-board .section-heading span {
    display: none;
  }

  .team-list,
  #teamList {
    gap: 4px;
    align-items: start;
  }

  .team-card {
    gap: 3px;
    padding: 5px;
    border-radius: 10px;
  }

  .resource-pool-card {
    grid-column: 1 / -1;
  }

  .resource-pool-card:not(.active) {
    min-height: 30px;
    padding: 5px 7px;
  }

  .resource-pool-card:not(.active) .team-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
  }

  .resource-pool-card:not(.active) .team-head strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .resource-pool-card:not(.active) .team-head small {
    max-width: none;
    padding: 1px 6px;
    font-size: 8px;
    white-space: nowrap;
  }

  .resource-pool-card:not(.active) .funds-ledger,
  .resource-pool-card:not(.active) .token-grid,
  .resource-pool-card:not(.active) .money-note,
  .resource-pool-card:not(.active) .hand-block {
    display: none;
  }

  .resource-pool-card.active .money-note {
    display: none;
  }

  .resource-pool-card.active .team-head {
    min-height: 0;
    gap: 3px;
  }

  .resource-pool-card.active .team-head strong {
    font-size: 12px;
    line-height: 1.12;
  }

  .resource-pool-card.active .team-head small {
    padding: 1px 5px;
    font-size: 8px;
  }

  .resource-pool-card.active .funds-badge,
  .resource-pool-card.active .hand-block:has(.empty-hand) {
    display: none;
  }

  .resource-pool-card.active .funds-ledger {
    gap: 4px;
    padding: 4px 5px;
    border-radius: 9px;
  }

  .resource-pool-card.active .funds-ledger strong {
    font-size: 15px;
  }

  .resource-pool-card.active .funds-ledger p {
    padding: 2px 5px;
    font-size: 8px;
    line-height: 1.1;
  }

  .resource-pool-card.active .token-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
  }

  .resource-pool-card.active .hand-block {
    padding: 4px 5px;
  }

  .member-card {
    min-height: 0;
  }

  .member-card .team-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .member-card .team-head strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .member-card .team-head small {
    display: none;
  }

  .member-card.acting-seat .team-head small {
    display: inline-flex;
    justify-self: start;
    max-width: 100%;
    padding: 2px 6px;
    font-size: 8px;
  }

  .member-card .member-row {
    display: none;
  }

  .member-card .talent-row {
    gap: 2px;
  }

  .member-card .talent-badge {
    min-height: 28px;
    padding: 3px 2px;
  }

  .member-card .talent-piece {
    width: 12px;
    height: 13px;
  }

  .member-card .talent-badge em {
    padding: 1px 4px;
    font-size: 8px;
  }

  .member-card .assignment-block {
    gap: 2px;
    padding: 4px;
  }

  .member-card .assignment-block:has(.empty-hand) {
    display: none;
  }

  .member-card .assignment-mini-card {
    min-height: 38px;
    padding: 4px;
  }

  .member-card:not(.acting-seat) {
    align-self: start;
    min-height: 32px;
    padding: 5px 7px;
    border-left-width: 3px;
    background: rgba(255, 250, 239, 0.72);
  }

  .member-card:not(.acting-seat) .team-head {
    min-height: 0;
  }

  .member-card:not(.acting-seat) .team-head strong {
    font-size: 11px;
  }

  .member-card:not(.acting-seat) .talent-row,
  .member-card:not(.acting-seat) .assignment-block {
    display: none;
  }

  .member-card.acting-seat {
    gap: 3px;
    padding: 5px;
    border-left-width: 4px;
    box-shadow:
      0 0 0 3px rgba(255, 211, 92, 0.14),
      0 10px 22px rgba(70, 42, 22, 0.12);
  }

  .member-card.acting-seat .talent-row {
    gap: 4px;
  }

  .member-card.acting-seat .talent-badge {
    min-height: 26px;
  }

  .map-player-board {
    background:
      radial-gradient(circle at 12% 0%, rgba(255, 219, 119, 0.16), transparent 34%),
      linear-gradient(180deg, rgba(255, 250, 238, 0.96), rgba(246, 229, 190, 0.9));
    box-shadow:
      0 16px 36px rgba(70, 42, 22, 0.11),
      inset 0 1px 0 rgba(255, 255, 255, 0.62);
  }

  .resource-pool-card.active {
    gap: 4px;
    padding: 6px;
    border-radius: 12px;
    background:
      radial-gradient(circle at 92% 18%, rgba(255, 220, 116, 0.28), transparent 30%),
      linear-gradient(135deg, rgba(255, 249, 230, 0.98), rgba(247, 232, 196, 0.96));
    box-shadow:
      inset 4px 0 0 var(--team-color, #9d1d22),
      0 10px 22px rgba(70, 42, 22, 0.12);
  }

  .resource-pool-card.active .team-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
  }

  .resource-pool-card.active .team-head strong {
    font-size: 13px;
  }

  .resource-pool-card.active .team-head small {
    border-radius: 999px;
    background: color-mix(in srgb, var(--team-color, #9d1d22) 82%, #7b2e0e);
    color: #fff8e4;
  }

  .resource-pool-card.active .funds-ledger {
    grid-template-columns: minmax(86px, 0.54fr) minmax(0, 1fr);
    gap: 5px;
    padding: 5px 6px;
  }

  .resource-pool-card.active .funds-ledger div {
    grid-template-columns: auto auto;
    align-items: baseline;
    gap: 0 5px;
  }

  .resource-pool-card.active .funds-ledger span {
    font-size: 8px;
    line-height: 1.1;
  }

  .resource-pool-card.active .funds-ledger strong {
    font-size: 17px;
  }

  .resource-pool-card.active .funds-ledger em {
    display: none;
  }

  .resource-pool-card.active .funds-ledger p {
    justify-self: end;
    align-self: center;
    padding: 2px 6px;
    font-size: 8px;
    line-height: 1.1;
  }

  .resource-pool-card.active .token-grid {
    gap: 3px;
  }

  .resource-pool-card.active .resource-badge {
    min-height: 25px;
    gap: 3px;
    padding: 3px;
    border-radius: 8px;
  }

  .resource-pool-card.active .resource-icon {
    width: 13px;
    height: 13px;
  }

  .resource-pool-card.active .resource-icon.ingot {
    height: 9px;
  }

  .resource-pool-card.active .resource-badge b {
    font-size: 8px;
    line-height: 1;
  }

  .resource-pool-card.active .resource-badge em {
    font-size: 11px;
    line-height: 1;
  }

  .resource-pool-card:not(.active) {
    min-height: 32px;
    padding: 3px 6px;
    border-left-width: 4px;
    background:
      linear-gradient(135deg, color-mix(in srgb, var(--team-color, #9d1d22) 10%, transparent), transparent 46%),
      rgba(255, 250, 239, 0.76);
  }

  .resource-pool-card:not(.active) .team-head {
    min-height: 24px;
    gap: 4px;
  }

  .resource-pool-card:not(.active) .team-head strong {
    font-size: 10px;
  }

  .resource-pool-card:not(.active) .team-head small {
    padding: 1px 5px;
    color: color-mix(in srgb, var(--team-color, #9d1d22) 88%, #4b382d);
    background: rgba(255, 255, 255, 0.72);
    font-size: 7px;
  }

  .member-card.acting-seat {
    min-height: 74px;
    border-radius: 12px;
    background:
      radial-gradient(circle at 88% 16%, rgba(255, 219, 119, 0.28), transparent 28%),
      linear-gradient(135deg, rgba(255, 248, 226, 0.98), rgba(251, 237, 202, 0.94));
  }

  .member-card.acting-seat .team-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
  }

  .member-card.acting-seat .team-head small {
    justify-self: end;
    padding: 2px 7px;
    color: #fff8e4;
    background: linear-gradient(135deg, var(--team-color, #9d1d22), #7b2e0e);
  }

  .member-card.acting-seat .talent-row {
    gap: 3px;
  }

  .member-card.acting-seat .talent-badge {
    min-height: 24px;
    gap: 2px;
    padding: 3px;
    border-radius: 8px;
  }

  .member-card.acting-seat .talent-badge b {
    font-size: 8px;
    line-height: 1;
  }

  .member-card.acting-seat .talent-badge em {
    font-size: 9px;
    line-height: 1;
  }

  .member-card:not(.acting-seat) {
    min-height: 28px;
    padding: 3px 6px;
    border-radius: 9px;
  }

  .member-card:not(.acting-seat) .team-head strong {
    font-size: 10px;
  }

  .side-command-row .advisor-card {
    gap: 5px;
    padding: 7px;
    border-radius: 12px;
  }

  .advisor-heading,
  .side-command-row .advisor-card .section-heading {
    grid-template-columns: minmax(0, 1fr) minmax(118px, 0.44fr);
    align-items: center;
    gap: 6px;
  }

  .side-command-row .advisor-card h2 {
    font-size: 15px;
    line-height: 1.08;
  }

  .side-command-row .advisor-card p {
    font-size: 11px;
    line-height: 1.28;
    -webkit-line-clamp: 2;
  }

  .compact-guide-select select {
    min-height: 34px;
    border-radius: 9px;
    padding: 0 28px 0 8px;
    font-size: 12px;
  }

  #advisorAction {
    min-height: 42px;
    border-radius: 11px;
    font-size: 13px;
  }

  .side-log-panel > .section-heading {
    padding: 5px 3px 2px;
  }

  .side-log-panel > .section-heading h2 {
    font-size: 14px;
  }

  .side-log-panel > .section-heading span {
    min-height: 18px;
    padding: 2px 6px;
    font-size: 8px;
  }

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

  .side-log-panel > #logList li {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 6px;
    padding: 6px 0;
    font-size: 11px;
    line-height: 1.3;
  }

  .side-log-panel > #logList li span {
    font-size: 10px;
  }

  .side-log-panel > #logList li p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .side-action-dock .action-panel {
    padding: 5px;
  }

  .side-action-dock .section-heading {
    box-sizing: border-box;
    width: 100%;
    min-height: 24px;
    margin: 0 0 3px;
    padding: 4px 7px;
    border-radius: 10px;
  }

  .side-action-dock .section-heading p,
  .side-action-dock .section-heading span {
    display: none;
  }

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

  .side-action-dock .action-grid button,
  .action-grid button {
    grid-template-columns: 18px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    gap: 1px 4px;
    min-height: 46px;
    padding: 4px 4px;
  }

  .side-action-dock .action-grid button.action-recommended,
  .action-grid button.action-recommended {
    grid-column: 1 / -1;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    grid-template-rows: auto;
    gap: 6px;
    min-height: 50px;
  }

  .side-action-dock .action-grid button small,
  .action-grid button small {
    width: 18px;
    height: 18px;
    font-size: 8px;
  }

  .side-action-dock .action-grid button strong,
  .action-grid button strong {
    font-size: 10px;
    line-height: 1.12;
  }

  .action-status,
  .side-action-dock .action-status {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    min-width: 0;
    min-height: 14px;
    padding: 1px 4px;
    font-size: 7px;
    line-height: 1.12;
  }

  .side-action-dock .action-grid button.action-recommended .action-status,
  .action-grid button.action-recommended .action-status {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    min-height: 17px;
    padding: 2px 6px;
    font-size: 8px;
  }

  .execution-banner {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top));
    right: 8px;
    left: 8px;
    z-index: 120;
    grid-template-columns: 8px minmax(0, 1fr) minmax(78px, 0.32fr);
    grid-template-rows: auto auto;
    gap: 2px 7px;
    width: auto;
    min-height: 56px;
    margin: 0;
    padding: 5px 37px 5px 9px;
    border-radius: 15px;
    transform: none;
    box-shadow:
      0 12px 34px rgba(51, 18, 15, 0.25),
      0 0 0 1px rgba(255, 232, 168, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }

  .execution-banner::before {
    grid-row: 1 / 3;
    width: 8px;
    height: 38px;
  }

  .execution-banner span {
    top: 6px;
    left: 27px;
    max-width: calc(100% - 150px);
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .execution-banner strong {
    grid-column: 2;
    grid-row: 1;
    padding-top: 8px;
    font-size: 15px;
    line-height: 1.08;
  }

  .execution-banner em {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    max-width: 100%;
    min-height: 22px;
    padding: 3px 7px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
  }

  .execution-advisor-action {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: stretch;
    display: grid;
    place-items: center;
    min-height: 40px;
    padding: 5px 6px;
    border-radius: 11px;
    font-size: 10px;
    line-height: 1.16;
    pointer-events: auto;
  }

  .execution-close {
    top: 7px;
    right: 7px;
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .action-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
    margin-top: 3px;
    padding-top: 3px;
  }

  .tool-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 8px;
    border-radius: 999px;
    text-align: center;
    background:
      linear-gradient(135deg, rgba(255, 232, 168, 0.18), rgba(255, 255, 255, 0.06));
  }

  .tool-button::after,
  .tool-button span,
  .tool-button em {
    display: none;
  }

  .tool-button strong {
    font-size: 11px;
    line-height: 1.1;
  }

  .action-dialog .section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
  }

  .action-dialog .section-heading h2 {
    font-size: 18px;
    line-height: 1.18;
  }

  .action-dialog .section-heading p,
  .action-dialog .section-heading span {
    font-size: 10px;
    line-height: 1.25;
  }

  .action-dialog .action-context {
    display: grid;
    gap: 3px;
    margin-bottom: 7px;
    padding: 7px 8px;
    border-radius: 12px;
  }

  .action-dialog .action-context strong {
    font-size: 14px;
    line-height: 1.2;
  }

  .action-dialog .action-context span {
    font-size: 10px;
    line-height: 1.32;
    text-align: left;
  }

  .action-dialog .action-market-grid,
  .action-dialog .detail-grid,
  .action-dialog .action-production-grid {
    gap: 6px;
  }

  .action-dialog .produce-option {
    gap: 5px;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 6px 14px rgba(70, 42, 22, 0.07);
  }

  .action-dialog .produce-option .option-status {
    justify-self: start;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1.1;
  }

  .action-dialog .produce-option .price-token {
    justify-self: start;
    min-height: 24px;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.1;
  }

  .action-dialog .produce-option .card {
    gap: 4px;
    min-height: 0;
    padding: 8px;
    border-radius: 10px;
  }

  .action-dialog .produce-option .card strong {
    font-size: 15px;
    line-height: 1.18;
  }

  .action-dialog .produce-option .card p {
    font-size: 11px;
    line-height: 1.28;
  }

  .action-dialog .produce-option .card-output-block {
    gap: 3px;
    margin-top: 0;
  }

  .action-dialog .produce-option .card-output-block > span {
    font-size: 10px;
    line-height: 1.1;
  }

  .action-dialog .produce-option .card-output-list {
    gap: 2px;
  }

  .action-dialog .produce-option .card-output-list li {
    padding-left: 11px;
    font-size: 11px;
    line-height: 1.25;
  }

  .action-dialog .produce-option .card-output-list li::before {
    width: 4px;
    height: 4px;
  }

  .action-dialog .produce-option label {
    display: grid;
    gap: 3px;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 900;
  }

  .action-dialog .produce-option select {
    min-height: 34px;
    border-radius: 9px;
    font-size: 13px;
  }

  .action-dialog .produce-option button {
    min-height: 42px;
    border-radius: 10px;
    font-size: 13px;
  }

  .action-dialog .action-market-grid .produce-option {
    grid-template-columns: minmax(0, 1fr) minmax(104px, 0.34fr);
    align-items: start;
    gap: 5px 6px;
    padding: 7px;
  }

  .action-dialog .action-market-grid .produce-option .option-status {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    min-height: 18px;
    padding: 2px 6px;
    font-size: 9px;
  }

  .action-dialog .action-market-grid .produce-option .price-token {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    min-height: 20px;
    padding: 3px 6px;
    font-size: 9px;
    white-space: nowrap;
  }

  .action-dialog .action-market-grid .produce-option .card {
    grid-column: 1 / -1;
    gap: 3px;
    padding: 7px;
  }

  .action-dialog .action-market-grid .produce-option .card p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.22;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .action-dialog .action-market-grid .produce-option .card-output-block {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 2px 5px;
  }

  .action-dialog .action-market-grid .produce-option .card-output-block > span {
    font-size: 9px;
    line-height: 1.2;
  }

  .action-dialog .action-market-grid .produce-option .card-output-list {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 6px;
  }

  .action-dialog .action-market-grid .produce-option .card-output-list li {
    padding-left: 8px;
    font-size: 10px;
    line-height: 1.18;
  }

  .action-dialog .action-market-grid .produce-option label {
    grid-column: 1;
    grid-row: 3;
    align-self: end;
    min-width: 0;
  }

  .action-dialog .action-market-grid .produce-option select {
    min-height: 34px;
    font-size: 12px;
  }

  .action-dialog .action-market-grid .produce-option button {
    grid-column: 2;
    grid-row: 3;
    align-self: end;
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
  }

  .action-dialog .production-zone {
    border-radius: 12px;
  }

  .action-dialog .production-zone header {
    min-height: 40px;
    gap: 5px;
    padding: 7px 8px;
  }

  .action-dialog .production-zone header strong {
    font-size: 15px;
    line-height: 1.15;
  }

  .action-dialog .production-zone header span {
    font-size: 10px;
    line-height: 1.22;
  }

  .action-dialog .production-routes {
    gap: 6px;
    padding: 7px;
  }

  .action-dialog .route-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .action-dialog .route-arrow {
    display: none;
  }

  .action-dialog .route-chip {
    min-height: 0;
    gap: 2px;
    padding: 6px;
    border-radius: 9px;
    overflow-wrap: anywhere;
  }

  .action-dialog .route-chip span {
    font-size: 10px;
    line-height: 1.1;
  }

  .action-dialog .route-chip strong {
    font-size: 11px;
    line-height: 1.25;
  }

  .action-dialog .route-meta {
    align-items: stretch;
    gap: 5px;
  }

  .action-dialog .route-meta small {
    align-self: center;
    min-width: 0;
    font-size: 10px;
    line-height: 1.25;
  }

  .action-dialog .route-meta button {
    min-width: 62px;
    min-height: 36px;
    border-radius: 9px;
    font-size: 12px;
  }

  .action-dialog .action-detail {
    padding-bottom: calc(54px + env(safe-area-inset-bottom));
  }

  .decision-panel {
    gap: 5px;
  }

  .decision-hero {
    grid-template-columns: minmax(0, 1fr) minmax(58px, 0.24fr);
    gap: 5px;
    min-height: 72px;
    padding: 6px;
    border-radius: 11px;
  }

  .decision-hero strong {
    font-size: 16px;
    line-height: 1.12;
  }

  .decision-hero p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.22;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .decision-meter {
    min-width: 58px;
    min-height: 54px;
    border-radius: 9px;
  }

  .decision-meter b {
    font-size: 21px;
  }

  .decision-meter em {
    font-size: 9px;
  }

  .upgraded-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .upgraded-flow > b {
    display: none;
  }

  .flow-input,
  .flow-output {
    min-height: 0;
    gap: 2px;
    padding: 6px;
    border-radius: 9px;
  }

  .flow-input strong,
  .flow-output strong {
    font-size: 12px;
    line-height: 1.2;
  }

  .flow-input em,
  .flow-output em {
    display: -webkit-box;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .decision-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .decision-option {
    min-height: 58px;
    gap: 2px;
    padding: 6px;
    border-radius: 10px;
  }

  .decision-option strong {
    font-size: 13px;
    line-height: 1.15;
  }

  .decision-option em,
  .decision-option i {
    display: -webkit-box;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.18;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .decision-primary {
    position: sticky;
    bottom: calc(6px + env(safe-area-inset-bottom));
    z-index: 5;
    justify-self: stretch;
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    box-shadow:
      0 8px 0 rgba(103, 15, 20, 0.34),
      0 14px 24px rgba(116, 22, 28, 0.2);
  }

  .system-progress-board {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .system-progress-board span {
    min-height: 26px;
    border-radius: 8px;
    font-size: 10px;
  }

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

  .recall-summary-grid article {
    min-height: 48px;
    gap: 1px;
    padding: 6px;
    border-radius: 9px;
  }

  .recall-summary-grid span {
    font-size: 9px;
    line-height: 1.1;
  }

  .recall-summary-grid strong {
    font-size: 18px;
  }

  .recall-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .recall-assignment {
    gap: 6px;
    padding: 6px;
    border-radius: 9px;
  }

  .recall-assignment .talent-piece {
    width: 16px;
    height: 18px;
  }

  .recall-assignment strong {
    font-size: 12px;
  }

  .recall-assignment em {
    display: -webkit-box;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .execution-advisor-action:not(:disabled),
  #advisorAction:not(:disabled),
  .side-action-dock .action-grid button.action-recommended {
    animation: mobileDecisionPulse 1.8s ease-in-out infinite;
  }

  .side-action-dock .action-grid button.action-recommended small,
  .side-action-dock .action-grid button.action-ready .action-status {
    animation: mobileChipGlow 1.45s ease-in-out infinite;
  }

  .action-dialog,
  .action-modal,
  .info-modal,
  .card-library-modal,
  .card-inspect-modal {
    align-items: end;
    justify-items: center;
    padding: calc(10px + env(safe-area-inset-top)) 8px calc(12px + env(safe-area-inset-bottom));
  }

  .action-dialog,
  .info-dialog,
  #assignmentOverviewModal .info-dialog,
  .library-dialog,
  .card-inspect-dialog,
  .assignment-detail-dialog,
  .plot-detail-dialog,
  .report-dialog {
    width: min(100%, 540px);
    max-height: min(80dvh, calc(100dvh - 50px - env(safe-area-inset-bottom)));
    gap: 8px;
    margin: 0;
    border-radius: 18px 18px 14px 14px;
    padding: 10px 10px calc(12px + env(safe-area-inset-bottom));
    animation: none;
    transform: none;
  }

  .library-dialog .section-heading,
  .info-dialog .section-heading,
  .action-dialog .section-heading,
  .card-inspect-dialog .section-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    margin: 0;
  }

  .library-dialog .section-heading h2,
  .info-dialog .section-heading h2,
  .action-dialog .section-heading h2,
  .card-inspect-dialog .section-heading h2 {
    overflow: hidden;
    font-size: 17px;
    line-height: 1.12;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .library-dialog .section-heading p,
  .info-dialog .section-heading p,
  .action-dialog .section-heading p,
  .card-inspect-dialog .section-heading p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.22;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .library-dialog .text-button,
  .info-dialog .text-button,
  .action-dialog .text-button,
  .card-inspect-dialog .text-button {
    min-width: 46px;
    min-height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    color: #fff7dc;
    background: linear-gradient(135deg, #8f171d, #b52128 58%, #d99a2b);
    box-shadow:
      0 8px 18px rgba(116, 22, 28, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);
    font-size: 11px;
  }

  .library-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(96px, 0.42fr);
    gap: 5px;
  }

  .library-toolbar input,
  .library-toolbar select {
    min-height: 36px;
    border-radius: 10px;
    padding: 0 9px;
    font-size: 12px;
  }

  .library-dialog .card-library {
    gap: 5px;
    grid-auto-rows: minmax(128px, max-content);
  }

  .library-card {
    min-height: 128px;
    gap: 3px;
    padding: 6px;
  }

  .library-card strong {
    font-size: 14px;
    line-height: 1.18;
  }

  .library-card p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.32;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .library-card .card-output-block {
    gap: 2px;
    margin-top: 0;
  }

  .library-card .card-output-block > span {
    font-size: 10px;
    line-height: 1.1;
  }

  .library-card .card-output-list {
    gap: 1px;
  }

  .library-card .card-output-list li {
    display: -webkit-box;
    overflow: hidden;
    padding-left: 10px;
    font-size: 9px;
    line-height: 1.18;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .library-card .card-output-list li::before {
    width: 4px;
    height: 4px;
  }

  #assignmentOverviewBody .overview-production-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  #assignmentOverviewBody .overview-grid {
    gap: 6px;
  }

  #assignmentOverviewBody .overview-grid h3 {
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.12;
  }

  #assignmentOverviewBody .overview-actions {
    margin: -2px 0 5px;
  }

  #assignmentOverviewBody .overview-actions .secondary {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
  }

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

  #assignmentOverviewBody .overview-goals article {
    min-height: 46px;
    gap: 2px;
    padding: 6px;
    border-radius: 9px;
  }

  #assignmentOverviewBody .overview-goals span,
  #assignmentOverviewBody .overview-goals em {
    font-size: 9px;
    line-height: 1.1;
  }

  #assignmentOverviewBody .overview-goals strong {
    font-size: 16px;
    line-height: 1;
  }

  #assignmentOverviewBody .overview-help {
    display: none;
  }

  #assignmentOverviewBody .overview-list {
    gap: 5px;
  }

  #assignmentOverviewBody .assignment-card {
    min-height: 66px;
    gap: 3px;
    padding: 7px;
    border-radius: 10px;
  }

  #assignmentOverviewBody .assignment-card-top {
    gap: 5px;
  }

  #assignmentOverviewBody .assignment-card-top strong {
    font-size: 14px;
  }

  #assignmentOverviewBody .assignment-card-top em,
  #assignmentOverviewBody .assignment-card-foot {
    padding: 3px 7px;
    font-size: 10px;
  }

  #assignmentOverviewBody .assignment-card-body small {
    font-size: 10px;
    line-height: 1.2;
  }

  #assignmentOverviewBody .plot-overview-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  #assignmentOverviewBody .overview-row {
    gap: 2px;
    padding: 6px;
    border-radius: 9px;
  }

  #assignmentOverviewBody .overview-row strong {
    font-size: 13px;
  }

  #assignmentOverviewBody .overview-row span,
  #assignmentOverviewBody .overview-row em {
    font-size: 10px;
    line-height: 1.22;
  }

  #assignmentOverviewBody .overview-production-zone {
    border-radius: 12px;
    overflow: hidden;
  }

  #assignmentOverviewBody .overview-production-zone header {
    min-height: 28px;
    gap: 4px;
    padding: 5px 6px;
  }

  #assignmentOverviewBody .overview-production-zone header strong {
    font-size: 13px;
    line-height: 1.1;
  }

  #assignmentOverviewBody .overview-production-zone header span {
    font-size: 10px;
    line-height: 1.2;
  }

  #assignmentOverviewBody .overview-production-zone .production-routes {
    max-height: 126px;
    gap: 3px;
    overflow: auto;
    padding: 4px;
    -webkit-overflow-scrolling: touch;
  }

  #assignmentOverviewBody .overview-route {
    gap: 2px;
    padding: 4px;
    border-radius: 9px;
  }

  #assignmentOverviewBody .overview-route .route-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
  }

  #assignmentOverviewBody .overview-route .route-arrow {
    display: none;
  }

  #assignmentOverviewBody .overview-route .route-chip {
    min-height: 0;
    gap: 2px;
    padding: 4px;
    border-radius: 8px;
  }

  #assignmentOverviewBody .overview-route .route-chip span {
    font-size: 9px;
    line-height: 1.1;
  }

  #assignmentOverviewBody .overview-route .route-chip strong {
    font-size: 9px;
    line-height: 1.24;
  }

  #assignmentOverviewBody .overview-route .route-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 3px;
  }

  #assignmentOverviewBody .overview-route .route-meta small {
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  #assignmentOverviewBody .overview-route .route-meta b {
    align-self: center;
    padding: 3px 6px;
    font-size: 9px;
  }

  #introOverlay {
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    overflow: hidden;
  }

  #introOverlay .intro-scene {
    width: min(100%, 420px);
    height: calc(100dvh - 12px - env(safe-area-inset-bottom));
    min-height: 0;
    align-content: start;
    gap: 5px;
    padding: 38px 0 4px;
  }

  #introOverlay .intro-music-unlock {
    top: 6px;
    right: 8px;
    min-width: 92px;
    min-height: 34px;
    padding: 3px 10px;
    border-radius: 999px;
  }

  #introOverlay .intro-music-unlock span {
    font-size: 9px;
  }

  #introOverlay .intro-music-unlock strong {
    font-size: 13px;
  }

  #introOverlay .intro-hero {
    gap: 3px;
  }

  #introOverlay .intro-epic-title {
    width: 100%;
    margin: 0;
    padding: 3px 8px 6px;
    font-size: clamp(23px, 6.7vw, 30px);
    line-height: 0.95;
    white-space: nowrap;
  }

  #introOverlay .intro-epic-title b {
    height: 42px;
  }

  #introOverlay .intro-epic-title i {
    width: 78vw;
  }

  #introOverlay .intro-epic-title span::after {
    bottom: -5px;
    height: 2px;
  }

  #introOverlay .intro-copy {
    gap: 3px;
  }

  #introOverlay .intro-kicker {
    padding: 3px 8px;
    font-size: 9px;
  }

  #introOverlay .intro-scene h2 {
    font-size: clamp(17px, 4.8vw, 21px);
    line-height: 1.08;
  }

  #introOverlay .intro-home-grid {
    gap: 5px;
  }

  #introOverlay .intro-letter {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 6px;
    min-height: 0;
    padding: 7px;
    border-radius: 14px;
  }

  #introOverlay .intro-letter::before {
    inset: 5px;
    border-radius: 11px;
  }

  #introOverlay .intro-letter-seal {
    width: 48px;
    border-width: 2px;
    font-size: 13px;
  }

  #introOverlay .intro-letter-paper {
    min-height: 0;
    gap: 2px;
    padding: 7px 9px 10px;
    border-radius: 10px;
  }

  #introOverlay .intro-letter-paper span {
    font-size: 9px;
  }

  #introOverlay .intro-letter-paper strong {
    font-size: clamp(18px, 5vw, 22px);
    line-height: 1.08;
  }

  #introOverlay .intro-letter-paper p,
  #introOverlay .intro-letter-paper em {
    display: -webkit-box;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.24;
    -webkit-box-orient: vertical;
  }

  #introOverlay .intro-letter-paper p {
    -webkit-line-clamp: 2;
  }

  #introOverlay .intro-letter-paper em {
    -webkit-line-clamp: 1;
  }

  #introOverlay .intro-letter-paper::after {
    right: 8px;
    bottom: 2px;
    font-size: 22px;
  }

  #introOverlay .intro-letter-years {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 3px;
  }

  #introOverlay .intro-letter-years i {
    min-height: 18px;
    border-radius: 7px;
    font-size: 8px;
  }

  #introOverlay .intro-config,
  #introOverlay .intro-home-grid .intro-config {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    padding: 8px;
    border-radius: 14px;
  }

  #introOverlay .intro-config > div,
  #introOverlay .leader-name-field,
  #introOverlay .intro-start {
    grid-column: 1 / -1;
  }

  #introOverlay .intro-config > div {
    gap: 0;
  }

  #introOverlay .intro-config h3 {
    overflow: hidden;
    font-size: 14px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #introOverlay .intro-config > div span,
  #introOverlay .intro-settings-heading {
    display: none;
  }

  #introOverlay .leader-name-field {
    grid-template-columns: 70px minmax(0, 1fr);
    align-items: center;
    min-height: 38px;
    padding: 5px 7px;
    font-size: 10px;
  }

  #introOverlay .leader-name-field input {
    min-height: 30px;
    font-size: 14px;
  }

  #introOverlay .intro-config label:not(.leader-name-field) {
    gap: 2px;
    min-width: 0;
    font-size: 9px;
  }

  #introOverlay .intro-config select,
  #introOverlay .intro-select-trigger {
    min-height: 34px;
    border-radius: 8px;
    padding: 0 7px;
    font-size: 13px;
  }

  #introOverlay .intro-start {
    min-height: 42px;
    border-radius: 10px;
    font-size: 14px;
  }

  #introOverlay .intro-producer {
    width: 100%;
    min-height: 28px;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
  }

  #introOverlay .intro-producer span {
    padding: 3px 7px;
    font-size: 9px;
  }

  #introOverlay .intro-producer strong {
    overflow: hidden;
    font-size: clamp(13px, 3.6vw, 16px);
    letter-spacing: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .side-timeline {
    padding: 7px;
    border-radius: 14px;
  }

  .side-timeline .section-heading {
    min-height: 26px;
    gap: 5px;
    margin-bottom: 5px;
    padding: 5px 7px;
    border-radius: 10px;
  }

  .side-timeline .section-heading h2 {
    font-size: 13px;
    line-height: 1.12;
  }

  .side-timeline .section-heading p,
  .side-timeline .section-heading span {
    display: none;
  }

  .side-timeline .timeline-story {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 7px;
    min-height: 0;
    padding: 7px;
    border-radius: 11px;
  }

  .side-timeline .timeline-current {
    min-height: 0;
    gap: 2px;
    padding-right: 6px;
  }

  .side-timeline .timeline-current span {
    font-size: 18px;
    line-height: 1;
  }

  .side-timeline .timeline-current strong {
    font-size: 10px;
    line-height: 1.12;
  }

  .side-timeline .timeline-current em {
    font-size: 8px;
    line-height: 1.18;
  }

  .side-timeline .timeline-copy {
    gap: 2px;
  }

  .side-timeline .timeline-story p {
    font-size: 10px;
    line-height: 1.25;
    -webkit-line-clamp: 2;
  }

  .side-timeline .timeline-anecdote,
  .side-timeline .timeline-inline-progress {
    display: none;
  }
}

@keyframes mobileDecisionPulse {
  0%,
  100% {
    box-shadow:
      0 8px 0 rgba(123, 46, 14, 0.2),
      0 14px 24px rgba(18, 8, 4, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }

  50% {
    box-shadow:
      0 8px 0 rgba(123, 46, 14, 0.26),
      0 0 0 4px rgba(255, 220, 116, 0.18),
      0 18px 34px rgba(157, 29, 34, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.78);
  }
}

@keyframes mobileChipGlow {
  0%,
  100% {
    filter: brightness(1);
    transform: translateZ(0) scale(1);
  }

  50% {
    filter: brightness(1.18);
    transform: translateZ(0) scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar,
  .topbar::before,
  .brand-panel::before,
  .brand-panel::after,
  .producer-line::before,
  .top-actions .secondary::before,
  .execution-advisor-action,
  #advisorAction::before,
  #advisorAction::after,
  .intro-letter::before,
  .intro-letter::after,
  .intro-letter-seal,
  .intro-letter-paper.unfolding,
  .execution-banner.is-waiting em,
  .turn-card::after,
  .acting-chip,
  body::before,
  .team-card.acting-seat,
  .team-card.acting-seat::after,
  .recommended-option,
  .recommended-option span:first-child,
  .produce-option.recommended-option .option-status,
  .action-grid button.action-recommended,
  .side-action-dock .action-grid button.action-ready .action-status,
  .action-grid button.action-recommended .action-status,
  h1::after,
  .score-strip div,
  .score-strip div::before,
  .score-strip div::after {
    animation: none !important;
  }
}
