/* THE CHAIR — Game Layout & Components */

/* ─── SCREWCAP SPLASH ─────────────────────────────── */
.screwcap-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-void);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: splash-fade 0.5s ease 0.5s forwards;
  pointer-events: none;
}
.screwcap-splash .splash-text {
  font-family: var(--font-display);
  font-size: clamp(1rem, 3vw, 1.5rem);
  letter-spacing: 0.2em;
  color: var(--text-dim);
  opacity: 0;
  animation: splash-text-in 0.4s ease 0.1s forwards;
}
@keyframes splash-text-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 0.6; transform: translateY(0); }
}
@keyframes splash-fade {
  from { opacity: 1; }
  to   { opacity: 0; visibility: hidden; }
}

/* ─── OVERLAYS ────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(30, 37, 48, 0.95);
  backdrop-filter: blur(20px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.overlay.active { display: flex; }

/* ─── SCENARIO SELECT ─────────────────────────────── */
.scenario-select {
  width: min(900px, 95vw); padding: 40px;
  animation: slide-up .4s var(--ease-out-expo);
}
.ss-header {
  font-size: 0.75rem; letter-spacing: 0.4em; color: var(--cyan);
  text-align: center; margin-bottom: 32px;
}
.ss-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px;
}
.ss-card {
  padding: 20px; border-radius: var(--r-md); cursor: pointer;
  background: var(--bg-raised); border: 1px solid var(--border-dim);
  transition: transform .2s, border-color .2s, box-shadow .2s;
  text-align: center;
}
.ss-card:hover {
  transform: translateY(-4px); border-color: var(--cyan);
  box-shadow: 0 8px 24px var(--cyan-glow);
}
.ss-diff {
  font-family: var(--font-display); font-size: 0.6rem; letter-spacing: 0.3em;
  margin-bottom: 8px;
}
.ss-year { font-family: var(--font-data); font-size: 2rem; font-weight: 700; color: var(--text-dim); }
.ss-name { font-size: 1rem; font-weight: 700; margin: 6px 0; }
.ss-desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }
.ss-survival { font-family: var(--font-data); font-size: 0.75rem; color: var(--text-secondary); }
.ss-survival strong { color: var(--yellow); }

/* ─── GAME BODY ───────────────────────────────────── */
.game-body {
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
  background: var(--bg-void);
}

/* ─── HEADER ──────────────────────────────────────── */
.game-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; height: 52px;
  background: var(--bg-deep); border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
}
.gh-left { display: flex; align-items: center; gap: 12px; }
.gh-brand { font-size: 0.85rem; color: var(--cyan); letter-spacing: 0.3em; }
.rank-badge {
  display: flex; align-items: center; gap: 6px;
  background: var(--gold-dim); border: 1px solid rgba(245,158,11,.3);
  padding: 3px 10px; border-radius: 100px; font-size: 0.72rem; color: var(--gold);
}
.gh-center { display: flex; align-items: center; gap: 16px; }
.quarter-info { text-align: center; }
.qi-label { font-size: 0.6rem; color: var(--text-dim); display: block; text-transform: uppercase; letter-spacing: .1em; }
.qi-val { font-size: 1rem; font-weight: 700; color: var(--cyan); }
.progress-track {
  width: 200px; height: 6px; background: var(--bg-raised);
  border-radius: 3px; position: relative; overflow: hidden;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--cyan), var(--gold));
  border-radius: 3px; transition: width .6s var(--ease-out-expo);
  width: 5%;
}
.progress-label {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 0.55rem; color: var(--text-dim); white-space: nowrap;
}
.scenario-name { font-size: 0.75rem; color: var(--text-secondary); }
.gh-right { display: flex; align-items: center; gap: 12px; }
.score-block { display: flex; align-items: baseline; gap: 4px; }
.sb-label { font-size: 0.6rem; color: var(--text-dim); text-transform: uppercase; }
.sb-val { font-size: 1.2rem; font-weight: 700; color: var(--cyan); }
.sb-max { font-size: 0.75rem; color: var(--text-dim); }
.economy-status {
  font-family: var(--font-display); font-size: 0.6rem; letter-spacing: 0.2em;
  padding: 4px 10px; border-radius: 100px;
  background: var(--green-dim); border: 1px solid var(--green); color: var(--green);
  transition: all .4s;
}
.economy-status.turbulent { background: var(--yellow-dim); border-color: var(--yellow); color: var(--yellow); }
.economy-status.critical   { background: var(--red-dim);    border-color: var(--red);    color: var(--red); animation: pulse-cyan .8s infinite; }

/* ─── NEWS BAR ────────────────────────────────────── */
.news-bar {
  display: flex; align-items: center; height: 28px;
  background: var(--bg-deep); border-bottom: 1px solid var(--border-dim);
  overflow: hidden; flex-shrink: 0;
}
.news-label {
  flex-shrink: 0; padding: 0 12px; font-size: 0.6rem;
  font-family: var(--font-display); letter-spacing: .2em;
  color: var(--bg-void); background: var(--red); height: 100%;
  display: flex; align-items: center;
}
.news-scroll-wrap { flex: 1; overflow: hidden; position: relative; }
.news-scroll {
  white-space: nowrap; font-size: 0.75rem; color: var(--text-secondary);
  padding: 0 20px;
  display: inline-block;
  animation: scroll-news 80s linear infinite;
}
@keyframes scroll-news {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─── MAIN LAYOUT ─────────────────────────────────── */
.game-main {
  flex: 1; overflow: hidden;
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  grid-template-rows: 1fr;
  gap: 12px; padding: 12px;
}

/* ─── PANELS ──────────────────────────────────────── */
.panel { border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.panel-title { font-size: 0.62rem; letter-spacing: 0.35em; color: var(--cyan); padding: 14px 16px 8px; border-bottom: 1px solid var(--border-dim); flex-shrink: 0; }

/* ─── LEFT PANEL ──────────────────────────────────── */
.panel-left { padding-bottom: 0; gap: 0; }
.chart-legend {
  display: flex; gap: 12px; padding: 8px 16px;
  font-size: 0.68rem; flex-shrink: 0;
}
.cl-item { color: var(--text-secondary); }
.cl-item.gdp { color: var(--cyan); }
.cl-item.inf { color: var(--gold); }
.cl-item.une { color: #f97316; }
.chart-container { padding: 0 8px; flex-shrink: 0; }
.chart-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding: 8px 16px; flex-shrink: 0;
  border-top: 1px solid var(--border-dim);
}
.cs-item { text-align: center; }
.cs-label { display: block; font-size: 0.6rem; color: var(--text-dim); text-transform: uppercase; }
.cs-val { font-size: 0.85rem; font-weight: 700; }
.cs-val.gdp { color: var(--cyan); }
.cs-val.inf { color: var(--gold); }
/* ─── QUARTERLY GRADE SIDEBAR DISPLAY ─────────────── */
.quarterly-grade-block {
  padding: 14px 16px;
  border-top: 1px solid var(--border-dim);
  background: linear-gradient(180deg, rgba(30, 58, 95, 0.35) 0%, rgba(20, 40, 65, 0.15) 100%);
  transition: background 0.5s ease, box-shadow 0.5s ease;
  position: relative;
  overflow: hidden;
}
.quarterly-grade-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.quarterly-grade-block.updated::before {
  opacity: 1;
  animation: grade-shimmer 1.5s ease-out;
}
@keyframes grade-shimmer {
  0% { opacity: 0; transform: translateX(-100%); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateX(100%); }
}
.qg-header {
  margin-bottom: 10px;
}
.qg-label {
  font-family: var(--font-display);
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-transform: uppercase;
}
.qg-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.qg-quarter {
  font-family: var(--font-data);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}
.qg-grade-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.qg-grade {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-dim);
  transition: color 0.4s ease, transform 0.3s ease, text-shadow 0.4s ease;
}
.qg-grade.grade-S { 
  color: var(--gold); 
  text-shadow: 0 0 24px var(--gold-glow), 0 0 40px var(--gold-glow); 
}
.qg-grade.grade-A { 
  color: var(--cyan); 
  text-shadow: 0 0 20px var(--cyan-glow), 0 0 32px var(--cyan-glow); 
}
.qg-grade.grade-B { 
  color: var(--green); 
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.4); 
}
.qg-grade.grade-C { 
  color: var(--yellow); 
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.3); 
}
.qg-grade.grade-D { 
  color: #f97316; 
  text-shadow: 0 0 10px rgba(249, 115, 22, 0.3); 
}
.qg-grade.grade-F { 
  color: var(--red); 
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.4); 
}
.qg-grade.updated {
  animation: grade-pulse 0.6s ease-out;
}
@keyframes grade-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.qg-score {
  font-family: var(--font-data);
  font-size: 0.78rem;
  color: var(--text-dim);
  transition: color 0.3s ease;
}
.qg-narrative {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.5;
  background: var(--bg-raised);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border-left: 2px solid var(--gold);
  transition: opacity 0.4s ease, border-color 0.4s ease;
}
.qg-narrative.updated {
  animation: narrative-fade-in 0.5s ease-out;
}
@keyframes narrative-fade-in {
  0% { opacity: 0.3; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}
.qg-narrative {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.5;
  background: var(--bg-raised);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border-left: 2px solid var(--gold);
}

.advisor-block {
  flex: 1; padding: 12px 14px;
  border-top: 1px solid var(--border-dim);
  display: flex; flex-direction: column; gap: 10px; overflow: auto;
}
.adv-header { display: flex; align-items: center; gap: 10px; }
.adv-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-raised); border: 1px solid var(--border-glow);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.adv-name { font-size: 0.82rem; font-weight: 600; }
.adv-title { font-size: 0.68rem; color: var(--text-secondary); }
.adv-message {
  font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6;
  background: var(--bg-raised); padding: 10px 12px; border-radius: var(--r-sm);
  border-left: 2px solid var(--cyan);
  animation: slide-right .3s var(--ease-out-expo);
}

/* SVG chart lines */
#history-chart .line-gdp { fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#history-chart .line-inf { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#history-chart .line-une { fill: none; stroke: #f97316; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#history-chart .band-good { fill: rgba(16,185,129,0.06); }
#history-chart .grid-line { stroke: var(--border-dim); stroke-width: 1; stroke-dasharray: 3,3; }
#history-chart .axis-label { fill: var(--text-dim); font-size: 8px; font-family: 'Courier New', monospace; }

/* ─── CENTER PANEL ────────────────────────────────── */
.panel-center { gap: 12px; padding: 12px; overflow-y: auto; }

.gauges-row {
  display: flex; justify-content: center; gap: 16px; flex-shrink: 0;
  margin-top: 220px; /* Push UI down to reveal more city skyline */
}
.gauge-wrap { text-align: center; }
.gauge-host { display: inline-block; }
.gauge-target { font-size: 0.68rem; color: var(--text-dim); margin-top: 4px; }

/* Commodity strip */
.commodities-strip {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; flex-shrink: 0;
  margin-top: 16px; /* Add spacing between gauges and commodities */
}
.comm-item {
  background: var(--bg-raised); border: 1px solid var(--border-dim);
  border-radius: var(--r-sm); padding: 6px 12px; text-align: center;
  min-width: 72px; transition: border-color .3s;
}
.comm-item.up { border-color: rgba(16,185,129,.4); }
.comm-item.down { border-color: rgba(239,68,68,.4); }
.ci-label { display: block; font-size: 0.58rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }
.ci-val { display: block; font-size: 0.85rem; font-weight: 600; }
.ci-arrow { display: block; font-size: 0.7rem; }
.comm-item.up .ci-arrow   { color: var(--green); }
.comm-item.down .ci-arrow { color: var(--red); }

/* Rate Control */
.rate-control { padding: 20px; flex-shrink: 0; }
.rc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rc-label { font-size: 0.68rem; letter-spacing: .2em; color: var(--text-secondary); }
.rc-current { font-size: 2rem; font-weight: 700; color: var(--cyan); line-height: 1; }
.rate-zones {
  display: flex; justify-content: space-between;
  font-size: 0.6rem; margin-bottom: 6px; font-family: var(--font-display);
  letter-spacing: .15em;
}
.slider-wrap { margin-bottom: 8px; }
.slider-track {
  position: relative; height: 8px; background: var(--bg-raised);
  border-radius: 4px; cursor: pointer;
  border: 1px solid var(--border-dim);
}
.slider-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--cyan), var(--yellow), var(--red));
  border-radius: 4px; pointer-events: none;
  width: 15%; /* 3/20 = 15% */
}
.slider-thumb {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-primary); border: 3px solid var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow); cursor: grab;
  transition: box-shadow .2s; outline: none; left: 15%;
}
.slider-thumb:hover, .slider-thumb:focus { box-shadow: 0 0 20px var(--cyan-glow); }
.slider-thumb:active { cursor: grabbing; }
.slider-labels {
  display: flex; justify-content: space-between;
  font-size: 0.65rem; color: var(--text-dim); margin-top: 4px;
}
.rate-buttons { display: flex; gap: 8px; margin: 12px 0; }
.rate-btn {
  flex: 1; padding: 8px; border-radius: var(--r-sm);
  border: 1px solid var(--border-dim); background: var(--bg-raised);
  color: var(--text-primary); font-size: 0.8rem; cursor: pointer;
  font-family: var(--font-data); transition: all .2s;
}
.rate-btn.cut:hover  { border-color: var(--cyan);  color: var(--cyan);  background: var(--cyan-dim); }
.rate-btn.hold:hover { border-color: var(--gold);  color: var(--gold);  background: var(--gold-dim); }
.rate-btn.hike:hover { border-color: var(--red);   color: var(--red);   background: var(--red-dim); }

/* Faint blink hint — draws player attention to the rate buttons */
.rate-btn { animation: cta-pulse 3s ease-in-out infinite; }
.rate-btn.cut  { animation-delay: 0s; }
.rate-btn.hold { animation-delay: 1s; }
.rate-btn.hike { animation-delay: 2s; }
.rate-btn:hover { animation: none; }

@keyframes cta-pulse {
  0%, 80%, 100% { opacity: 1; }
  90%           { opacity: 0.45; }
}
/* Stop blinking once a game is active (game adds .game-active to body) */
body.game-active .rate-btn { animation: none; }

.submit-btn {
  width: 100%; padding: 14px; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--cyan), #0099cc);
  color: var(--bg-void); font-weight: 700; font-size: 0.9rem;
  font-family: var(--font-display); letter-spacing: .15em;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .2s var(--ease-spring), box-shadow .2s;
  position: relative; overflow: hidden;
}
.submit-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,.15), transparent);
  transform: translateX(-100%); transition: transform .4s;
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--cyan-glow); }
.submit-btn:hover::before { transform: translateX(100%); }
.submit-btn:active { transform: scale(.98); }
.sb-icon { font-size: 1rem; }
.sb-shortcut { margin-left: auto; opacity: .5; font-size: .75rem; }

.submit-btn.submitting { animation: pulse-cyan .4s infinite; pointer-events: none; }

/* Consequences preview */
.consequences-preview {
  margin-top: 12px; padding: 12px; background: var(--bg-raised);
  border-radius: var(--r-sm); border-left: 2px solid var(--gold);
  font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6;
  animation: slide-up .3s var(--ease-out-expo);
}

.game-controls { display: flex; gap: 8px; justify-content: center; flex-shrink: 0; }
.gc-btn {
  padding: 7px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--border-dim); background: var(--bg-raised);
  color: var(--text-secondary); font-size: 0.78rem; cursor: pointer;
  transition: all .2s;
}
.gc-btn:hover { border-color: var(--cyan-dim); color: var(--text-primary); }

/* Autoplay faint blink hint */
#btn-autoplay { animation: cta-pulse 3s ease-in-out infinite 1.5s; }
#btn-autoplay:hover { animation: none; }
body.game-active #btn-autoplay { animation: none; }

/* ─── RIGHT PANEL ─────────────────────────────────── */
.panel-right { overflow: hidden; }
.feed-tabs {
  display: flex; border-bottom: 1px solid var(--border-dim); flex-shrink: 0;
}
.ft-tab {
  flex: 1; padding: 8px 4px; background: none; border: none;
  font-family: var(--font-display); font-size: 0.55rem; letter-spacing: .2em;
  color: var(--text-secondary); cursor: pointer;
  border-bottom: 2px solid transparent; transition: all .2s;
}
.ft-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.feed-stream { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.feed-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.fp-icon { font-size: 2rem; opacity: .3; }
.fp-text { font-size: 0.78rem; color: var(--text-dim); text-align: center; }

/* Feed cards */
.feed-card {
  background: var(--bg-raised); border-radius: var(--r-sm);
  border: 1px solid var(--border-dim);
  padding: 10px 12px; font-size: 0.78rem;
  animation: slide-up .35s var(--ease-out-expo);
  transition: border-color .3s;
}
.feed-card:hover { border-color: var(--border-glow); }
.fc-source {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.fc-source-icon { font-size: 0.7rem; }
.fc-source-name {
  font-size: 0.65rem; font-weight: 700;
  font-family: var(--font-data);
}
.fc-source-name.reddit    { color: #ff4500; }
.fc-source-name.twitter   { color: #1d9bf0; }
.fc-source-name.bloomberg { color: #f59e0b; }
.fc-source-name.tiktok    { color: #ff0050; }
.fc-source-name.news      { color: var(--text-secondary); }
.fc-source-time { margin-left: auto; font-size: 0.62rem; color: var(--text-dim); }
.fc-text { color: var(--text-secondary); line-height: 1.5; }
.fc-text strong { color: var(--text-primary); }
.fc-stats { margin-top: 6px; font-size: 0.65rem; color: var(--text-dim); }

/* Impact cards */
.impact-card {
  background: var(--bg-raised); border-radius: var(--r-sm);
  border: 1px solid var(--border-dim); padding: 12px;
  animation: slide-up .35s var(--ease-out-expo);
}
.impact-card.positive { border-left: 3px solid var(--green); }
.impact-card.negative { border-left: 3px solid var(--red); }
.impact-card.neutral  { border-left: 3px solid var(--gold); }
.ic-person { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ic-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
  background: var(--bg-surface); flex-shrink: 0;
}
.ic-name { font-size: 0.82rem; font-weight: 600; }
.ic-context { font-size: 0.68rem; color: var(--text-secondary); }
.ic-story { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; font-style: italic; }

/* ─── GAUGE STYLES ────────────────────────────────── */
.needle-gauge-svg { display: block; filter: drop-shadow(0 4px 16px rgba(0,0,0,.5)); overflow: visible; }

/* ─── MODALS ──────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(30,37,48,.85); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.event-modal, .debrief-modal {
  max-width: 480px; width: 100%; padding: 32px; text-align: center;
  animation: slide-up .4s var(--ease-out-expo);
}
.em-icon { font-size: 3rem; margin-bottom: 12px; }
.em-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 12px; }
.em-desc { color: var(--text-secondary); line-height: 1.7; margin-bottom: 20px; }
.em-impacts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 24px; }
.impact-pill {
  padding: 4px 12px; border-radius: 100px; font-size: 0.78rem;
  font-family: var(--font-data); font-weight: 600;
}
.impact-pill.pos { background: var(--green-dim); border: 1px solid var(--green); color: var(--green); }
.impact-pill.neg { background: var(--red-dim);   border: 1px solid var(--red);   color: var(--red); }
.em-btn {
  padding: 12px 32px; border-radius: var(--r-sm);
  background: var(--cyan); color: var(--bg-void);
  font-family: var(--font-display); font-size: 0.7rem; letter-spacing: .2em;
  border: none; cursor: pointer;
  transition: box-shadow .2s, transform .15s;
}
.em-btn:hover { box-shadow: 0 4px 16px var(--cyan-glow); transform: translateY(-1px); }

/* Debrief modal */
.dm-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.dm-quarter { font-size: 0.75rem; letter-spacing: .2em; color: var(--text-secondary); }
.dm-grade {
  font-family: var(--font-display); font-size: 3rem; font-weight: 900;
  color: var(--cyan); line-height: 1;
}
.dm-grade.good  { color: var(--green); }
.dm-grade.warn  { color: var(--yellow); }
.dm-grade.bad   { color: var(--red); }
.dm-narrative {
  background: var(--bg-raised); border-left: 2px solid var(--cyan);
  padding: 12px 16px; border-radius: var(--r-sm);
  font-size: 0.88rem; color: var(--text-secondary); line-height: 1.7;
  text-align: left; margin-bottom: 16px;
}
.dm-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px;
}
.dm-stat { background: var(--bg-raised); padding: 10px; border-radius: var(--r-sm); text-align: center; }
.dm-stat-label { display: block; font-size: 0.62rem; color: var(--text-dim); text-transform: uppercase; }
.dm-stat-val { display: block; font-family: var(--font-data); font-size: 1.1rem; font-weight: 700; margin-top: 2px; }
.dm-real-fed {
  font-size: 0.78rem; color: var(--text-secondary); background: var(--gold-dim);
  border: 1px solid rgba(245,158,11,.3); padding: 10px 14px; border-radius: var(--r-sm);
  text-align: left; margin-bottom: 20px; line-height: 1.6;
}
.dm-real-fed strong { color: var(--gold); }

/* ─── GAMEOVER ────────────────────────────────────── */
.gameover-panel {
  max-width: 720px; width: 100%; padding: 48px;
  animation: slide-up .5s var(--ease-out-expo);
  max-height: 90vh; overflow-y: auto;
}
.go-title { font-family: var(--font-display); font-size: 0.7rem; letter-spacing: .4em; color: var(--cyan); margin-bottom: 8px; }
.go-grade-block { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.go-grade { font-family: var(--font-display); font-size: 5rem; font-weight: 900; line-height: 1; }
.go-grade.S { color: var(--gold); text-shadow: 0 0 30px var(--gold-glow); }
.go-grade.A { color: var(--cyan); text-shadow: 0 0 30px var(--cyan-glow); }
.go-grade.B { color: var(--green); }
.go-grade.C { color: var(--yellow); }
.go-grade.D, .go-grade.F { color: var(--red); }
.go-verdict { font-size: 1.3rem; font-weight: 700; }
.go-subtitle { font-size: 0.9rem; color: var(--text-secondary); margin-top: 4px; }
.go-narrative {
  font-size: 0.92rem; color: var(--text-secondary); line-height: 1.8;
  background: var(--bg-raised); padding: 16px; border-radius: var(--r-sm);
  border-left: 3px solid var(--cyan); margin-bottom: 24px;
}
.go-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 24px; }
.go-stat { background: var(--bg-raised); padding: 12px; border-radius: var(--r-sm); text-align: center; }
.go-stat-label { display: block; font-size: 0.6rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .1em; }
.go-stat-val { display: block; font-family: var(--font-data); font-size: 1.3rem; font-weight: 700; margin-top: 4px; }
.go-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.go-btn {
  flex: 1; padding: 12px; border-radius: var(--r-sm);
  font-family: var(--font-display); font-size: 0.65rem; letter-spacing: .15em;
  border: 1px solid var(--border-dim); background: var(--bg-raised);
  color: var(--text-secondary); cursor: pointer; transition: all .2s;
}
.go-btn.primary {
  background: linear-gradient(135deg, var(--cyan), #0099cc);
  color: var(--bg-void); border-color: transparent; font-weight: 700;
}
.go-btn:hover { border-color: var(--cyan); color: var(--text-primary); }
.go-btn.primary:hover { box-shadow: 0 4px 16px var(--cyan-glow); transform: translateY(-1px); }

.go-upsell {
  margin-top: 14px; padding: 12px 16px;
  background: linear-gradient(135deg, rgba(0,200,255,0.07), rgba(0,255,136,0.05));
  border: 1px solid rgba(0,200,255,0.25); border-radius: var(--r-sm);
  text-align: center;
}
.go-upsell a {
  color: rgba(0,200,255,0.9); text-decoration: none;
  font-size: 0.82rem; line-height: 1.5;
  transition: color .2s;
}
.go-upsell a:hover { color: #fff; }
.go-upsell strong { color: #00ff88; }

/* ─── IMPROVEMENT 1: WATCHERS SCROLL ─────────────── */
.watchers-scroll-wrap {
  overflow: hidden; max-width: 260px; height: 20px;
}
.watchers-scroll {
  display: inline-block;
  white-space: nowrap; font-size: 0.65rem; color: var(--text-dim);
  animation: scroll-watchers 18s linear infinite;
  letter-spacing: 0.05em;
}
@keyframes scroll-watchers {
  from { transform: translateX(0); }
  to   { transform: translateX(-33.33%); }
}

/* ─── IMPROVEMENT 1: BRAND FONT REDUCED ───────────── */
.gh-brand { font-size: 0.75rem !important; }

/* ─── IMPROVEMENT 2: DEBRIEF POPUP ────────────────── */
.debrief-popup {
  max-width: 560px; width: 100%; padding: 32px;
  max-height: 85vh; overflow-y: auto;
  animation: slide-up .4s var(--ease-out-expo);
  position: relative;
}
.dp-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--text-dim);
  font-size: 1.1rem; cursor: pointer;
}
.dp-close:hover { color: var(--text-primary); }
.dp-title { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: .3em; color: var(--cyan); margin-bottom: 16px; }
.dp-explanation { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 20px; }
.dp-section-label { font-size: 0.65rem; font-family: var(--font-display); letter-spacing: .25em; color: var(--gold); margin-bottom: 10px; }
.dp-tweets { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.dp-tweet { background: var(--bg-raised); border-radius: var(--r-sm); padding: 10px 12px; border-left: 2px solid var(--cyan-dim); }
.dp-tweet-handle { font-size: 0.7rem; color: var(--cyan); font-weight: 700; display: block; margin-bottom: 4px; }
.dp-tweet-text { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }
.dp-tweet-likes { font-size: 0.65rem; color: var(--text-dim); margin-top: 4px; display: block; }
.dp-impact { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; font-style: italic; background: var(--bg-raised); padding: 12px; border-radius: var(--r-sm); border-left: 2px solid var(--gold); }

/* ─── IMPROVEMENT 3: SPACING REDUCTION ────────────── */
.game-main { gap: 10px; padding: 10px; }
.panel-title { padding: 10px 14px 6px; }
.chart-legend { padding: 6px 14px; }
.chart-stats { gap: 6px; padding: 6px 14px; }
.quarterly-grade-block { padding: 10px 14px; }
.advisor-block { padding: 10px 12px; gap: 8px; }
.panel-center { gap: 10px; padding: 10px; }
.commodities-strip { margin-top: 10px; }
.rate-control { padding: 14px; }

/* ─── IMPROVEMENT 4: MARGINS + LETTER SPACING ─────── */
.cs-label, .qg-label, .ci-label, .qi-label { letter-spacing: 0.04em; }
.rate-control, .panel-left, .panel-right { padding-left: 14px; padding-right: 14px; }

/* ─── IMPROVEMENT 9: CURRENT EVENTS ───────────────── */
.current-events-panel {
  background: var(--bg-raised); border-bottom: 1px solid var(--border-dim);
  max-height: 200px; overflow-y: auto; flex-shrink: 0;
}
.ce-header {
  font-size: 0.6rem; font-family: var(--font-display); letter-spacing: .2em;
  color: var(--gold); padding: 8px 12px 4px;
}
.ce-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 12px; cursor: pointer; border-bottom: 1px solid var(--border-dim);
  transition: background .2s;
}
.ce-item:hover { background: rgba(0,212,255,.05); }
.ce-score { font-size: 0.65rem; flex-shrink: 0; padding-top: 2px; }
.ce-headline { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.4; }
.news-popup-modal {
  max-width: 460px; width: 100%; padding: 28px;
  animation: slide-up .4s var(--ease-out-expo); position: relative;
}
.np-headline { font-size: 1rem; font-weight: 700; margin-bottom: 14px; line-height: 1.4; }
.np-relevance { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 14px; }
.np-score { font-size: 0.75rem; color: var(--gold); }

/* ─── IMPROVEMENT 13: GAME OVER ADDITIONS ─────────── */
.how-to-a {
  background: var(--bg-raised); border-radius: var(--r-sm);
  border-left: 3px solid var(--gold); padding: 14px; margin-bottom: 20px;
  font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7;
}
.how-to-a ul { margin: 8px 0 0 16px; }
.how-to-a li { margin-bottom: 6px; }
.hta-label { font-family: var(--font-display); font-size: 0.65rem; letter-spacing: .2em; color: var(--gold); margin-bottom: 8px; }
.how-to-a.excellent { border-color: var(--cyan); color: var(--cyan); font-weight: 600; }
.go-leaderboard { margin-bottom: 20px; }
.lb-header { font-family: var(--font-display); font-size: 0.65rem; letter-spacing: .2em; color: var(--gold); margin-bottom: 12px; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.lb-table th { color: var(--text-dim); font-size: 0.6rem; text-transform: uppercase; letter-spacing: .1em; padding: 4px 8px; text-align: left; border-bottom: 1px solid var(--border-dim); }
.lb-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-dim); color: var(--text-secondary); }
.lb-current td { color: var(--cyan); background: rgba(0,212,255,.05); }
.lb-grade { font-weight: 700; }
.lb-S { color: var(--gold); }
.lb-A { color: var(--cyan); }
.lb-B { color: var(--green); }
.lb-C { color: var(--yellow); }
.lb-D, .lb-F { color: var(--red); }
.lb-cta { font-size: 0.78rem; color: var(--text-dim); margin-top: 10px; text-align: center; }

/* ─── IMPROVEMENT 16: SCORECARD PRINT ─────────────── */
.scorecard-print {
  display: none; position: fixed; inset: 0; z-index: 9998;
  background: white; color: #000; padding: 60px;
  font-family: 'Georgia', serif; text-align: center;
}
.sc-print-header { font-size: 1.4rem; font-weight: 700; letter-spacing: .15em; margin-bottom: 40px; }
.sc-print-grade { font-size: 4rem; font-weight: 900; margin: 20px 0; }
.sc-print-details { font-size: 1rem; line-height: 2; color: #333; }
.sc-print-footer { margin-top: 60px; font-size: 0.8rem; color: #999; }
@media print {
  body > *:not(#scorecard-print) { display: none !important; }
  #scorecard-print { display: block !important; position: static !important; }
}

/* ─── IMPROVEMENT 17: CINEMATIC ANIMATIONS ────────── */

/* LIVE dot in header */
.live-indicator {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-display); font-size: 0.55rem; letter-spacing: .2em;
  color: var(--red);
}
.live-dot-red {
  width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  animation: live-blink 1.2s ease-in-out infinite;
}
@keyframes live-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--red); }
  50%       { opacity: 0.3; box-shadow: none; }
}

/* Heartbeat on score */
.heartbeat {
  animation: heartbeat 2.4s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%      { transform: scale(1.07); }
  28%      { transform: scale(1); }
  42%      { transform: scale(1.04); }
  70%      { transform: scale(1); }
}

/* Rate change flash */
.rate-flash-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 500;
  background: rgba(255,255,255,0.12);
  animation: rate-flash .4s ease-out forwards;
}
@keyframes rate-flash {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

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

/* Cinematic vignette */
.cinematic-vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.65) 100%);
}

/* Advisor panel phone shake on high pressure */
.advisor-block.pressure {
  animation: phone-shake .5s ease-in-out;
}
@keyframes phone-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px) rotate(-1deg); }
  40%      { transform: translateX(4px) rotate(1deg); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}

/* Dust mote particles */
.game-body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background-image: radial-gradient(circle, rgba(0,212,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: float-up 20s linear infinite;
}
@keyframes float-up {
  from { background-position: 0 0; }
  to   { background-position: 30px -60px; }
}

/* Ticker flash amber on bad events */
.news-bar.alert .news-scroll { color: var(--gold); }
.news-bar.critical .news-scroll { color: var(--red); animation: ticker-flash .6s ease-in-out infinite alternate; }
@keyframes ticker-flash {
  from { color: var(--red); }
  to   { color: rgba(239,68,68,.4); }
}

/* Crosshair cursor on rate buttons */
.rate-btn, #slider-thumb, #slider-track { cursor: crosshair; }

/* Analog clock */
.analog-clock { display: flex; align-items: center; }
#clock-canvas { border-radius: 50%; }

/* ─── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1100px) {
  .game-main { grid-template-columns: 240px 1fr 260px; }
}
@media (max-width: 900px) {
  .game-main { grid-template-columns: 1fr; grid-template-rows: auto; overflow-y: auto; }
  .panel-left, .panel-right { max-height: 300px; }
  .game-body { height: auto; overflow: auto; }
  .gauges-row { margin-top: 80px; } /* Less margin on mobile for stacked layout */
}
@media (max-height: 900px) {
  .gauges-row { margin-top: 160px; } /* Reduce margin on shorter screens */
}
@media (max-height: 750px) {
  .gauges-row { margin-top: 100px; } /* Further reduce on medium-short screens */
}
@media (max-height: 600px) {
  .gauges-row { margin-top: 50px; } /* Minimal margin on very short screens */
}
