:root {
  --bg-sky: #a9c9d6;
  --bg-panel: #1b1f27;
  --bg-panel-soft: rgba(44, 50, 60, 0.4);
  --text-cream: #f4f0e6;
  --text-muted: #a3aab7;
  --gold: #dfb25a;
  --gold-soft: #f2d197;

  --stat-market: #e0a83e;
  --stat-equity: #6fa787;
  --stat-order: #6c8fc7;

  --danger: #d95a47;
  --radius-lg: 24px;
  --radius-md: 16px;
  --font-display: 'Playfair Display', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-panel);
  font-family: var(--font-body);
  color: var(--text-cream);
  -webkit-tap-highlight-color: transparent;
  font-size: 16px;
}

/* Government-palace vector backdrop, sits behind the app panel */
body {
  background-color: #10151b;
  position: relative;
}
body::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("assets/background.svg");
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: cover;
  z-index: 0;
  animation: bg-breathe 20s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes bg-breathe {
  0% { transform: scale(1); }
  100% { transform: scale(1.04); }
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--bg-sky) 0%, transparent 0%);
  backdrop-filter: blur(2px);
  overflow: hidden;
}

/* --- EPIC EFFECTS --- */
.stamp-effect {
  display: inline-block;
  animation: stamp-down 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  opacity: 0;
  transform: scale(3);
}
@keyframes stamp-down {
  0% { transform: scale(3) rotate(-10deg); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.screen-shake {
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

#app::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Explicit animation:none ensures browser truly resets when danger-alert is removed */
  animation: none;
  box-shadow: inset 0 0 0 rgba(255, 0, 0, 0);
  z-index: 9999;
}
body.danger-alert #app::after {
  animation: danger-pulse 1s infinite alternate;
}
@keyframes danger-pulse {
  0%   { box-shadow: inset 0 0 60px  rgba(255, 0, 0, 0.25); }
  100% { box-shadow: inset 0 0 160px rgba(255, 0, 0, 0.65); }
}
body.danger-alert .game-container {
  animation: subtle-shake 0.5s infinite;
}
@keyframes subtle-shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-1px, 1px); }
  50% { transform: translate(1px, -1px); }
  75% { transform: translate(-1px, -1px); }
}
/* --------------------- */


/* Scale everything up on larger screens (desktop / 1920x1080 etc.) */
@media (min-width: 900px) and (min-height: 700px) {
  html, body { font-size: 20px; }
}
@media (min-width: 1400px) and (min-height: 850px) {
  html, body { font-size: 22px; }
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 1;
}
.screen.active { 
  opacity: 1; 
  pointer-events: auto; 
  transform: scale(1);
  z-index: 2;
}

/* ---------- START SCREEN ---------- */
#screen-start {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(58,66,80,0.6) 0%, rgba(35,40,48,0.85) 70%);
  text-align: center;
  padding: 2rem;
}
.start-content { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.game-title {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1.15;
  letter-spacing: 0.1rem;
  color: var(--gold-soft);
  text-transform: uppercase;
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
  animation: glow-float 4s ease-in-out infinite;
  will-change: transform, text-shadow;
}
.game-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 22rem;
  line-height: 1.5;
  animation: subtitle-breathe 5s ease-in-out infinite;
  will-change: opacity;
}
@keyframes subtitle-breathe {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1;   }
}
.btn-primary {
  margin-top: 0.75rem;
  padding: 0.9rem 2.4rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #c99330);
  color: #1c1f26;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(217, 171, 82, 0.3);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 6px 20px rgba(217, 171, 82, 0.5);
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 10px rgba(217, 171, 82, 0.3); }

/* ---------- TUTORIAL SCREEN ---------- */
#screen-tutorial {
  align-items: center;
  justify-content: flex-start;
  background:
    radial-gradient(circle at 50% 30%, rgba(58,66,80,0.6) 0%, rgba(35,40,48,0.85) 70%);
  text-align: center;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}
.tutorial-content { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; max-width: 24rem; width: 100%; padding-bottom: 1rem; }
.tutorial-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold-soft);
  text-transform: uppercase;
  letter-spacing: 0.06rem;
  margin-bottom: 0.1rem;
  animation: glow-float 4s ease-in-out infinite;
  will-change: transform, text-shadow;
}
.tutorial-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0,0,0,0.25);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  width: 100%;
  backdrop-filter: blur(8px);
  border: var(--glass-border);
}
.tutorial-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  min-width: 2rem;
  text-align: center;
}
.tutorial-step .tutorial-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-cream);
  text-align: left;
}
.color-market { color: var(--stat-market); }
.color-equity { color: var(--stat-equity); }
.color-order { color: var(--stat-order); }

/* ---------- HUD ---------- */
#hud {
  padding: 0.2rem 1.25rem 0.2rem;
  z-index: 5;
  position: relative;
}
.hud-top {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.5rem;
}
.year-counter {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  background: rgba(0,0,0,0.25);
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
}
#year-number {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-soft);
  font-weight: 700;
}
.year-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06rem;
}

.stat-bars {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1rem 0;
}
.stat-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.04);
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
}
.stat-icon { font-size: 1rem; flex-shrink: 0; }
.stat-track {
  position: relative;
  flex: 1;
  height: 0.6rem;
  background: rgba(0,0,0,0.35);
  border-radius: 999px;
  /* No overflow:hidden — dot must escape the track bounds */
}
.stat-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 50%;
  border-radius: 999px;
  transition: width 0.35s ease, background 0.35s ease;
  z-index: 2;
}
/* Dot indicator — floats above the stat bar tip, NOT inside the clipped track */
.stat-preview {
  /* positioned relative to .stat-track */
  position: absolute;
  top: 50%;
  transform: translateY(-50%) translateX(-50%);
  width: 0;
  height: 0;
  border-radius: 50%;
  opacity: 0;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* Small dot — normal change */
.stat-bar.previewing .stat-preview.dot-small {
  opacity: 1;
  width: 0.75rem;
  height: 0.75rem;
  animation: dot-pulse 0.6s ease-in-out infinite;
}
/* Large dot — big change (raw delta > 20) */
.stat-bar.previewing .stat-preview.dot-large {
  opacity: 1;
  width: 1.1rem;
  height: 1.1rem;
  animation: dot-pulse 0.6s ease-in-out infinite;
}
.stat-bar.previewing .stat-preview.gain {
  background: #4ade80;
  box-shadow: 0 0 8px 2px rgba(74,222,128,0.7), 0 0 0 2px rgba(74,222,128,0.25);
}
.stat-bar.previewing .stat-preview.loss {
  background: var(--danger);
  box-shadow: 0 0 8px 2px rgba(217,90,71,0.7), 0 0 0 2px rgba(217,90,71,0.25);
}

@keyframes dot-pulse {
  0%, 100% { transform: translateY(-50%) translateX(-50%) scale(0.85); opacity: 0.7; }
  50%       { transform: translateY(-50%) translateX(-50%) scale(1.2);  opacity: 1;   }
}

/* Per-stat fill colors */
.stat-bar[data-stat="market"] .stat-fill { background: linear-gradient(90deg, #b07e1c, var(--stat-market)); }
.stat-bar[data-stat="equity"] .stat-fill { background: linear-gradient(90deg, #4b7a5f, var(--stat-equity)); }
.stat-bar[data-stat="order"]  .stat-fill { background: linear-gradient(90deg, #476494, var(--stat-order)); }

/* ---------- CARD STAGE ---------- */
#card-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.5rem 0.25rem;
  z-index: 10;
}

.event-card {
  position: relative;
  width: 100%;
  max-width: 26rem;
  background: var(--bg-panel-soft);
  backdrop-filter: blur(12px);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0.75rem 1.9rem rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
  will-change: transform;
}
.event-card:active { 
  cursor: grabbing; 
  box-shadow: 0 1.5rem 3rem rgba(0,0,0,0.6), 0 0 30px rgba(255, 255, 255, 0.3), inset 0 1px 0 rgba(255,255,255,0.1); 
}

.event-card.flip-in {
  animation: card-flip-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes card-flip-in {
  0% { transform: translateY(150px) rotateY(180deg) scale(0.95); opacity: 0; }
  100% { transform: translateY(0) rotateY(0deg) scale(1); opacity: 1; }
}

.event-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #3a4250;
  overflow: hidden;
}
.event-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.event-content {
  padding: 1.25rem 1.5rem;
  background: rgba(27, 31, 39, 0.65);
  backdrop-filter: blur(12px);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 34rem;
  margin: 0 auto 1.5rem;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
#event-text {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-cream);
  text-align: center;
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.choice-indicator {
  position: absolute;
  top: 30%;
  transform: translateY(-50%);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05rem;
  line-height: 1.5;
  padding: 0.8rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(223, 178, 90, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #10151b;
  opacity: 0;
  z-index: 20;
  pointer-events: none;
  transition: opacity 0.2s ease;
  width: max-content;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.choice-indicator.left { left: 50%; transform: translate(-50%, -150%); text-align: center; }
.choice-indicator.right { right: 50%; transform: translate(50%, -150%); text-align: center; }

@media (min-width: 900px) {
  .choice-indicator { top: 50%; }
  .choice-indicator.left { left: 1.5rem; transform: translateY(-50%); text-align: left; }
  .choice-indicator.right { right: 1.5rem; transform: translateY(-50%); text-align: right; }
}



/* ---------- ENDING SCREEN ---------- */
#screen-ending {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(58,66,80,0.6) 0%, rgba(35,40,48,0.9) 70%);
  padding: 2rem;
  text-align: center;
}
.ending-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  max-width: 21rem;
}
.ending-image {
  width: 11.25rem;
  height: 11.25rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #3a4250;
  box-shadow: 0 0.75rem 1.9rem rgba(0,0,0,0.4);
}
.ending-image img { width: 100%; height: 100%; object-fit: cover; }
.ending-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold-soft);
  text-transform: uppercase;
  letter-spacing: 0.06rem;
}
.ending-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-cream);
}
.ending-years {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06rem;
}

/* ---------- SUMMARY SCREEN ---------- */
#screen-summary {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(58,66,80,0.6) 0%, rgba(35,40,48,0.9) 70%);
  padding: 2rem;
  text-align: center;
}
.summary-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 32rem;
  background: rgba(0,0,0,0.4);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(217, 171, 82, 0.3);
  box-shadow: 0 0.75rem 1.9rem rgba(0,0,0,0.4);
}
.summary-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold-soft);
  text-transform: uppercase;
  letter-spacing: 0.08rem;
}
.summary-text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-cream);
  text-align: justify;
}

/* ---------- CREDITS SCREEN ---------- */
#screen-credits {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(58,66,80,0.6) 0%, rgba(35,40,48,0.9) 70%);
  padding: 2rem;
  text-align: center;
}
.credits-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 26rem;
}
.credits-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gold-soft);
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  margin-bottom: 0.5rem;
  animation: glow-float 4s ease-in-out infinite;
  will-change: transform, text-shadow;
}
@keyframes glow-float {
  0%, 100% { transform: translateY(0); text-shadow: 0 0 10px rgba(217, 171, 82, 0.3); }
  50% { transform: translateY(-4px); text-shadow: 0 0 18px rgba(217, 171, 82, 0.7); }
}
/* VIP Name Styling */
.vip-name {
  color: #ffda75 !important;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(255, 218, 117, 0.6);
  animation: vip-pulse 2s ease-in-out infinite alternate;
  will-change: transform, text-shadow;
}
@keyframes vip-pulse {
  0% { transform: scale(1) translateY(0); text-shadow: 0 0 10px rgba(255, 218, 117, 0.6); }
  100% { transform: scale(1.08) translateY(-1px); text-shadow: 0 0 20px rgba(255, 218, 117, 1), 0 0 30px rgba(255, 165, 0, 0.8); }
}
.credits-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.credits-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: min-content;
  gap: 1rem 1rem;
  width: 100%;
  max-height: 55vh;
  overflow-y: auto;
  text-align: left;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 15px rgba(0,0,0,0.5), 0 0 15px rgba(0,0,0,0.2);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  margin-bottom: 1.8rem;
}
.credits-list span {
  display: block;
  font-size: 0.95rem;
  line-height: 1.4;
  padding-bottom: 0.2rem;
  color: var(--text-cream);
  word-wrap: break-word;
}

/* ---------- NEW LAYOUT (3-COLUMN & MOBILE) ---------- */
.game-container {
  display: flex;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.side-panel {
  display: none;
  flex-direction: column;
  width: 100%;
  padding: 1.5rem;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
}
.main-panel {
  display: none;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  position: relative;
}
.main-panel.active, .side-panel.active {
  display: flex;
}

.panel-title {
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  letter-spacing: 0.05rem;
  font-family: var(--font-display);
}

/* Left panel tab controls */
.left-panel-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.left-tab-btns {
  display: flex;
  gap: 0.4rem;
}
.left-tab-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-muted);
  font-size: 1.3rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.left-tab-btn:hover {
  color: var(--gold);
  background: rgba(255,255,255,0.12);
}
.left-tab-btn.active {
  background: rgba(217,171,82,0.18);
  border-color: rgba(217,171,82,0.45);
  color: var(--gold-soft);
  transform: translateY(-1px);
}

/* Rules panel */
.rules-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(255,255,255,0.03);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  animation: rule-fade-in 0.3s ease both;
}
@keyframes rule-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rule-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
  min-width: 2rem;
  text-align: center;
  margin-top: 0.1rem;
}
.rule-body {}
.rule-title {
  font-weight: 700;
  color: var(--gold-soft);
  font-size: 0.92rem;
  margin-bottom: 0.3rem;
  letter-spacing: 0.02rem;
}
.rule-desc {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-cream);
}
.rule-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  margin-right: 0.15rem;
}
.rule-tag.danger {
  background: rgba(217,90,71,0.2);
  color: var(--danger);
  border: 1px solid rgba(217,90,71,0.35);
}
.rule-tag.warn {
  background: rgba(217,171,82,0.15);
  color: var(--gold-soft);
  border: 1px solid rgba(217,171,82,0.3);
}

/* History Log */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: opacity 0.3s ease;
  position: relative;
}
.history-list::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.1);
}
.history-list.collapsed {
  display: none;
}
.history-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: var(--glass-border);
  position: relative;
  margin-left: 1.5rem;
}
.history-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 1.2rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold-soft);
  border: 2px solid var(--bg-panel);
  transform: translateX(-50%);
}
.history-q {
  font-size: 0.9rem;
  color: var(--text-cream);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.history-a {
  font-size: 0.85rem;
  color: var(--stat-equity);
  font-weight: bold;
}

/* Advisor */
.advisor-bubble {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  margin-top: 1.5rem;
  backdrop-filter: blur(8px);
  border: var(--glass-border);
  position: relative;
}
.advisor-bubble::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 20px;
  border-width: 0 10px 10px 10px;
  border-style: solid;
  border-color: transparent transparent rgba(255, 255, 255, 0.05) transparent;
}
.advisor-content-wrap {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.advisor-avatar {
  font-size: 2.2rem;
  background: rgba(0, 0, 0, 0.3);
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}
.advisor-status {
  font-weight: bold;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
.advisor-status.correct { color: var(--stat-equity); }
.advisor-status.incorrect { color: var(--danger); }
.advisor-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-cream);
}

/* Mobile Nav */
.mobile-nav {
  display: flex;
  background: rgba(27, 31, 39, 0.9);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.8rem 0.5rem 1.2rem;
  justify-content: space-around;
  z-index: 100;
}
.nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
  transition: color 0.2s ease, transform 0.2s ease;
}
.nav-btn i {
  font-size: 1.4rem;
  margin-bottom: 2px;
}
.nav-btn.active {
  color: var(--gold-soft);
  transform: translateY(-2px);
}

/* ---------- RESPONSIVE ---------- */
@media (min-width: 900px) {
  .game-container {
    display: grid;
    grid-template-columns: minmax(300px, 450px) 1fr minmax(300px, 450px);
  }
  .side-panel, .main-panel {
    display: flex !important; /* Always show all 3 on desktop */
    width: auto;
  }
  .mobile-nav {
    display: none !important;
  }
  .side-panel {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
  }
}

@media (max-height: 640px) {
  .game-title { font-size: 2.1rem; }
  .event-content { padding: 0.8rem 1.1rem 1.1rem; }
  #event-text { font-size: 0.95rem; }
}

/* ---------- DRAG EFFECTS ---------- */
#panel-history, .advisor-bubble, .year-counter, .event-card {
  transition: opacity 0.3s ease, filter 0.3s ease;
}

body.is-dragging #panel-history,
body.is-dragging .advisor-bubble,
body.is-dragging .year-counter,
body.is-previewing #panel-history,
body.is-previewing .advisor-bubble,
body.is-previewing .year-counter,
body.is-previewing .event-card {
  opacity: 0.15;
  filter: blur(4px);
  pointer-events: none;
}
body.is-dragging .event-card {
  /* don't disable pointer-events while dragging, just maybe blur slightly */
  filter: blur(1px);
}
