@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500&family=Inter:wght@400;500&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --midnight:   #0B1829;
  --midnight2:  #0F2138;
  --midnight3:  #162840;
  --blue:       #1A5FC8;
  --blue2:      #4A9EFF;
  --blue3:      #E8F2FF;
  --green:      #1AA87A;
  --green2:     #0F6E56;
  --green3:     #E1F5EE;
  --surface:    #F5F7FA;
  --surface2:   #EDF1F7;
  --white:      #FFFFFF;
  --ink:        #0B1829;
  --ink2:       #2D4160;
  --ink3:       #5A7290;
  --ink4:       #8BA3BE;

  --amber:      #E89B1A;
  --red:        #D94040;
  --teal:       #1AA87A;

  --font-display: 'DM Sans', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --r:    6px;
  --r2:   10px;
  --r3:   14px;
  --r4:   20px;

  --shadow-sm: 0 1px 3px rgba(11,24,41,0.08);
  --shadow:    0 2px 8px rgba(11,24,41,0.10);
  --shadow-lg: 0 4px 20px rgba(11,24,41,0.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--midnight);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

img { display: block; max-width: 100%; }
a { color: var(--blue2); text-decoration: none; }
a:hover { color: var(--white); }

p, span, div, li, td { overflow-wrap: break-word; word-break: break-word; }

.section-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue2);
  background: rgba(74,158,255,0.08);
  border: 1px solid rgba(74,158,255,0.2);
  border-radius: 20px;
  padding: 5px 14px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

/* ── UTILITIES ── */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 24px; max-width: 1160px; margin: 0 auto; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue2);
  display: block;
  margin-bottom: 12px;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
.badge-blue  { background: rgba(74,158,255,0.12); color: var(--blue2); }
.badge-green { background: rgba(26,168,122,0.12); color: var(--green); }
.badge-amber { background: rgba(232,155,26,0.12); color: var(--amber); }

.divider { height: 1px; background: rgba(255,255,255,0.09); margin: 0; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: var(--r2);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(26,95,200,0.3);
}
.btn-primary:hover { background: #1e6ee0; color: var(--white); box-shadow: 0 4px 16px rgba(26,95,200,0.4); }

.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.12);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); color: var(--white); }

.btn-ghost {
  background: transparent;
  color: var(--blue2);
  border: 1px solid rgba(74,158,255,0.25);
}
.btn-ghost:hover { background: rgba(74,158,255,0.08); color: var(--blue2); }

.btn-green {
  background: var(--green);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(26,168,122,0.3);
}
.btn-green:hover { background: #1bbf8a; color: var(--white); }

.btn-gold {
  background: var(--amber);
  color: var(--midnight);
  box-shadow: 0 2px 8px rgba(232,155,26,0.3);
}
.btn-gold:hover { background: #f0a82a; color: var(--midnight); }
.btn-gold:disabled { background: rgba(232,155,26,0.3); color: rgba(11,24,41,0.5); }

.btn-lg { font-size: 16px; padding: 13px 28px; }
.btn-sm { font-size: 13px; padding: 7px 16px; }

/* ── NAV ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(11,24,41,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 32px;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--white);
  letter-spacing: -0.8px;
  text-decoration: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.nav-logo-mark {
  width: 34px; height: 34px;
  background: var(--blue);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-logo-mark svg { width: 18px; height: 18px; }
.nav-logo span { color: var(--blue2); }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  padding: 6px 12px;
  border-radius: var(--r);
  transition: all 0.12s;
  text-decoration: none;
}
.nav-links a:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.nav-links a.active { color: var(--white); }
.nav-cta { margin-left: auto; }

/* ── HERO ── */
.hero {
  padding: 100px 32px 80px;
  max-width: 1160px;
  margin: 0 auto;
}
.hero-inner { max-width: 680px; }
.hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  color: var(--white);
  margin-bottom: 20px;
  line-height: 1.05;
}
.hero h1 em { color: var(--blue2); font-style: normal; }
.hero-sub {
  font-size: clamp(16px, 2vw, 18px);
  color: rgba(255,255,255,0.5);
  max-width: 520px;
  margin-bottom: 36px;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 56px; }
.hero-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.hero-stat-n {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  color: var(--white);
  letter-spacing: -1px;
  line-height: 1;
}
.hero-stat-l {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ── TICKER ── */
.ticker {
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 12px 0;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-inner { display: inline-block; animation: ticker 50s linear infinite; }
.ticker-item {
  display: inline-block;
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  padding: 0 40px;
}
.ticker-item::after { content: '·'; margin-left: 40px; color: var(--blue); }
@keyframes ticker { from{transform:translateX(0)} to{transform:translateX(-50%)} }

/* ── SECTION HEADER ── */
.section-header { margin-bottom: 48px; }
.section-header h2 {
  font-size: clamp(28px, 4vw, 44px);
  color: var(--white);
  margin-bottom: 12px;
}
.section-header p { font-size: 16px; color: rgba(255,255,255,0.45); max-width: 520px; line-height: 1.7; }

/* ── CARDS ── */
.card {
  background: var(--midnight2);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r3);
  padding: 24px;
  transition: all 0.15s;
}
.card:hover { border-color: rgba(74,158,255,0.2); background: var(--midnight3); }

/* ── CATEGORY CARDS ── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cat-card {
  background: var(--midnight2);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r3);
  padding: 20px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--blue);
  opacity: 0;
  transition: opacity 0.15s;
}
.cat-card:hover { border-color: rgba(74,158,255,0.25); background: var(--midnight3); }
.cat-card:hover::after { opacity: 1; }
.cat-icon { font-size: 32px; margin-bottom: 10px; display: block; }
.cat-name { font-family: var(--font-display); font-size: 15px; color: var(--white); margin-bottom: 4px; }
.cat-count { font-family: var(--font-mono); font-size: 13px; color: var(--ink4); }

/* ── GAME CARDS ── */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.game-card {
  background: var(--midnight2);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r3);
  padding: 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.game-card:hover { border-color: rgba(74,158,255,0.25); background: var(--midnight3); transform: translateY(-1px); }
.game-card-icon { font-size: 28px; margin-bottom: 10px; }
.game-card-name { font-family: var(--font-display); font-size: 15px; color: var(--white); margin-bottom: 4px; }
.game-card-desc { font-size: 13px; color: rgba(255,255,255,0.4); line-height: 1.5; margin-bottom: 12px; }
.game-card-footer { display: flex; align-items: center; gap: 8px; }
.game-sci {
  font-size: 11px;
  color: var(--blue2);
  background: rgba(74,158,255,0.08);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5,12,22,0.85);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--midnight2);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--r4);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.modal-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 14px;
}
.modal-icon { font-size: 28px; }
.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--white);
  flex: 1;
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s;
}
.modal-close:hover { background: rgba(255,255,255,0.14); color: var(--white); }
.modal-body { padding: 24px 28px; }
.modal-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 2px solid var(--blue);
  line-height: 1.6;
}
.modal-section-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 12px;
}

/* ── INSTRUCTIONS PANEL ── */
.modal-instructions {
  background: rgba(74,158,255,0.05);
  border: 1px solid rgba(74,158,255,0.12);
  border-radius: var(--r2);
  padding: 16px;
  margin-bottom: 20px;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
}
.modal-instructions strong { color: var(--blue2); font-weight: 500; }

/* ── LEVEL SELECT ── */
.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}
.level-btn {
  padding: 8px 4px;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.5);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
}
.level-btn:hover { border-color: rgba(74,158,255,0.3); color: var(--white); background: rgba(74,158,255,0.08); }
.level-btn.selected { border-color: var(--blue2); color: var(--blue2); background: rgba(74,158,255,0.12); }
.level-name { display: block; font-size: 9px; opacity: 0.6; margin-top: 2px; font-family: var(--font-body); letter-spacing: 0.3px; }

/* ── GAME HUD ── */
.game-hud {
  display: flex; gap: 0;
  background: var(--midnight3);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r2);
  margin-bottom: 20px;
  overflow: hidden;
}
.hud-stat {
  flex: 1; text-align: center;
  padding: 12px 8px;
  border-right: 1px solid rgba(255,255,255,0.05);
}
.hud-stat:last-child { border-right: none; }
.hud-val {
  font-family: var(--font-mono);
  font-size: 24px;
  color: var(--white);
  line-height: 1;
}
.hud-lbl {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 3px;
}

/* ── GAME AREA ── */
.game-area {
  background: var(--midnight3);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r2);
  padding: 24px;
  min-height: 280px;
}

/* ── GAME INSTRUCTIONS / COUNTDOWN ── */
.game-instructions {
  background: rgba(74,158,255,0.05);
  border: 1px solid rgba(74,158,255,0.15);
  border-radius: var(--r2);
  padding: 20px 24px;
  margin-bottom: 20px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  line-height: 1.8;
}
.game-instructions h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--white);
  margin-bottom: 10px;
}
.game-instructions ul { padding-left: 20px; }
.game-instructions li { margin-bottom: 4px; }
.game-instructions strong { color: var(--blue2); font-weight: 500; }

.game-countdown { text-align: center; padding: 48px 24px; }
.game-countdown-num {
  font-family: var(--font-display);
  font-size: 100px;
  color: var(--blue2);
  line-height: 1;
  animation: countPulse 0.8s ease-in-out;
}
@keyframes countPulse { 0%{transform:scale(1.3);opacity:0} 60%{opacity:1} 100%{transform:scale(1);opacity:1} }

/* ── PROGRESS ── */
.progress-track {
  height: 3px;
  background: rgba(255,255,255,0.09);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}
.progress-fill { height: 100%; background: var(--blue2); transition: width 0.3s linear; border-radius: 2px; }
.progress-fill.green { background: var(--green); }

/* ── RESULT ── */
.game-result {
  text-align: center;
  padding: 32px;
  background: var(--midnight3);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r2);
  margin-top: 20px;
}
.result-score {
  font-family: var(--font-display);
  font-size: 64px;
  color: var(--white);
  line-height: 1;
}
.result-score span { font-size: 28px; color: rgba(255,255,255,0.3); }
.result-label { font-size: 16px; color: rgba(255,255,255,0.45); margin: 12px 0 24px; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── NBACK ── */
.nback-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 6px; max-width: 220px; margin: 0 auto;
}
.nback-cell {
  aspect-ratio: 1;
  border-radius: var(--r);
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.18);
  transition: all 0.1s;
}
.nback-cell.active { background: var(--blue); border-color: var(--blue2); }

/* ── CORSI ── */
.corsi-board { position: relative; width: 280px; height: 280px; margin: 0 auto; }
.corsi-block {
  position: absolute; width: 52px; height: 52px;
  background: rgba(255,255,255,0.09);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--r);
  cursor: pointer; transition: all 0.12s;
  display: flex; align-items: center; justify-content: center;
}
.corsi-block.lit { background: var(--blue); border-color: var(--blue2); }
.corsi-block.correct { background: var(--green); border-color: var(--green); }
.corsi-block.wrong { background: var(--red); border-color: var(--red); }

/* ── SIMON ── */
.simon-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; max-width: 240px; margin: 0 auto;
}
.simon-btn {
  aspect-ratio: 1; border-radius: var(--r2);
  border: 1.5px solid rgba(255,255,255,0.18);
  cursor: pointer; transition: all 0.1s; opacity: 0.6;
}
.simon-btn:hover { opacity: 0.85; transform: scale(0.98); }
.simon-btn.lit { opacity: 1; transform: scale(0.95); }
.simon-green { background: #1AA87A; }
.simon-red   { background: #D94040; }
.simon-blue  { background: #1A5FC8; }
.simon-yellow{ background: #E89B1A; }

/* ── STROOP ── */
.stroop-word {
  font-family: var(--font-display);
  font-size: clamp(48px, 10vw, 80px);
  text-align: center;
  padding: 24px;
  min-height: 120px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r2);
  background: var(--midnight3);
  letter-spacing: -1px;
}
.stroop-options { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.stroop-btn {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 10px 22px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--r);
  cursor: pointer; transition: all 0.1s;
  color: var(--white);
  background: rgba(255,255,255,0.08);
}
.stroop-btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-1px); }

/* ── FLANKER ── */
.flanker-display {
  font-family: var(--font-mono);
  font-size: clamp(36px, 8vw, 64px);
  text-align: center;
  letter-spacing: 10px;
  padding: 24px;
  min-height: 100px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r2);
  background: var(--midnight3);
  color: var(--white);
}

/* ── TRAIL ── */
.trail-svg {
  width: 100%; height: 320px;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r2);
  background: var(--midnight3);
  cursor: crosshair;
}

/* ── MATRICES ── */
.matrix-grid {
  display: grid; gap: 4px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r);
  padding: 4px;
  width: fit-content; margin: 0 auto;
}
.matrix-cell {
  width: 68px; height: 68px;
  background: var(--midnight3);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  border-radius: 4px;
}
.matrix-cell.empty { background: rgba(74,158,255,0.05); border: 1px dashed rgba(74,158,255,0.2); }
.matrix-options { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.matrix-opt {
  width: 68px; height: 68px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--r);
  background: var(--midnight3);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; cursor: pointer; transition: all 0.1s;
}
.matrix-opt:hover { border-color: rgba(74,158,255,0.4); transform: translateY(-1px); }
.matrix-opt.correct { border-color: var(--green); background: rgba(26,168,122,0.1); }
.matrix-opt.wrong   { border-color: var(--red); background: rgba(217,64,64,0.1); }

/* ── WCST ── */
.wcst-area { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.wcst-card {
  width: 76px; height: 96px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--r2);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; cursor: pointer;
  background: var(--midnight3);
  transition: all 0.1s;
  flex-direction: column; gap: 4px;
}
.wcst-card:hover { border-color: rgba(74,158,255,0.3); transform: translateY(-1px); }

/* ── HANOI ── */
.hanoi-board {
  display: flex; justify-content: space-around;
  align-items: flex-end; padding: 20px 0; gap: 12px;
}
.hanoi-peg {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  cursor: pointer; padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--r2);
  transition: border-color 0.15s;
  min-width: 90px;
}
.hanoi-peg.selected { border-color: var(--blue2); }
.hanoi-peg:hover { border-color: rgba(74,158,255,0.3); }
.hanoi-pole { width: 6px; height: 110px; background: rgba(255,255,255,0.15); border-radius: 3px; }
.hanoi-disk {
  height: 22px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--white);
  transition: all 0.2s;
}
.hanoi-base { width: 110px; height: 6px; background: rgba(255,255,255,0.12); border-radius: 3px; }

/* ── WORD SEARCH ── */
.word-grid {
  display: inline-grid; gap: 2px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r);
  padding: 3px;
  user-select: none;
}
.word-cell {
  width: 28px; height: 28px;
  background: var(--midnight3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--white); cursor: pointer;
  border-radius: 3px; transition: background 0.08s;
}
.word-cell:hover { background: rgba(74,158,255,0.1); }
.word-cell.selected { background: rgba(74,158,255,0.25); color: var(--blue2); }
.word-cell.found { background: rgba(26,168,122,0.2); color: var(--green); }

/* ── ROTATION ── */
.rotation-area { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; align-items: center; }
.rotation-shape {
  font-size: 72px; padding: 16px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--r2);
  background: var(--midnight3);
  display: inline-block; min-width: 110px; text-align: center;
}
.rotation-opts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.rotation-opt {
  font-size: 56px; padding: 14px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--r2);
  background: var(--midnight3);
  cursor: pointer; transition: all 0.1s;
  min-width: 96px; text-align: center;
}
.rotation-opt:hover { border-color: rgba(74,158,255,0.3); transform: translateY(-1px); }
.rotation-opt.correct { border-color: var(--green); background: rgba(26,168,122,0.08); }
.rotation-opt.wrong   { border-color: var(--red); background: rgba(217,64,64,0.08); }

/* ── STUDY CARDS (ciencia.html) ── */
.study-card {
  background: var(--midnight2);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r3);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.study-card:hover { border-color: rgba(74,158,255,0.2); }
.study-header {
  display: flex; align-items: flex-start; gap: 16px;
  cursor: pointer; padding: 20px 24px;
  min-width: 0;
}
.study-icon {
  font-size: 24px;
  width: 44px; height: 44px;
  border-radius: var(--r2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.study-title {
  font-family: var(--font-display); font-size: 17px;
  color: var(--white); margin-bottom: 4px;
  overflow-wrap: break-word;
}
.study-meta {
  flex: 1; min-width: 0;
  font-size: 13px; color: rgba(255,255,255,0.4);
  overflow-wrap: break-word;
}
.study-toggle { font-size: 18px; color: rgba(255,255,255,0.25); transition: transform 0.2s; flex-shrink: 0; }
.study-body { display: none; padding: 0 24px 20px; min-width: 0; overflow-wrap: break-word; }
.study-body.open { display: block; }
.study-finding {
  background: rgba(74,158,255,0.06);
  border-left: 3px solid var(--blue2);
  border-radius: var(--r2);
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
}
.study-finding strong { color: var(--white); font-weight: 500; }
.study-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.study-section-title {
  font-size: 12px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase;
  color: var(--blue2); margin-bottom: 12px;
}
.game-tag {
  font-size: 12px; padding: 5px 12px;
  border-radius: 20px;
  display: inline-block;
}
.stat-box {
  background: var(--midnight3);
  border: 1.5px solid rgba(255,255,255,0.16);
  border-radius: var(--r);
  padding: 12px 14px; text-align: center;
  min-width: 0;
}
.stat-n { font-family: var(--font-display); font-size: 24px; line-height: 1.1; overflow-wrap: break-word; }
.stat-l { font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 4px; line-height: 1.3; }
.mech-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.mech-step {
  font-size: 12px; padding: 6px 14px;
  background: rgba(74,158,255,0.08);
  border: 1.5px solid rgba(74,158,255,0.18);
  border-radius: 20px; color: var(--blue2);
}
.mech-arrow { color: rgba(255,255,255,0.25); font-size: 16px; flex-shrink: 0; }

/* ── TEST ── */
.test-card {
  background: var(--midnight2);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r3);
  padding: 32px;
  animation: fadeUp 0.25s ease both;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.phase-track { display: flex; gap: 4px; margin-bottom: 28px; }
.phase-pip { flex: 1; height: 3px; background: rgba(255,255,255,0.09); border-radius: 2px; transition: all 0.4s; }
.phase-pip.done { background: var(--green); }
.phase-pip.active { background: var(--blue2); }
.test-phase-label { font-size: 11px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase; color: var(--blue2); margin-bottom: 6px; }
.test-title { font-family: var(--font-display); font-size: clamp(24px, 4vw, 36px); color: var(--white); margin-bottom: 12px; }
.test-desc { font-size: 14px; color: rgba(255,255,255,0.45); margin-bottom: 20px; line-height: 1.7; }
.phase-intro-inst {
  background: rgba(74,158,255,0.05);
  border: 1px solid rgba(74,158,255,0.12);
  border-radius: var(--r2);
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 14px; color: rgba(255,255,255,0.6); line-height: 1.8;
}
.phase-intro-inst strong { color: var(--blue2); font-weight: 500; }
.countdown-big {
  font-family: var(--font-display);
  font-size: 96px; color: var(--blue2);
  line-height: 1; animation: countPulse 0.8s ease-in-out;
}
.hud-stat { text-align: center; flex: 1; min-width: 55px; }
.resp-btn {
  font-family: var(--font-body); font-size: 15px; font-weight: 500;
  padding: 11px 20px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--r);
  background: rgba(255,255,255,0.08);
  color: var(--white); cursor: pointer; transition: all 0.1s;
}
.resp-btn:hover:not(:disabled) { background: rgba(255,255,255,0.1); transform: translateY(-1px); }
.resp-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.domain-card {
  background: var(--midnight3);
  border: 1.5px solid rgba(255,255,255,0.16);
  border-radius: var(--r2);
  padding: 16px; text-align: center;
}
.domain-icon { font-size: 28px; margin-bottom: 6px; display: block; }
.domain-name { font-family: var(--font-display); font-size: 13px; color: var(--white); margin-bottom: 2px; }
.domain-sub { font-size: 11px; color: rgba(255,255,255,0.3); }
.result-domain {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.result-domain-icon { font-size: 22px; min-width: 28px; }
.result-domain-bar { flex: 1; }
.result-domain-name { font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 3px; }
.result-domain-track { height: 4px; background: rgba(255,255,255,0.09); border-radius: 2px; overflow: hidden; }
.result-domain-fill { height: 100%; border-radius: 2px; transition: width 1s ease; }
.result-domain-score { font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 2px; }

/* ── PLAN ── */
.week-card {
  background: var(--midnight2);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r3);
  margin-bottom: 10px; overflow: hidden;
}
.week-header {
  padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  cursor: pointer; user-select: none;
  transition: background 0.12s;
  min-width: 0;
}
.week-header:hover { background: rgba(255,255,255,0.03); }
.week-num {
  font-family: var(--font-display); font-size: 18px;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.week-info { flex: 1; min-width: 0; overflow-wrap: break-word; }
.week-name { font-family: var(--font-display); font-size: 15px; color: var(--white); margin-bottom: 2px; }
.week-sub { font-size: 12px; color: rgba(255,255,255,0.4); }
.week-toggle { font-size: 16px; color: rgba(255,255,255,0.25); transition: transform 0.2s; flex-shrink: 0; }
.week-body { display: none; padding: 0 20px 20px; min-width: 0; overflow-wrap: break-word; }
.week-body.open { display: block; }
.day-row {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--midnight3);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: var(--r2);
  padding: 12px 14px; margin-bottom: 8px;
  min-width: 0;
}
.day-num {
  font-family: var(--font-mono); font-size: 13px;
  color: rgba(255,255,255,0.35);
  width: 22px; height: 22px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.day-games { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.day-game {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--r);
  padding: 8px 12px;
  min-width: 0;
}
.day-game-icon { font-size: 16px; flex-shrink: 0; }
.day-game-name { font-size: 13px; color: rgba(255,255,255,0.7); flex: 1; min-width: 0; overflow-wrap: break-word; }
.day-game-level {
  font-family: var(--font-mono); font-size: 11px;
  padding: 2px 9px; border-radius: 10px;
  border: 1px solid transparent;
  flex-shrink: 0; white-space: nowrap;
}
.day-duration {
  font-family: var(--font-mono); font-size: 12px;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0; padding-top: 2px;
}

/* ── BADGES ── */
.badge {
  display: inline-block;
  font-size: 11px; font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-accent { background: rgba(74,158,255,0.12); color: var(--blue2); }
.badge-green { background: rgba(26,168,122,0.15); color: var(--green); }

/* ── FILTERS & SEARCH ── */
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-btn {
  font-size: 13px; padding: 6px 14px;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  background: transparent; color: rgba(255,255,255,0.4);
  cursor: pointer; transition: all 0.12s;
}
.filter-btn:hover { border-color: rgba(74,158,255,0.3); color: rgba(255,255,255,0.8); }
.filter-btn.active { background: rgba(74,158,255,0.1); border-color: rgba(74,158,255,0.3); color: var(--blue2); }
.search-box {
  font-family: var(--font-body); font-size: 14px;
  padding: 9px 16px;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r2);
  background: var(--midnight2);
  color: var(--white);
  width: 100%; max-width: 360px; outline: none;
  transition: border-color 0.15s;
}
.search-box::placeholder { color: rgba(255,255,255,0.2); }
.search-box:focus { border-color: rgba(74,158,255,0.3); }

/* ── NUMPAD ── */
.numpad { display: grid; grid-template-columns: repeat(3,64px); gap: 6px; margin: 0 auto; width: fit-content; }
.numpad-btn {
  width: 64px; height: 64px;
  font-family: var(--font-mono); font-size: 22px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--r);
  background: var(--midnight3); color: var(--white);
  cursor: pointer; transition: all 0.1s;
}
.numpad-btn:hover { background: rgba(74,158,255,0.1); border-color: rgba(74,158,255,0.3); }
.numpad-btn:active { transform: scale(0.96); }

/* ── FOOTER ── */
.footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 48px 32px;
  text-align: center;
}
.footer-logo {
  font-family: var(--font-display); font-size: 30px;
  font-weight: 400; letter-spacing: -1px;
  color: var(--white); margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px; justify-content: center;
}
.footer-logo span { color: var(--blue2); }
.footer-links { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.footer-links a { color: rgba(255,255,255,0.35); font-size: 14px; }
.footer-links a:hover { color: var(--white); }
.footer-copy { font-family: var(--font-mono); font-size: 12px; color: rgba(255,255,255,0.15); }

/* ── FEEDBACK ── */
.feedback { font-size: 16px; min-height: 26px; text-align: center; margin: 8px 0; }
.feedback.correct { color: var(--green); }
.feedback.wrong   { color: var(--red); }

/* ── ANIMATIONS ── */
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
@keyframes pulse  { 0%,100%{opacity:1} 50%{opacity:.5} }
.animate-fade { animation: fadeIn 0.25s ease both; }

/* ── LEVEL COLORS (10 niveles) ── */
.lvl-1  { color: #52c41a; } .lvl-1.selected  { border-color: #52c41a; color: #52c41a; background: rgba(82,196,26,.1); }
.lvl-2  { color: #73d13d; } .lvl-2.selected  { border-color: #73d13d; color: #73d13d; background: rgba(115,209,61,.1); }
.lvl-3  { color: #95de64; } .lvl-3.selected  { border-color: #95de64; color: #95de64; background: rgba(149,222,100,.1); }
.lvl-4  { color: #fadb14; } .lvl-4.selected  { border-color: #fadb14; color: #fadb14; background: rgba(250,219,20,.1); }
.lvl-5  { color: #ffc53d; } .lvl-5.selected  { border-color: #ffc53d; color: #ffc53d; background: rgba(255,197,61,.1); }
.lvl-6  { color: #ff7a45; } .lvl-6.selected  { border-color: #ff7a45; color: #ff7a45; background: rgba(255,122,69,.1); }
.lvl-7  { color: #f5222d; } .lvl-7.selected  { border-color: #f5222d; color: #f5222d; background: rgba(245,34,45,.1); }
.lvl-8  { color: #eb2f96; } .lvl-8.selected  { border-color: #eb2f96; color: #eb2f96; background: rgba(235,47,150,.1); }
.lvl-9  { color: #9254de; } .lvl-9.selected  { border-color: #9254de; color: #9254de; background: rgba(146,84,222,.1); }
.lvl-10 { color: #4A9EFF; } .lvl-10.selected { border-color: #4A9EFF; color: #4A9EFF; background: rgba(74,158,255,.1); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav { padding: 0 16px; gap: 16px; }
  .nav-links { display: none; }
  .hero { padding: 60px 20px 48px; }
  .section { padding: 48px 20px; }
  .modal-body, .modal-header { padding: 16px 20px; }
  .level-grid { grid-template-columns: repeat(5,1fr); }
  .hero-stats { gap: 24px; }
}

/* ── CATEGORY COLORS ── */
:root {
  --c-mem: #4A9EFF;
  --c-att: #E89B1A;
  --c-spd: #1AA87A;
  --c-log: #9254de;
  --c-spa: #eb2f96;
  --c-exe: #ff7a45;
  --c-lan: #52c41a;
  --c-mul: #D94040;
}

/* ── REACTION CIRCLE ── */
.reaction-circle {
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  font-size: 52px;
}
.reaction-circle.go   { background: rgba(26,168,122,0.2); border-color: var(--green); }
.reaction-circle.nogo { background: rgba(217,64,64,0.2);  border-color: var(--red); }
.reaction-circle.wait { background: rgba(74,158,255,0.1); border-color: var(--blue2); }
