/* =============================================
   NEXUS COMPENDIUM — main.css
   ============================================= */
:root {
  --bg: #1a1040;
  --surface: #241650;
  --surface2: #2e1a60;
  --surface3: #3a2070;
  --border: rgba(255,255,255,0.10);
  --border2: rgba(255,255,255,0.20);
  --text: #f0eaff;
  --muted: #a090c8;
  --accent: #ffe94d;
  --accent2: #ff6fcf;
  --nav-h: 68px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Block right-click and text selection site-wide */
body { pointer-events: auto; }

/* ---- Background effects ---- */
#bg-layer {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 10% 0%, rgba(255,110,207,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 90% 100%, rgba(68,102,255,0.15) 0%, transparent 60%);
}
#bg-dots {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ---- Loading screen ---- */
#loading-screen {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
}
.loader-logo {
  font-family: 'Fredoka One', cursive;
  font-size: 5rem;
  color: var(--accent);
  text-shadow: 4px 4px 0 rgba(0,0,0,0.4);
  letter-spacing: .06em;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.6} }
.loader-sub {
  font-family: 'Fredoka One', cursive;
  font-size: 1rem; color: var(--muted);
  letter-spacing: .12em; text-transform: uppercase;
}
.loader-bar {
  width: 220px; height: 8px;
  background: var(--surface2);
  border-radius: 50px; overflow: hidden;
  border: 2px solid var(--border2);
}
.loader-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  border-radius: 50px;
  transition: width .3s ease;
}

/* ---- NAV ---- */
#nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h); z-index: 200;
  background: rgba(26,16,64,0.94);
  backdrop-filter: blur(20px);
  border-bottom: 3px solid rgba(255,233,77,0.28);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  display: none;
}
.nav-inner {
  max-width: 1400px; margin: 0 auto;
  height: 100%; padding: 0 1.5rem;
  display: flex; align-items: center; gap: 8px;
}

/* Logo */
.nav-logo {
  font-family: 'Fredoka One', cursive;
  font-size: 1.8rem; color: var(--accent);
  text-shadow: 3px 3px 0 rgba(0,0,0,0.4);
  letter-spacing: .04em; cursor: pointer;
  text-decoration: none; flex-shrink: 0;
  transition: opacity .15s; line-height: 1;
}
.nav-logo:hover { opacity: .82; }
.nav-logo span {
  color: var(--accent2); font-size: .65rem;
  display: block; margin-top: -4px; letter-spacing: .1em;
}

/* Core link row */
.nav-links {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.nav-link {
  font-family: 'Fredoka One', cursive;
  font-size: .82rem; letter-spacing: .05em; text-transform: uppercase;
  padding: 6px 13px; border-radius: 50px;
  cursor: pointer; border: 2px solid transparent;
  background: transparent; color: var(--muted);
  text-decoration: none; white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.nav-link:hover { color: var(--text); border-color: var(--border2); }
.nav-link.active { color: #1a1040; background: var(--accent); border-color: var(--accent); }

/* Types dropdown */
.nav-dropdown { position: relative; }
.nav-dd-btn {
  display: flex; align-items: center; gap: 5px;
}
.dd-arrow {
  font-size: .7rem; transition: transform .2s; display: inline-block;
}
.nav-dropdown.open .dd-arrow { transform: rotate(180deg); }
.nav-dropdown.open .nav-dd-btn { color: var(--text); border-color: var(--border2); }

.dd-panel {
  display: none;
  position: absolute; top: calc(100% + 10px); left: 50%;
  transform: translateX(-50%);
  background: rgba(20,12,52,0.98);
  backdrop-filter: blur(24px);
  border: 2px solid var(--border2);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,233,77,0.08);
  z-index: 300;
  min-width: 380px;
  animation: ddFadeIn .18s ease both;
}
@keyframes ddFadeIn {
  from { opacity:0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity:1; transform: translateX(-50%) translateY(0); }
}
.nav-dropdown.open .dd-panel { display: block; }
.dd-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.dd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 12px;
  text-decoration: none; color: var(--muted);
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 13px;
  border: 2px solid transparent;
  transition: all .13s;
  white-space: nowrap;
}
.dd-item:hover {
  background: color-mix(in srgb, var(--tc) 18%, transparent);
  border-color: var(--tc);
  color: var(--text);
}
.dd-item-active {
  background: color-mix(in srgb, var(--tc) 25%, transparent);
  border-color: var(--tc);
  color: var(--text);
}
.dd-icon { font-size: 1.1rem; flex-shrink: 0; }
.dd-name { font-family: 'Fredoka One', cursive; font-size: .82rem; letter-spacing: .04em; }

/* Right side */
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-search-wrap { position: relative; }
.nav-search-wrap input {
  background: var(--surface2);
  border: 2.5px solid rgba(255,233,77,0.3);
  border-radius: 50px; padding: 7px 14px 7px 36px;
  color: var(--text); font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 700; outline: none; width: 180px;
  transition: border-color .2s, box-shadow .2s, width .25s;
}
.nav-search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,233,77,0.16);
  width: 220px;
}
.nav-search-wrap input::placeholder { color: var(--muted); }
.nav-search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--accent); font-size: 15px; pointer-events: none;
}
.nav-count {
  font-family: 'Fredoka One', cursive; font-size: 12px;
  color: #1a1040; background: var(--accent);
  border-radius: 50px; padding: 5px 12px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  white-space: nowrap;
}

/* Hamburger — shown on small screens */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px; flex-shrink: 0;
}
.hamburger span {
  display: block; width: 24px; height: 2.5px;
  background: var(--text); border-radius: 2px;
  transition: all .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---- MOBILE DRAWER ---- */
#mobile-nav {
  display: none;
  position: fixed; top: var(--nav-h); left: 0; right: 0;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  z-index: 199;
  background: rgba(20,12,52,0.98);
  backdrop-filter: blur(20px);
  border-bottom: 2px solid var(--border2);
  padding: 12px;
  flex-direction: column; gap: 5px;
}
#mobile-nav.open { display: flex; }
.mob-section-label {
  font-family: 'Fredoka One', cursive;
  font-size: 10px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); padding: 8px 10px 2px;
}
.mob-link {
  font-family: 'Fredoka One', cursive;
  font-size: .95rem; letter-spacing: .05em; text-transform: uppercase;
  padding: 9px 16px; border-radius: 12px;
  border: 2px solid var(--border); background: var(--surface2);
  color: var(--muted); text-decoration: none;
  transition: all .15s; display: block;
}
.mob-link:hover { color: var(--text); border-color: var(--border2); }
.mob-link.active { color: #1a1040; background: var(--accent); border-color: var(--accent); }
.mob-type-link {
  font-size: .82rem; padding: 7px 14px;
  background: color-mix(in srgb, var(--tc,#888) 12%, var(--surface2));
  border-color: color-mix(in srgb, var(--tc,#888) 30%, transparent);
  color: var(--text);
}
.mob-type-link.active {
  background: var(--tc,var(--accent));
  border-color: var(--tc,var(--accent));
  color: #1a1040;
}

/* ---- PAGE WRAPPER ---- */
#page-root {
  position: relative; z-index: 1;
  padding-top: calc(var(--nav-h) + 1rem);
  min-height: 100vh;
  display: none;
}

/* ---- HERO (home + type pages) ---- */
.page-hero {
  max-width: 1400px; margin: 0 auto;
  padding: 2.5rem 2rem 1.5rem;
}
.hero-eyebrow {
  font-family: 'Fredoka One', cursive; font-size: 13px;
  letter-spacing: .2em; color: var(--accent2);
  text-transform: uppercase; margin-bottom: 8px;
}
.hero-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1; letter-spacing: .02em; color: var(--text);
  text-shadow: 4px 4px 0 rgba(0,0,0,0.4); margin-bottom: .8rem;
}
.hero-title em { color: var(--accent); font-style: normal; }
.hero-desc { font-size: 15px; color: var(--muted); max-width: 500px; line-height: 1.7; font-weight: 600; }

/* ---- STAT CARDS (home) ---- */
.stat-strip {
  max-width: 1400px; margin: 0 auto;
  padding: .5rem 2rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.stat-card {
  background: var(--surface);
  border: 2.5px solid var(--border2);
  border-radius: 16px; padding: 14px 16px;
  box-shadow: 2px 3px 0 rgba(0,0,0,0.3);
  transition: transform .15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card-label {
  font-family: 'Fredoka One', cursive; font-size: 11px;
  letter-spacing: .14em; color: var(--muted);
  text-transform: uppercase; margin-bottom: 6px;
}
.stat-card-val {
  font-family: 'Fredoka One', cursive; font-size: 2rem;
  line-height: 1; color: var(--accent);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.35);
}
.stat-card-val span { font-size: 1rem; color: var(--muted); margin-left: 4px; }

/* ---- TYPE GRID (home) ---- */
.section-label {
  max-width: 1400px; margin: 0 auto;
  padding: .5rem 2rem .8rem;
  font-family: 'Fredoka One', cursive; font-size: 13px;
  letter-spacing: .15em; color: var(--muted); text-transform: uppercase;
}
.type-grid {
  max-width: 1400px; margin: 0 auto;
  padding: 0 2rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
}
.type-card {
  border: 2.5px solid; border-radius: 18px; padding: 18px 14px;
  cursor: pointer; text-align: center;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 3px 4px 0 rgba(0,0,0,0.35);
  position: relative; overflow: hidden;
  text-decoration: none;
}
.type-card:hover { transform: translateY(-4px) scale(1.04); box-shadow: 5px 7px 0 rgba(0,0,0,0.45); }
.type-card-icon { font-size: 2.2rem; margin-bottom: 8px; display: block; }
.type-card-name {
  font-family: 'Fredoka One', cursive; font-size: 1.1rem;
  letter-spacing: .05em; display: block;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4); color: #1a1040;
}
.type-card-count {
  font-family: 'Nunito', sans-serif; font-size: 11px; font-weight: 700;
  display: block; margin-top: 4px; color: rgba(26,16,64,0.7);
}

/* ---- FILTER BAR (type page) ---- */
.filter-bar {
  max-width: 1400px; margin: 0 auto;
  padding: .5rem 2rem 1rem;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.filter-select {
  background: var(--surface2); border: 2.5px solid var(--border2);
  border-radius: 50px; padding: 8px 16px;
  color: var(--text); font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 700; outline: none; cursor: pointer;
}
.filter-select:focus { border-color: var(--accent); }
.sort-btn {
  font-family: 'Fredoka One', cursive; font-size: 12px;
  padding: 7px 16px; border-radius: 50px;
  border: 2px solid var(--border2); background: transparent;
  color: var(--muted); cursor: pointer;
  transition: all .15s; text-transform: uppercase; letter-spacing: .04em;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}
.sort-btn.active { background: var(--accent); color: #1a1040; border-color: var(--accent); box-shadow: 2px 3px 0 rgba(0,0,0,0.35); }
.sort-btn:hover:not(.active) { color: var(--text); border-color: var(--border2); }
.results-label {
  font-family: 'Fredoka One', cursive; font-size: 14px; color: var(--muted);
}
.results-label strong { color: var(--accent); font-size: 16px; }

/* ---- MOVE GRID ---- */
.move-grid-wrap { max-width: 1400px; margin: 0 auto; padding: 0 2rem 4rem; }
.move-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 13px;
}
.move-card {
  border: 2.5px solid; border-radius: 18px; padding: 15px 17px;
  transition: transform .15s, box-shadow .15s;
  animation: popIn .28s cubic-bezier(.34,1.56,.64,1) both;
}
.move-card:hover { transform: translateY(-4px) scale(1.015); }
@keyframes popIn {
  from { opacity:0; transform: scale(.86) translateY(14px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}
.move-top { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 7px; }
.move-name {
  font-family: 'Fredoka One', cursive; font-size: 1.1rem;
  letter-spacing: .03em; color: var(--text); flex: 1; line-height: 1.1;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}
.type-badge {
  font-family: 'Fredoka One', cursive; font-size: 10px;
  letter-spacing: .08em; padding: 3px 10px; border-radius: 50px;
  text-transform: uppercase; flex-shrink: 0; margin-top: 2px;
  border: 2px solid; box-shadow: 1px 2px 0 rgba(0,0,0,0.3);
}
.move-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.cat-tag {
  font-family: 'Fredoka One', cursive; font-size: 10px;
  padding: 3px 10px; border-radius: 50px; text-transform: uppercase;
  border: 2px solid; box-shadow: 1px 2px 0 rgba(0,0,0,0.3);
}
.cat-physical { background: rgba(255,86,48,.22); color: #ff9977; border-color: rgba(255,86,48,.5); }
.cat-special   { background: rgba(40,184,255,.18); color: #66ccff; border-color: rgba(40,184,255,.4); }
.cat-status    { background: rgba(160,144,200,.18); color: #c0b0e0; border-color: rgba(160,144,200,.35); }
.power-val { font-family: 'Fredoka One', cursive; font-size: 12px; color: var(--muted); }
.power-val strong { color: var(--accent); font-size: 14px; }
.move-desc { font-size: 12.5px; color: #c0b0e0; line-height: 1.55; font-weight: 600; }

/* ---- EMPTY / 404 ---- */
.empty-state, .not-found {
  text-align: center; padding: 80px 20px; color: var(--muted);
}
.empty-state h3, .not-found h2 {
  font-family: 'Fredoka One', cursive; font-size: 2.5rem;
  margin-bottom: 10px; color: var(--text);
}
.not-found .big-num {
  font-family: 'Fredoka One', cursive; font-size: 8rem;
  color: var(--accent); line-height: 1; display: block;
  text-shadow: 5px 5px 0 rgba(0,0,0,0.4);
}
.back-btn {
  display: inline-block; margin-top: 20px;
  font-family: 'Fredoka One', cursive; font-size: 1rem;
  padding: 10px 26px; border-radius: 50px;
  background: var(--accent); color: #1a1040;
  border: none; cursor: pointer; text-decoration: none;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.35);
  transition: transform .12s;
}
.back-btn:hover { transform: translateY(-2px); }

/* ---- TYPE PAGE HEADER ---- */
.type-page-header {
  max-width: 1400px; margin: 0 auto;
  padding: 2rem 2rem 1rem;
  display: flex; align-items: center; gap: 16px;
}
.type-page-icon { font-size: 3.5rem; }
.type-page-info {}
.type-page-name {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1; text-shadow: 3px 3px 0 rgba(0,0,0,0.4);
}
.type-page-sub {
  font-family: 'Nunito', sans-serif; font-weight: 700;
  font-size: 14px; color: var(--muted); margin-top: 4px;
}

/* ---- FOOTER ---- */
#footer {
  position: relative; z-index: 1;
  border-top: 3px solid rgba(255,233,77,0.2);
  padding: 1.8rem 2rem; text-align: center;
  background: rgba(26,16,64,0.7);
}
#footer p {
  font-family: 'Fredoka One', cursive; font-size: 13px;
  color: var(--muted); letter-spacing: .08em;
}
#footer strong { color: var(--accent); }

/* ---- RESPONSIVE ---- */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-search-wrap { display: none; }
  .nav-count { display: none; }
  .hamburger { display: flex; }
  .type-grid { grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); }
}
@media (max-width: 1100px) {
  .nav-search-wrap input { width: 150px; }
  .nav-search-wrap input:focus { width: 180px; }
}
@media (max-width: 520px) {
  .move-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2,1fr); }
}
