:root {
  color-scheme: dark;
  --bg: #090a09;
  --panel: #171816;
  --panel-strong: #24231e;
  --panel-soft: #111512;
  --line: #3d3a31;
  --line-bright: #756a4d;
  --text: #f1eadc;
  --muted: #b7aa94;
  --dim: #7c725f;
  --cyan: #67c5b8;
  --amber: #d8a64b;
  --coral: #d95d4f;
  --green: #92c46b;
  --violet: #8f83d7;
  --white: #fff9ed;
  --button: #27251e;
  --shadow: rgba(0, 0, 0, 0.34);
  --panel-glow: rgba(67, 214, 197, 0.16);
  --layout-gap: 8px;
  --shell-pad-x: clamp(8px, 0.65vw, 16px);
  --font-ui: "Songti SC", "STSong", "Noto Serif CJK SC", "PingFang SC", "Hiragino Sans GB", serif;
  --font-display: "Songti SC", "STSong", "Noto Serif CJK SC", "PingFang SC", "Hiragino Sans GB", serif;
  --font-data: "SF Mono", "SFMono-Regular", "DIN Alternate", "Avenir Next", ui-monospace, Menlo, Consolas, monospace;
  font-family: var(--font-ui);
}

* {
  box-sizing: border-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(67, 214, 197, 0.34) rgba(255, 255, 255, 0.035);
}

*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(67, 214, 197, 0.34);
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.035);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 24%, rgba(216, 166, 75, 0.16), transparent 28%),
    radial-gradient(circle at 50% 62%, rgba(103, 197, 184, 0.1), transparent 30%),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    linear-gradient(145deg, #080908 0%, #171611 52%, #080b0a 100%);
  background-size: auto, auto, 86px 86px, 86px 86px, auto;
  color: var(--text);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(216, 166, 75, 0.1), transparent 24%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.7), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.72)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.78));
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(rgba(67, 214, 197, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, transparent 0, transparent 49%, rgba(255, 249, 237, 0.012) 50%, transparent 51%);
  background-size: 100% 5px, 42px 100%;
  mix-blend-mode: screen;
  opacity: 0.22;
}

button {
  font: inherit;
  white-space: nowrap;
}

.game-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: var(--layout-gap);
  width: min(100vw, 2200px);
  max-width: 2200px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: 8px var(--shell-pad-x) 10px;
  overflow: hidden;
}

.topbar {
  position: relative;
  z-index: 16;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 7px 10px;
  border: 1px solid rgba(67, 214, 197, 0.16);
  border-bottom-color: rgba(240, 180, 78, 0.34);
  background:
    linear-gradient(90deg, rgba(67, 214, 197, 0.09), transparent 32%, rgba(240, 180, 78, 0.08)),
    rgba(10, 13, 12, 0.92);
  backdrop-filter: blur(16px);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(240, 180, 78, 0.56);
  background:
    linear-gradient(135deg, rgba(240, 180, 78, 0.16), transparent 52%),
    #191c19;
  color: var(--amber);
  font-family: var(--font-data);
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(67, 214, 197, 0.22);
}

.brand-mark::after {
  inset: 15px;
  border-color: rgba(240, 180, 78, 0.24);
  transform: rotate(45deg);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 900;
  line-height: 1.32;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 0 22px rgba(255, 249, 237, 0.16);
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.sol-chip {
  display: flex;
  align-items: baseline;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    rgba(18, 22, 20, 0.92);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
}

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

.sol-chip strong {
  font-family: var(--font-data);
  color: var(--white);
  font-size: 20px;
}

.primary-action,
.secondary-action,
.icon-button {
  position: relative;
  overflow: hidden;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--button);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.primary-action::after,
.secondary-action::after,
.icon-button::after,
.card-button::after,
.event-choice::after {
  content: "";
  position: absolute;
  inset: var(--rip-y, 50%) auto auto var(--rip-x, 50%);
  width: 10px;
  height: 10px;
  border: 1px solid rgba(255, 249, 237, 0.26);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1);
}

.primary-action.ripple::after,
.secondary-action.ripple::after,
.icon-button.ripple::after,
.card-button.ripple::after,
.event-choice.ripple::after {
  animation: controlRipple 520ms ease-out;
}

.primary-action {
  min-width: 116px;
  padding: 0 14px;
  border-color: rgba(67, 214, 197, 0.74);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 42%),
    linear-gradient(180deg, #16645a, #10332f);
  color: var(--white);
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -3px 0 rgba(0, 0, 0, 0.26),
    0 0 0 rgba(67, 214, 197, 0);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
}

.primary-action.resolving {
  border-color: rgba(240, 180, 78, 0.78);
  background: linear-gradient(180deg, #55411d, #322711);
  animation: resolvingBlink 720ms ease-in-out infinite;
}

.goal-dock {
  position: relative;
  top: auto;
  z-index: 11;
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(90px, 138px) minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 38px;
  margin: 0;
  padding: 5px 8px;
  border: 1px solid rgba(216, 166, 75, 0.34);
  background:
    linear-gradient(90deg, rgba(216, 166, 75, 0.13), rgba(103, 197, 184, 0.045)),
    rgba(14, 15, 13, 0.98);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
}

.goal-dock.ready {
  border-color: rgba(142, 212, 106, 0.36);
  background:
    linear-gradient(90deg, rgba(142, 212, 106, 0.12), rgba(67, 214, 197, 0.06)),
    rgba(17, 20, 18, 0.96);
}

.goal-dock-status {
  min-width: 96px;
}

.goal-dock-status span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.goal-dock-status strong {
  display: block;
  margin-top: 2px;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 14px;
}

.goal-dock-meter {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
}

.goal-dock-meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--amber), #e6d38a);
  transition: width 220ms ease;
}

.goal-dock.ready .goal-dock-meter span {
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.goal-dock.ignition-ready {
  border-color: rgba(255, 249, 237, 0.62);
  box-shadow:
    0 0 0 1px rgba(240, 180, 78, 0.18),
    0 0 34px rgba(240, 180, 78, 0.2),
    0 12px 34px rgba(0, 0, 0, 0.3);
  animation: ignitionDockPulse 1500ms ease-in-out infinite;
}

.ignition-banner {
  position: relative;
  z-index: 15;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 249, 237, 0.66);
  background:
    linear-gradient(90deg, rgba(240, 180, 78, 0.26), rgba(67, 214, 197, 0.16) 46%, rgba(255, 249, 237, 0.08)),
    rgba(16, 20, 17, 0.98);
  box-shadow:
    0 0 0 1px rgba(240, 180, 78, 0.16),
    0 0 54px rgba(240, 180, 78, 0.2),
    0 18px 48px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  animation: ignitionBannerIn 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ignition-banner.hidden {
  display: none;
}

.ignition-banner::before,
.ignition-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ignition-banner::before {
  background:
    linear-gradient(100deg, transparent 0 38%, rgba(255, 249, 237, 0.16) 48%, transparent 58%),
    repeating-linear-gradient(90deg, rgba(255, 249, 237, 0.04) 0 1px, transparent 1px 12px);
  transform: translateX(-64%);
  animation: ignitionSweep 2200ms ease-in-out infinite;
}

.ignition-banner::after {
  border: 1px solid rgba(67, 214, 197, 0.18);
  box-shadow: inset 0 0 34px rgba(240, 180, 78, 0.08);
}

.ignition-banner.blocked {
  border-color: rgba(240, 180, 78, 0.42);
  filter: saturate(0.78);
}

.ignition-sigil {
  position: relative;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 249, 237, 0.52);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 249, 237, 0.34) 0 8%, transparent 10%),
    conic-gradient(from 120deg, rgba(240, 180, 78, 0.78), rgba(67, 214, 197, 0.62), rgba(240, 180, 78, 0.78));
  box-shadow:
    0 0 24px rgba(240, 180, 78, 0.28),
    inset 0 0 20px rgba(0, 0, 0, 0.42);
}

.ignition-sigil span {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(9, 12, 11, 0.78);
  border-radius: 50%;
  background: rgba(10, 14, 12, 0.88);
}

.ignition-sigil span + span {
  inset: 21px 8px auto;
  height: 2px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 249, 237, 0.82);
  box-shadow: 0 0 16px rgba(255, 249, 237, 0.46);
  transform: rotate(-18deg);
}

.ignition-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.ignition-copy span {
  display: block;
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.ignition-copy strong {
  display: block;
  margin-top: 2px;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 950;
  line-height: 1.05;
}

.ignition-copy p {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
}

.ignition-action {
  position: relative;
  z-index: 1;
  min-width: 142px;
  min-height: 46px;
  border-color: rgba(255, 249, 237, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 249, 237, 0.2), transparent 44%),
    linear-gradient(180deg, #765416, #193f38);
  box-shadow:
    0 0 28px rgba(240, 180, 78, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  animation: ignitionButtonPulse 1150ms ease-in-out infinite;
}

.ignition-action:disabled {
  animation: none;
}

.goal-dock-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
  max-height: 56px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.goal-dock-list li {
  display: inline-grid;
  grid-template-columns: minmax(0, auto) auto;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px 8px;
  min-height: 24px;
  max-width: 172px;
  padding: 3px 7px;
  border: 1px solid rgba(240, 180, 78, 0.2);
  background:
    linear-gradient(90deg, rgba(240, 180, 78, 0.075), transparent),
    rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.goal-dock-list b {
  overflow: hidden;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
}

.goal-dock-list span {
  flex: 0 0 auto;
  color: var(--amber);
  font-size: 10px;
  font-weight: 900;
  justify-self: end;
  line-height: 1;
  white-space: nowrap;
}

.goal-dock-list span .term-trigger,
.goal-checklist span .term-trigger {
  color: inherit;
  font-size: inherit;
  font-weight: 950;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.goal-dock-list li.blocked,
.goal-checklist li.blocked {
  border-color: rgba(235, 91, 91, 0.32);
  background:
    linear-gradient(90deg, rgba(235, 91, 91, 0.11), transparent 68%),
    rgba(18, 12, 12, 0.9);
}

.goal-dock-list li.blocked span,
.goal-checklist li.blocked span {
  color: #ff8e7d;
}

.goal-dock-list li.done span {
  color: var(--green);
}

.goal-dock-list li.done {
  border-color: rgba(142, 212, 106, 0.24);
  background:
    linear-gradient(90deg, rgba(142, 212, 106, 0.08), transparent 68%),
    rgba(12, 18, 13, 0.9);
}

.turn-summary {
  position: absolute;
  top: 10px;
  left: 10px;
  right: auto;
  z-index: 18;
  display: grid;
  grid-template-columns: minmax(220px, 340px) auto;
  gap: 8px;
  align-items: start;
  max-width: min(760px, calc(100% - 20px));
  max-height: 92px;
  margin: 0;
  padding: 8px 10px 34px;
  border: 1px solid rgba(67, 214, 197, 0.34);
  background:
    linear-gradient(90deg, rgba(67, 214, 197, 0.1), rgba(240, 180, 78, 0.08)),
    rgba(16, 20, 18, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
}

.turn-summary.expanded {
  right: 10px;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, auto);
  max-width: none;
  max-height: 210px;
}

.turn-summary.has-alert {
  border-color: rgba(216, 166, 75, 0.62);
  background:
    linear-gradient(90deg, rgba(216, 166, 75, 0.16), rgba(217, 93, 79, 0.08)),
    rgba(16, 20, 18, 0.97);
}

.turn-summary.hidden {
  display: none;
}

.turn-summary.pulse {
  animation: turnPulse 900ms ease-out;
}

.turn-summary span:first-child {
  display: block;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.turn-summary strong {
  display: block;
  margin-top: 3px;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 14px;
}

.turn-summary p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.turn-summary.expanded p {
  max-height: 88px;
  overflow: auto;
  display: block;
  -webkit-line-clamp: unset;
}

.turn-summary-deltas {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 380px;
  max-height: 64px;
  overflow: hidden;
}

.turn-summary.expanded .turn-summary-deltas {
  max-width: none;
  max-height: 132px;
  overflow: auto;
}

.inline-toggle {
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid rgba(67, 214, 197, 0.28);
  background:
    linear-gradient(180deg, rgba(67, 214, 197, 0.08), transparent),
    rgba(8, 13, 12, 0.92);
  color: var(--cyan);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.turn-summary-toggle {
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 2;
  min-width: 78px;
  box-shadow: 0 0 14px rgba(67, 214, 197, 0.1);
}

.turn-delta {
  min-height: 20px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.turn-delta.positive {
  border-color: rgba(124, 214, 122, 0.32);
  color: var(--green);
  animation: deltaPop 520ms ease-out both;
}

.turn-delta.negative {
  border-color: rgba(255, 106, 91, 0.34);
  color: var(--coral);
  animation: deltaPop 520ms ease-out both;
}

.turn-delta.alert {
  border-color: rgba(216, 166, 75, 0.52);
  background: rgba(216, 166, 75, 0.09);
  color: var(--amber);
}

.turn-delta.day {
  border-color: rgba(67, 214, 197, 0.26);
  color: var(--cyan);
}

.turn-delta.neutral {
  color: var(--dim);
}

@keyframes turnPulse {
  0% {
    transform: translateY(-8px);
    opacity: 0;
  }
  55% {
    transform: translateY(0);
    opacity: 1;
    box-shadow: 0 0 0 1px rgba(67, 214, 197, 0.42), 0 20px 54px rgba(0, 0, 0, 0.34);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes deltaPop {
  0% {
    transform: translateY(3px) scale(0.92);
    opacity: 0;
  }
  70% {
    transform: translateY(-1px) scale(1.04);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 19;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}

.fx-layer::before,
.fx-layer::after {
  content: "";
  position: absolute;
  inset: 0;
}

.fx-layer::before {
  border: 1px solid transparent;
  background:
    linear-gradient(90deg, transparent 0 47%, rgba(255, 249, 237, 0.12) 49%, transparent 51%),
    linear-gradient(0deg, transparent 0 47%, rgba(255, 249, 237, 0.08) 49%, transparent 51%),
    radial-gradient(circle at 50% 46%, rgba(67, 214, 197, 0.24), transparent 28%),
    linear-gradient(180deg, transparent, rgba(67, 214, 197, 0.05), transparent);
}

.fx-layer::after {
  content: attr(data-label);
  display: grid;
  place-items: center;
  color: rgba(255, 249, 237, 0.78);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.fx-layer.turn,
.fx-layer.event,
.fx-layer.good,
.fx-layer.warn,
.fx-layer.bad,
.fx-layer.decision,
.fx-layer.launchReady,
.fx-layer.launch,
.fx-layer.neutral {
  animation: fxPulse 860ms ease-out both;
}

.fx-layer.good::before {
  background:
    radial-gradient(circle at 50% 46%, rgba(142, 212, 106, 0.28), transparent 30%),
    linear-gradient(90deg, transparent, rgba(142, 212, 106, 0.08), transparent);
}

.fx-layer.warn::before,
.fx-layer.decision::before {
  background:
    radial-gradient(circle at 50% 46%, rgba(240, 180, 78, 0.28), transparent 30%),
    linear-gradient(90deg, transparent, rgba(240, 180, 78, 0.1), transparent);
}

.fx-layer.bad::before {
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 116, 102, 0.3), transparent 30%),
    linear-gradient(90deg, rgba(255, 116, 102, 0.08), transparent 50%, rgba(255, 116, 102, 0.08));
}

.fx-layer.launch {
  animation: launchFlash 1420ms ease-out both;
}

.fx-layer.launchReady {
  animation: launchFlash 1680ms ease-out both;
}

.fx-layer.launchReady::before {
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 249, 237, 0.42), transparent 17%),
    radial-gradient(circle at 50% 46%, rgba(240, 180, 78, 0.32), transparent 34%),
    linear-gradient(90deg, transparent 0 48%, rgba(240, 180, 78, 0.2) 49.5% 50.5%, transparent 52%),
    linear-gradient(180deg, rgba(67, 214, 197, 0.08), transparent 46%, rgba(240, 180, 78, 0.08));
}

.fx-layer.launch::before {
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(255, 249, 237, 0.2) 49.5% 50.5%, transparent 52%),
    radial-gradient(circle at 50% 46%, rgba(255, 249, 237, 0.5), transparent 18%),
    radial-gradient(circle at 50% 46%, rgba(67, 214, 197, 0.34), transparent 38%),
    linear-gradient(90deg, rgba(240, 180, 78, 0.1), transparent, rgba(67, 214, 197, 0.1));
}

@keyframes fxPulse {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.04);
  }
}

@keyframes launchFlash {
  0% {
    opacity: 0;
    transform: scale(0.94);
  }
  18% {
    opacity: 1;
  }
  45% {
    opacity: 0.55;
    transform: scale(1.02);
  }
  100% {
    opacity: 0;
    transform: scale(1.1);
  }
}

@keyframes ignitionBannerIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ignitionSweep {
  0%,
  32% {
    transform: translateX(-68%);
  }
  76%,
  100% {
    transform: translateX(72%);
  }
}

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

@keyframes ignitionButtonPulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 28px rgba(240, 180, 78, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 0 42px rgba(240, 180, 78, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }
}

@keyframes actionTabPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.2);
  }
}

.secondary-action {
  min-width: 92px;
  padding: 0 14px;
}

.secondary-action.compact {
  min-width: 96px;
  padding: 0 10px;
  border-color: rgba(240, 180, 78, 0.52);
  color: var(--amber);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 48%),
    rgba(48, 36, 22, 0.86);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}

#tutorialButton {
  white-space: nowrap;
  font-size: 12.5px;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.icon-button.active {
  border-color: rgba(67, 214, 197, 0.72);
  background:
    radial-gradient(circle at 50% 20%, rgba(67, 214, 197, 0.24), transparent 64%),
    rgba(15, 49, 45, 0.9);
  color: var(--cyan);
  box-shadow: 0 0 18px rgba(67, 214, 197, 0.18);
}

.icon-button.danger {
  color: var(--coral);
  border-color: rgba(255, 116, 102, 0.34);
  background: rgba(45, 24, 20, 0.76);
  font-weight: 900;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--cyan);
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.2),
    0 0 24px rgba(67, 214, 197, 0.22);
}

button:focus-visible {
  outline: 2px solid rgba(67, 214, 197, 0.78);
  outline-offset: 2px;
}

button:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
  filter: brightness(1.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

@keyframes resolvingBlink {
  0%,
  100% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 rgba(240, 180, 78, 0);
  }
  50% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 24px rgba(240, 180, 78, 0.28);
  }
}

@keyframes controlRipple {
  0% {
    opacity: 0.72;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(24);
  }
}

.dashboard {
  display: grid;
  grid-template-columns:
    clamp(300px, 22vw, 430px)
    minmax(660px, 1.35fr)
    clamp(300px, 22vw, 430px);
  gap: var(--layout-gap);
  min-height: 0;
  height: 100%;
  align-items: stretch;
  overflow: hidden;
}

.dashboard-column {
  display: grid;
  gap: var(--layout-gap);
  align-content: stretch;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.dashboard-column-left {
  grid-template-rows: minmax(0, 1fr);
}

.dashboard-column-center {
  position: relative;
  grid-template-rows: minmax(300px, min(42vh, 470px)) minmax(0, 1fr);
}

.dashboard-column-right {
  grid-template-rows: minmax(112px, auto) minmax(0, 1fr);
}

.sector {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(216, 166, 75, 0.18);
  background:
    linear-gradient(135deg, rgba(216, 166, 75, 0.06), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 92px),
    rgba(14, 15, 13, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.018),
    0 12px 34px var(--shadow);
  min-width: 0;
  min-height: 0;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.tutorial-focus {
  border-color: rgba(67, 214, 197, 0.9);
  box-shadow:
    0 0 0 1px rgba(67, 214, 197, 0.42),
    0 0 28px rgba(67, 214, 197, 0.18),
    0 18px 54px var(--shadow);
  transform: translateY(-1px);
}

button.tutorial-focus,
.card-button.tutorial-focus {
  animation: tutorialPulse 1100ms ease-in-out infinite;
}

@keyframes tutorialPulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(67, 214, 197, 0.34);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(67, 214, 197, 0.18), 0 0 28px rgba(67, 214, 197, 0.28);
  }
}

.command-sector {
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  scrollbar-gutter: stable;
  border-color: rgba(240, 180, 78, 0.42);
  background:
    radial-gradient(circle at 8% 4%, rgba(240, 180, 78, 0.2), transparent 26%),
    radial-gradient(circle at 96% 18%, rgba(67, 214, 197, 0.12), transparent 32%),
    linear-gradient(135deg, rgba(240, 180, 78, 0.1), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 120px),
    rgba(10, 14, 12, 0.97);
  box-shadow:
    inset 0 0 0 1px rgba(255, 249, 237, 0.035),
    inset 5px 0 0 rgba(240, 180, 78, 0.28),
    0 0 0 1px rgba(240, 180, 78, 0.12),
    0 18px 48px rgba(0, 0, 0, 0.46),
    0 0 36px rgba(240, 180, 78, 0.08);
}

.command-sector > * {
  flex: 0 0 auto;
}

.command-sector::-webkit-scrollbar {
  width: 6px;
}

.command-sector::-webkit-scrollbar-track {
  background: rgba(7, 10, 9, 0.42);
}

.command-sector::-webkit-scrollbar-thumb {
  background: rgba(240, 180, 78, 0.38);
}

.directive-board {
  min-height: 0;
}

.command-sector::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(67, 214, 197, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(67, 214, 197, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 72%);
  opacity: 0.48;
}

.command-sector::after {
  content: "COMMAND";
  position: absolute;
  top: 9px;
  right: 14px;
  color: rgba(240, 180, 78, 0.22);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
  pointer-events: none;
}

.viewport-sector {
  position: relative;
  align-self: stretch;
  height: auto;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 198, 96, 0.18), transparent 24%),
    radial-gradient(circle at 50% 54%, rgba(67, 214, 197, 0.14), transparent 36%),
    linear-gradient(90deg, rgba(216, 166, 75, 0.08), transparent 20%, transparent 80%, rgba(216, 166, 75, 0.08)),
    #060706;
  border-color: rgba(216, 166, 75, 0.46);
  box-shadow:
    0 18px 62px rgba(0, 0, 0, 0.48),
    0 0 70px rgba(67, 214, 197, 0.1),
    inset 0 0 0 1px rgba(255, 249, 237, 0.045);
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px));
}

.viewport-sector::before,
.viewport-sector::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.viewport-sector::before {
  background:
    radial-gradient(circle at 50% 48%, transparent 0 27%, rgba(216, 166, 75, 0.14) 27.3%, transparent 28.2%),
    radial-gradient(circle at 50% 48%, transparent 0 36%, rgba(67, 214, 197, 0.07) 36.4%, transparent 37.4%),
    linear-gradient(90deg, transparent 0 49.7%, rgba(67, 214, 197, 0.14) 49.85% 50.15%, transparent 50.3%),
    linear-gradient(0deg, transparent 0 49.7%, rgba(67, 214, 197, 0.1) 49.85% 50.15%, transparent 50.3%);
  opacity: 0.5;
}

.viewport-sector::after {
  background:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, transparent 0 60%, rgba(4, 5, 5, 0.62) 100%);
  background-size: 100% 4px, auto;
  mix-blend-mode: screen;
  opacity: 0.54;
}

.resources-sector {
  align-self: start;
  padding: 8px;
}

.crew-sector {
  padding: 11px;
}

.build-sector {
  align-self: start;
  padding: 11px;
}

.briefing-sector {
  padding: 7px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-color: rgba(103, 197, 184, 0.32);
  background:
    radial-gradient(circle at 8% 0%, rgba(103, 197, 184, 0.13), transparent 36%),
    linear-gradient(180deg, rgba(216, 166, 75, 0.045), transparent 120px),
    rgba(11, 16, 14, 0.96);
}

.dashboard-column-center .briefing-sector {
  align-self: stretch;
}

.dashboard-column-center .briefing-panel {
  min-height: 64px;
}

.dashboard-column-center .briefing-alerts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-column-center .briefing-alerts li:nth-child(n + 3) {
  display: none;
}

.action-sector {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  padding: 10px;
  border-color: rgba(67, 214, 197, 0.58);
  background:
    radial-gradient(circle at 50% 0%, rgba(67, 214, 197, 0.18), transparent 34%),
    linear-gradient(90deg, rgba(240, 180, 78, 0.1), transparent 18%, transparent 82%, rgba(67, 214, 197, 0.1)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 112px),
    rgba(11, 16, 14, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(67, 214, 197, 0.08),
    0 18px 58px rgba(0, 0, 0, 0.42),
    0 0 42px rgba(67, 214, 197, 0.12);
}

.action-sector.has-action {
  border-color: rgba(255, 212, 104, 0.7);
  box-shadow:
    inset 0 0 0 1px rgba(240, 180, 78, 0.12),
    0 18px 58px rgba(0, 0, 0, 0.42),
    0 0 46px rgba(240, 180, 78, 0.14);
}

.action-sector.has-action .action-heading span {
  color: var(--amber);
}

.action-sector.has-action .action-heading::after {
  content: "待处理";
  display: inline-grid;
  min-width: 58px;
  height: 22px;
  place-items: center;
  margin-left: auto;
  border: 1px solid rgba(255, 249, 237, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 249, 237, 0.22), rgba(240, 180, 78, 0.16)),
    rgba(44, 31, 12, 0.96);
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow:
    0 0 0 1px rgba(240, 180, 78, 0.12),
    0 0 18px rgba(240, 180, 78, 0.32);
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}

.action-heading {
  margin-bottom: 7px;
}

.action-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 7px;
}

.action-tab {
  position: relative;
  min-height: 50px;
  padding: 16px 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(18, 20, 18, 0.94);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.action-tab::before {
  content: attr(data-step);
  position: absolute;
  top: 4px;
  left: 6px;
  color: rgba(216, 166, 75, 0.78);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.action-tab.active {
  border-color: rgba(67, 214, 197, 0.66);
  background:
    linear-gradient(180deg, rgba(67, 214, 197, 0.17), transparent),
    rgba(10, 38, 35, 0.94);
  color: var(--white);
  box-shadow:
    0 0 0 1px rgba(67, 214, 197, 0.16),
    0 0 24px rgba(67, 214, 197, 0.16);
  transform: translateY(-1px);
}

.action-tab.has-action {
  border-color: rgba(255, 212, 104, 0.86);
  background:
    linear-gradient(180deg, rgba(240, 180, 78, 0.2), transparent 52%),
    linear-gradient(90deg, rgba(240, 180, 78, 0.14), transparent),
    rgba(30, 26, 17, 0.96);
  color: var(--white);
  box-shadow:
    inset 0 0 0 1px rgba(240, 180, 78, 0.16),
    0 0 28px rgba(240, 180, 78, 0.24);
  animation: actionTabPulse 1350ms ease-in-out infinite;
}

.action-tab.has-action::after {
  content: attr(data-signal);
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: auto;
  height: auto;
  max-width: calc(100% - 10px);
  padding: 3px 6px;
  border: 1px solid rgba(255, 249, 237, 0.62);
  background:
    linear-gradient(180deg, rgba(255, 249, 237, 0.28), rgba(240, 180, 78, 0.16)),
    rgba(42, 31, 13, 0.96);
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow:
    0 0 0 1px rgba(240, 180, 78, 0.1),
    0 0 18px rgba(240, 180, 78, 0.46);
}

.action-tab.has-action::before {
  color: var(--amber);
}

.action-panel-stack {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid rgba(67, 214, 197, 0.16);
  padding-top: 8px;
}

.action-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  clip-path: none;
}

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

.action-panel::after {
  display: none;
}

.action-panel .sector-heading {
  margin-bottom: 7px;
}

.action-panel .crew-grid,
.action-panel .night-grid,
.action-panel .contract-grid,
.action-panel .policy-grid,
.action-panel .build-grid {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 0 4px 8px 0;
}

.archive-rail {
  min-height: 0;
}

.contract-sector {
  padding: 11px;
}

.sector::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0%, rgba(67, 214, 197, 0.035) 48%, transparent 58%);
  opacity: 0;
  transform: translateX(-40%);
  transition:
    opacity 180ms ease,
    transform 360ms ease;
}

.sector:hover::after {
  opacity: 1;
  transform: translateX(22%);
}

.history-sector {
  padding: 8px 9px;
  opacity: 0.88;
}

.history-sector #clearHistoryButton {
  min-width: 54px;
  min-height: 28px;
  padding: 0 8px;
  border-color: rgba(240, 180, 78, 0.26);
  color: rgba(240, 180, 78, 0.8);
  font-size: 11px;
}

.history-sector #clearHistoryButton.confirming {
  min-width: 76px;
  border-color: rgba(255, 116, 102, 0.62);
  background:
    linear-gradient(90deg, rgba(255, 116, 102, 0.16), transparent),
    rgba(19, 11, 10, 0.94);
  color: var(--coral);
}

.history-sector.expanded {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 14;
  width: min(620px, 100%);
  height: min(420px, calc(100vh - 180px));
  opacity: 1;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.58),
    0 0 36px rgba(67, 214, 197, 0.12);
}

.policy-sector {
  padding: 11px;
  max-height: 100%;
}

.policy-sector .policy-grid {
  max-height: none;
  overflow: auto;
  padding-right: 4px;
}

.log-sector {
  align-self: stretch;
  min-height: 0;
  padding: 8px 9px;
}

.log-sector.expanded {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 13;
  height: min(360px, calc(100vh - 200px));
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.58),
    0 0 36px rgba(67, 214, 197, 0.12);
}

.sector-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 22px;
  margin-bottom: 7px;
}

.sector-heading h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 0 16px rgba(67, 214, 197, 0.12);
}

.sector-heading h2::before {
  content: "";
  width: 6px;
  height: 15px;
  border: 1px solid rgba(67, 214, 197, 0.8);
  background:
    linear-gradient(180deg, rgba(67, 214, 197, 0.62), rgba(67, 214, 197, 0.08));
  box-shadow: 0 0 16px rgba(67, 214, 197, 0.24);
}

.sector-heading span {
  color: var(--muted);
  font-size: 11.5px;
  text-align: right;
}

.sector-note {
  margin: -3px 0 8px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.4;
}

.mission-meter {
  padding: 8px;
  border: 1px solid rgba(67, 214, 197, 0.28);
  background:
    linear-gradient(90deg, rgba(67, 214, 197, 0.13), transparent 70%),
    rgba(10, 18, 17, 0.94);
  box-shadow: inset 0 0 18px rgba(67, 214, 197, 0.06);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.window-panel {
  position: relative;
  overflow: hidden;
  margin-top: 0;
  padding: 9px 10px;
  border: 1px solid rgba(240, 180, 78, 0.5);
  background:
    radial-gradient(circle at 100% 0%, rgba(240, 180, 78, 0.18), transparent 42%),
    linear-gradient(90deg, rgba(240, 180, 78, 0.2), transparent 72%),
    rgba(18, 16, 11, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(255, 249, 237, 0.035),
    0 0 24px rgba(240, 180, 78, 0.08);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.window-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 42%, rgba(255, 249, 237, 0.08), transparent 58% 100%);
  transform: translateX(-120%);
  animation: commandScan 5.6s ease-in-out infinite;
  pointer-events: none;
}

.window-panel span {
  display: block;
  color: rgba(255, 249, 237, 0.68);
  font-size: 12px;
  font-weight: 800;
}

.window-panel strong {
  display: block;
  margin-top: 4px;
  color: var(--amber);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.25;
  text-shadow: 0 0 18px rgba(240, 180, 78, 0.26);
}

.window-panel p {
  margin-top: 5px;
  color: rgba(255, 249, 237, 0.72);
  font-size: 12px;
  line-height: 1.35;
}

.condition-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 0;
}

.condition-strip div {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 6px 6px 5px;
  border: 1px solid rgba(67, 214, 197, 0.2);
  background:
    linear-gradient(180deg, rgba(67, 214, 197, 0.07), transparent 70%),
    rgba(8, 16, 15, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    inset 0 -1px 0 rgba(67, 214, 197, 0.08);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}

.condition-strip div::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 6px;
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(67, 214, 197, 0.7));
  opacity: 0.7;
}

.condition-strip span,
.condition-strip strong {
  display: block;
}

.condition-strip span {
  color: rgba(255, 249, 237, 0.62);
  font-size: 10px;
  font-weight: 700;
}

.condition-strip strong {
  margin-top: 3px;
  color: var(--cyan);
  font-family: var(--font-data);
  font-size: 12px;
  line-height: 1.2;
  text-shadow: 0 0 12px rgba(67, 214, 197, 0.22);
}

.condition-strip strong.charged {
  color: var(--amber);
  text-shadow: 0 0 12px rgba(240, 180, 78, 0.25);
}

.condition-strip strong.critical {
  color: var(--coral);
  text-shadow: 0 0 14px rgba(255, 116, 102, 0.32);
}

.consequence-strip {
  display: grid;
  gap: 5px;
  margin-top: 0;
  overflow: hidden;
}

.consequence-strip[hidden] {
  display: none;
}

.command-sector .consequence-strip[hidden] {
  margin: 0;
}

.consequence-strip.is-collapsed {
  max-height: none;
}

.consequence-strip.is-collapsed .optional {
  display: none;
}

.consequence-strip div {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 7px 9px 7px 13px;
  border: 1px solid rgba(240, 180, 78, 0.48);
  background:
    linear-gradient(90deg, rgba(240, 180, 78, 0.18), transparent 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(17, 17, 13, 0.96);
  box-shadow:
    inset 4px 0 0 rgba(240, 180, 78, 0.66),
    0 0 24px rgba(240, 180, 78, 0.08);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.consequence-strip div.decision-echo {
  border-color: rgba(67, 214, 197, 0.68);
  background:
    linear-gradient(90deg, rgba(67, 214, 197, 0.18), rgba(240, 180, 78, 0.08)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(7, 16, 16, 0.96);
  box-shadow:
    inset 4px 0 0 rgba(67, 214, 197, 0.76),
    0 0 22px rgba(67, 214, 197, 0.12);
}

.consequence-strip div::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent, rgba(255, 249, 237, 0.08), transparent);
  transform: translateX(-120%);
  animation: commandScan 4.8s ease-in-out infinite;
  pointer-events: none;
}

.consequence-strip span,
.consequence-strip strong {
  display: block;
}

.consequence-strip span {
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
  text-shadow: 0 0 14px rgba(240, 180, 78, 0.28);
}

.consequence-strip div.decision-echo span {
  color: var(--cyan);
}

.consequence-strip strong {
  margin-top: 3px;
  color: var(--white);
  font-size: 12px;
  line-height: 1.32;
}

.consequence-toggle {
  justify-self: stretch;
  min-height: 28px;
  border-color: rgba(103, 197, 184, 0.34);
  background:
    linear-gradient(90deg, rgba(103, 197, 184, 0.12), transparent),
    rgba(8, 15, 14, 0.96);
  color: var(--cyan);
  font-weight: 900;
}

.countdown-panel {
  position: relative;
  overflow: hidden;
  padding: 8px;
  border: 1px solid rgba(240, 180, 78, 0.36);
  background:
    radial-gradient(circle at 100% 0%, rgba(240, 180, 78, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(240, 180, 78, 0.08), transparent),
    rgba(17, 14, 10, 0.94);
  box-shadow:
    inset 0 0 0 1px rgba(240, 180, 78, 0.08),
    0 0 24px rgba(240, 180, 78, 0.08);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.countdown-panel.hidden {
  display: none;
}

.countdown-panel.clickable {
  cursor: pointer;
}

.countdown-panel.clickable:hover,
.countdown-panel.clickable:focus-visible {
  border-color: rgba(67, 214, 197, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(67, 214, 197, 0.14),
    0 0 24px rgba(67, 214, 197, 0.16);
  transform: translateY(-1px);
}

.countdown-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 180, 78, 0.86), transparent);
}

.countdown-list {
  display: grid;
  gap: 6px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.countdown-list li {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 5px;
  padding: 8px 10px 8px 13px;
  border: 1px solid rgba(240, 180, 78, 0.34);
  background:
    linear-gradient(90deg, rgba(240, 180, 78, 0.14), transparent 74%),
    rgba(18, 15, 10, 0.96);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.countdown-list li.clickable {
  cursor: pointer;
}

.countdown-list li.clickable:hover,
.countdown-list li.clickable:focus-visible {
  border-color: rgba(67, 214, 197, 0.74);
  box-shadow:
    inset 0 0 0 1px rgba(67, 214, 197, 0.12),
    0 0 18px rgba(67, 214, 197, 0.14);
  transform: translateX(2px);
}

.countdown-list li::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--amber);
  box-shadow: 0 0 16px rgba(240, 180, 78, 0.42);
}

.countdown-list li.critical {
  border-color: rgba(255, 116, 102, 0.76);
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 93, 79, 0.18), transparent 40%),
    linear-gradient(90deg, rgba(217, 93, 79, 0.2), transparent 76%),
    rgba(26, 12, 10, 0.97);
  animation: crisisPulse 1600ms ease-in-out infinite;
}

.countdown-list li.critical::before {
  background: var(--coral);
}

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

.countdown-head strong {
  color: var(--white);
  font-size: 12.5px;
}

.countdown-head em {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid rgba(255, 249, 237, 0.22);
  color: var(--amber);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}

.countdown-list p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.countdown-list small {
  color: var(--dim);
  font-size: 10.5px;
  line-height: 1.3;
}

.crisis-panel {
  position: relative;
  overflow: hidden;
  margin-top: 0;
  padding: 7px 8px 8px;
  border: 1px solid rgba(67, 214, 197, 0.2);
  background:
    linear-gradient(180deg, rgba(67, 214, 197, 0.065), transparent),
    rgba(10, 17, 15, 0.92);
  box-shadow: inset 0 0 18px rgba(67, 214, 197, 0.045);
  min-height: 0;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.crisis-panel.fresh {
  border-color: rgba(240, 180, 78, 0.8);
  box-shadow:
    inset 0 0 0 1px rgba(240, 180, 78, 0.18),
    0 0 34px rgba(240, 180, 78, 0.18);
  animation: briefingWake 1500ms ease-out;
}

.crisis-panel.urgent {
  border-color: rgba(255, 116, 102, 0.86);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 116, 102, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(217, 93, 79, 0.12), transparent),
    rgba(17, 12, 11, 0.94);
  box-shadow:
    inset 0 0 0 1px rgba(255, 116, 102, 0.16),
    0 0 34px rgba(217, 93, 79, 0.18);
}

.crisis-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(67, 214, 197, 0.8), transparent);
  opacity: 0.75;
}

.crisis-panel:hover,
.crisis-panel:focus-visible {
  border-color: rgba(67, 214, 197, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(67, 214, 197, 0.14),
    0 0 24px rgba(67, 214, 197, 0.16);
  transform: translateY(-1px);
}

.crisis-list {
  display: grid;
  gap: 5px;
  max-height: none;
  margin: 6px 0 0;
  padding: 0;
  overflow: visible;
  list-style: none;
}

.crisis-panel.warnings-collapsed .crisis-list li.optional {
  display: none;
}

.crisis-list li {
  position: relative;
  overflow: hidden;
  padding: 8px 10px 8px 14px;
  border: 1px solid rgba(103, 197, 184, 0.18);
  background:
    linear-gradient(90deg, rgba(103, 197, 184, 0.08), transparent 74%),
    rgba(12, 18, 16, 0.94);
}

.crisis-list li::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(103, 197, 184, 0.36);
}

.crisis-list li.warn,
.crisis-list li.new-warning {
  border-color: rgba(240, 180, 78, 0.58);
  background:
    linear-gradient(90deg, rgba(240, 180, 78, 0.16), transparent 74%),
    rgba(25, 19, 12, 0.96);
}

.crisis-list li.warn::before,
.crisis-list li.new-warning::before {
  background: var(--amber);
  box-shadow: 0 0 18px rgba(240, 180, 78, 0.46);
}

.crisis-list li.critical {
  border-color: rgba(255, 116, 102, 0.72);
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 93, 79, 0.16), transparent 40%),
    linear-gradient(90deg, rgba(217, 93, 79, 0.2), transparent 76%),
    rgba(28, 13, 12, 0.97);
  box-shadow: 0 0 20px rgba(217, 93, 79, 0.16);
}

.crisis-list li.critical::before {
  background: var(--coral);
  box-shadow: 0 0 20px rgba(255, 116, 102, 0.58);
}

.crisis-list li.has-actions::after {
  content: "可处理";
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 249, 237, 0.36);
  background: rgba(240, 180, 78, 0.16);
  color: var(--amber);
  font-size: 10px;
  font-weight: 950;
}

.crisis-list-toggle {
  width: 100%;
  min-height: 28px;
  margin-top: 6px;
  border-color: rgba(240, 180, 78, 0.38);
  background:
    linear-gradient(90deg, rgba(240, 180, 78, 0.14), rgba(103, 197, 184, 0.08)),
    rgba(9, 14, 13, 0.96);
  color: var(--amber);
  font-weight: 950;
}

.crisis-list li {
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.crisis-list li.actions-collapsed .crisis-actions {
  display: none;
}

.crisis-list li.warn {
  border-color: rgba(240, 180, 78, 0.58);
}

.crisis-list li.critical {
  animation: crisisPulse 1600ms ease-in-out infinite;
}

.crisis-list li.new-warning {
  border-color: rgba(216, 166, 75, 0.84);
  box-shadow:
    inset 0 0 0 1px rgba(216, 166, 75, 0.12),
    0 0 28px rgba(216, 166, 75, 0.12);
  animation: briefingWake 1500ms ease-out;
}

.crisis-list li.good {
  border-color: var(--green);
}

.crisis-list strong,
.crisis-list span {
  display: block;
}

.crisis-list strong {
  color: var(--white);
  font-size: 12.5px;
  text-shadow: 0 0 12px rgba(255, 249, 237, 0.12);
}

.crisis-list strong em {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 18px;
  margin-right: 6px;
  border: 1px solid rgba(216, 166, 75, 0.58);
  background: rgba(216, 166, 75, 0.12);
  color: var(--amber);
  font-size: 11px;
  font-style: normal;
}

.crisis-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.32;
}

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

.crisis-action {
  position: relative;
  overflow: hidden;
  min-height: 58px;
  padding: 7px;
  border: 1px solid rgba(240, 180, 78, 0.32);
  background:
    linear-gradient(135deg, rgba(240, 180, 78, 0.12), rgba(255, 116, 102, 0.055)),
    rgba(18, 17, 15, 0.9);
  color: var(--white);
  cursor: pointer;
  text-align: left;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.crisis-action.standard {
  border-color: rgba(67, 214, 197, 0.26);
  background:
    linear-gradient(135deg, rgba(67, 214, 197, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(15, 18, 18, 0.92);
}

.crisis-action.desperate {
  border-color: rgba(255, 116, 102, 0.48);
  background:
    linear-gradient(135deg, rgba(255, 116, 102, 0.18), rgba(240, 180, 78, 0.08)),
    rgba(24, 14, 11, 0.94);
}

.crisis-action::after {
  content: "";
  position: absolute;
  inset: auto 8px 6px 8px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 180, 78, 0.5), transparent);
}

.crisis-action:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255, 249, 237, 0.48);
  background:
    linear-gradient(135deg, rgba(240, 180, 78, 0.19), rgba(255, 116, 102, 0.08)),
    rgba(23, 20, 16, 0.95);
}

.crisis-action:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.crisis-action b,
.crisis-action span,
.crisis-action small,
.crisis-action em {
  display: block;
}

.crisis-action b {
  color: var(--amber);
  font-size: 11px;
}

.crisis-action span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.22;
}

.crisis-action small {
  margin-top: 4px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.25;
}

.crisis-action.desperate small {
  color: var(--amber);
}

.crisis-action em {
  margin-top: 4px;
  color: var(--white);
  font-size: 10px;
  font-style: normal;
  line-height: 1.25;
}

.crisis-action-toggle {
  width: 100%;
  min-height: 28px;
  margin-top: 6px;
  text-align: center;
}

.meter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 12px;
  color: var(--muted);
}

.meter-label strong {
  color: var(--cyan);
}

.meter-track {
  width: 100%;
  height: 12px;
  border: 1px solid rgba(67, 214, 197, 0.18);
  background: #0f1312;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.42);
}

.meter-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), #e6d38a, var(--amber));
  box-shadow: 0 0 18px rgba(216, 166, 75, 0.22);
  transition: width 260ms ease;
}

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

.directive-board {
  display: grid;
  gap: 6px;
  min-height: 0;
  margin-top: 0;
}

.directive-card,
.directive-progress {
  position: relative;
  overflow: hidden;
  padding: 8px 9px;
  border: 1px solid rgba(255, 249, 237, 0.11);
  background:
    linear-gradient(90deg, rgba(255, 249, 237, 0.055), transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(12, 17, 15, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.directive-card.primary {
  display: none;
  border-color: rgba(240, 180, 78, 0.3);
  background:
    linear-gradient(90deg, rgba(240, 180, 78, 0.075), transparent 62%),
    var(--panel-soft);
}

.directive-card span,
.directive-subhead span {
  display: block;
  color: rgba(255, 249, 237, 0.65);
  font-size: 12px;
  font-weight: 750;
}

.directive-card strong {
  display: block;
  margin-top: 3px;
  color: var(--white);
  font-size: 14px;
  line-height: 1.25;
  text-shadow: 0 0 14px rgba(255, 249, 237, 0.12);
}

.directive-card.primary strong {
  color: var(--amber);
}

.directive-card p {
  margin-top: 4px;
  color: rgba(255, 249, 237, 0.74);
  font-size: 12px;
  line-height: 1.35;
}

.directive-subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.directive-subhead strong {
  color: var(--cyan);
  font-size: 14px;
  text-align: right;
  text-shadow: 0 0 14px rgba(67, 214, 197, 0.24);
}

.goal-checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.goal-checklist li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px;
  min-height: 21px;
  padding: 3px 2px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.026);
  color: var(--muted);
  font-size: 10.5px;
}

.goal-checklist li::before {
  display: none;
}

.goal-checklist li.done {
  border-color: rgba(142, 212, 106, 0.2);
  background: rgba(142, 212, 106, 0.035);
  color: var(--green);
}

.goal-checklist li:not(.done) {
  border-color: rgba(240, 180, 78, 0.28);
  background:
    linear-gradient(90deg, rgba(240, 180, 78, 0.075), transparent 72%),
    rgba(16, 17, 14, 0.92);
}

.goal-checklist li.done::before {
  border-color: rgba(142, 212, 106, 0.76);
  background: rgba(142, 212, 106, 0.28);
}

.goal-checklist b {
  flex: 0 1 auto;
  color: var(--white);
  font-weight: 800;
  min-width: 0;
  max-width: 100%;
}

.goal-checklist b .term-trigger {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-checklist li.summary {
  border-color: rgba(103, 197, 184, 0.18);
  background:
    linear-gradient(90deg, rgba(103, 197, 184, 0.08), transparent),
    rgba(255, 255, 255, 0.028);
  color: var(--cyan);
  font-weight: 900;
}

.goal-checklist span {
  flex: 0 0 auto;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 15px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--amber);
  font-size: 9px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.goal-checklist li.done span {
  border-color: rgba(142, 212, 106, 0.3);
  background: rgba(142, 212, 106, 0.08);
  color: var(--green);
}

.goal-checklist li.blocked {
  border-color: rgba(235, 91, 91, 0.32);
  background:
    linear-gradient(90deg, rgba(235, 91, 91, 0.11), transparent 68%),
    rgba(18, 12, 12, 0.9);
}

.goal-checklist li.blocked span {
  color: #ff8e7d;
}


.metric-label,
.card-title {
  display: flex;
  align-items: center;
  min-width: 0;
}

.metric-label {
  gap: 5px;
}

.card-title {
  gap: 7px;
  margin-bottom: 4px;
}

.card-title h3 {
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.16;
}

.card-copy {
  min-width: 0;
}

.term-trigger {
  display: inline;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: inherit;
  cursor: help;
  text-decoration: underline;
  text-decoration-color: rgba(103, 197, 184, 0.28);
  text-underline-offset: 3px;
}

.term-trigger:hover,
.term-trigger:focus-visible {
  color: var(--cyan);
  outline: none;
  text-decoration-color: rgba(103, 197, 184, 0.75);
}

.term-toast {
  position: fixed;
  z-index: 40;
  display: grid;
  gap: 4px;
  width: min(320px, calc(100vw - 20px));
  padding: 11px 13px;
  border: 1px solid rgba(103, 197, 184, 0.46);
  background:
    linear-gradient(90deg, rgba(103, 197, 184, 0.16), rgba(240, 180, 78, 0.08)),
    rgba(8, 13, 12, 0.96);
  color: var(--text);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.48),
    0 0 28px rgba(67, 214, 197, 0.14);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  pointer-events: none;
}

.term-toast.hidden {
  display: none;
}

.term-toast strong {
  color: var(--cyan);
  font-size: 13px;
}

.term-toast span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.feature-icon {
  --icon-color: var(--cyan);
  position: relative;
  z-index: 2;
  display: inline-grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--icon-color) 48%, transparent);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--icon-color) 16%, transparent), transparent 62%),
    rgba(10, 14, 13, 0.8);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    0 0 16px color-mix(in srgb, var(--icon-color) 13%, transparent);
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}

.metric-label .feature-icon {
  display: none;
  width: 18px;
  height: 18px;
  opacity: 0.92;
  clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 5px 100%, 0 calc(100% - 5px));
}

.feature-icon::before,
.feature-icon::after,
.feature-icon i,
.feature-icon i::before,
.feature-icon i::after {
  content: "";
  position: absolute;
  display: block;
  box-sizing: border-box;
}

.feature-icon::before {
  inset: 6px;
  border: 1px solid color-mix(in srgb, var(--icon-color) 72%, transparent);
}

.feature-icon::after {
  width: 3px;
  height: 3px;
  background: var(--icon-color);
  box-shadow: 0 0 9px var(--icon-color);
}

.feature-icon i {
  inset: 50% auto auto 50%;
  color: var(--icon-color);
  transform: translate(-50%, -50%);
}

.metric-label .feature-icon::before {
  inset: 4px;
}

.metric-label .feature-icon::after {
  width: 2px;
  height: 2px;
}

.icon-credits,
.tone-credits,
.icon-solar,
.tone-solar,
.icon-beacon,
.tone-beacon,
.icon-morale,
.tone-morale,
.icon-reputation,
.tone-reputation {
  --icon-color: var(--amber);
}

.icon-oxygen,
.tone-oxygen,
.icon-hydroponics,
.tone-hydroponics,
.icon-sanctuary,
.tone-sanctuary,
.icon-colonists,
.tone-colonists,
.icon-rest,
.tone-rest {
  --icon-color: var(--green);
}

.icon-alloys,
.tone-alloys,
.icon-ore,
.tone-ore,
.icon-scraper,
.tone-scraper,
.icon-shield,
.tone-shield,
.icon-hull,
.tone-hull,
.icon-wrench,
.tone-wrench {
  --icon-color: var(--violet);
}

.icon-heat,
.tone-heat,
.icon-reactor,
.tone-engineering,
.tone-reactor,
.icon-energy,
.tone-energy {
  --icon-color: var(--coral);
}

.icon-data,
.tone-data,
.icon-signal,
.tone-research,
.icon-relay,
.tone-relay,
.icon-archive,
.tone-archive,
.icon-survey,
.tone-survey,
.icon-containment,
.tone-containment {
  --icon-color: var(--cyan);
}

.icon-dock,
.tone-dock,
.icon-crate,
.tone-crate,
.icon-convoy,
.tone-convoy,
.icon-fleet,
.tone-fleet,
.icon-factory,
.tone-factory,
.icon-drone,
.tone-drone,
.icon-crew,
.tone-crew {
  --icon-color: #8fceb9;
}

.icon-shadow,
.tone-shadow,
.icon-ledger,
.tone-ledger,
.icon-charter,
.tone-charter,
.icon-mandate,
.tone-mandate,
.icon-assembly,
.tone-assembly,
.icon-broadcast,
.tone-broadcast {
  --icon-color: #c1a3ff;
}

.icon-reactor::before,
.icon-energy::before {
  border-radius: 50%;
}

.icon-reactor i,
.icon-energy i {
  width: 15px;
  height: 15px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.icon-reactor i::before,
.icon-energy i::before {
  left: 50%;
  top: -3px;
  width: 1px;
  height: 21px;
  background: currentColor;
  transform: translateX(-50%) rotate(45deg);
}

.icon-reactor i::after,
.icon-energy i::after {
  left: -3px;
  top: 50%;
  width: 21px;
  height: 1px;
  background: currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.icon-oxygen i,
.icon-sanctuary i,
.icon-colonists i,
.icon-rest i {
  width: 15px;
  height: 10px;
  border: 1px solid currentColor;
  border-radius: 999px 999px 999px 3px;
  transform: translate(-50%, -50%) rotate(-28deg);
}

.icon-oxygen i::before,
.icon-sanctuary i::before,
.icon-colonists i::before,
.icon-rest i::before {
  right: -5px;
  bottom: -5px;
  width: 11px;
  height: 7px;
  border: 1px solid currentColor;
  border-radius: 999px 999px 3px 999px;
}

.icon-alloys i,
.icon-ore i,
.icon-scraper i {
  width: 15px;
  height: 15px;
  border: 1px solid currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.icon-alloys i::before,
.icon-ore i::before,
.icon-scraper i::before {
  inset: 3px;
  border: 1px solid currentColor;
}

.icon-data i,
.icon-signal i,
.icon-relay i,
.icon-archive i,
.icon-survey i,
.icon-containment i {
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.icon-data i::before,
.icon-signal i::before,
.icon-relay i::before,
.icon-archive i::before,
.icon-survey i::before,
.icon-containment i::before {
  left: 50%;
  top: 50%;
  width: 22px;
  height: 1px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(-28deg);
}

.icon-data i::after,
.icon-signal i::after,
.icon-relay i::after,
.icon-archive i::after,
.icon-survey i::after,
.icon-containment i::after {
  left: 50%;
  top: 50%;
  width: 1px;
  height: 22px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(-28deg);
}

.icon-hull i,
.icon-shield i,
.icon-wrench i {
  width: 15px;
  height: 17px;
  border: 1px solid currentColor;
  border-radius: 9px 9px 4px 4px;
}

.icon-hull i::before,
.icon-shield i::before,
.icon-wrench i::before {
  left: 50%;
  top: 3px;
  width: 1px;
  height: 10px;
  background: currentColor;
  transform: translateX(-50%);
}

.icon-heat i {
  width: 11px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 10px 10px 10px 2px;
  transform: translate(-50%, -50%) rotate(20deg);
}

.icon-heat i::before {
  left: 6px;
  top: 3px;
  width: 9px;
  height: 13px;
  border: 1px solid currentColor;
  border-radius: 10px 10px 2px 10px;
}

.icon-credits i,
.icon-reputation i,
.icon-morale i {
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.icon-credits i::before,
.icon-reputation i::before,
.icon-morale i::before {
  left: 50%;
  top: 3px;
  width: 1px;
  height: 10px;
  background: currentColor;
  transform: translateX(-50%);
}

.icon-dock i,
.icon-crate i,
.icon-convoy i,
.icon-fleet i,
.icon-factory i {
  width: 17px;
  height: 10px;
  border: 1px solid currentColor;
  transform: translate(-50%, -50%) skewX(-12deg);
}

.icon-dock i::before,
.icon-crate i::before,
.icon-convoy i::before,
.icon-fleet i::before,
.icon-factory i::before {
  left: 3px;
  right: 3px;
  bottom: -5px;
  height: 1px;
  background: currentColor;
  box-shadow: 6px 0 0 currentColor;
}

.icon-crew i,
.icon-drone i {
  width: 15px;
  height: 15px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.icon-crew i::before,
.icon-drone i::before {
  left: 50%;
  top: 50%;
  width: 22px;
  height: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.icon-crew i::after,
.icon-drone i::after {
  left: 50%;
  top: 50%;
  width: 1px;
  height: 22px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.icon-shadow i,
.icon-ledger i,
.icon-charter i,
.icon-mandate i,
.icon-assembly i,
.icon-broadcast i {
  width: 16px;
  height: 12px;
  border: 1px solid currentColor;
}

.icon-shadow i::before,
.icon-ledger i::before,
.icon-charter i::before,
.icon-mandate i::before,
.icon-assembly i::before,
.icon-broadcast i::before {
  left: 3px;
  right: 3px;
  top: 3px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor;
}

.build-card.available .feature-icon,
.contract-card.available .feature-icon,
.policy-card.available .feature-icon,
.policy-card.active .feature-icon,
.crew-card.active .feature-icon,
.resource-card.healthy-card .feature-icon {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 0 18px color-mix(in srgb, var(--icon-color) 24%, transparent);
}

.build-card.locked .feature-icon,
.contract-card.locked .feature-icon,
.policy-card.locked .feature-icon {
  opacity: 0.62;
}

.status-card {
  min-height: 46px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    var(--panel-strong);
}

.status-card .metric-label > span:not(.feature-icon),
.resource-card .metric-label > span:not(.feature-icon) {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
}

.status-card strong {
  display: block;
  margin-top: 3px;
  color: var(--white);
  font-family: var(--font-data);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.status-card small {
  display: none;
  margin-top: 4px;
  color: var(--dim);
  font-size: 11px;
}

.status-card.critical {
  border-color: rgba(217, 93, 79, 0.55);
  background:
    linear-gradient(180deg, rgba(217, 93, 79, 0.08), transparent),
    var(--panel-strong);
  box-shadow: 0 0 18px rgba(217, 93, 79, 0.12);
}

.status-card.charged {
  border-color: rgba(216, 166, 75, 0.36);
}

#spaceCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.furnace-frame {
  position: absolute;
  z-index: 3;
  inset: 56px 42px 72px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.furnace-frame::before,
.furnace-frame::after {
  content: "";
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
}

.furnace-frame::before {
  width: min(78%, 560px);
  border: 2px solid rgba(216, 166, 75, 0.54);
  background:
    conic-gradient(from 10deg, transparent 0 8deg, rgba(216, 166, 75, 0.42) 9deg 12deg, transparent 13deg 42deg),
    radial-gradient(circle, transparent 0 49%, rgba(255, 198, 96, 0.08) 50%, transparent 61%);
  box-shadow:
    0 0 42px rgba(216, 166, 75, 0.14),
    inset 0 0 38px rgba(216, 166, 75, 0.08);
  animation: furnaceTurn 32s linear infinite;
}

.furnace-frame::after {
  width: min(56%, 390px);
  border: 1px solid rgba(67, 214, 197, 0.34);
  box-shadow:
    0 0 26px rgba(67, 214, 197, 0.16),
    inset 0 0 28px rgba(67, 214, 197, 0.12);
  animation: furnacePulse 2600ms ease-in-out infinite;
}

.furnace-frame span {
  position: absolute;
  width: min(86%, 650px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 249, 237, 0.26), transparent);
  opacity: 0.62;
}

.furnace-frame span:nth-child(1) {
  transform: rotate(34deg);
}

.furnace-frame span:nth-child(2) {
  transform: rotate(-34deg);
}

@keyframes furnaceTurn {
  to {
    transform: rotate(360deg);
  }
}

@keyframes furnacePulse {
  0%,
  100% {
    opacity: 0.58;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1.025);
  }
}

.viewport-hud {
  position: absolute;
  inset: 22px 22px 58px;
  z-index: 3;
  pointer-events: none;
  opacity: 0.86;
}

.viewport-hud span {
  position: absolute;
  width: 78px;
  height: 78px;
  border-color: rgba(240, 180, 78, 0.58);
}

.viewport-hud span:nth-child(1) {
  top: 0;
  left: 0;
  border-top: 1px solid;
  border-left: 1px solid;
}

.viewport-hud span:nth-child(2) {
  top: 0;
  right: 0;
  border-top: 1px solid;
  border-right: 1px solid;
}

.viewport-hud span:nth-child(3) {
  right: 0;
  bottom: 0;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.viewport-readout {
  position: absolute;
  z-index: 4;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid rgba(240, 180, 78, 0.54);
  background:
    linear-gradient(90deg, rgba(240, 180, 78, 0.08), rgba(67, 214, 197, 0.08)),
    rgba(7, 10, 9, 0.84);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.viewport-readout span {
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 800;
}

.viewport-readout strong {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

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

.resource-card {
  position: relative;
  overflow: hidden;
  min-height: 52px;
  padding: 6px;
  border: 1px solid rgba(216, 166, 75, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), transparent),
    linear-gradient(90deg, rgba(216, 166, 75, 0.04), transparent 68%),
    var(--panel-strong);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.resource-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(67, 214, 197, 0.32), transparent);
}

.resource-card.danger-card {
  border-color: rgba(255, 116, 102, 0.38);
  background:
    linear-gradient(180deg, rgba(255, 116, 102, 0.06), transparent),
    var(--panel-strong);
  animation: dangerPanel 1700ms ease-in-out infinite;
}

.resource-card.healthy-card {
  border-color: rgba(142, 212, 106, 0.28);
}

.resource-value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.resource-value strong {
  color: var(--white);
  font-family: var(--font-data);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.resource-value em {
  color: var(--muted);
  font-family: var(--font-data);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.resource-value em.positive {
  color: var(--green);
}

.resource-value em.negative {
  color: var(--coral);
}

.mini-track {
  width: 100%;
  height: 6px;
  margin-top: 7px;
  background: #111412;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mini-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--cyan);
  transition: width 240ms ease;
}

.mini-track.warning span {
  background: var(--amber);
}

.mini-track.danger span {
  background: var(--coral);
}

.crew-grid {
  display: grid;
  gap: 6px;
}

.crew-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: var(--panel-soft);
}

.crew-card.active {
  border-color: rgba(67, 214, 197, 0.28);
  background:
    linear-gradient(90deg, rgba(67, 214, 197, 0.075), transparent 54%),
    var(--panel-soft);
}

.crew-card.emergency-ready {
  border-color: rgba(255, 116, 102, 0.44);
  background:
    linear-gradient(90deg, rgba(255, 116, 102, 0.12), transparent 58%),
    var(--panel-soft);
}

.crew-card h3,
.build-card h3,
.contract-card h3,
.policy-card h3 {
  margin: 0;
  color: var(--white);
  font-size: 12.5px;
  line-height: 1.2;
}

.crew-card p,
.build-card p,
.contract-card p,
.policy-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.26;
}

.stepper {
  display: grid;
  grid-template-columns: 30px 32px 30px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #101312;
}

.stepper button {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  font-size: 20px;
}

.stepper button.emergency-dispatch:not(:disabled) {
  color: var(--coral);
  text-shadow: 0 0 10px rgba(255, 116, 102, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 116, 102, 0.5);
}

.stepper button.emergency-dispatch:hover:not(:disabled) {
  background: rgba(255, 116, 102, 0.14);
}

.stepper output {
  color: var(--white);
  text-align: center;
  font-weight: 900;
}

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

.build-card,
.night-card,
.contract-card,
.policy-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 8px;
  min-height: 164px;
  height: max-content;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  background: var(--panel-soft);
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px));
}

.build-card::before,
.night-card::before,
.contract-card::before,
.policy-card::before,
.resource-card::before,
.status-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 42px;
  height: 1px;
  background: rgba(255, 249, 237, 0.18);
}

.build-card.available::after,
.night-card.available::after,
.contract-card.available::after,
.policy-card.available::after,
.policy-card.active::after {
  content: "";
  position: absolute;
  inset: auto 10px 8px 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(67, 214, 197, 0.42), transparent);
  animation: cardCharge 1800ms ease-in-out infinite;
}

.build-card.available,
.night-card.available,
.contract-card.available {
  border-color: rgba(67, 214, 197, 0.58);
}

.night-card.available {
  border-color: rgba(103, 197, 184, 0.42);
  background:
    linear-gradient(135deg, rgba(103, 197, 184, 0.08), transparent 58%),
    var(--panel-soft);
}

.night-card.selected {
  border-color: rgba(240, 180, 78, 0.48);
  box-shadow: inset 0 0 0 1px rgba(240, 180, 78, 0.1);
}

.contract-card.available {
  border-color: rgba(240, 180, 78, 0.36);
}

.policy-card.available,
.policy-card.active {
  border-color: rgba(165, 140, 255, 0.36);
}

.policy-card.route-policy.available,
.policy-card.route-policy.active {
  border-color: rgba(240, 180, 78, 0.38);
  background:
    linear-gradient(135deg, rgba(240, 180, 78, 0.08), transparent 50%),
    var(--panel-soft);
}

.policy-card.active {
  background:
    linear-gradient(90deg, rgba(165, 140, 255, 0.085), transparent 58%),
    var(--panel-soft);
}

.build-card.locked,
.night-card.locked,
.contract-card.locked,
.policy-card.locked {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.055);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(0, 0, 0, 0.08)),
    rgba(12, 15, 15, 0.9);
  filter: saturate(0.52);
}

.build-card.locked::before,
.night-card.locked::before,
.contract-card.locked::before,
.policy-card.locked::before {
  background: rgba(255, 249, 237, 0.07);
}

.build-card.locked h3,
.night-card.locked h3,
.contract-card.locked h3,
.policy-card.locked h3 {
  color: rgba(255, 249, 237, 0.62);
}

.build-card.locked p,
.night-card.locked p,
.contract-card.locked p,
.policy-card.locked p,
.build-card.locked .cost-badge,
.contract-card.locked .cost-badge,
.policy-card.locked .cost-badge {
  color: rgba(188, 198, 190, 0.56);
}

.build-card:first-child {
  grid-column: 1 / -1;
  min-height: 158px;
}

.build-card:first-child .card-meta {
  align-items: stretch;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 6px;
}

.build-card:first-child .cost-badge {
  flex: 1 1 220px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 3px 6px;
  line-height: 1.35;
  white-space: normal;
}

.build-card:first-child .cost-badge b {
  color: var(--amber);
  font-size: 10px;
  font-weight: 900;
}

.build-card:first-child .card-button {
  min-height: 36px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.build-card .card-meta {
  align-items: stretch;
}

.build-card:not(:first-child) .cost-badge {
  flex: 1 1 100%;
  font-size: 11px;
  line-height: 1.32;
}

.level-badge,
.cost-badge,
.reward-badge,
.risk-badge,
.benefit-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #141716;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  white-space: normal;
}

.level-badge {
  color: var(--amber);
}

.reward-badge {
  color: var(--green);
}

.risk-badge {
  border-color: rgba(240, 180, 78, 0.16);
  color: var(--amber);
  font-size: 10.5px;
}

.benefit-badge {
  flex: 1 1 100%;
  border-color: rgba(67, 214, 197, 0.14);
  background:
    linear-gradient(90deg, rgba(67, 214, 197, 0.08), transparent),
    #111514;
  color: var(--cyan);
  font-size: 10.5px;
}

.route-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  max-width: 100%;
  padding: 3px 6px;
  border: 1px solid rgba(240, 180, 78, 0.2);
  background: rgba(240, 180, 78, 0.08);
  color: var(--amber);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.3;
}

.cooldown-text {
  display: block;
  margin-top: 5px;
  color: var(--amber);
  font-size: 11px;
}

.card-button {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 34px;
  margin-top: 4px;
  border: 1px solid rgba(67, 214, 197, 0.44);
  background: linear-gradient(180deg, #143934, #102c29);
  color: var(--white);
  cursor: pointer;
  font-weight: 750;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
}

.card-button:disabled {
  cursor: default;
  border-color: rgba(255, 255, 255, 0.08);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, #1d2221, #121514);
  color: rgba(188, 198, 190, 0.58);
  opacity: 1;
  text-shadow: none;
  box-shadow: none;
}

.action-hint {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 2px 6px;
  border: 1px solid rgba(255, 249, 237, 0.42);
  background:
    linear-gradient(180deg, rgba(240, 180, 78, 0.24), rgba(67, 214, 197, 0.12)),
    rgba(9, 12, 11, 0.88);
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 950;
  line-height: 1.2;
  box-shadow: 0 0 14px rgba(240, 180, 78, 0.22);
}

.action-hint.locked {
  border-color: rgba(255, 255, 255, 0.13);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 7px),
    rgba(10, 12, 12, 0.9);
  color: rgba(188, 198, 190, 0.72);
  box-shadow: none;
}

.build-card.available,
.contract-card.available,
.policy-card.available {
  border-color: rgba(67, 214, 197, 0.58);
  background:
    linear-gradient(120deg, rgba(67, 214, 197, 0.12), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent),
    var(--panel-soft);
  box-shadow:
    inset 0 0 0 1px rgba(67, 214, 197, 0.14),
    0 0 22px rgba(67, 214, 197, 0.14);
}

.build-card.available .card-button,
.night-card.available .card-button,
.contract-card.available .card-button,
.policy-card.available .card-button {
  border-color: rgba(122, 255, 232, 0.72);
  background:
    linear-gradient(180deg, rgba(103, 255, 230, 0.24), rgba(30, 94, 84, 0.78)),
    #143934;
  color: #fffdf5;
  text-shadow: 0 0 10px rgba(122, 255, 232, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 20px rgba(67, 214, 197, 0.14);
}

.build-card.available:not(:first-child) .card-button,
.night-card.available .card-button,
.contract-card.available .card-button,
.policy-card.available .card-button {
  animation: cardButtonReady 1900ms ease-in-out infinite;
}

.build-card:first-child.available .card-button {
  border-color: rgba(255, 249, 237, 0.72);
  background:
    linear-gradient(180deg, rgba(240, 180, 78, 0.42), rgba(67, 214, 197, 0.2)),
    #173c36;
  color: var(--white);
  text-shadow: 0 0 14px rgba(255, 249, 237, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 28px rgba(240, 180, 78, 0.2);
  animation: ignitionReady 1300ms ease-in-out infinite;
}

.build-card:first-child.available {
  border-color: rgba(255, 249, 237, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(240, 180, 78, 0.18),
    0 0 38px rgba(240, 180, 78, 0.2);
}

.card-button.contract {
  border-color: rgba(240, 180, 78, 0.48);
  background: linear-gradient(180deg, #342817, #2a2117);
}

.contract-card.available .card-button.contract {
  border-color: rgba(255, 205, 99, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 205, 99, 0.26), rgba(84, 58, 24, 0.82)),
    #342817;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 22px rgba(240, 180, 78, 0.14);
}

.card-button.policy {
  border-color: rgba(165, 140, 255, 0.48);
  background: linear-gradient(180deg, #2c2850, #201f3d);
}

.policy-card.available .card-button.policy {
  border-color: rgba(196, 180, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(196, 180, 255, 0.24), rgba(64, 53, 120, 0.82)),
    #2c2850;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 22px rgba(165, 140, 255, 0.14);
}

.card-button.contract:disabled,
.card-button.policy:disabled,
.card-button.night:disabled,
.policy-card.available .card-button.policy:disabled {
  border-color: rgba(255, 255, 255, 0.08);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, #1d2221, #121514);
  color: rgba(188, 198, 190, 0.58);
  text-shadow: none;
  box-shadow: none;
  animation: none;
  filter: none;
}

.briefing-panel {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  min-height: 70px;
  padding: 8px;
  border: 1px solid rgba(67, 214, 197, 0.28);
  background:
    linear-gradient(90deg, rgba(67, 214, 197, 0.1), transparent 68%),
    rgba(8, 15, 14, 0.92);
  box-shadow: inset 0 0 24px rgba(67, 214, 197, 0.045);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.briefing-panel.fresh {
  border-color: rgba(240, 180, 78, 0.8);
  box-shadow:
    inset 0 0 0 1px rgba(240, 180, 78, 0.14),
    0 0 28px rgba(240, 180, 78, 0.15);
  animation: briefingWake 1500ms ease-out;
}

.briefing-panel.urgent {
  border-color: rgba(255, 116, 102, 0.82);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 116, 102, 0.18), transparent 34%),
    linear-gradient(90deg, rgba(217, 93, 79, 0.18), transparent 70%),
    rgba(18, 12, 11, 0.94);
  box-shadow:
    inset 0 0 0 1px rgba(255, 116, 102, 0.14),
    0 0 30px rgba(217, 93, 79, 0.16);
}

.briefing-countdown {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 1px solid rgba(216, 166, 75, 0.28);
  background:
    radial-gradient(circle at 50% 32%, rgba(216, 166, 75, 0.18), transparent 60%),
    rgba(255, 255, 255, 0.035);
}

.briefing-countdown span,
.briefing-countdown em {
  color: var(--dim);
  font-family: var(--font-data);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.briefing-countdown strong {
  color: var(--white);
  font-family: var(--font-data);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 18px rgba(216, 166, 75, 0.24);
}

.briefing-copy {
  min-width: 0;
  align-self: center;
}

.briefing-copy strong {
  display: block;
  color: var(--white);
  font-size: 15px;
  line-height: 1.25;
}

.briefing-copy p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.briefing-alerts {
  display: grid;
  gap: 5px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.briefing-alerts li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  padding: 7px;
  border: 1px solid rgba(67, 214, 197, 0.15);
  background:
    linear-gradient(90deg, rgba(67, 214, 197, 0.055), transparent 68%),
    rgba(255, 255, 255, 0.03);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
}

.briefing-alerts li.new {
  border-color: rgba(240, 180, 78, 0.72);
  background:
    linear-gradient(90deg, rgba(240, 180, 78, 0.16), transparent 72%),
    rgba(27, 20, 12, 0.94);
  box-shadow:
    inset 4px 0 0 rgba(240, 180, 78, 0.78),
    inset 0 0 18px rgba(240, 180, 78, 0.1),
    0 0 18px rgba(240, 180, 78, 0.12);
}

.briefing-alerts li.critical {
  border-color: rgba(255, 116, 102, 0.72);
  background:
    linear-gradient(90deg, rgba(217, 93, 79, 0.18), transparent 72%),
    rgba(29, 13, 12, 0.95);
  box-shadow:
    inset 4px 0 0 rgba(255, 116, 102, 0.82),
    0 0 20px rgba(217, 93, 79, 0.14);
}

.briefing-alerts li.warn {
  border-color: rgba(240, 180, 78, 0.58);
  box-shadow: inset 4px 0 0 rgba(240, 180, 78, 0.58);
}

.briefing-alerts li.good {
  border-color: rgba(146, 196, 107, 0.34);
}

.briefing-alerts li > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.briefing-alerts li.critical > span {
  color: var(--coral);
}

.briefing-alerts li.warn > span,
.briefing-alerts li.new > span {
  color: var(--amber);
}

.briefing-alerts li.good > span {
  color: var(--green);
}

.briefing-alerts strong {
  display: block;
  color: var(--white);
  font-size: 12.5px;
  line-height: 1.3;
}

.briefing-alerts p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.28;
}

.event-log {
  display: grid;
  gap: 5px;
  max-height: 100%;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.event-log li {
  position: relative;
  padding: 7px 9px 7px 11px;
  border-left: 4px solid var(--line-bright);
  background:
    linear-gradient(90deg, rgba(67, 214, 197, 0.04), transparent 62%),
    var(--panel-soft);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.36;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
  white-space: normal;
}

.event-log li strong {
  display: inline-block;
  margin-right: 6px;
  color: var(--white);
}

.event-log li:first-child {
  border-color: rgba(67, 214, 197, 0.68);
  background:
    linear-gradient(90deg, rgba(67, 214, 197, 0.1), transparent 64%),
    var(--panel-soft);
}

.event-log li.good {
  border-color: var(--green);
}

.event-log li.warn {
  border-color: var(--amber);
}

.event-log li.bad {
  border-color: var(--coral);
}

.event-log li.info {
  border-color: var(--cyan);
}

@keyframes briefingWake {
  0% {
    box-shadow:
      inset 0 0 24px rgba(67, 214, 197, 0.045),
      0 0 0 rgba(216, 166, 75, 0);
  }
  35% {
    box-shadow:
      inset 0 0 24px rgba(67, 214, 197, 0.045),
      0 0 30px rgba(216, 166, 75, 0.22);
  }
  100% {
    box-shadow:
      inset 0 0 24px rgba(67, 214, 197, 0.045),
      0 0 0 rgba(216, 166, 75, 0);
  }
}

.status-card,
.resource-card,
.crew-card,
.build-card,
.contract-card,
.policy-card {
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.crew-card.active,
.policy-card.active,
.resource-card.danger-card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.build-card.available {
  border-color: rgba(67, 214, 197, 0.58);
  background:
    linear-gradient(120deg, rgba(67, 214, 197, 0.12), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent),
    var(--panel-soft);
  box-shadow:
    inset 0 0 0 1px rgba(67, 214, 197, 0.14),
    0 0 22px rgba(67, 214, 197, 0.14);
}

.contract-card.available {
  border-color: rgba(240, 180, 78, 0.52);
  background:
    linear-gradient(120deg, rgba(240, 180, 78, 0.13), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent),
    var(--panel-soft);
  box-shadow:
    inset 0 0 0 1px rgba(240, 180, 78, 0.12),
    0 0 22px rgba(240, 180, 78, 0.12);
}

.policy-card.available {
  border-color: rgba(165, 140, 255, 0.52);
  background:
    linear-gradient(120deg, rgba(165, 140, 255, 0.12), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent),
    var(--panel-soft);
  box-shadow:
    inset 0 0 0 1px rgba(165, 140, 255, 0.12),
    0 0 22px rgba(165, 140, 255, 0.12);
}

.build-card.available:hover,
.contract-card.available:hover,
.policy-card.available:hover,
.crew-card.active:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 12px 30px rgba(0, 0, 0, 0.24),
    0 0 28px rgba(67, 214, 197, 0.16);
}

@keyframes crisisPulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 rgba(255, 116, 102, 0);
  }
  50% {
    box-shadow: inset 0 0 18px rgba(255, 116, 102, 0.1);
  }
}

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

@keyframes cardCharge {
  0%,
  100% {
    opacity: 0.22;
    transform: scaleX(0.62);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes cardButtonReady {
  0%,
  100% {
    filter: brightness(1);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.14),
      0 0 16px rgba(67, 214, 197, 0.1);
  }
  50% {
    filter: brightness(1.12);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      0 0 26px rgba(67, 214, 197, 0.22);
  }
}

@keyframes ignitionReady {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 0 20px rgba(240, 180, 78, 0.14);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 0 34px rgba(240, 180, 78, 0.32),
      0 0 24px rgba(67, 214, 197, 0.18);
  }
}

@keyframes dangerPanel {
  0%,
  100% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.045),
      0 0 26px rgba(255, 116, 102, 0.16);
  }
}

.history-list {
  display: grid;
  gap: 7px;
  max-height: 96px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.log-sector:not(.expanded) .event-log li:nth-child(n + 2) {
  display: none;
}

.log-sector.expanded .event-log {
  max-height: calc(100% - 36px);
  padding-right: 4px;
}

.log-sector.expanded .event-log li {
  padding: 9px 10px 9px 12px;
}

.history-sector.expanded .history-list {
  max-height: calc(100% - 44px);
  padding-right: 4px;
}

.history-list li {
  display: grid;
  gap: 5px;
  padding: 8px 9px;
  border-left: 4px solid var(--line-bright);
  background:
    linear-gradient(90deg, rgba(240, 180, 78, 0.045), transparent 64%),
    var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.history-list li:hover,
.history-list li:focus-visible {
  outline: none;
  border-color: var(--amber);
  background:
    linear-gradient(90deg, rgba(240, 180, 78, 0.09), transparent 64%),
    rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 22px rgba(240, 180, 78, 0.14);
  transform: translateY(-1px);
}

.history-sector:not(.expanded) .history-list li:nth-child(n + 2) {
  display: none;
}

.history-sector:not(.expanded) .history-list li small:nth-of-type(n + 2),
.history-sector:not(.expanded) .history-list li em {
  display: none;
}

.history-sector.expanded .history-list li {
  gap: 6px;
  padding: 10px 11px;
}

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

.history-list li.good {
  border-color: var(--green);
}

.history-list li.bad {
  border-color: var(--coral);
}

.history-list strong {
  display: block;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.history-list span,
.history-list small {
  display: block;
  color: var(--dim);
}

.history-list span {
  flex: 0 0 auto;
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.history-cause {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.history-list em {
  display: block;
  padding: 7px 8px;
  border: 1px solid rgba(67, 214, 197, 0.16);
  background: rgba(67, 214, 197, 0.055);
  color: var(--cyan);
  font-size: 11.5px;
  font-style: normal;
  line-height: 1.4;
}

.history-review {
  display: grid;
  gap: 14px;
  color: var(--muted);
}

.history-review-lead {
  display: grid;
  gap: 7px;
}

.history-review-lead strong {
  display: inline-flex;
  width: max-content;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(240, 180, 78, 0.35);
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 12px;
}

.history-review.win .history-review-lead strong {
  border-color: rgba(142, 212, 106, 0.46);
  color: var(--green);
}

.history-review.loss .history-review-lead strong {
  border-color: rgba(255, 116, 102, 0.5);
  color: var(--coral);
}

.history-review-lead p {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.history-review-lead span {
  color: var(--dim);
  font-size: 12px;
}

.history-review-stats {
  margin-top: 0;
}

.history-review-stats span {
  min-height: 58px;
}

.history-review-blocks {
  margin-top: 0;
}

.history-review-blocks p {
  background:
    linear-gradient(90deg, rgba(67, 214, 197, 0.055), transparent 76%),
    rgba(255, 255, 255, 0.035);
  font-size: 13px;
}

.detail-panel.history-detail {
  width: min(860px, calc(100vw - 28px));
}

.modal,
.detail-overlay,
.event-overlay,
.feedback-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 5, 5, 0.72);
  z-index: 20;
}

.modal.hidden,
.detail-overlay.hidden,
.event-overlay.hidden,
.feedback-overlay.hidden {
  display: none;
}

.detail-overlay {
  z-index: 24;
  background:
    radial-gradient(circle at 50% 20%, rgba(67, 214, 197, 0.12), transparent 34%),
    rgba(4, 5, 5, 0.78);
}

.detail-panel {
  width: min(620px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(103, 197, 184, 0.5);
  background:
    linear-gradient(135deg, rgba(103, 197, 184, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 130px),
    rgba(9, 14, 13, 0.98);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.64),
    0 0 46px rgba(67, 214, 197, 0.16);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.detail-heading {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(103, 197, 184, 0.18);
}

.detail-heading span {
  grid-column: 1;
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
}

.detail-heading h2 {
  grid-column: 1;
  margin: 0;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}

.detail-heading .icon-button {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: start;
  width: 34px;
  min-width: 34px;
  height: 34px;
  color: var(--cyan);
}

.detail-body {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px 18px;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-item {
  position: relative;
  overflow: hidden;
  padding: 11px 12px;
  border: 1px solid rgba(103, 197, 184, 0.22);
  background:
    linear-gradient(90deg, rgba(103, 197, 184, 0.08), transparent 72%),
    rgba(14, 18, 16, 0.94);
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 0 100%);
}

.detail-item.consequence-detail {
  border-color: rgba(240, 180, 78, 0.38);
  background:
    linear-gradient(90deg, rgba(240, 180, 78, 0.12), transparent 72%),
    rgba(19, 17, 12, 0.96);
}

.detail-item.countdown-detail {
  border-color: rgba(240, 180, 78, 0.46);
  background:
    radial-gradient(circle at 100% 0%, rgba(240, 180, 78, 0.14), transparent 38%),
    linear-gradient(90deg, rgba(240, 180, 78, 0.12), transparent 74%),
    rgba(19, 15, 10, 0.97);
}

.detail-item.countdown-detail b {
  color: var(--amber);
}

.countdown-choice-preview {
  margin-top: 10px;
  border: 1px solid rgba(240, 180, 78, 0.24);
  background: rgba(255, 249, 237, 0.035);
}

.countdown-choice-preview summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 8px 10px;
  color: var(--amber);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 950;
  list-style: none;
}

.countdown-choice-preview summary::-webkit-details-marker {
  display: none;
}

.countdown-choice-preview summary::after {
  content: "+";
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(240, 180, 78, 0.32);
  color: var(--cyan);
  font-family: var(--font-data);
}

.countdown-choice-preview[open] summary::after {
  content: "-";
}

.countdown-choice-preview summary:hover {
  background: rgba(240, 180, 78, 0.08);
}

.countdown-choice-preview > p {
  margin: 0;
  padding: 0 10px 8px;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.35;
}

.countdown-choice-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 10px 10px;
  list-style: none;
}

.countdown-choice-list li {
  padding: 8px;
  border: 1px solid rgba(255, 249, 237, 0.12);
  background: rgba(255, 249, 237, 0.045);
}

.countdown-choice-list span,
.countdown-choice-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.countdown-choice-list small {
  color: var(--dim);
}

.detail-item.critical {
  border-color: rgba(255, 116, 102, 0.56);
  background:
    linear-gradient(90deg, rgba(217, 93, 79, 0.18), transparent 74%),
    rgba(25, 12, 11, 0.97);
}

.detail-item.warn {
  border-color: rgba(240, 180, 78, 0.48);
}

.detail-item.good {
  border-color: rgba(142, 212, 106, 0.38);
}

.detail-item-head {
  display: flex;
  gap: 8px;
  align-items: center;
}

.detail-item-head em {
  display: inline-grid;
  min-width: 24px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(240, 180, 78, 0.36);
  color: var(--amber);
  font-family: var(--font-data);
  font-style: normal;
  font-weight: 900;
}

.detail-item strong {
  display: block;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
}

.detail-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.event-overlay {
  z-index: 21;
  background:
    radial-gradient(circle at 50% 18%, rgba(216, 166, 75, 0.18), transparent 30%),
    radial-gradient(circle at 50% 58%, rgba(0, 0, 0, 0.42), transparent 42%),
    rgba(4, 5, 5, 0.84);
  background-size: 100% 6px, auto, auto;
  animation: overlayWake 260ms ease-out both;
}

.event-panel {
  position: relative;
  overflow: hidden;
  width: min(460px, 100%);
  min-height: 620px;
  padding: 26px 24px 24px;
  border: 1px solid rgba(216, 166, 75, 0.72);
  background:
    radial-gradient(circle at 50% 18%, rgba(216, 166, 75, 0.22), transparent 20%),
    radial-gradient(ellipse at 50% 30%, rgba(67, 214, 197, 0.09), transparent 36%),
    linear-gradient(90deg, transparent 0 18%, rgba(216, 166, 75, 0.06) 18.2% 18.6%, transparent 19% 81%, rgba(216, 166, 75, 0.06) 81.2% 81.6%, transparent 82%),
    linear-gradient(180deg, rgba(255, 249, 237, 0.045), transparent 120px),
    #15140f;
  box-shadow:
    0 34px 110px rgba(0, 0, 0, 0.66),
    0 0 70px rgba(216, 166, 75, 0.13),
    inset 0 0 0 1px rgba(255, 249, 237, 0.04);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  animation: panelEnter 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.event-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 116px, transparent 0 58px, rgba(216, 166, 75, 0.24) 59px 60px, transparent 61px),
    conic-gradient(from 0deg at 50% 116px, transparent 0 18deg, rgba(216, 166, 75, 0.18) 19deg 22deg, transparent 23deg 68deg),
    linear-gradient(105deg, transparent 0%, rgba(255, 249, 237, 0.06) 50%, transparent 62%);
  transform: translateX(-72%);
  animation: panelSweep 1200ms ease-out 80ms both;
}

.event-panel::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 64px;
  left: 50%;
  width: 118px;
  height: 118px;
  border: 1px solid rgba(216, 166, 75, 0.46);
  background:
    radial-gradient(circle, rgba(255, 249, 237, 0.14) 0 7px, transparent 8px),
    linear-gradient(90deg, transparent 45%, rgba(67, 214, 197, 0.26) 46% 54%, transparent 55%),
    linear-gradient(0deg, transparent 45%, rgba(216, 166, 75, 0.24) 46% 54%, transparent 55%),
    rgba(7, 10, 9, 0.8);
  box-shadow:
    0 0 26px rgba(216, 166, 75, 0.16),
    inset 0 0 24px rgba(67, 214, 197, 0.12);
  transform: translateX(-50%) rotate(45deg);
}

.event-panel > * {
  position: relative;
  z-index: 1;
}

.event-panel.good {
  border-color: rgba(124, 214, 122, 0.62);
  background:
    linear-gradient(180deg, rgba(124, 214, 122, 0.08), transparent 150px),
    rgba(20, 25, 20, 0.98);
}

.event-panel.warn,
.event-panel.info {
  border-color: rgba(240, 180, 78, 0.62);
}

.event-panel.bad {
  border-color: rgba(255, 106, 91, 0.68);
}

.event-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  min-width: 96px;
  padding: 0 8px;
  border: 1px solid rgba(216, 166, 75, 0.46);
  background: #0d0f0d;
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 900;
  margin: 0 auto;
}

.event-panel.good .event-kicker {
  border-color: rgba(124, 214, 122, 0.36);
  color: var(--green);
}

.event-panel.warn .event-kicker,
.event-panel.info .event-kicker {
  border-color: rgba(240, 180, 78, 0.38);
  color: var(--amber);
}

.event-panel.bad .event-kicker {
  border-color: rgba(255, 106, 91, 0.42);
  color: var(--coral);
}

.event-panel h2 {
  margin-top: 156px;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-wrap: balance;
}

.event-panel p {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.68;
  text-align: center;
}

.event-choices {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.event-choice {
  width: 100%;
  padding: 15px 15px;
  border: 1px solid rgba(216, 166, 75, 0.28);
  background:
    linear-gradient(90deg, rgba(67, 214, 197, 0.08) 0 3px, transparent 3px),
    linear-gradient(90deg, rgba(216, 166, 75, 0.07), transparent 70%),
    rgba(255, 255, 255, 0.035);
  color: var(--white);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.event-choice:hover:not(:disabled) {
  border-color: rgba(216, 166, 75, 0.58);
  background:
    linear-gradient(90deg, rgba(255, 249, 237, 0.18) 0 3px, transparent 3px),
    linear-gradient(90deg, rgba(216, 166, 75, 0.13), transparent 78%),
    rgba(255, 255, 255, 0.055);
  transform: translateX(3px);
  box-shadow: 0 0 26px rgba(216, 166, 75, 0.16);
}

.event-choice:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.event-choice.emergency {
  border-color: rgba(217, 93, 79, 0.54);
  background:
    linear-gradient(90deg, rgba(217, 93, 79, 0.16) 0 3px, transparent 3px),
    linear-gradient(135deg, rgba(217, 93, 79, 0.14), rgba(216, 166, 75, 0.05)),
    rgba(20, 13, 12, 0.92);
}

.event-choice.emergency:hover:not(:disabled) {
  border-color: rgba(217, 93, 79, 0.82);
  box-shadow: 0 0 24px rgba(217, 93, 79, 0.14);
}

.event-choice strong,
.event-choice span,
.event-choice small {
  display: block;
}

.event-choice span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.event-choice small {
  margin-top: 6px;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.35;
}

.event-panel button {
  margin-top: 18px;
  margin-left: auto;
}

.urgent-overlay {
  position: fixed;
  inset: 0;
  z-index: 26;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 116, 102, 0.18), transparent 34%),
    radial-gradient(circle at 50% 64%, rgba(0, 0, 0, 0.48), transparent 42%),
    repeating-linear-gradient(0deg, rgba(255, 116, 102, 0.045) 0 1px, transparent 1px 7px),
    rgba(4, 5, 5, 0.9);
  animation: overlayWake 220ms ease-out both;
}

.urgent-overlay.hidden {
  display: none;
}

.urgent-panel {
  position: relative;
  overflow: hidden;
  width: min(620px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid rgba(255, 116, 102, 0.78);
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 116, 102, 0.2), transparent 27%),
    linear-gradient(180deg, rgba(255, 249, 237, 0.04), transparent 120px),
    rgba(25, 12, 11, 0.98);
  box-shadow:
    0 34px 120px rgba(0, 0, 0, 0.72),
    0 0 76px rgba(217, 93, 79, 0.2),
    inset 0 0 0 1px rgba(255, 249, 237, 0.04);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.urgent-panel.warning {
  animation: urgentPulse 740ms ease-in-out infinite;
}

.urgent-kicker {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(255, 116, 102, 0.54);
  background: rgba(15, 7, 6, 0.92);
  color: var(--coral);
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 950;
}

.urgent-timer {
  --progress: 1;
  position: relative;
  display: grid;
  width: 128px;
  height: 128px;
  place-items: center;
  margin: 14px auto 12px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(12, 8, 7, 0.98) 0 56%, transparent 57%),
    conic-gradient(var(--coral) calc(var(--progress) * 1turn), rgba(255, 255, 255, 0.09) 0);
  box-shadow:
    0 0 34px rgba(255, 116, 102, 0.2),
    inset 0 0 24px rgba(0, 0, 0, 0.34);
}

.urgent-timer strong {
  color: var(--white);
  font-family: var(--font-data);
  font-size: 42px;
  font-weight: 900;
  line-height: 0.9;
}

.urgent-timer span {
  position: absolute;
  bottom: 28px;
  color: var(--muted);
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 900;
}

.urgent-panel h2 {
  margin: 10px 0 0;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.08;
  text-align: center;
}

.urgent-panel p {
  margin: 12px auto 0;
  max-width: 520px;
  color: var(--muted);
  line-height: 1.58;
  text-align: center;
}

.urgent-consequence {
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 116, 102, 0.34);
  background:
    linear-gradient(90deg, rgba(217, 93, 79, 0.16), transparent),
    rgba(18, 9, 8, 0.92);
  color: var(--amber);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.4;
}

.urgent-choices {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.urgent-choice {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(255, 116, 102, 0.3);
  background:
    linear-gradient(90deg, rgba(67, 214, 197, 0.08) 0 3px, transparent 3px),
    linear-gradient(90deg, rgba(255, 116, 102, 0.08), transparent 78%),
    rgba(255, 255, 255, 0.035);
  color: var(--white);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.urgent-choice:hover:not(:disabled),
.urgent-choice:focus-visible {
  border-color: rgba(255, 116, 102, 0.72);
  box-shadow: 0 0 26px rgba(217, 93, 79, 0.16);
  transform: translateX(3px);
}

.urgent-choice:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.urgent-choice strong {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
}

.urgent-choice span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.36;
}

.urgent-choice small {
  color: var(--dim);
  font-size: 11px;
  line-height: 1.34;
}

@keyframes urgentPulse {
  0%,
  100% {
    box-shadow:
      0 34px 120px rgba(0, 0, 0, 0.72),
      0 0 54px rgba(217, 93, 79, 0.16);
  }
  50% {
    box-shadow:
      0 34px 120px rgba(0, 0, 0, 0.72),
      0 0 92px rgba(255, 116, 102, 0.34);
  }
}

.feedback-overlay {
  z-index: 22;
  overflow-y: auto;
  background:
    radial-gradient(circle at 52% 18%, rgba(240, 180, 78, 0.1), transparent 32%),
    rgba(4, 5, 5, 0.78);
}

.invite-overlay {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 24%, rgba(67, 214, 197, 0.12), transparent 34%),
    rgba(4, 5, 5, 0.82);
}

.invite-overlay.hidden {
  display: none;
}

.invite-panel {
  width: min(440px, 100%);
  padding: 20px;
  border: 1px solid rgba(67, 214, 197, 0.58);
  background: rgba(22, 24, 21, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
}

.invite-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(240, 180, 78, 0.34);
  background: #111513;
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 900;
}

.invite-panel h2 {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
}

.invite-panel p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.invite-form {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.invite-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invite-form input {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #101312;
  color: var(--white);
  font: inherit;
  letter-spacing: 0;
  padding: 0 12px;
  text-transform: uppercase;
}

.invite-form input:focus {
  outline: 2px solid rgba(67, 214, 197, 0.66);
  outline-offset: 2px;
}

.invite-message {
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.invite-message.error {
  color: var(--coral);
}

.invite-message.good {
  color: var(--green);
}

.modal-panel {
  position: relative;
  overflow: hidden;
  width: min(560px, 100%);
  padding: 20px;
  border: 1px solid rgba(240, 180, 78, 0.45);
  background: rgba(29, 28, 24, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: panelEnter 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal-panel.win {
  border-color: rgba(124, 214, 122, 0.66);
  background:
    radial-gradient(circle at 50% 0%, rgba(124, 214, 122, 0.2), transparent 28%),
    linear-gradient(180deg, rgba(124, 214, 122, 0.08), transparent 150px),
    rgba(23, 29, 23, 0.98);
  box-shadow:
    0 24px 90px rgba(0, 0, 0, 0.55),
    0 0 70px rgba(124, 214, 122, 0.14);
}

.modal-panel.loss {
  border-color: rgba(255, 106, 91, 0.72);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 106, 91, 0.2), transparent 30%),
    linear-gradient(180deg, rgba(255, 106, 91, 0.1), transparent 150px),
    rgba(31, 23, 22, 0.98);
  box-shadow:
    0 24px 90px rgba(0, 0, 0, 0.55),
    0 0 70px rgba(255, 106, 91, 0.14);
}

.modal-panel.win::before,
.modal-panel.loss::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 249, 237, 0.08) 50%, transparent 62%);
  transform: translateX(-78%);
  animation: panelSweep 1500ms ease-out 120ms both;
}

.modal-panel h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
}

@keyframes overlayWake {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes panelEnter {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes panelSweep {
  0% {
    transform: translateX(-78%);
  }
  100% {
    transform: translateX(78%);
  }
}

.modal-text {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.55;
}

.modal-text strong {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(240, 180, 78, 0.35);
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 12px;
}

.modal-panel.win .modal-text strong {
  border-color: rgba(124, 214, 122, 0.38);
  color: var(--green);
}

.modal-panel.loss .modal-text strong {
  border-color: rgba(255, 106, 91, 0.42);
  color: var(--coral);
}

.modal-text span,
.modal-text em {
  display: block;
  margin-top: 7px;
  font-style: normal;
}

.modal-text em {
  color: var(--dim);
  font-size: 12px;
}

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

.outcome-stats span {
  min-height: 42px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font-family: var(--font-data);
  font-weight: 900;
}

.outcome-stats b {
  display: block;
  margin-bottom: 3px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.outcome-review {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.outcome-review p {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.outcome-review b {
  display: block;
  margin-bottom: 4px;
  color: var(--white);
  font-size: 11px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.feedback-panel {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid rgba(67, 214, 197, 0.48);
  background: rgba(22, 24, 21, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
}

.feedback-panel h2 {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
}

.feedback-panel p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.feedback-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.feedback-rating,
.feedback-tags {
  margin: 0;
  padding: 0;
  border: 0;
}

.feedback-rating legend,
.feedback-tags legend,
.feedback-field span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.feedback-rating {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.feedback-rating legend,
.feedback-tags legend {
  grid-column: 1 / -1;
}

.feedback-rating label {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #101312;
  color: var(--text);
  font-family: var(--font-data);
  font-weight: 800;
  cursor: pointer;
}

.feedback-rating label:has(input:checked) {
  border-color: rgba(67, 214, 197, 0.74);
  background: rgba(21, 69, 63, 0.76);
  color: var(--white);
}

.feedback-rating input,
.feedback-tags input {
  accent-color: var(--cyan);
}

.feedback-rating input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.feedback-field {
  display: grid;
  gap: 8px;
}

.feedback-field select,
.feedback-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #101312;
  color: var(--white);
  font: inherit;
}

.feedback-field select {
  height: 42px;
  padding: 0 12px;
}

.feedback-field textarea {
  min-height: 112px;
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.5;
}

.feedback-field select:focus,
.feedback-field textarea:focus {
  outline: 2px solid rgba(67, 214, 197, 0.66);
  outline-offset: 2px;
}

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

.feedback-tags label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(16, 19, 18, 0.86);
  color: var(--text);
  font-size: 13px;
}

.feedback-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
}

.feedback-message.good {
  color: var(--green);
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.critical {
  color: var(--coral) !important;
}

.healthy {
  color: var(--green) !important;
}

.charged {
  color: var(--cyan) !important;
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 5, 5, 0.36);
  overflow-y: auto;
  pointer-events: none;
}

.tutorial-overlay.hidden {
  display: none;
}

.tutorial-panel {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid rgba(67, 214, 197, 0.68);
  background: rgba(22, 24, 21, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  pointer-events: auto;
}

.tutorial-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: #101312;
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 800;
}

.tutorial-panel h2 {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
}

.tutorial-panel p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.tutorial-task {
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid rgba(240, 180, 78, 0.34);
  background:
    linear-gradient(90deg, rgba(240, 180, 78, 0.08), transparent 70%),
    #111513;
  color: var(--white);
  font-size: 13px;
  line-height: 1.45;
}

.tutorial-task::before {
  content: "当前任务";
  display: block;
  margin-bottom: 4px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
}

.tutorial-task.complete {
  border-color: rgba(142, 212, 106, 0.5);
  background:
    linear-gradient(90deg, rgba(142, 212, 106, 0.1), transparent 70%),
    #111513;
}

.tutorial-task.complete::before {
  content: "已完成";
  color: var(--green);
}

.tutorial-actions {
  position: sticky;
  bottom: -1px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(22, 24, 21, 0), rgba(22, 24, 21, 0.98) 24%);
  flex-wrap: wrap;
}

.dev-tools {
  position: fixed;
  left: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  width: min(420px, calc(100vw - 24px));
  color: var(--text);
  font-family: var(--font-body);
  pointer-events: none;
}

.dev-tools-toggle,
.dev-tools-panel {
  pointer-events: auto;
}

.dev-tools-toggle {
  min-width: 58px;
  min-height: 34px;
  border: 1px solid rgba(255, 249, 237, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 249, 237, 0.16), rgba(240, 180, 78, 0.12)),
    rgba(26, 20, 12, 0.96);
  color: var(--amber);
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 0 18px rgba(240, 180, 78, 0.24);
}

.dev-tools-panel {
  display: grid;
  gap: 8px;
  max-height: min(72vh, 620px);
  margin-top: 6px;
  padding: 10px;
  overflow: auto;
  border: 1px solid rgba(67, 214, 197, 0.5);
  background:
    linear-gradient(135deg, rgba(67, 214, 197, 0.12), rgba(240, 180, 78, 0.08)),
    rgba(9, 13, 12, 0.98);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 0 36px rgba(67, 214, 197, 0.16);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.dev-tools.collapsed .dev-tools-panel {
  display: none;
}

.dev-tools-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dev-tools-head strong {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 16px;
}

.dev-tools-head span,
.dev-tools-note,
.dev-tools-subhead {
  color: var(--muted);
  font-size: 11px;
}

.dev-tools-subhead {
  color: var(--cyan);
  font-weight: 900;
}

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

.dev-tools label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.dev-tools label span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-tools input {
  width: 100%;
  min-width: 0;
  height: 28px;
  border: 1px solid rgba(67, 214, 197, 0.26);
  background: rgba(6, 10, 9, 0.92);
  color: var(--white);
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

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

.dev-tools-actions button {
  min-height: 32px;
  border: 1px solid rgba(240, 180, 78, 0.36);
  background:
    linear-gradient(180deg, rgba(240, 180, 78, 0.14), transparent),
    rgba(22, 18, 12, 0.94);
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
}

@media (min-width: 1800px) {
  :root {
    --layout-gap: 10px;
    --shell-pad-x: clamp(10px, 0.85vw, 22px);
  }

  .dashboard {
    grid-template-columns:
      minmax(340px, 430px)
      minmax(860px, 1fr)
      minmax(340px, 460px);
  }

  .dashboard-column-center {
    grid-template-rows: minmax(360px, min(44vh, 560px)) minmax(0, 1fr);
  }

  .history-sector.expanded {
    width: min(720px, 100%);
  }
}

@media (min-width: 2200px) {
  .game-shell {
    width: min(100vw, 2260px);
    max-width: 2260px;
  }

  .dashboard {
    grid-template-columns:
      minmax(360px, 460px)
      minmax(920px, 1120px)
      minmax(360px, 480px);
    justify-content: center;
  }
}

@media (max-width: 1380px) {
  :root {
    --layout-gap: 7px;
    --shell-pad-x: 7px;
  }

  .dashboard {
    grid-template-columns:
      minmax(282px, 0.78fr)
      minmax(560px, 1.42fr)
      minmax(282px, 0.78fr);
  }

  .topbar {
    min-height: 54px;
    gap: 8px;
    padding: 6px 8px;
  }

  .top-actions {
    gap: 7px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  h1 {
    font-size: 24px;
  }

  .primary-action {
    min-width: 108px;
    padding: 0 11px;
  }

  .secondary-action.compact {
    min-width: 86px;
  }

  .icon-button {
    width: 38px;
  }

  .dashboard-column-center {
    grid-template-rows: minmax(300px, min(38vh, 430px)) minmax(0, 1fr);
  }

  .action-tabs {
    grid-template-columns: repeat(5, minmax(58px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .action-tab {
    min-width: 58px;
  }

  .build-grid,
  .night-grid,
  .contract-grid,
  .policy-grid {
    grid-template-columns: 1fr;
  }

  .build-card,
  .night-card,
  .contract-card,
  .policy-card {
    min-height: 132px;
  }

  .briefing-panel {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .briefing-countdown strong {
    font-size: 24px;
  }
}

@media (max-width: 1180px) {
  .game-shell {
    width: 100vw;
    max-width: none;
    margin: 0;
  }

  .dashboard {
    grid-template-columns: 286px 560px 300px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 3px;
  }

  .dashboard-column-right {
    grid-column: auto;
    grid-template-columns: none;
  }

  .log-sector {
    grid-column: auto;
  }

  .goal-dock {
    grid-template-columns: minmax(82px, auto) minmax(84px, 120px) minmax(0, 1fr);
  }

  .goal-dock-list li {
    max-width: 148px;
  }

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

  .viewport-hud span {
    width: 58px;
    height: 58px;
  }

  .viewport-readout {
    left: 12px;
    right: 12px;
    bottom: 12px;
    min-height: 38px;
    padding: 9px 10px;
  }
}

@media (max-width: 820px) {
  .game-shell {
    width: 100vw;
    max-width: none;
    padding-top: 10px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 64px 42px 42px minmax(0, 1fr);
    width: 100%;
    justify-content: stretch;
    gap: 6px;
  }

  .sol-chip {
    grid-column: 1;
    grid-row: 1;
    justify-content: center;
    padding: 0 8px;
  }

  .goal-dock {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 6px;
    margin: 0 8px 8px;
  }

  .goal-dock-status {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
  }

  .goal-dock-status strong {
    text-align: right;
  }

  .goal-dock-list {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .goal-dock-list li {
    flex: 0 0 auto;
    max-width: 160px;
  }

  .ignition-banner {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 8px;
    margin: 0 8px 8px;
    padding: 8px;
  }

  .ignition-sigil {
    width: 42px;
    height: 42px;
  }

  .ignition-copy strong {
    font-size: 18px;
  }

  .ignition-copy p {
    font-size: 12px;
  }

  .ignition-action {
    grid-column: 1 / -1;
    width: 100%;
  }

  .turn-summary {
    position: fixed;
    left: 8px;
    right: 8px;
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 34;
    grid-template-columns: 1fr;
    max-width: none;
    max-height: min(34vh, 230px);
    margin: 0;
    padding: 9px 10px 40px;
    overflow: hidden;
    backdrop-filter: blur(8px);
  }

  .turn-summary-deltas {
    justify-content: flex-start;
    max-width: none;
    max-height: 74px;
    overflow: auto;
    padding-right: 4px;
  }

  .turn-summary.expanded {
    left: 8px;
    right: 8px;
    grid-template-columns: 1fr;
    max-height: min(48vh, 360px);
    overflow: auto;
  }

  .turn-summary.expanded p {
    max-height: none;
  }

  .turn-summary.expanded .turn-summary-deltas {
    max-height: 160px;
  }

  .turn-summary-toggle {
    right: 10px;
    bottom: 8px;
  }

  .log-sector.expanded,
  .history-sector.expanded {
    position: relative;
    inset: auto;
    z-index: 2;
    width: auto;
    height: auto;
    max-height: min(58vh, 520px);
    overflow: hidden;
  }

  .log-sector.expanded .event-log,
  .history-sector.expanded .history-list {
    max-height: min(44vh, 400px);
    overflow: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
  }

  .log-sector.expanded .sector-heading,
  .history-sector.expanded .sector-heading {
    position: sticky;
    top: 0;
    z-index: 3;
    padding-bottom: 7px;
    background:
      linear-gradient(180deg, rgba(15, 20, 18, 0.98), rgba(15, 20, 18, 0.9)),
      var(--panel);
  }

  #tutorialButton {
    grid-column: 4;
    grid-row: 1;
  }

  #soundToggle {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
  }

  #musicToggle {
    grid-column: 3;
    grid-row: 1;
    width: 100%;
  }

  #resetButton {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }

  #endTurnButton {
    grid-column: 2 / 5;
    grid-row: 2;
  }

  .dashboard {
    grid-template-columns: minmax(0, 1fr);
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 3px;
    padding-right: 2px;
  }

  .dashboard-column {
    display: contents;
    min-width: 0;
    min-height: auto;
    overflow: visible;
  }

  .dashboard-column-center,
  .dashboard-column-right {
    align-content: start;
    overflow-y: visible;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .dashboard-column-left {
    grid-template-rows: auto;
  }

  .action-sector {
    order: 1;
  }

  .command-sector {
    order: 2;
  }

  .viewport-sector {
    order: 3;
  }

  .resources-sector {
    order: 4;
  }

  .archive-rail {
    order: 5;
  }

  .command-sector {
    max-height: none;
  }

  .viewport-sector,
  #spaceCanvas {
    min-height: 0;
  }

  .action-sector {
    min-height: 420px;
  }

  .action-panel-stack {
    min-height: 240px;
  }

  .crisis-actions {
    grid-template-columns: 1fr;
  }

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

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

  .primary-action {
    width: 100%;
  }

  .secondary-action.compact {
    min-width: 0;
    width: 100%;
  }

  .tutorial-overlay {
    align-items: flex-start;
    justify-content: flex-start;
    padding: max(10px, env(safe-area-inset-top, 0px)) 10px max(10px, env(safe-area-inset-bottom, 0px));
    z-index: 48;
  }

  .tutorial-panel {
    width: min(360px, 100%);
    max-width: min(360px, 100%);
    max-height: min(48svh, 380px);
    padding: 14px;
  }

  .tutorial-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1.25fr;
    gap: 6px;
  }

  .tutorial-actions .secondary-action {
    width: 100%;
    min-width: 0;
  }

  .tutorial-actions .primary-action {
    grid-column: auto;
    min-width: 0;
  }

  .feedback-panel {
    max-height: calc(100vh - 20px);
    padding: 14px;
  }

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

  .feedback-actions {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
  }

  .feedback-actions .secondary-action,
  .feedback-actions .primary-action {
    width: 100%;
    min-width: 0;
  }

  .dev-tools {
    left: 8px;
    right: 8px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }

  .dev-tools-panel {
    max-height: min(62vh, 520px);
  }

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

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

@media (max-width: 460px) {
  .top-actions {
    grid-template-columns: 54px 38px 38px minmax(0, 1fr);
  }

  .goal-dock {
    padding: 6px 7px;
  }

  .goal-dock-status strong {
    font-size: 13px;
  }

  .turn-summary {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

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

  .crew-card {
    grid-template-columns: 1fr;
  }

  .action-sector {
    min-height: 320px;
  }

  .stepper {
    width: 100%;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .stepper button,
  .stepper output {
    width: 100%;
  }

  .feedback-rating {
    gap: 6px;
  }

  .feedback-tags {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 760px) and (min-width: 821px) {
  .game-shell {
    padding-top: 5px;
    padding-bottom: 6px;
  }

  .topbar {
    min-height: 48px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  h1 {
    font-size: 22px;
    line-height: 1.16;
  }

  .brand p {
    display: none;
  }

  .goal-dock {
    min-height: 34px;
    padding: 4px 7px;
  }

  .dashboard-column-center {
    grid-template-rows: minmax(300px, min(50vh, 440px)) auto minmax(60px, 0.14fr);
  }

  .viewport-sector {
    min-height: 300px;
  }

  .furnace-frame {
    inset: 38px 32px 58px;
  }

  .briefing-sector,
  .log-sector,
  .history-sector {
    padding: 7px;
  }

  .briefing-panel {
    min-height: 58px;
    padding: 7px;
  }

  .briefing-alerts li {
    padding: 6px;
  }

  .history-list {
    max-height: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .fx-layer {
    display: none;
  }
}
