/* ===========================
   VARIABLES & RESET
   =========================== */
:root {
  --bg: #060d14;
  --bg-2: #080f18;
  --bg-card: #0a1420;
  --green: #00d4ff;
  --yellow: #fcd34d;
  --yellow-dim: rgba(252,211,77,0.15);
  --yellow-border: rgba(252,211,77,0.3);
  --blue: #60a5fa;
  --purple: #a78bfa;
  --red: #f87171;
  --teal: #34d399;
  --text: #d4eeff;
  --text-dim: #6a9ab8;
  --border: rgba(0,212,255,0.15);
  --border-bright: rgba(0,212,255,0.4);
  --font-pixel: 'Press Start 2P', monospace;   /* titles, nav, badges */
  --font-vt: 'VT323', monospace;               /* terminal, body, flavor */
  --font-silk: 'Silkscreen', monospace;        /* medium UI, stats, labels */
  --radius: 4px;
  --max-w: 960px;
  --nav-h: 48px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-vt);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ===========================
   CRT EFFECTS
   =========================== */
.crt-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9001;
  background: linear-gradient(
    transparent 50%,
    rgba(0, 0, 0, 0.04) 50%
  );
  background-size: 100% 4px;
  animation: scanline-move 8s linear infinite;
}

@keyframes scanline-move {
  0% { background-position: 0 0; }
  100% { background-position: 0 100vh; }
}

.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 8999;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0,0,0,0.7) 100%
  );
}

/* ===========================
   BOOT SCREEN
   =========================== */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem;
  transition: opacity 0.5s ease;
}

.boot-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.boot-text {
  font-family: var(--font-vt);
  font-size: 1.4rem;
  white-space: pre;
  line-height: 1.5;
  background: linear-gradient(
    90deg,
    var(--green) 0%,
    var(--green) 30%,
    #b0f0ff 50%,
    var(--green) 70%,
    var(--green) 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: boot-shimmer 3.2s ease-in-out infinite;
}

@keyframes boot-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}

.boot-cursor {
  font-family: var(--font-vt);
  font-size: 1.4rem;
  color: var(--green);
  animation: blink-cursor 0.6s step-end infinite;
}

@keyframes blink-cursor {
  50% { opacity: 0; }
}

/* ===========================
   MAIN CONTENT
   =========================== */
.main-content {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.main-content.visible { opacity: 1; }

/* ===========================
   HEADER
   =========================== */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(13,13,13,0.92);
  border-bottom: 1px solid var(--border-bright);
  z-index: 100;
  backdrop-filter: blur(4px);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--green);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-name {
  font-family: var(--font-silk);
  font-size: 0.6rem;
  color: #c8d8e8;
  letter-spacing: 0.05em;
}

.nav-dex {
  color: #8aa8c0;
}

.header-right {
  font-family: var(--font-silk);
  font-size: 0.55rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--green); }
  50% { opacity: 0.5; box-shadow: 0 0 2px var(--green); }
}

/* ===========================
   BLINK ANIMATIONS
   =========================== */
.blink {
  animation: blink-cursor 1s step-end infinite;
}

.blink-green {
  color: var(--green);
  animation: blink-green 2s ease-in-out infinite;
}

@keyframes blink-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===========================
   TITLE SCREEN
   =========================== */
.title-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.title-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(252,211,77,0.05) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 50%, rgba(0,212,255,0.03) 0%, transparent 60%);
}

.title-inner {
  position: relative;
  z-index: 1;
  width: 100%;        /* pin to section width — prevents typewriter reflow rippling out */
  min-width: 0;
}

.shiny-label {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--yellow);
  letter-spacing: 0.3em;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 20px var(--yellow);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { text-shadow: 0 0 10px var(--yellow), 0 0 20px var(--yellow); }
  50% { text-shadow: 0 0 5px var(--yellow); }
}

.title-duck {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.pixel-sprite {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Float lives on the wrapper — never conflicts with scale on the img */
.hero-sprite-floater {
  display: flex;
  justify-content: center;
  animation: hero-float 4s ease-in-out infinite;
}

.hero-sprite-img {
  width: 260px;
  height: 260px;
  object-fit: contain;
  filter: brightness(1.05) saturate(1.1);
  cursor: pointer;
  transition: filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 2;
  transform: scale(1);
  /* Fade the sprite edges so the GIF bounding box disappears */
  -webkit-mask-image: radial-gradient(ellipse 80% 85% at 50% 55%, black 60%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 85% at 50% 55%, black 60%, transparent 100%);
}

/* HOVER: grows — never shrinks */
.hero-sprite-img:hover {
  filter: brightness(1.25) saturate(1.5) drop-shadow(0 0 28px rgba(167,139,250,0.8));
  transform: scale(1.1);
}


/* Pure vertical float on the wrapper */
@keyframes hero-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-20px); }
}

.sprite-label {
  font-family: var(--font-pixel);
  font-size: 0.35rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  transition: color 0.3s;
}

.dex-sprite-img {
  width: 240px;
  height: 240px;
  object-fit: contain;
  /* Static — no animation */
}

@keyframes duck-float {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-15px) rotate(5deg); }
}

h1.game-title {
  font-family: var(--font-pixel);
  font-size: clamp(2.5rem, 8vw, 5rem);
  color: #ffffff;
  text-shadow:
    3px 3px 0 var(--green),
    6px 6px 0 #003d60,
    9px 9px 0 rgba(0,0,0,0.35),
    0 0 30px rgba(0,212,255,0.8),
    0 0 60px rgba(0,212,255,0.5),
    0 0 110px rgba(167,139,250,0.3);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  animation: title-glow 3.5s ease-in-out infinite;
}

@keyframes title-glow {
  0%, 100% {
    text-shadow:
      3px 3px 0 var(--green),
      6px 6px 0 #003d60,
      9px 9px 0 rgba(0,0,0,0.35),
      0 0 30px rgba(0,212,255,0.8),
      0 0 60px rgba(0,212,255,0.5),
      0 0 110px rgba(167,139,250,0.3);
  }
  50% {
    text-shadow:
      3px 3px 0 #d4aa30,
      6px 6px 0 #7a4f00,
      9px 9px 0 rgba(0,0,0,0.35),
      0 0 40px rgba(252,211,77,0.9),
      0 0 80px rgba(0,212,255,0.6),
      0 0 140px rgba(167,139,250,0.4);
  }
}

.title-sub {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.2em;
  margin-bottom: 2rem;
}

.title-tagline {
  font-family: var(--font-vt);
  font-size: 1.6rem;
  color: var(--text-dim);
  margin-bottom: 3rem;
  min-height: 2rem;
  width: 100%;        /* fixed container — text content changes don't shift parent width */
  display: block;
}

.cursor { animation: blink-cursor 0.7s step-end infinite; }


/* ===========================
   SPARKLES
   =========================== */
.hero-sparkles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  image-rendering: pixelated;
}

/* ===========================
   BRAINWAVE RINGS
   =========================== */
.brainwave-rings {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0,212,255,0.15);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: brainwave 5s ease-out infinite;
}

.ring-1 { width: 200px; height: 200px; animation-delay: 0s; }
.ring-2 { width: 350px; height: 350px; animation-delay: 1.2s; border-color: rgba(167,139,250,0.1); }
.ring-3 { width: 520px; height: 520px; animation-delay: 2.4s; border-color: rgba(0,212,255,0.08); }
.ring-4 { width: 700px; height: 700px; animation-delay: 3.6s; border-color: rgba(167,139,250,0.05); }

@keyframes brainwave {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ===========================
   PIXEL CANVAS (particle field)
   =========================== */
.pixel-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}


/* Contact sprite */
.contact-sprite {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(0,212,255,0.5));
  animation: duck-float 4s ease-in-out infinite;
}

/* ===========================
   SECTION BASE
   =========================== */
.section-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: #fff;
  text-shadow: 2px 2px 0 var(--green), 4px 4px 0 #003d60;
  border-bottom: 1px solid var(--border-bright);
  padding-bottom: 0.75rem;
  margin-bottom: 2.5rem;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-num {
  color: var(--yellow);
}

/* ===========================
   DEX SECTION
   =========================== */
.dex-section {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.dex-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.dex-card {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.dex-sprite {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dex-info { flex: 1; }

.dex-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(0,212,255,0.07);
  font-family: var(--font-vt);
  font-size: 1.1rem;
}

.dex-row:last-child { border-bottom: none; }

.dex-label {
  font-family: var(--font-silk);
  font-size: 0.6rem;
  color: var(--text-dim);
  min-width: 60px;
}

.type-badge {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  letter-spacing: 0.05em;
}

.type-psychic { background: rgba(167,139,250,0.2); color: var(--purple); border: 1px solid rgba(167,139,250,0.4); }
.type-water   { background: rgba(96,165,250,0.2);  color: var(--blue);   border: 1px solid rgba(96,165,250,0.4); }
.type-normal  { background: rgba(136,136,136,0.2); color: #aaa;          border: 1px solid rgba(136,136,136,0.4); }

/* Stats */
.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.ls-updated-tag {
  font-family: var(--font-vt);
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: normal;
  margin-left: 0.5rem;
  letter-spacing: 0;
}

.stats-title {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--yellow);
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
}

.stat-row {
  display: grid;
  grid-template-columns: 110px 1fr 40px;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-name {
  font-family: var(--font-silk);
  font-size: 0.55rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

.stat-bar {
  height: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  width: var(--fill);
  background: var(--color);
  box-shadow: 0 0 6px var(--color);
  border-radius: 1px;
  animation: stat-grow 1.2s ease-out both;
  transform-origin: left;
}

@keyframes stat-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.stat-num {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--yellow);
  text-align: right;
}

.dex-flavor {
  font-family: var(--font-vt);
  font-size: 1.1rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.7;
  padding: 1rem;
  background: rgba(0,212,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.flavor-bracket { color: var(--green); }

/* ===========================
   MOVES SECTION
   =========================== */
.moves-section { background: var(--bg); }

.moves-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.move-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.move-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 0 16px rgba(0,212,255,0.08);
}

.move-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.move-name {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--yellow);
  letter-spacing: 0.05em;
}

.move-type {
  font-family: var(--font-pixel);
  font-size: 0.35rem;
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
}

.move-pp {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.move-card p {
  font-family: var(--font-vt);
  font-size: 1.05rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ===========================
   SYSTEM / TERMINAL
   =========================== */
.system-section {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.terminal-box {
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0,212,255,0.05);
}

.terminal-bar {
  background: rgba(0,212,255,0.08);
  border-bottom: 1px solid var(--border-bright);
  padding: 0.5rem 1rem;
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--green);
}

.terminal-body {
  padding: 1.5rem;
  background: #040c14;
}

.term-line {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  padding: 0.4rem 0;
  font-family: var(--font-vt);
  font-size: 1.2rem;
  border-bottom: 1px solid rgba(0,212,255,0.04);
}

.term-line:last-child { border-bottom: none; }

.term-key {
  color: var(--green);
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  display: flex;
  align-items: center;
  letter-spacing: 0.05em;
}

.term-val { color: var(--text); }

/* ===========================
   CONTACT
   =========================== */
.contact-section { background: var(--bg); }

.contact-inner {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.contact-duck {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: duck-float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(252,211,77,0.5));
}

.contact-text {
  font-family: var(--font-vt);
  font-size: 1.4rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.contact-text a {
  color: var(--yellow);
  border-bottom: 1px solid var(--yellow-border);
  transition: color 0.2s;
}

.contact-text a:hover { color: #fde68a; }

.contact-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.retro-btn {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--green);
  border: 1px solid var(--border-bright);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  letter-spacing: 0.1em;
  transition: all 0.2s;
  background: rgba(0,212,255,0.03);
}

.retro-btn:hover {
  background: rgba(0,212,255,0.1);
  box-shadow: 0 0 12px rgba(0,212,255,0.2);
  color: #fff;
}

/* ===========================
   FOOTER
   =========================== */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: var(--text-dim);
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===========================
   HEADER NAV
   =========================== */
.header-nav {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.nav-link {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  color: var(--text-dim);
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  letter-spacing: 0.1em;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

/* IDEAS — solo nav button, bigger + electric */
.nav-link-ideas {
  font-size: 0.52rem;
  padding: 0.38rem 0.9rem;
  color: #fcd34d;
  border-color: #fcd34d55;
  letter-spacing: 0.15em;
  gap: 0.45rem;
}

.nav-link-ideas:hover,
.nav-link-ideas.active {
  color: #fcd34d;
  border-color: #fcd34d;
  background: rgba(252, 211, 77, 0.08);
  box-shadow: 0 0 14px rgba(252, 211, 77, 0.25), inset 0 0 8px rgba(252, 211, 77, 0.05);
}

.nav-sym {
  font-size: 0.75rem;
  opacity: 0.75;
  line-height: 1;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.2s;
}

.nav-label {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  vertical-align: middle;
}

.nav-link:hover .nav-sym,
.nav-link.active .nav-sym {
  opacity: 1;
  transform: scale(1.2);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--green);
  transform: scaleX(0);
  transition: transform 0.25s ease;
  transform-origin: left;
}

.nav-link:hover,
.nav-link.active {
  color: var(--green);
  border-color: var(--border-bright);
  background: rgba(0,212,255,0.05);
  box-shadow: 0 0 10px rgba(0,212,255,0.1);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-pip {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green), 0 0 12px rgba(0,212,255,0.5);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ===========================
   IDEAS SECTION
   =========================== */
.ideas-section {
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.ideas-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(167,139,250,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(0,212,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.ideas-subtitle {
  font-family: var(--font-vt);
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
}

.ideas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.idea-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  position: relative;
  overflow: hidden;
}

.idea-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.idea-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 0 24px rgba(0,212,255,0.08), 0 8px 32px rgba(0,0,0,0.3);
  transform: translateY(-3px);
}

/* clickable idea cards on /ideas page */
a.idea-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.idea-card-link:hover {
  border-color: #fcd34d55;
  box-shadow: 0 0 24px rgba(252,211,77,0.08), 0 8px 32px rgba(0,0,0,0.3);
  transform: translateY(-3px);
}

.idea-card:hover::before {
  opacity: 1;
}

.idea-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.idea-name {
  font-family: var(--font-pixel);
  font-size: 0.42rem;
  color: var(--yellow);
  letter-spacing: 0.05em;
  line-height: 1.5;
}

.idea-status {
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  padding: 0.2rem 0.45rem;
  border-radius: 2px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.status-deployed {
  background: rgba(52,211,153,0.15);
  color: var(--teal);
  border: 1px solid rgba(52,211,153,0.35);
}

.status-proto {
  background: rgba(96,165,250,0.15);
  color: var(--blue);
  border: 1px solid rgba(96,165,250,0.35);
}

.status-brewing {
  background: rgba(252,211,77,0.12);
  color: var(--yellow);
  border: 1px solid rgba(252,211,77,0.3);
  animation: blink-green 2.5s ease-in-out infinite;
}

.status-pass {
  background: rgba(100,100,100,0.12);
  color: #6b7280;
  border: 1px solid rgba(100,100,100,0.25);
  text-decoration: line-through;
}

.status-rd {
  background: rgba(252,211,77,0.1);
  color: #fcd34d;
  border: 1px solid rgba(252,211,77,0.3);
}

.idea-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.idea-tag {
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
}

.tag-psychic { background: rgba(167,139,250,0.2); color: var(--purple); border: 1px solid rgba(167,139,250,0.4); }
.tag-tech    { background: rgba(96,165,250,0.2);  color: var(--blue);   border: 1px solid rgba(96,165,250,0.4); }

.idea-type {
  font-family: var(--font-silk);
  font-size: 0.5rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.idea-desc {
  font-family: var(--font-vt);
  font-size: 1.05rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 1.1rem;
}

.idea-bar {
  height: 3px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  overflow: hidden;
}

.idea-bar-fill {
  height: 100%;
  width: var(--fill);
  background: var(--c);
  box-shadow: 0 0 6px var(--c);
  border-radius: 2px;
  animation: stat-grow 1.4s ease-out both;
  transform-origin: left;
}

/* ===========================
   LIVE STATUS PANEL
   =========================== */
.live-status-box {
  margin-bottom: 1.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.live-status-title {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--cyan);
  letter-spacing: 0.12em;
  padding: 0.6rem 1rem;
  background: rgba(0,212,255,0.06);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.live-status-updated {
  font-size: 0.38rem;
  color: var(--text-dim);
}

.live-status-loading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0.8rem 1rem;
}

.ls-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.ls-group {
  padding: 0.7rem 1rem 0.8rem;
}

.ls-group + .ls-group {
  border-left: 1px solid var(--border);
}

.ls-group-label {
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.ls-row {
  display: grid;
  grid-template-columns: 1rem 6rem 4.5rem 1fr;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.ls-icon { font-size: 0.65rem; text-align: center; }
.ls-name { color: var(--text); white-space: nowrap; }
.ls-note { color: var(--text-dim); font-size: 0.68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ls-badge {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  padding: 0.15rem 0.35rem;
  border-radius: 2px;
  text-align: center;
  letter-spacing: 0.05em;
}

/* Status colours */
.ls-status-ok      { color: #34d399; }
.ls-status-limited { color: #fcd34d; }
.ls-status-down    { color: #f87171; }
.ls-status-locked  { color: #6b7280; }
.ls-status-unknown { color: var(--text-dim); }

.ls-badge.ls-status-ok      { background: rgba(52,211,153,0.12);  border: 1px solid rgba(52,211,153,0.3); }
.ls-badge.ls-status-limited { background: rgba(252,211,77,0.12);  border: 1px solid rgba(252,211,77,0.3); }
.ls-badge.ls-status-down    { background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.3); }
.ls-badge.ls-status-locked  { background: rgba(107,114,128,0.12); border: 1px solid rgba(107,114,128,0.3); }

/* ===========================
   MODEL STACK DIAGRAM
   =========================== */
.model-stack-box {
  margin-top: 1.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.model-stack-title {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--cyan);
  letter-spacing: 0.12em;
  padding: 0.6rem 1rem;
  background: rgba(0,212,255,0.06);
  border-bottom: 1px solid var(--border);
}

.model-stack-diagram {
  padding: 1rem 1rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.model-tier {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.8rem;
  border-radius: 4px;
  border: 1px solid transparent;
}

.tier-primary {
  border-color: rgba(0,212,255,0.35);
  background: rgba(0,212,255,0.05);
}

.tier-fallback {
  border-color: rgba(167,139,250,0.25);
  background: rgba(167,139,250,0.04);
}

.tier-local {
  border-color: rgba(100,100,100,0.3);
  background: rgba(255,255,255,0.02);
}

.tier-badge {
  font-family: var(--font-pixel);
  font-size: 0.35rem;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tier-primary   .tier-badge { color: var(--cyan);   background: rgba(0,212,255,0.12); }
.tier-fallback  .tier-badge { color: #a78bfa;        background: rgba(167,139,250,0.12); }
.tier-local     .tier-badge { color: var(--text-dim); background: rgba(255,255,255,0.05); }

.tier-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tier-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
}

.tier-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.tier-status {
  font-family: var(--font-pixel);
  font-size: 0.32rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.tier-connector {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  padding: 0.2rem 0.8rem;
  opacity: 0.5;
}

.model-aliases {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.7rem 0.8rem 0.2rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.alias-label {
  font-family: var(--font-pixel);
  font-size: 0.35rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.alias-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
}

.alias-key {
  color: var(--yellow);
}

.local-fleet {
  margin-top: 0.8rem;
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
}

.local-fleet-title {
  font-family: var(--font-pixel);
  font-size: 0.35rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
  padding: 0 0.2rem;
}

.local-fleet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.local-model-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lm-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
}

.lm-tags {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.lm-tag {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  padding: 0.15rem 0.35rem;
  border-radius: 2px;
  letter-spacing: 0.05em;
}

.lm-tag-custom  { color: #fcd34d; background: rgba(252,211,77,0.1);  border: 1px solid rgba(252,211,77,0.25); }
.lm-tag-tools   { color: #34d399; background: rgba(52,211,153,0.1);  border: 1px solid rgba(52,211,153,0.25); }
.lm-tag-reason  { color: #a78bfa; background: rgba(167,139,250,0.1); border: 1px solid rgba(167,139,250,0.25); }
.lm-tag-code    { color: #60a5fa; background: rgba(96,165,250,0.1);  border: 1px solid rgba(96,165,250,0.25); }
.lm-tag-vision  { color: #f87171; background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.25); }

.lm-desc {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ===========================
   TRIPPY CLICK EFFECT
   =========================== */
.trippy-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8498;
  opacity: 0;
  background: transparent;
  mix-blend-mode: screen;
}

.trippy-overlay.active {
  animation: trippy-pulse 2.4s ease-out forwards;
}

@keyframes trippy-pulse {
  0%   { opacity: 0; background: radial-gradient(ellipse at 50% 50%, rgba(167,139,250,0) 0%, transparent 80%); }
  5%   { opacity: 0.9; background: radial-gradient(ellipse at 40% 40%, rgba(167,139,250,0.76) 0%, rgba(0,212,255,0.54) 30%, rgba(252,211,77,0.27) 60%, transparent 80%); }
  15%  { opacity: 0.85; background: radial-gradient(ellipse at 65% 35%, rgba(252,211,77,0.72) 0%, rgba(167,139,250,0.54) 35%, rgba(0,212,255,0.27) 65%, transparent 85%); }
  28%  { opacity: 0.76; background: radial-gradient(ellipse at 30% 65%, rgba(0,212,255,0.76) 0%, rgba(252,211,77,0.45) 35%, rgba(167,139,250,0.27) 65%, transparent 85%); }
  42%  { opacity: 0.67; background: radial-gradient(ellipse at 70% 55%, rgba(167,139,250,0.72) 0%, rgba(0,212,255,0.36) 40%, rgba(252,211,77,0.18) 70%, transparent 90%); }
  58%  { opacity: 0.5; background: radial-gradient(ellipse at 45% 30%, rgba(252,211,77,0.63) 0%, rgba(167,139,250,0.36) 40%, transparent 80%); }
  78%  { opacity: 0.27; background: radial-gradient(ellipse at 60% 70%, rgba(0,212,255,0.45) 0%, rgba(167,139,250,0.18) 50%, transparent 80%); }
  100% { opacity: 0; background: transparent; }
}

/* Main content filter — animated via JS */
#mainContent.trippy-active {
  will-change: filter;
}

/* ===========================
   PIXEL GRID BACKGROUND
   =========================== */
.dex-section::before,
.system-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

.dex-section, .system-section { position: relative; overflow: hidden; }

/* ===========================
   WANDERING DUCK
   =========================== */
#wanderDuck {
  position: fixed;
  z-index: 200;
  width: 70px;
  height: 70px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  /* position + rotation handled by JS physics — no CSS transition on those */
  transition: opacity 1.4s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  filter: drop-shadow(0 4px 14px rgba(0,212,255,0.35));
  transform-origin: center center;
  will-change: transform, left, top;
}

#wanderDuck.visible {
  opacity: 1;
  pointer-events: auto;
}

#wanderDuck:hover {
  opacity: 1;
  filter: drop-shadow(0 4px 20px rgba(167,139,250,0.7));
}

#wanderDuck img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  -webkit-mask-image: radial-gradient(ellipse 80% 85% at 50% 55%, black 60%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 85% at 50% 55%, black 60%, transparent 100%);
}

.wander-label {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

#wanderDuck:hover .wander-label {
  opacity: 1;
}

/* wander-bob removed — rotation + float handled by JS physics */

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
  .dex-grid { grid-template-columns: 1fr; }
  .moves-grid { grid-template-columns: 1fr 1fr; }
  .ideas-grid { grid-template-columns: 1fr 1fr; }
  .dex-card { flex-direction: column; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .moves-grid { grid-template-columns: 1fr; }
  .ideas-grid { grid-template-columns: 1fr; }
  h1.game-title { font-size: 2rem; }
  .section-wrap { padding: 2.5rem 1.25rem; }
  .boot-screen { padding: 1.5rem; }
  .boot-text { font-size: 1rem; }
}
