/* Elegant Ghibli-inspired Study Theme - Experiment 08: Involution Arms Race */

:root {
  /* Dark Mode (左下/导航/主正文背景) */
  --bpt-background-primary-dark: #2d343f;
  --bpt-background-secondary-dark: #3a414e;
  --bpt-text-normal-dark: #d9e0e8;
  --bpt-text-faint-dark: #a0a7b1;

  /* Light Mode (右上/提示块背景) */
  --bpt-background-primary-light: #f5f0e9;
  --bpt-text-normal-light: #2d343f;
  --bpt-callout-background-light: #e6eef6;

  /* Accents */
  --bpt-link-color: #8fb1df; /* Soft blue accent */

  /* Highlight Levels */
  --bpt-highlight-1-bg: #fce4ec;
  --bpt-highlight-1-text: #e91e63; /* Level 1: Pink */

  --bpt-highlight-2-bg: #fff3e0;
  --bpt-highlight-2-text: #ff9800; /* Level 2: Orange */

  --bpt-highlight-3-bg: #e3f2fd;
  --bpt-highlight-3-text: #2196f3; /* Level 3: Blue */

  /* Typography */
  --bpt-font-sans: "Inter", "SF Pro", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bpt-font-mono: "Fira Code", "JetBrains Mono", Consolas, Monaco, monospace;
}

/* Global Reset & Base */
body.game-arms-race {
  background: var(--bpt-background-primary-dark) !important;
  color: var(--bpt-text-normal-dark) !important;
  font-family: var(--bpt-font-sans) !important;
}

body.game-arms-race .navbar {
  background: rgba(45, 52, 63, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

body.game-arms-race .navbar .brand span {
  color: #fff;
}

body.game-arms-race .navbar .nav-links a {
  color: var(--bpt-text-faint-dark);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.game-arms-race .navbar .nav-links a:hover {
  color: #fff;
  border-color: var(--bpt-link-color);
  background: rgba(143, 177, 223, 0.1);
  box-shadow: 0 0 15px rgba(143, 177, 223, 0.2);
}

/* Page Typography */
body.game-arms-race .page-title h1 {
  font-family: "Outfit", var(--bpt-font-sans);
  font-weight: 800;
  font-size: 2.2rem;
  color: #fff;
  margin: 10px 0;
}

body.game-arms-race .page-title p {
  color: var(--bpt-text-faint-dark);
  font-size: 1.05rem;
}

.eyebrow {
  font-family: "Outfit", var(--bpt-font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--bpt-link-color);
}

/* Highlight levels custom styles */
body.game-arms-race mark.highlight-1 {
  background-color: var(--bpt-highlight-1-bg);
  color: var(--bpt-highlight-1-text);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

body.game-arms-race mark.highlight-2 {
  background-color: var(--bpt-highlight-2-bg);
  color: var(--bpt-highlight-2-text);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

body.game-arms-race mark.highlight-3 {
  background-color: var(--bpt-highlight-3-bg);
  color: var(--bpt-highlight-3-text);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* Soft Rainbow Tags & Shards */
body.game-arms-race .tag,
body.game-arms-race .shard-card {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-block;
  margin: 4px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

body.game-arms-race .tag:nth-child(6n+1),
body.game-arms-race .shard-card:nth-child(6n+1) {
  background: #ffebee;
  color: #e91e63;
  border-color: #ffcdd2;
}

body.game-arms-race .tag:nth-child(6n+2),
body.game-arms-race .shard-card:nth-child(6n+2) {
  background: #fff3e0;
  color: #ff9800;
  border-color: #ffe0b2;
}

body.game-arms-race .tag:nth-child(6n+3),
body.game-arms-race .shard-card:nth-child(6n+3) {
  background: #fffde7;
  color: #f57f17;
  border-color: #fff9c4;
}

body.game-arms-race .tag:nth-child(6n+4),
body.game-arms-race .shard-card:nth-child(6n+4) {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #c8e6c9;
}

body.game-arms-race .tag:nth-child(6n+5),
body.game-arms-race .shard-card:nth-child(6n+5) {
  background: #e3f2fd;
  color: #1565c0;
  border-color: #bbdefb;
}

body.game-arms-race .tag:nth-child(6n+6),
body.game-arms-race .shard-card:nth-child(6n+6) {
  background: #f3e5f5;
  color: #6a1b9a;
  border-color: #e1bee7;
}

/* Split Pane Grid Layout */
.strategy-shell {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  margin-top: 30px;
  align-items: stretch;
}

/* Left Navigation / Control Column */
.event-panel {
  background: var(--bpt-background-secondary-dark);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.event-panel .panel-title {
  color: #fff;
  font-family: "Outfit", var(--bpt-font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#round-label {
  font-family: "Caveat", cursive;
  font-size: 1.3rem;
  color: var(--bpt-link-color);
  font-weight: 700;
}

/* Campus Signal Callout Card (Light Mode Theme contrast inside Dark Left panel) */
.campus-card {
  background: var(--bpt-callout-background-light);
  color: var(--bpt-text-normal-light);
  border: 1px solid rgba(143, 177, 223, 0.35);
  border-radius: 12px;
  padding: 20px 20px 20px 52px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  position: relative;
}

.campus-card::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 20px;
  width: 24px;
  height: 24px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232196f3' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9'%3E%3C/path%3E%3C/svg%3E");
}

.campus-card .eyebrow {
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--bpt-text-normal-light);
  opacity: 0.6;
  margin-bottom: 4px;
}

.campus-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--bpt-text-normal-light);
}

.campus-card p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--bpt-text-normal-light);
  margin: 0;
}

/* Action Buttons inside Left Panel */
.race-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
}

.race-actions .action-button {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  color: var(--bpt-text-normal-dark);
  text-align: left;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: auto;
  line-height: 1.4;
}

.race-actions .action-button strong {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 700;
}

.race-actions .action-button span {
  font-size: 0.8rem;
  color: var(--bpt-text-faint-dark);
  line-height: 1.4;
}

.race-actions .action-button:hover:not(:disabled) {
  background: var(--bpt-link-color);
  border-color: var(--bpt-link-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(143, 177, 223, 0.25);
}

.race-actions .action-button:hover:not(:disabled) strong {
  color: var(--bpt-background-primary-dark);
}

.race-actions .action-button:hover:not(:disabled) span {
  color: rgba(45, 52, 63, 0.8);
}

.race-actions .action-button:active:not(:disabled) {
  transform: translateY(0);
}

.race-actions .action-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Right Content Pane containing Map and Reactions */
.right-content-pane {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 20px;
  background: linear-gradient(135deg, var(--bpt-background-primary-light) 48%, var(--bpt-background-primary-dark) 48%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  align-items: stretch;
  position: relative;
  overflow: hidden;
}

/* Ecosystem sandbox maps (Dark mode left glass pane) */
.ecosystem-panel {
  background: rgba(45, 52, 63, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  color: var(--bpt-text-normal-dark);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ecosystem-panel h2 {
  font-family: "Outfit", var(--bpt-font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.ecosystem-panel p.muted {
  font-size: 0.8rem;
  color: var(--bpt-text-faint-dark);
  margin: 2px 0 0 0;
}

.ecosystem-panel .map-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.mini-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.76rem;
  color: var(--bpt-text-faint-dark);
  justify-content: flex-end;
}

.mini-status span {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px 8px;
  border-radius: 6px;
}

.mini-status strong {
  font-family: var(--bpt-font-mono);
  color: var(--bpt-link-color);
  font-weight: 700;
}

/* Building Facade Container (Node-Link Map) */
.building-facade {
  --pressure-alpha: 0.42;
  --clarity-alpha: 0.52;
  position: relative;
  min-height: 480px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
}

.building-facade.rumbling {
  animation: building-rumble 0.6s ease-in-out;
}

@keyframes building-rumble {
  0%, 100% { transform: translate(0, 0); }
  10%, 90% { transform: translate(-1.5px, 0.5px); }
  20%, 80% { transform: translate(1px, -1px); }
  30%, 70% { transform: translate(-2px, -1px); }
  40%, 60% { transform: translate(1.5px, 1.5px); }
  50% { transform: translate(-1px, 2px); }
}

.building-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 16px;
  flex-grow: 1;
  position: relative;
  z-index: 5;
}

/* Window nodes network layout */
.window-pane {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px;
  text-align: center;
  min-height: 110px;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: visible;
}

/* Circle nodes for abstract realms */
.circle-pane {
  border-radius: 50%;
  border-style: dashed;
  background: rgba(143, 177, 223, 0.02);
  border-color: rgba(143, 177, 223, 0.15);
}

.circle-pane::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.03);
  border-radius: 50%;
}

/* Rounded squares for classmates */
.student-pane {
  border-radius: 12px;
}

/* Classmate windows click & investigation styles */
.building-grid .student-pane:not(.player) {
  cursor: pointer;
  position: relative;
}

/* Hover effects */
.building-grid .student-pane:not(.player):hover {
  border-color: var(--bpt-link-color);
  box-shadow: 0 0 15px rgba(143, 177, 223, 0.4), inset 0 0 10px rgba(143, 177, 223, 0.2);
}

/* Magnifying glass icon for unrevealed panes */
.building-grid .student-pane:not(.player):not(.revealed-done)::after {
  content: "🔍";
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.7rem;
  opacity: 0.6;
  z-index: 10;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.building-grid .student-pane:not(.player):not(.revealed-done):hover::after {
  opacity: 1;
  transform: scale(1.2);
}

/* Reveal Flash animation & class */
.revealed-flash {
  position: relative;
}

.revealed-flash::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 15;
  animation: revealFlash 0.8s ease-out forwards;
}

@keyframes revealFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(143, 177, 223, 0.8), inset 0 0 0 0 rgba(143, 177, 223, 0.5);
    background-color: rgba(143, 177, 223, 0.3);
  }
  100% {
    box-shadow: 0 0 0 25px transparent, inset 0 0 20px transparent;
    background-color: transparent;
  }
}


.window-light {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Glass reflections */
.window-pane::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 70%);
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  pointer-events: none;
  z-index: 3;
}

/* Neon glow states representing class dynamics */
.window-pane.glow-cold .window-light {
  opacity: 0.35;
  background: radial-gradient(circle, rgba(143, 177, 223, 0.45) 0%, transparent 80%);
  box-shadow: 0 0 15px rgba(143, 177, 223, 0.25), inset 0 0 10px rgba(143, 177, 223, 0.2);
}

.window-pane.glow-cold {
  border-color: rgba(143, 177, 223, 0.4);
}

.window-pane.glow-cold-intense .window-light {
  opacity: 0.6;
  background: radial-gradient(circle, rgba(143, 177, 223, 0.65) 0%, transparent 70%);
  box-shadow: 0 0 25px rgba(143, 177, 223, 0.5), inset 0 0 15px rgba(143, 177, 223, 0.4);
  animation: node-pulse 2s infinite ease-in-out;
}

.window-pane.glow-cold-intense {
  border-color: rgba(143, 177, 223, 0.8);
}

.window-pane.glow-gold .window-light {
  opacity: 0.45;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.5) 0%, transparent 80%);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.35), inset 0 0 10px rgba(251, 191, 36, 0.2);
}

.window-pane.glow-gold {
  border-color: rgba(251, 191, 36, 0.5);
}

.window-pane.glow-green .window-light {
  opacity: 0.4;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.45) 0%, transparent 80%);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.35), inset 0 0 10px rgba(16, 185, 129, 0.2);
}

.window-pane.glow-green {
  border-color: rgba(16, 185, 129, 0.5);
}

.window-pane.glow-red .window-light {
  opacity: 0.55;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.5) 0%, transparent 80%);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.4), inset 0 0 12px rgba(239, 68, 68, 0.25);
  animation: alert-flash 1.2s infinite ease-in-out;
}

.window-pane.glow-red {
  border-color: rgba(239, 68, 68, 0.6);
}

.window-pane.fuse-blown .window-light {
  opacity: 0.05;
  background: #000;
  box-shadow: none;
}

.window-pane.fuse-blown {
  border-color: rgba(255, 255, 255, 0.02);
  opacity: 0.25;
}

@keyframes node-pulse {
  0%, 100% { box-shadow: 0 0 15px rgba(143, 177, 223, 0.3), inset 0 0 10px rgba(143, 177, 223, 0.2); }
  50% { box-shadow: 0 0 25px rgba(143, 177, 223, 0.6), inset 0 0 15px rgba(143, 177, 223, 0.4); }
}

@keyframes alert-flash {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.6; }
}

/* Node labels */
.window-pane span {
  position: relative;
  z-index: 2;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bpt-text-faint-dark);
  transition: color 0.3s ease;
}

.window-pane.glow-cold span,
.window-pane.glow-cold-intense span {
  color: #fff;
}

.window-pane.glow-gold span {
  color: #fef3c7;
}

.window-pane.glow-green span {
  color: #ecfdf5;
}

.window-pane.glow-red span {
  color: #fecdd3;
}

/* Student names board */
.student-label {
  position: absolute;
  bottom: -8px;
  z-index: 10;
  padding: 2px 8px;
  background: var(--bpt-background-secondary-dark);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: var(--bpt-text-normal-dark);
  font-size: 0.68rem;
  font-weight: 600;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  white-space: nowrap;
}

.window-pane.player .student-label {
  background: var(--bpt-link-color);
  border-color: var(--bpt-link-color);
  color: var(--bpt-background-primary-dark);
}

/* Mainline Beam */
.player-beam {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 50%;
  width: 4px;
  height: 520px;
  background: linear-gradient(to top, rgba(251, 191, 36, 0.7) 0%, rgba(251, 191, 36, 0) 100%);
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6));
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.window-pane.player.glow-gold .player-beam {
  opacity: 1;
}

/* Crushing warning ceiling */
.crushing-ceiling {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--threshold-y, 50%);
  height: 16px;
  z-index: 10;
  transition: top 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: none;
}

.ceiling-beam {
  height: 8px;
  background: repeating-linear-gradient(45deg, #f57f17, #f57f17 10px, #27272a 10px, #27272a 20px);
  border-top: 1px solid #ef4444;
  border-bottom: 1px solid #000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6), 0 0 8px rgba(239, 68, 68, calc(var(--pressure-alpha) * 0.5));
}

.crushing-ceiling span {
  position: absolute;
  right: 20px;
  top: -20px;
  padding: 2px 8px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 20px;
  color: #fecdd3;
  background: var(--bpt-background-primary-dark);
  font-size: 0.65rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Glowing Connecting Wires */
.wire-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.cooperate-wire {
  stroke: #10b981;
  stroke-width: 2.2;
  fill: none;
  stroke-dasharray: 5 5;
  stroke-dashoffset: 0;
  animation: copper-flow 1.2s infinite linear;
  filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.6));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.cooperate-wire.active {
  opacity: 0.8;
}

@keyframes copper-flow {
  to {
    stroke-dashoffset: -10;
  }
}

/* Stacking 2D manuscripts */
.paper-stack {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: var(--collection-height, 0px);
  z-index: 2;
  pointer-events: none;
}

.paper-sheet {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 20px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: all 0.35s ease;
}

/* Broadcast status */
.broadcast-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 4px;
}

.broadcast-panel h3 {
  font-size: 0.9rem;
  color: #fff;
  margin: 0 0 4px 0;
  font-weight: 700;
}

.broadcast-panel p {
  font-size: 0.8rem;
  color: var(--bpt-text-faint-dark);
  line-height: 1.5;
  margin: 0;
}

/* Reaction & logs column (Light mode right glass pane) */
.reaction-panel {
  background: rgba(245, 240, 233, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 20px;
  color: var(--bpt-text-normal-light);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.reaction-panel h2.panel-title {
  color: var(--bpt-text-normal-light);
  font-family: "Outfit", var(--bpt-font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 12px;
  margin: 0;
}

/* Callout blocks inside reaction column */
.feedback-card,
.delta-card {
  background: var(--bpt-callout-background-light);
  color: var(--bpt-text-normal-light);
  border: 1px solid rgba(143, 177, 223, 0.3);
  border-radius: 12px;
  padding: 14px 14px 14px 44px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  position: relative;
}

.feedback-card::before,
.delta-card::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 14px;
  width: 22px;
  height: 22px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.feedback-card::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232196f3' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z'%3E%3C/path%3E%3C/svg%3E");
}

.delta-card::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232196f3' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M13 7h8m0 0v8m0-8l-8 8-4-4-6 6'%3E%3C/path%3E%3C/svg%3E");
}

.feedback-card h3,
.delta-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--bpt-text-normal-light);
}

.feedback-card p,
.delta-card p {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--bpt-text-normal-light);
  opacity: 0.85;
  margin: 0;
}

/* Classmate reactions log */
.classmate-reactions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.classmate-reactions p {
  margin: 0;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-left: 4px solid var(--bpt-link-color);
  border-radius: 8px;
  color: var(--bpt-text-normal-light);
  font-size: 0.8rem;
  line-height: 1.5;
  transition: all 0.3s ease;
}

.classmate-reactions p.highlighted {
  background: #fff;
  border-left-color: #2196f3;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.12);
  transform: translateX(4px);
}

.classmate-reactions strong {
  color: var(--bpt-text-normal-light);
  font-weight: 700;
}

/* Right theory card: keep the arms-race side column aligned with the museum style. */
.race-theory-panel {
  min-width: 0;
}

.race-theory-panel h2.panel-title {
  color: #a89abf !important;
}

.race-theory-card {
  margin-top: 4px;
  padding: 18px 18px 18px 22px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(168, 154, 191, 0.28) !important;
  background:
    linear-gradient(180deg, rgba(246, 242, 231, 0.94), rgba(224, 216, 202, 0.88)) !important;
  color: #2f3746 !important;
  box-shadow: 0 14px 30px rgba(20, 24, 34, 0.16) !important;
  transform: none !important;
}

.race-theory-card::before {
  display: none !important;
}

.race-theory-card .panel-title {
  margin: 0 0 10px !important;
  padding-bottom: 8px !important;
  border-bottom: 1px dashed rgba(168, 154, 191, 0.28) !important;
  color: #a89abf !important;
  font-family: var(--font-display), cursive, serif !important;
  font-size: 1.08rem !important;
  font-weight: 700 !important;
}

.race-theory-card p {
  margin: 0 0 10px !important;
  color: #46576f !important;
  font-family: var(--bpt-font-sans) !important;
  font-size: 0.86rem !important;
  line-height: 1.72 !important;
}

.race-theory-card p.muted {
  color: #66768e !important;
  opacity: 1 !important;
}

/* Retro Ledger Card Style - 期末心智负债表 */
.ending-panel.race-ending {
  background: var(--bpt-background-primary-light) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3) !important;
  color: var(--bpt-text-normal-light) !important;
  padding: 30px !important;
  margin-top: 30px !important;
  background-image: none !important;
  transform: none !important;
}

.ending-panel.race-ending h3 {
  font-family: "Outfit", var(--bpt-font-sans);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--bpt-text-normal-light) !important;
  border-bottom: 2px solid var(--bpt-text-normal-light);
  padding-bottom: 10px;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.ending-panel.race-ending .ending-layer {
  border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
  padding: 16px 0;
  margin: 0;
}

.ending-panel.race-ending .ending-layer:last-of-type {
  border-bottom: none;
}

.ending-panel.race-ending h4 {
  font-family: "Outfit", var(--bpt-font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.ending-panel.race-ending p {
  color: var(--bpt-text-normal-light) !important;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Ledger accounting tables */
.ledger-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 15px;
}

.ledger-column {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.015);
  border-radius: 8px;
  padding: 16px;
}

.ledger-column h5 {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 12px 0;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--bpt-text-normal-light);
  color: var(--bpt-text-normal-light);
}

.ledger-column.liabilities h5 {
  border-bottom-color: #ef4444;
  color: #ef4444;
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* Alternate rows table */
.ledger-row:nth-child(even) {
  background: rgba(0, 0, 0, 0.03);
}

.ledger-row strong {
  font-family: var(--bpt-font-mono);
  font-size: 0.85rem;
  color: var(--bpt-text-normal-light) !important;
}

.ledger-column.liabilities .ledger-row strong {
  color: #ef4444 !important;
}

.dilution-banner {
  margin-top: 20px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 14px;
}

.dilution-banner h5 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #b45309;
  margin: 0 0 6px 0;
}

.dilution-banner p {
  font-size: 0.8rem !important;
  color: #78350f !important;
  margin: 0;
}

/* Micro-animations and resets for restart button */
.ending-panel.race-ending .primary-button {
  background: var(--bpt-text-normal-light) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 12px 30px !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  margin-top: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
}

.ending-panel.race-ending .primary-button:hover {
  background: #000 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2) !important;
}

.ending-panel.race-ending .primary-button:active {
  transform: translateY(0);
}

/* Shard panels list */
.log-panel {
  background: var(--bpt-background-secondary-dark);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.log-panel .panel-title {
  color: #fff;
  font-family: "Outfit", var(--bpt-font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#shard-count {
  font-family: "Caveat", cursive;
  color: var(--bpt-link-color);
  font-size: 1.25rem;
}

.shard-deck {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.log-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

.log-list li {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--bpt-text-normal-dark);
}

.log-list li:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

/* Responsive view */
@media (max-width: 992px) {
  .strategy-shell {
    grid-template-columns: 1fr;
  }
  .right-content-pane {
    grid-template-columns: 1fr;
    background: linear-gradient(180deg, var(--bpt-background-primary-light) 45%, var(--bpt-background-primary-dark) 45%);
  }
  .ledger-sheet {
    grid-template-columns: 1fr;
  }
}
