/* =========================================================
   BitEra Design System — Crisp Pixel Terminal Aesthetic
   Mobile-First (390px baseline) + Desktop Dual-Column
   Supports 3 Display Themes: cyber | gameboy | crt
   ========================================================= */

:root {
  --bg-page: #090e1a;
  --bg-surface: #0f172a;
  --bg-card: #131d33;
  --bg-deep: #060a14;
  --border-main: #283a5a;
  --border-soft: #1e2c46;

  --text-main: #f1f5f9;
  --text-sub: #94a3b8;
  --text-dim: #64748b;

  --c-root: #22c55e;
  --c-over: #38bdf8;
  --c-stable: #facc15;
  --c-glitch: #fb923c;
  --c-far: #ef4444;
  --c-bsod: #475569;
  --c-gold: #fbbf24;
  --c-purple: #a855f7;

  --accent: var(--c-root);
  --accent-secondary: var(--c-over);

  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, sans-serif;
}

/* Pro Theme 2: Game Boy Classic Olive Green */
body[data-theme="gameboy"] {
  --bg-page: #0f2010;
  --bg-surface: #172e17;
  --bg-card: #1f3b1e;
  --bg-deep: #0b170b;
  --border-main: #4a783a;
  --border-soft: #315226;
  --text-main: #d8f3a0;
  --text-sub: #9cc46a;
  --text-dim: #688c46;
  --accent: #a3e635;
  --accent-secondary: #84cc16;
}

/* Pro Theme 3: Retro CRT Neon Vapor */
body[data-theme="crt"] {
  --bg-page: #110a1a;
  --bg-surface: #1a1026;
  --bg-card: #241636;
  --bg-deep: #0a0511;
  --border-main: #5b2d7a;
  --border-soft: #3b1c52;
  --text-main: #fdf4ff;
  --text-sub: #d8b4fe;
  --text-dim: #9370b5;
  --accent: #f472b6;
  --accent-secondary: #38bdf8;
}

.crt-overlay {
  display: none;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.16) 0px,
    rgba(0, 0, 0, 0.16) 1px,
    transparent 1px,
    transparent 3px
  );
}

body[data-theme="crt"] .crt-overlay {
  display: block;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.45;
  overflow-x: hidden;
}

body {
  background-image:
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.08), transparent 55%),
    linear-gradient(rgba(56, 189, 248, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px, 24px 24px;
}

.pixel-art {
  shape-rendering: crispEdges;
}

/* Blink animations for pixel LEDs */
@keyframes pxBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.25; }
}
.px-blink-1 { animation: pxBlink 1.3s infinite; }
.px-blink-2 { animation: pxBlink 1.9s infinite 0.3s; }
.px-blink-3 { animation: pxBlink 2.4s infinite 0.7s; }

@keyframes stageFlash {
  0% { filter: brightness(1); transform: scale(1); }
  35% { filter: brightness(1.8); transform: scale(1.015); }
  100% { filter: brightness(1); transform: scale(1); }
}
.anim-upgrade { animation: stageFlash 0.55s ease-out; }

@keyframes glitchShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); filter: hue-rotate(45deg); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.anim-glitch { animation: glitchShake 0.38s ease-in-out; }

@keyframes popIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.anim-pop { animation: popIn 0.22s ease-out; }

/* App Shell */
.app-shell {
  max-width: 1120px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 16px;
}

/* Top Navbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 2px 10px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 12px;
}

.brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--bg-deep);
  border: 2px solid var(--accent);
  box-shadow: 2px 2px 0 rgba(34, 197, 94, 0.3);
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.edition-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent-secondary);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  color: var(--text-sub);
  border-radius: 6px;
  padding: 6px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.14s;
}

.nav-pill:hover, .nav-pill.active {
  border-color: var(--accent-secondary);
  color: var(--text-main);
  background: rgba(56, 189, 248, 0.14);
}

.nav-pill.pro-pill {
  border-color: rgba(168, 85, 247, 0.65);
  color: #e9d5ff;
  background: rgba(168, 85, 247, 0.16);
}

.nav-pill.pro-pill.unlocked {
  border-color: var(--c-gold);
  color: var(--c-gold);
  background: rgba(250, 204, 21, 0.12);
}

.nav-label {
  display: none;
}

@media (min-width: 640px) {
  .nav-label { display: inline; }
  .app-shell { padding: 16px 26px 18px; }
}

/* Pixel Primitives */
.px-card {
  background: var(--bg-card);
  border: 2px solid var(--border-main);
  box-shadow: 0 4px 0 rgba(4, 7, 15, 0.7);
  border-radius: 8px;
}

.px-btn {
  font-family: var(--font-mono);
  font-weight: 800;
  border: 2px solid;
  border-radius: 7px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
  text-decoration: none;
}

.px-btn:hover:not(:disabled) {
  filter: brightness(1.07);
}

.px-btn:active:not(:disabled) {
  transform: translateY(2px);
}

.px-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.px-btn-primary {
  background: var(--accent);
  border-color: #bbf7d0;
  color: #052e16;
  box-shadow: 0 4px 0 #15803d;
}
.px-btn-primary:active:not(:disabled) { box-shadow: 0 2px 0 #15803d; }

.px-btn-cyan {
  background: var(--accent-secondary);
  border-color: #bae6fd;
  color: #082f49;
  box-shadow: 0 4px 0 #0369a1;
}
.px-btn-cyan:active:not(:disabled) { box-shadow: 0 2px 0 #0369a1; }

.px-btn-gold {
  background: var(--c-gold);
  border-color: #fef08a;
  color: #451a03;
  box-shadow: 0 4px 0 #b45309;
}
.px-btn-gold:active:not(:disabled) { box-shadow: 0 2px 0 #b45309; }

.px-btn-dark {
  background: var(--bg-surface);
  border-color: var(--border-main);
  color: var(--text-main);
  box-shadow: 0 3px 0 #060912;
}
.px-btn-dark:active:not(:disabled) { box-shadow: 0 1px 0 #060912; }

/* Main Play Grid (Mobile 1-col -> Desktop 2-col centered vertically) */
.play-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  align-content: start;
}

@media (min-width: 860px) {
  .play-layout {
    grid-template-columns: 1.08fr 0.92fr;
    gap: 24px;
    align-items: stretch;
    margin: auto 0;
    padding: 10px 0 18px;
  }
}

.stage-col, .control-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 860px) {
  .stage-col, .control-col {
    gap: 14px;
  }
}

/* Progress Chips */
.progress-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.progress-chip {
  height: 11px;
  border-radius: 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  transition: all 0.2s;
}

.progress-chip.active {
  border-color: var(--accent-secondary);
  background: rgba(56, 189, 248, 0.28);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

/* Pixel Desk Canvas Box */
.desk-stage-box {
  position: relative;
  height: 172px;
  border-radius: 10px;
  border: 2px solid var(--border-main);
  background: var(--bg-deep);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (min-width: 860px) {
  .desk-stage-box {
    height: auto;
    min-height: 365px;
    flex: 1;
  }
}

.desk-hud-bar {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  gap: 8px;
}

.stage-chip {
  background: rgba(6, 10, 20, 0.84);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: var(--text-main);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.score-hud-chip {
  background: rgba(6, 10, 20, 0.84);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 800;
}

.timer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 10, 20, 0.88);
  border: 1px solid rgba(250, 204, 21, 0.55);
  color: var(--c-stable);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 800;
}

.timer-chip.urgent {
  border-color: var(--c-far);
  color: var(--c-far);
  animation: pxBlink 0.55s infinite;
}

.timer-cells {
  display: flex;
  gap: 2px;
}

.timer-cells i {
  width: 4px;
  height: 9px;
  background: currentColor;
  display: block;
}

.timer-cells i.off {
  opacity: 0.2;
}

.desk-art-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.desk-footer-bar {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: linear-gradient(transparent, rgba(5, 8, 16, 0.92));
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-sub);
}

/* Desktop keyboard cheat sheet */
.kbd-bar {
  display: none;
}

@media (min-width: 860px) {
  .kbd-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-sub);
  }
}

.kbd {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--text-main);
  font-weight: 700;
}

/* Event Prompt Card */
.prompt-card {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prompt-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
}

.cat-pill {
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #e9d5ff;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.prompt-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.48;
}

@media (min-width: 860px) {
  .prompt-text { font-size: 18px; }
}

/* Tactile Chrono-Dial */
.dial-box {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.era-anchors {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.era-anchor-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 6px 2px;
  border-radius: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.12s;
}

.era-anchor-btn:hover, .era-anchor-btn.near {
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
  background: rgba(56, 189, 248, 0.14);
}

.year-readout-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nudge-btn {
  width: 48px;
  height: 48px;
  font-size: 16px;
  flex-shrink: 0;
}

.year-lcd {
  flex: 1;
  height: 48px;
  background: var(--bg-deep);
  border: 2px solid var(--border-main);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(34, 197, 94, 0.35);
  position: relative;
}

.year-lcd.typing {
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

.dial-viewport {
  position: relative;
  height: 58px;
  background: var(--bg-deep);
  border: 2px solid var(--border-main);
  border-radius: 7px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}

.dial-viewport:active { cursor: grabbing; }

.dial-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--accent);
  transform: translateX(-50%);
  z-index: 4;
  box-shadow: 0 0 10px var(--accent);
  pointer-events: none;
}

.dial-needle::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--accent);
}

.dial-track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  will-change: transform;
}

.dial-hint-band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(250, 204, 21, 0.24);
  border-left: 2px dashed var(--c-gold);
  border-right: 2px dashed var(--c-gold);
  z-index: 1;
  display: none;
}

.dial-hint-band.visible { display: block; }

.dial-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  background: #334155;
  pointer-events: none;
}
.dial-tick.major { height: 23px; width: 2px; background: #94a3b8; }
.dial-tick.mid { height: 15px; background: #64748b; }
.dial-tick.minor { height: 9px; background: #334155; }

.dial-tick-year {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-sub);
  pointer-events: none;
}

.dial-action-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
}

.hint-action-btn {
  padding: 13px 6px;
  font-size: 11px;
  color: var(--c-gold);
  border-color: rgba(250, 204, 21, 0.5);
}

.lock-action-btn {
  padding: 13px 12px;
  font-size: 15px;
  letter-spacing: 0.04em;
}

/* Revealed Panel */
.reveal-card {
  padding: 16px;
  text-align: center;
  border-width: 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grade-badge {
  display: inline-block;
  margin: 0 auto;
  padding: 4px 12px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
  color: #090e1a;
}

.reveal-year-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-mono);
}

.reveal-actual {
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
}

.reveal-diff {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.16);
  color: var(--text-main);
}

.ruler-wrap {
  position: relative;
  height: 36px;
  margin: 6px 10px 2px;
}

.ruler-line {
  position: absolute;
  top: 19px;
  left: 4%;
  right: 4%;
  height: 4px;
  background: var(--border-main);
  border-radius: 99px;
}

.ruler-span {
  position: absolute;
  top: 19px;
  height: 4px;
  border-radius: 99px;
}

.ruler-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.ruler-marker .dot {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}

.upgrade-banner {
  padding: 10px 12px;
  border-radius: 7px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px dashed var(--c-root);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
}

.fact-box {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 860px) {
  .prompt-card {
    padding: 20px 22px;
    flex: 1;
    justify-content: center;
  }
  .fact-box {
    padding: 18px 20px;
    flex: 1;
    justify-content: center;
  }
}

.fact-box p {
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.55;
}

.fact-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-secondary);
  text-decoration: none;
}
.fact-link:hover { text-decoration: underline; }

/* 6-Stage Evolution Ladder Strip */
.stage-ladder {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stage-ladder-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
}

.stage-steps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.stage-step {
  padding: 5px 2px;
  border-radius: 5px;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  transition: all 0.2s;
}

.stage-step.reached {
  border-color: var(--border-main);
  color: var(--text-sub);
  background: rgba(56, 189, 248, 0.08);
}

.stage-step.current {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(34, 197, 94, 0.14);
  font-weight: 900;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.22);
}

/* Single Column Subviews (Summary / Shelf / Squad / Archive) */
.page-wrap {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (min-width: 860px) {
  .page-wrap {
    margin: auto;
    padding: 8px 0 16px;
  }
}

/* Subtle Terminal Footer */
.app-footer {
  margin-top: 14px;
  padding: 12px 4px 2px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-link-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}

.footer-link-btn:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

/* Summary Receipt */
.receipt-box {
  background: var(--bg-card);
  border: 2px dashed var(--border-main);
  border-radius: 10px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.receipt-header {
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-main);
}

.receipt-theme-title {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 900;
  color: var(--c-gold);
  margin: 4px 0;
}

.receipt-total {
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 900;
  line-height: 1.1;
}

.receipt-emojis {
  font-size: 22px;
  letter-spacing: 5px;
  margin-top: 6px;
}

.drop-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(250, 204, 21, 0.09);
  border: 1px solid rgba(250, 204, 21, 0.5);
}

.artifact-frame {
  width: 56px;
  height: 56px;
  background: var(--bg-deep);
  border: 2px solid var(--c-gold);
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Museum Shelf */
.shelf-tier {
  background: var(--bg-surface);
  border: 2px solid var(--border-main);
  border-bottom: 7px solid #4a3525;
  border-radius: 8px;
  padding: 14px 10px 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (min-width: 580px) {
  .shelf-tier { grid-template-columns: repeat(4, 1fr); }
}

.shelf-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s, border-color 0.12s;
}

.shelf-slot:hover {
  transform: translateY(-2px);
  border-color: var(--c-gold);
}

.shelf-slot.selected {
  border-color: var(--c-gold);
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.25);
}

.shelf-slot.locked {
  opacity: 0.4;
  filter: grayscale(1);
  border-style: dashed;
}

.shelf-slot-name {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-main);
  line-height: 1.25;
}

.shelf-slot-year {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--c-gold);
}

/* Era Radar Bars */
.radar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radar-row {
  display: grid;
  grid-template-columns: 82px 1fr 44px;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.radar-track {
  height: 10px;
  background: var(--bg-deep);
  border: 1px solid var(--border-main);
  border-radius: 4px;
  overflow: hidden;
}

.radar-fill {
  height: 100%;
  background: var(--accent-secondary);
}

/* Squad Leaderboard */
.podium-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: end;
  gap: 8px;
  padding: 12px 6px 2px;
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
}

.podium-pedestal {
  width: 100%;
  border-radius: 7px 7px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  padding: 8px 4px;
}

.ped-1 { height: 94px; background: rgba(250,204,21,0.18); border: 2px solid var(--c-gold); color: var(--c-gold); }
.ped-2 { height: 72px; background: rgba(148,163,184,0.16); border: 2px solid #94a3b8; color: #e2e8f0; }
.ped-3 { height: 58px; background: rgba(251,146,60,0.16); border: 2px solid var(--c-glitch); color: #fdba74; }

.squad-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.squad-row.is-me {
  border-color: var(--accent);
  background: rgba(34, 197, 94, 0.1);
}

/* Archive & Endless Grid */
.archive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 560px) {
  .archive-grid { grid-template-columns: repeat(2, 1fr); }
}

.archive-item {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.14s, transform 0.12s;
}

.archive-item:hover {
  border-color: var(--accent-secondary);
  transform: translateY(-2px);
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 540px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Form inputs */
.px-input {
  width: 100%;
  background: var(--bg-deep);
  border: 2px solid var(--border-main);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
}

.px-input:focus {
  border-color: var(--accent-secondary);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(4, 7, 15, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-panel {
  width: 100%;
  max-width: 440px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
}

/* Toast Notifications */
.toast-root {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  background: var(--bg-deep);
  border: 2px solid var(--accent);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 7px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: popIn 0.18s ease-out;
}

.muted { color: var(--text-sub); }
.dim { color: var(--text-dim); }
.mono { font-family: var(--font-mono); }
.text-center { text-align: center; }
.full-w { width: 100%; }

/* White-Hat Collapsible SEO / GEO Guide beneath App Shell */
.seo-guide-wrap {
  max-width: 1120px;
  margin: 0 auto 28px;
  padding: 0 12px;
}

@media (min-width: 640px) {
  .seo-guide-wrap { padding: 0 26px; }
}

.seo-details {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-sub);
}

.seo-summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  user-select: none;
}

.seo-summary::-webkit-details-marker { display: none; }
.seo-summary:hover { color: var(--text-sub); }
.seo-details[open] .seo-chevron { transform: rotate(180deg); }

.seo-content {
  padding: 4px 18px 18px;
  border-top: 1px dashed var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.seo-content h2 {
  font-size: 15px;
  color: var(--text-main);
  margin: 10px 0 6px;
  font-family: var(--font-mono);
}

.seo-content h3 {
  font-size: 13px;
  color: var(--accent-secondary);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}

.seo-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 720px) {
  .seo-cols { grid-template-columns: 1fr 1fr; }
}

.seo-content ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.seo-nav-links {
  font-family: var(--font-mono);
  font-size: 11px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-soft);
}

.seo-nav-links a {
  color: var(--accent-secondary);
  text-decoration: none;
}

.seo-nav-links a:hover { text-decoration: underline; }
