@font-face {
  font-family: 'Pixelify Sans';
  src: url('vendor/pixelify-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  /* Color System: Alpine Obsidian & Ruby Glow */
  --bg-deep: #080c14;
  --bg-base: #0f1624;
  --bg-surface: #172033;
  --bg-surface-hover: #1f2b44;
  --bg-surface-elevated: #24314c;
  --border-subtle: #25334e;
  --border-bright: #394b6e;
  
  --red-primary: #ef4444;
  --red-deep: #dc2626;
  --red-dark: #991b1b;
  --red-glow: rgba(239, 68, 68, 0.35);
  
  --gold-accent: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.25);
  --cyan-accent: #38bdf8;
  --cyan-glow: rgba(56, 189, 248, 0.2);
  --green-accent: #10b981;

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --pixel: 'Pixelify Sans', monospace, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Console chassis styling */
  --console-chassis: #1e2638;
  --console-border: #33415f;
  --console-bezel: #0b0f17;
  --bezel-glare: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text-main);
  background: var(--bg-deep);
  font: 15px/1.65 var(--body);
  background-image: 
    radial-gradient(circle at 50% -10%, rgba(239, 68, 68, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 10% 30%, rgba(56, 189, 248, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 70%, rgba(245, 158, 11, 0.04) 0%, transparent 40%),
    radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 24px 24px;
  min-height: 100vh;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--red-primary);
  outline-offset: 3px;
}

.app {
  max-width: 1240px;
  margin: auto;
  padding: 0 24px 60px;
}

.skip-link {
  position: fixed;
  top: -120px;
  left: 20px;
  background: var(--red-primary);
  color: #fff;
  padding: 12px 20px;
  font-weight: 700;
  border-radius: 8px;
  z-index: 100;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

/* ==================== MASTHEAD ==================== */
.masthead {
  height: 96px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  font: 700 28px/0.95 var(--pixel);
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.brand:hover .pokeball {
  transform: rotate(20deg) scale(1.05);
}

.brand small {
  display: block;
  font: 600 10px/1 var(--body);
  letter-spacing: 2px;
  margin-top: 6px;
  color: var(--text-secondary);
}

.red-word {
  color: var(--red-primary);
  text-shadow: 0 0 16px var(--red-glow);
  margin-left: 4px;
}

.pokeball {
  width: 34px;
  height: 34px;
  border: 3px solid #f8fafc;
  border-radius: 50%;
  background: linear-gradient(to bottom, var(--red-primary) 0 44%, #0f1624 44% 56%, #f8fafc 56%);
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 14px var(--red-glow);
}

.pokeball::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border: 3px solid #0f1624;
  border-radius: 50%;
  background: #f8fafc;
  top: 8px;
  left: 8px;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

.masthead nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-button {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-button:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
  border-color: var(--border-bright);
}

.about-button {
  height: 36px;
  width: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font: 700 16px var(--pixel);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.about-button:hover {
  color: var(--red-primary);
  border-color: var(--red-primary);
  background: var(--bg-surface-hover);
}

/* ==================== HERO INTRO ==================== */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 36px;
  padding: 44px 0 36px;
}

.eyebrow {
  font: 700 11px/1.4 var(--body);
  letter-spacing: 2px;
  margin: 0 0 14px;
  color: var(--red-primary);
  text-transform: uppercase;
  display: flex;
  align-items: center;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--red-primary);
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 8px var(--red-primary);
  animation: pulse-dot 2s infinite ease-in-out;
}

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

.intro h1 {
  font: 700 48px/1.05 var(--pixel);
  margin: 0;
  letter-spacing: -1.5px;
  color: #fff;
}

.intro h1 span {
  display: block;
  color: var(--red-primary);
  font-size: 0.62em;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin-top: 10px;
  text-shadow: 0 0 20px var(--red-glow);
}

.intro-copy {
  max-width: 480px;
}

.intro-copy p {
  font-size: 15px;
  line-height: 1.8;
  margin: 0 0 20px;
  color: var(--text-secondary);
}

.edition {
  font: 600 11px var(--body);
  letter-spacing: 1.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: 6px;
  width: fit-content;
}

.edition > span {
  color: var(--red-primary);
  font-size: 16px;
}

.edition i {
  height: 4px;
  width: 4px;
  background: var(--text-muted);
  border-radius: 50%;
}

/* ==================== GAME CONSOLE & LAYOUT ==================== */
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(290px, 1fr);
  gap: 28px;
  align-items: start;
  margin-bottom: 40px;
}

/* Console Handheld Chassis */
.console {
  background: linear-gradient(175deg, #222c40 0%, #171f30 100%);
  border: 2px solid var(--console-border);
  box-shadow: 
    0 12px 36px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 2px 0 var(--red-primary) inset;
  border-radius: 20px 20px 32px 20px;
  overflow: hidden;
  padding: 0 18px 18px;
  position: relative;
}

.console-top {
  height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 700 10px var(--body);
  letter-spacing: 2px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.console-top > span:first-child {
  font-weight: 700;
  letter-spacing: 2.2px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.power-light {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--green-accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green-accent);
}

.app[data-state="loading"] .power-light {
  background: var(--gold-accent);
  box-shadow: 0 0 8px var(--gold-accent);
  animation: pulse-dot 1s infinite;
}

.app[data-state="playing"] .power-light {
  background: var(--red-primary);
  box-shadow: 0 0 10px var(--red-primary);
}

/* Screen Bezel & Canvas Frame */
.bezel {
  background: #090d15;
  border-radius: 12px;
  padding: 12px;
  margin-top: 14px;
  border: 1px solid #28344d;
  box-shadow: 
    0 4px 14px rgba(0, 0, 0, 0.8) inset,
    0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
}

.screen {
  aspect-ratio: 3 / 2;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.9) inset;
}

.screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bezel-glare);
  pointer-events: none;
  z-index: 10;
}

.game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 2;
}

/* Screen Cards (Title, Loading, Error) */
.card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px;
  z-index: 3;
  transition: opacity 0.25s ease;
}

.app[data-state="title"] .card:not(.card-title),
.app[data-state="loading"] .card:not(.card-loading),
.app[data-state="error"] .card:not(.card-error),
.app[data-state="playing"] .card {
  display: none !important;
}

/* Title Card Mount Silver Theme */
.card-title {
  background: linear-gradient(180deg, #182236 0%, #0d1320 100%);
  color: #fff;
  padding: 0;
  justify-content: space-between;
}

.summit-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.65;
}

.summit-art svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.snow {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #fff, transparent),
    radial-gradient(2px 2px at 80px 120px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 150px 70px, rgba(255,255,255,0.7), transparent),
    radial-gradient(2px 2px at 220px 180px, #fff, transparent);
  background-size: 260px 260px;
  opacity: 0.5;
  animation: snow-drift 18s linear infinite;
}

@keyframes snow-drift {
  0% { transform: translateY(-260px) translateX(0); }
  100% { transform: translateY(260px) translateX(40px); }
}

.screen-caption {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  font: 700 11px var(--pixel);
  letter-spacing: 1.5px;
  color: var(--cyan-accent);
  text-shadow: 0 0 8px var(--cyan-glow);
}

.title-content {
  position: relative;
  z-index: 1;
  padding: 0 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.trainer-wrap {
  position: relative;
  margin-bottom: 12px;
}

.red-sprite {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.6));
}

.screen-title {
  font: 700 28px/1.1 var(--pixel);
  margin: 0 0 6px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.screen-subtitle {
  font-size: 13px;
  color: #cbd5e1;
  margin: 0 0 18px;
  max-width: 380px;
}

/* Play & Action Buttons */
.button-play {
  background: linear-gradient(180deg, var(--red-primary) 0%, var(--red-dark) 100%);
  color: #fff;
  border: 1px solid #fca5a5;
  padding: 12px 30px;
  font: 700 16px var(--pixel);
  letter-spacing: 0.5px;
  border-radius: 8px;
  box-shadow: 0 4px 16px var(--red-glow), 0 2px 0 #7f1d1d;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.button-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px var(--red-glow), 0 2px 0 #7f1d1d;
  filter: brightness(1.1);
}

.button-play:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px var(--red-glow);
}

.played {
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.played-result {
  font: 700 18px var(--pixel);
  color: var(--gold-accent);
  margin: 0;
}

.played-next {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.screen-footnote {
  font-size: 11px;
  color: #94a3b8;
  margin: 12px 0 0;
}

.card-note {
  font-size: 12px;
  color: var(--gold-accent);
  margin-top: 6px;
}

/* Loading & Error States */
.card-loading {
  background: #0d1320;
  color: #fff;
}

.loading-ball {
  margin-bottom: 18px;
  animation: spin-ball 1.4s linear infinite;
}

@keyframes spin-ball {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.card-heading {
  font: 700 20px var(--pixel);
  margin: 0 0 16px;
  color: #fff;
}

.meter {
  width: 240px;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid #334155;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red-primary), var(--gold-accent));
  transition: width 0.2s ease;
}

.card-error {
  background: #140d10;
  color: #fca5a5;
}

/* Console Toolbar (Sound, Fullscreen) */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding: 0 4px;
}

.console-label {
  font: 700 9px var(--body);
  letter-spacing: 2px;
  color: var(--text-muted);
}

.button-quiet {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.button-quiet:hover:not(:disabled) {
  color: #fff;
  border-color: var(--border-bright);
  background: var(--bg-surface-hover);
}

/* ==================== VIRTUAL TOUCH PAD ==================== */
.pad {
  margin-top: 20px;
  padding: 12px 14px 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  grid-template-columns: 120px 1fr 110px;
  grid-template-rows: auto;
  align-items: center;
  user-select: none;
  touch-action: none;
}

/* D-Pad */
.dpad {
  width: 112px;
  height: 112px;
  position: relative;
  margin: auto;
}

.dpad-arm {
  position: absolute;
  background: #2d3748;
  border: 2px solid #1a202c;
  box-shadow: 0 4px 6px rgba(0,0,0,0.4);
}

.dpad-center {
  width: 36px;
  height: 36px;
  top: 38px;
  left: 38px;
  z-index: 2;
  background: #252e3d;
  border-radius: 4px;
}

.dpad-center::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #1a202c;
  opacity: 0.5;
}

.dpad-up {
  width: 36px;
  height: 40px;
  top: 0;
  left: 38px;
  border-radius: 6px 6px 0 0;
}

.dpad-down {
  width: 36px;
  height: 40px;
  bottom: 0;
  left: 38px;
  border-radius: 0 0 6px 6px;
}

.dpad-left {
  width: 40px;
  height: 36px;
  top: 38px;
  left: 0;
  border-radius: 6px 0 0 6px;
}

.dpad-right {
  width: 40px;
  height: 36px;
  top: 38px;
  right: 0;
  border-radius: 0 6px 6px 0;
}

.dpad[data-dir="up"] .dpad-up,
.dpad[data-dir="down"] .dpad-down,
.dpad[data-dir="left"] .dpad-left,
.dpad[data-dir="right"] .dpad-right {
  background: var(--red-deep);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

/* A / B Action Buttons */
.face {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  transform: rotate(-15deg);
}

.pad-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font: 700 18px var(--pixel);
  color: #fff;
  border: 2px solid #7f1d1d;
  background: linear-gradient(180deg, var(--red-primary) 0%, var(--red-dark) 100%);
  box-shadow: 0 5px 0 #450a0a, 0 6px 12px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.08s ease;
}

.pad-button.is-down, .pad-button:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #450a0a, 0 2px 4px rgba(0,0,0,0.6);
}

/* Select / Start Pills */
.meta {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.pad-pill {
  background: #2a3447;
  color: var(--text-secondary);
  border: 1px solid #1a202c;
  border-radius: 12px;
  padding: 4px 12px;
  font: 700 9px var(--body);
  letter-spacing: 1px;
  box-shadow: 0 3px 0 #131722;
  transition: all 0.08s ease;
}

.pad-pill.is-down, .pad-pill:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #131722;
}

/* ==================== SIDEBAR TACTICAL HUD ==================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.challenge-panel, .record-panel, .practice-panel {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  position: relative;
  overflow: hidden;
}

.challenge-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red-primary), var(--gold-accent));
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.panel-heading h2 {
  font: 700 18px var(--pixel);
  margin: 0;
  letter-spacing: -0.5px;
  color: #fff;
}

.live-badge {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-primary);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font: 700 10px var(--body);
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
}

.challenge-date {
  font-size: 13px;
  color: var(--cyan-accent);
  font-weight: 600;
  margin: 0 0 16px;
}

.rule {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.rule-number {
  font: 700 12px var(--pixel);
  color: var(--red-primary);
  background: rgba(239, 68, 68, 0.1);
  padding: 3px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.rule p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.rule p strong {
  color: #fff;
  font-size: 13px;
}

.reset-line {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.reset-line strong {
  color: var(--gold-accent);
  font: 700 16px var(--pixel);
  letter-spacing: 1px;
  text-shadow: 0 0 10px var(--gold-glow);
}

/* Stats Record Panel */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 0 14px;
}

.stats > div {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}

.stats dt {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats dd {
  margin: 4px 0 0;
  font: 700 24px/1 var(--pixel);
  color: #fff;
}

.stats > div:nth-child(1) dd { color: var(--green-accent); }
.stats > div:nth-child(2) dd { color: var(--red-primary); }
.stats > div:nth-child(3) dd { color: var(--gold-accent); }
.stats > div:nth-child(4) dd { color: var(--cyan-accent); }

.record-note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* Practice Mode Launcher in Sidebar */
.practice-panel {
  background: linear-gradient(180deg, #162033 0%, #0f1624 100%);
}

.practice-panel p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.seed-input-wrap {
  display: flex;
  gap: 8px;
}

.seed-input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 12px;
  color: #fff;
  font: 700 13px var(--pixel);
  letter-spacing: 0.5px;
}

.seed-input:focus {
  border-color: var(--red-primary);
  outline: none;
}

.seed-btn-go {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-bright);
  color: #fff;
  border-radius: 6px;
  padding: 0 14px;
  font: 700 13px var(--pixel);
  transition: all 0.2s ease;
}

.seed-btn-go:hover {
  background: var(--red-primary);
  border-color: var(--red-primary);
}

.seed-btn-random {
  width: 100%;
  margin-top: 8px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-bright);
  color: var(--cyan-accent);
  border-radius: 6px;
  padding: 7px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.seed-btn-random:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--cyan-accent);
}

/* ==================== CONTROLS STRIP ==================== */
.under-game {
  margin-top: 20px;
}

.keyboard-strip {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.keyboard-strip kbd {
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  padding: 2px 7px;
  font: 700 11px var(--pixel);
  color: #fff;
  box-shadow: 0 2px 0 rgba(0,0,0,0.4);
  margin-right: 4px;
}

.text-button {
  color: var(--cyan-accent);
  font-size: 13px;
  font-weight: 600;
  margin-left: auto;
  cursor: pointer;
}

.text-button:hover {
  color: #fff;
  text-decoration: underline;
}

/* ==================== OPPONENT DOSSIER (RED'S TEAM) ==================== */
.opponent-strip {
  margin-top: 48px;
}

.section-head {
  margin-bottom: 24px;
}

.section-head h2 {
  font: 700 32px var(--pixel);
  margin: 4px 0 8px;
  color: #fff;
  letter-spacing: -1px;
}

.section-head p {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0;
  max-width: 620px;
}

.dossier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.dossier-card {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.dossier-card:hover {
  transform: translateY(-4px);
  border-color: var(--red-primary);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2);
}

.dossier-sprite-wrap {
  width: 72px;
  height: 72px;
  background: var(--bg-surface);
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  position: relative;
}

.dossier-card:hover .dossier-sprite-wrap {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.2) 0%, transparent 70%);
  border-color: rgba(239, 68, 68, 0.4);
}

.dossier-sprite-wrap img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.dossier-name {
  font: 700 18px var(--pixel);
  color: #fff;
  margin: 0 0 4px;
}

.threat-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.threat-s-plus { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.threat-s { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.threat-a { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }

.dossier-moves {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.dossier-tip {
  font-size: 11px;
  color: var(--gold-accent);
  margin-top: 6px;
  font-style: italic;
}

/* ==================== STRATEGY & WORDLE MATRIX ==================== */
.matrix-section, .guide-section, .faq-section {
  margin-top: 64px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 48px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.comparison-card {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 28px;
  position: relative;
}

.comparison-card.highlight {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg, #172033 0%, #0f1624 100%);
}

.comparison-card h3 {
  font: 700 22px var(--pixel);
  margin: 0 0 14px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comparison-card ul {
  padding-left: 20px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.comparison-card li strong {
  color: #fff;
}

/* Battle Guide Step Cards */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.guide-card {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.guide-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-bright);
}

.guide-step-num {
  font: 700 13px var(--pixel);
  color: var(--cyan-accent);
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 12px;
}

.guide-card h3 {
  font: 700 18px var(--pixel);
  color: #fff;
  margin: 0 0 10px;
}

.guide-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.7;
}

/* ==================== INTERACTIVE ACCORDION FAQ ==================== */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item:hover, .faq-item[open] {
  border-color: var(--border-bright);
}

.faq-question {
  padding: 18px 22px;
  font: 700 16px var(--pixel);
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-icon {
  font-size: 16px;
  color: var(--red-primary);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 22px 20px;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.faq-answer p {
  margin: 0 0 8px;
}

.faq-answer p:last-child {
  margin: 0;
}

/* ==================== FOOTER ==================== */
.footer {
  margin-top: 80px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 40px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 36px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-brand {
  font: 700 24px var(--pixel);
  color: #fff;
  display: inline-block;
  margin-bottom: 8px;
}

.footer-brand span {
  color: var(--red-primary);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: flex-end;
}

.footer-links a, .footer-links button {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.footer-links a:hover, .footer-links button:hover {
  color: #fff;
}

/* ==================== DIALOGS & MODALS ==================== */
dialog {
  background: var(--bg-base);
  color: var(--text-main);
  border: 1px solid var(--border-bright);
  border-radius: 16px;
  padding: 32px;
  max-width: 540px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
}

dialog::backdrop {
  background: rgba(8, 12, 20, 0.75);
  backdrop-filter: blur(4px);
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.dialog-close:hover {
  color: #fff;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1024px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
  .intro {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 32px 0 24px;
  }
  .intro h1 {
    font-size: 38px;
  }
}

@media (max-width: 640px) {
  .app {
    padding: 0 16px 40px;
  }
  .masthead {
    height: 76px;
  }
  .brand {
    font-size: 22px;
  }
  .brand small {
    display: none;
  }
  .intro h1 {
    font-size: 30px;
  }
  .footer {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .footer-links {
    justify-content: flex-start;
  }
}
