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

:root {
  --bg: #030508;
  --mesh-1: #0a3d2e;
  --mesh-2: #1a1040;
  --mesh-3: #3d1508;
  --text: #e8e4dc;
  --text-dim: #8a857c;
  --accent: #55ff9f;
  --glow-teal: #1d9e75;
  --glow-coral: #ff6b35;
  --glow-purple: #9d8cff;
  --glow-amber: #ffb347;
  --glow-blue: #4da6ff;
  --glow-red: #ff3d5a;
  --cursor-x: 50%;
  --cursor-y: 50%;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Serif', Georgia, serif;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: none;
}

body.myth-mode {
  --mesh-1: #2a0810;
  --mesh-2: #1a0515;
  --mesh-3: #401010;
  --accent: #ff3d5a;
}

/* Custom cursor */
.cursor-dot, .cursor-ring {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, border-color 0.2s;
}
.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(85, 255, 159, 0.4);
  transition: transform 0.08s ease-out, width 0.2s, height 0.2s;
}
body.myth-mode .cursor-ring { border-color: rgba(255, 61, 90, 0.5); }
body.myth-mode .cursor-dot { background: var(--glow-red); box-shadow: 0 0 12px var(--glow-red); }
.cursor-ring.hover { width: 52px; height: 52px; border-color: var(--accent); }
body.focus-mode .cursor-ring { width: 24px; height: 24px; }

@media (max-width: 768px) {
  body, body * { cursor: auto !important; }
  .cursor-dot, .cursor-ring { display: none; }
}

/* Ambient mesh */
#ambient-mesh {
  position: fixed;
  inset: -50%;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at var(--cursor-x) var(--cursor-y), rgba(85,255,159,0.12) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 20% 80%, color-mix(in srgb, var(--mesh-1) 80%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 80% 20%, color-mix(in srgb, var(--mesh-2) 70%, transparent) 0%, transparent 45%),
    radial-gradient(ellipse 40% 35% at 60% 70%, color-mix(in srgb, var(--mesh-3) 60%, transparent) 0%, transparent 40%);
  animation: meshDrift 20s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes meshDrift {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-3%, 2%) rotate(2deg); }
}

#bg-canvas, #hero-canvas, #myth-canvas, #burst-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#bg-canvas { z-index: 1; }
#hero-canvas { z-index: 2; opacity: 0.9; }
#myth-canvas { z-index: 2; opacity: 0; transition: opacity 0.8s; }
#myth-canvas.active { opacity: 0.55; }
#burst-canvas { z-index: 50; pointer-events: none; }

.scanlines {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.035) 2px, rgba(0,0,0,0.035) 4px);
  opacity: 0.35;
}
.vignette {
  position: fixed; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,0.8) 100%);
}

.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 200;
  background: linear-gradient(90deg, var(--glow-teal), var(--glow-purple), var(--glow-coral));
  box-shadow: 0 0 20px var(--accent);
  transition: width 0.1s linear;
}

.focus-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0,0,0,0.65);
  backdrop-filter: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
.focus-backdrop.active { opacity: 1; pointer-events: auto; }

/* ── HERO ── */
.hero {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 100px;
  overflow: hidden;
}

.end-portal {
  position: absolute;
  width: min(420px, 85vw);
  height: min(420px, 85vw);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.35;
  pointer-events: none;
}
.portal-ring {
  position: absolute;
  inset: 0;
  border: 3px solid;
  animation: portalSpin 12s linear infinite;
}
.portal-ring:nth-child(1) { border-color: #2d1b4e; animation-duration: 14s; inset: 5%; }
.portal-ring:nth-child(2) { border-color: #4a2080; animation-duration: 10s; animation-direction: reverse; inset: 15%; }
.portal-ring:nth-child(3) { border-color: #7b3fd4; animation-duration: 8s; inset: 25%; opacity: 0.8; }
.portal-ring:nth-child(4) { border-color: #b06aff; animation-duration: 6s; animation-direction: reverse; inset: 35%; box-shadow: 0 0 60px rgba(157,140,255,0.4); inset: 32%; }
.portal-core {
  position: absolute;
  inset: 38%;
  background: radial-gradient(circle, #1a0a2e 0%, #000 70%);
  box-shadow: inset 0 0 80px rgba(157,140,255,0.5), 0 0 100px rgba(123,63,212,0.3);
  animation: corePulse 4s ease-in-out infinite;
}
@keyframes portalSpin { to { transform: rotate(360deg); } }
@keyframes corePulse {
  0%, 100% { box-shadow: inset 0 0 60px rgba(157,140,255,0.4), 0 0 80px rgba(123,63,212,0.2); }
  50% { box-shadow: inset 0 0 100px rgba(157,140,255,0.7), 0 0 120px rgba(123,63,212,0.5); }
}

.floating-blocks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.voxel {
  position: absolute;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
  animation: floatVoxel 8s ease-in-out infinite;
  opacity: 0.4;
}
@keyframes floatVoxel {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

.hero-content { position: relative; z-index: 2; }

.hero-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
  padding: 8px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 20%, transparent);
  animation: pulseBadge 3s ease-in-out infinite;
}
@keyframes pulseBadge {
  0%, 100% { box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 15%, transparent); }
  50% { box-shadow: 0 0 45px color-mix(in srgb, var(--accent) 40%, transparent); }
}

.hero h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(18px, 5.5vw, 44px);
  line-height: 1.65;
  min-height: 3.3em;
}
.hero h1 .line {
  display: block;
  background: linear-gradient(135deg, #55ff9f 0%, #9d8cff 35%, #ff6b35 70%, #ffb347 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 8s ease infinite;
  filter: drop-shadow(0 0 30px rgba(157, 140, 255, 0.45));
}
.hero h1 .cursor-blink {
  display: inline-block;
  width: 0.6em;
  height: 0.9em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 4px;
  animation: blink 1s step-end infinite;
  -webkit-text-fill-color: var(--accent);
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-sub {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(11px, 2vw, 14px);
  letter-spacing: 0.25em;
  color: var(--text-dim);
  margin-top: 32px;
  text-transform: uppercase;
}

.hero-desc {
  max-width: 540px;
  margin-top: 20px;
  font-size: 16px;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 36px;
}

.btn-hero {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  letter-spacing: 0.15em;
  padding: 14px 24px;
  border: 1px solid var(--accent);
  background: rgba(85, 255, 159, 0.08);
  color: var(--accent);
  cursor: none;
  text-transform: uppercase;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.btn-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
  z-index: -1;
  opacity: 0.15;
}
.btn-hero:hover::before { transform: scaleX(1); }
.btn-hero:hover {
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 50%, transparent);
  color: #fff;
  text-shadow: 0 0 10px var(--accent);
}
.btn-hero.secondary {
  border-color: var(--glow-purple);
  color: var(--glow-purple);
  background: rgba(157, 140, 255, 0.08);
}

.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  animation: bounce 2s ease infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* Realm orbit strip */
.realm-orbit {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 48px auto 0;
  max-width: 600px;
  flex-wrap: wrap;
}
.orbit-node {
  width: 100px;
  text-align: center;
  cursor: none;
  transition: transform 0.3s;
}
.orbit-node:hover { transform: scale(1.08) translateY(-4px); }
.orbit-sphere {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 2px solid;
  animation: orbitFloat 4s ease-in-out infinite;
}
.orbit-node:nth-child(2) .orbit-sphere { animation-delay: -1.3s; }
.orbit-node:nth-child(3) .orbit-sphere { animation-delay: -2.6s; }
@keyframes orbitFloat {
  0%, 100% { transform: translateY(0); box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
  50% { transform: translateY(-8px); box-shadow: 0 16px 40px rgba(0,0,0,0.5); }
}
.orbit-sphere.teal { background: radial-gradient(circle at 30% 30%, #1d9e75, #04342c); border-color: #55ff9f; box-shadow: 0 0 30px rgba(29,158,117,0.5); }
.orbit-sphere.coral { background: radial-gradient(circle at 30% 30%, #ff6b35, #4a1b0c); border-color: #ff9a6b; box-shadow: 0 0 30px rgba(255,107,53,0.5); }
.orbit-sphere.purple { background: radial-gradient(circle at 30% 30%, #9d8cff, #26215c); border-color: #cecbf6; box-shadow: 0 0 30px rgba(157,140,255,0.5); }
.orbit-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 8px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
}

/* ── NAV & TOOLBAR ── */
.realm-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px clamp(12px, 3vw, 20px);
  row-gap: 10px;
  background: rgba(3, 5, 8, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.realm-btn, .tool-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 8px;
  letter-spacing: 0.1em;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  cursor: none;
  transition: all 0.25s;
  text-transform: uppercase;
  border-radius: 4px;
}
.realm-btn:hover, .tool-btn:hover, .realm-btn.active {
  color: #fff;
  border-color: currentColor;
  box-shadow: 0 0 18px currentColor;
}
.realm-btn[data-realm="official"].active { color: var(--accent); border-color: var(--accent); }
.realm-btn[data-realm="myth"].active { color: var(--glow-red); border-color: var(--glow-red); }
.realm-btn[data-realm="mobs"].active { color: var(--glow-teal); border-color: var(--glow-teal); }
.tool-btn.map-btn { color: var(--glow-purple); border-color: rgba(157,140,255,0.3); }
.nav-divider { width: 1px; height: 24px; background: rgba(255,255,255,0.1); margin: 0 4px; }

/* ── CONTENT ── */
.wrapper {
  position: relative;
  z-index: 10;
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px clamp(28px, 5vw, 52px) 120px;
}

.section { margin-bottom: 72px; scroll-margin-top: 88px; }
.section-header { text-align: center; margin-bottom: 44px; }

.section-label {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(10px, 2.5vw, 14px);
  letter-spacing: 0.08em;
  line-height: 1.8;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section.myth .section-label {
  background: linear-gradient(90deg, transparent, var(--glow-red), transparent);
  -webkit-background-clip: text;
  background-clip: text;
}
.section-tag {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 0.35em;
  color: var(--text-dim);
  margin-top: 12px;
  text-transform: uppercase;
}

/* Timeline */
.timeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 40px;
  padding: 16px 12px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  overflow-x: auto;
}
.timeline-step {
  flex: 1;
  min-width: 70px;
  text-align: center;
  position: relative;
}
.timeline-step::after {
  content: '';
  position: absolute;
  top: 14px;
  right: -50%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--glow-amber), transparent);
  z-index: 0;
}
.timeline-step:last-child::after { display: none; }
.timeline-dot {
  width: 12px;
  height: 12px;
  margin: 0 auto 8px;
  background: var(--glow-amber);
  box-shadow: 0 0 12px var(--glow-amber);
  position: relative;
  z-index: 1;
}
.timeline-step span {
  font-family: 'Orbitron', sans-serif;
  font-size: 7px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  display: block;
  line-height: 1.4;
}

.myth-note {
  text-align: center;
  font-size: 14px;
  color: var(--glow-red);
  font-style: italic;
  margin: -24px 0 36px;
  text-shadow: 0 0 24px rgba(255, 61, 90, 0.5);
  animation: glitchText 4s infinite;
}
@keyframes glitchText {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(-3px, 1px); filter: hue-rotate(90deg); }
  94% { transform: translate(3px, -1px); }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr));
  gap: 16px;
  align-items: start;
}

.node-wrap {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  perspective: 1200px;
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.node-wrap.visible { opacity: 1; transform: translateY(0) scale(1); }
.node-wrap.wide { grid-column: 1 / -1; }
.node-wrap.open-wrap {
  position: relative;
  z-index: 80;
  isolation: isolate;
  grid-column: 1 / -1;
  width: 100%;
}

.node {
  border-radius: 12px;
  padding: 18px 18px 16px;
  padding-top: 28px;
  cursor: none;
  border: 1px solid transparent;
  position: relative;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  transition: box-shadow 0.3s, border-color 0.3s;
  backdrop-filter: blur(10px);
}
.node-rarity {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 6px;
  letter-spacing: 0.2em;
  padding: 3px 8px;
  border-radius: 2px;
  opacity: 0.7;
  z-index: 2;
}
.rarity-legendary { background: rgba(255,179,71,0.2); color: #fac775; border: 1px solid rgba(255,179,71,0.4); }
.rarity-mythic { background: rgba(255,61,90,0.2); color: #ff8a9a; border: 1px solid rgba(255,61,90,0.4); animation: rarityPulse 2s infinite; }
.rarity-canon { background: rgba(85,255,159,0.15); color: #9fe1cb; border: 1px solid rgba(85,255,159,0.3); }
@keyframes rarityPulse {
  50% { box-shadow: 0 0 12px rgba(255,61,90,0.4); }
}

.node::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, transparent 45%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.node:hover::before, .node.open::before { opacity: 1; }

.node::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.1), transparent 25%);
  animation: rotateGlow 5s linear infinite;
  opacity: 0;
  pointer-events: none;
}
.node:hover::after, .node.open::after { opacity: 1; }
@keyframes rotateGlow { to { transform: rotate(360deg); } }

.node.open {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: 0 0 50px var(--card-glow, rgba(85,255,159,0.35));
}

.node-icon { font-size: 32px; margin-bottom: 10px; filter: drop-shadow(0 0 12px var(--card-glow)); }
.node-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.node-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}
.node-arrow { font-size: 12px; opacity: 0.7; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.node.open .node-arrow { transform: rotate(180deg); }
.node-sub {
  position: relative;
  z-index: 1;
  font-size: 12px;
  line-height: 1.55;
  font-style: italic;
  opacity: 0.8;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.c-teal   { --card-glow: rgba(29,158,117,0.55); background: linear-gradient(145deg, #04342c, #0d5c4a); color: #9fe1cb; border-color: rgba(29,158,117,0.5); }
.c-coral  { --card-glow: rgba(255,107,53,0.55); background: linear-gradient(145deg, #4a1b0c, #8a3218); color: #f0997b; border-color: rgba(216,90,48,0.5); }
.c-purple { --card-glow: rgba(157,140,255,0.55); background: linear-gradient(145deg, #26215c, #453a90); color: #cecbf6; border-color: rgba(127,119,221,0.5); }
.c-amber  { --card-glow: rgba(255,179,71,0.55); background: linear-gradient(145deg, #412402, #7a4a0c); color: #fac775; border-color: rgba(186,117,23,0.5); }
.c-gray   { --card-glow: rgba(180,180,170,0.4); background: linear-gradient(145deg, #141412, #2e2e2c); color: #d3d1c7; border-color: rgba(95,94,90,0.45); }
.c-blue   { --card-glow: rgba(77,166,255,0.55); background: linear-gradient(145deg, #042c53, #0e5090); color: #b5d4f4; border-color: rgba(24,95,165,0.5); }
.c-red    { --card-glow: rgba(255,61,90,0.6); background: linear-gradient(145deg, #501313, #901f1f); color: #f7c1c1; border-color: rgba(163,45,45,0.55); animation: dangerPulse 2.5s ease-in-out infinite; }
@keyframes dangerPulse {
  50% { box-shadow: 0 0 35px rgba(255,61,90,0.35); }
}

.dropdown {
  border-radius: 0 0 12px 12px;
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.55s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s ease, opacity 0.3s;
  opacity: 0;
  backdrop-filter: blur(14px);
}
.dropdown.open {
  max-height: 3200px;
  padding: 22px 22px 26px;
  opacity: 1;
  overflow: visible;
}

.dropdown-body { font-size: 16px; line-height: 1.9; font-weight: 300; }
.dropdown-body::first-letter {
  font-size: 2.4em;
  float: left;
  line-height: 0.85;
  margin: 4px 10px 0 0;
  font-family: 'Press Start 2P', monospace;
  color: var(--accent);
  opacity: 0.9;
}

.drop-teal   { background: rgba(5, 46, 38, 0.97); color: #9fe1cb; border: 1px solid rgba(29,158,117,0.3); border-top: none; }
.drop-coral  { background: rgba(61, 23, 9, 0.97); color: #f0997b; border: 1px solid rgba(216,90,48,0.3); border-top: none; }
.drop-purple { background: rgba(32, 28, 79, 0.97); color: #cecbf6; border: 1px solid rgba(127,119,221,0.3); border-top: none; }
.drop-amber  { background: rgba(55, 30, 2, 0.97); color: #fac775; border: 1px solid rgba(186,117,23,0.3); border-top: none; }
.drop-gray   { background: rgba(16, 16, 14, 0.97); color: #d3d1c7; border: 1px solid rgba(95,94,90,0.25); border-top: none; }
.drop-blue   { background: rgba(3, 37, 70, 0.97); color: #b5d4f4; border: 1px solid rgba(24,95,165,0.3); border-top: none; }
.drop-red    { background: rgba(67, 16, 16, 0.97); color: #f7c1c1; border: 1px solid rgba(163,45,45,0.35); border-top: none; }

.dropdown-connections { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.dropdown-connections h4 {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 10px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 15px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.22);
  cursor: none;
  font-style: italic;
  background: rgba(0,0,0,0.3);
  font-family: 'IBM Plex Serif', serif;
  transition: all 0.22s;
  position: relative;
  overflow: hidden;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 35%, transparent);
  transform: translateY(-2px);
}

.node-wrap.herobrine-card .node { border-color: rgba(255, 61, 90, 0.5); }
.node-wrap.herobrine-card .node-label { animation: herobrineGlitch 4s infinite; }
@keyframes herobrineGlitch {
  0%, 85%, 100% { text-shadow: none; }
  86% { text-shadow: 3px 0 #f00, -3px 0 #0ff; }
  88% { text-shadow: -3px 0 #f00, 3px 0 #0ff; }
}

/* LORE MAP MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  width: min(900px, 100%);
  max-height: 90vh;
  background: linear-gradient(160deg, #0c1018, #060810);
  border: 1px solid rgba(157,140,255,0.35);
  border-radius: 16px;
  box-shadow: 0 0 80px rgba(157,140,255,0.2);
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.modal-header h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--glow-purple);
  line-height: 1.6;
}
.modal-close {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: var(--text-dim);
  cursor: none;
  letter-spacing: 0.15em;
}
.modal-close:hover { color: #fff; border-color: var(--glow-red); }

.modal-body { padding: 20px; overflow: auto; max-height: calc(90vh - 80px); }
#lore-svg { width: 100%; height: auto; min-height: 400px; }
.lore-node-circle { cursor: none; transition: filter 0.2s; }
.lore-node-circle:hover { filter: brightness(1.4) drop-shadow(0 0 8px currentColor); }
.lore-link { stroke: rgba(157,140,255,0.25); stroke-width: 1; fill: none; }
.lore-link.active { stroke: var(--accent); stroke-width: 2; opacity: 1; animation: linkPulse 1.5s ease infinite; }
@keyframes linkPulse {
  50% { stroke-opacity: 0.5; }
}

footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 48px 20px 80px;
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--text-dim);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent), var(--glow-purple));
  border-radius: 3px;
}

@media (max-width: 600px) {
  .hero h1 { line-height: 1.9; }
  .grid { grid-template-columns: 1fr; }
  .node-wrap.open-wrap { grid-column: 1 / -1; }
  .timeline { font-size: 0; }
  .timeline-step span { font-size: 6px; }
}

/* Language picker */
.lang-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lang-picker label {
  font-family: 'Orbitron', sans-serif;
  font-size: 7px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.lang-select {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 8px 28px 8px 10px;
  border: 1px solid rgba(157, 140, 255, 0.35);
  background: rgba(0, 0, 0, 0.5);
  color: var(--glow-purple);
  border-radius: 4px;
  cursor: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' fill='%239d8cff'%3E%3Cpath d='M0 2l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  max-width: 140px;
}
.lang-select:hover, .lang-select:focus {
  border-color: var(--glow-purple);
  box-shadow: 0 0 16px rgba(157, 140, 255, 0.25);
  outline: none;
}

html[dir="rtl"] .node-top { flex-direction: row-reverse; }
html[dir="rtl"] .node-rarity { right: auto; left: 10px; }
html[dir="rtl"] .dropdown-body::first-letter { float: right; margin: 4px 0 0 10px; }
html[dir="rtl"] .realm-nav { direction: rtl; }
html[dir="rtl"] .lang-select {
  padding: 8px 10px 8px 28px;
  background-position: left 8px center;
}

.locale-loading {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--accent);
  transition: opacity 0.4s;
}
.locale-loading.hidden { opacity: 0; pointer-events: none; }

/* ── v4 enhancements ── */
#aurora-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

.hero-content {
  transition: transform 0.15s ease-out;
  will-change: transform;
}

.hero h1.title-glitch .line {
  animation: gradientShift 8s ease infinite, titleGlitch 6s infinite;
}

@keyframes titleGlitch {
  0%, 92%, 100% { transform: translate(0); filter: drop-shadow(0 0 30px rgba(157, 140, 255, 0.45)); }
  93% { transform: translate(-2px, 0); filter: drop-shadow(3px 0 #f00) drop-shadow(-3px 0 #0ff); }
  95% { transform: translate(2px, 1px); }
}

.dimension-flash {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 61, 90, 0.35) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.6s ease;
}
.dimension-flash.active { opacity: 1; }

.discovery-hud {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 90;
  width: min(220px, 40vw);
  padding: 12px 14px;
  background: rgba(3, 5, 8, 0.88);
  border: 1px solid rgba(85, 255, 159, 0.25);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.discovery-hud span {
  font-family: 'Orbitron', sans-serif;
  font-size: 8px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  display: block;
  margin-bottom: 8px;
}
.discovery-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}
.discovery-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--glow-teal), var(--glow-purple));
  box-shadow: 0 0 12px var(--accent);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lore-search-wrap {
  flex: 1;
  min-width: 120px;
  max-width: 200px;
}
.lore-search {
  width: 100%;
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 10px 12px 10px 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.4) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%238a857c'%3E%3Cpath d='M6 0a6 6 0 104.47 10.03l3.05 3.05 1.41-1.41-3.05-3.05A6 6 0 006 0zm0 2a4 4 0 110 8 4 4 0 010-8z'/%3E%3C/svg%3E") no-repeat 10px center;
  color: var(--text);
  border-radius: 4px;
  cursor: none;
}
.lore-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 30%, transparent);
  outline: none;
}
.lore-search::placeholder { color: var(--text-dim); }

.tool-btn.random-btn { color: var(--glow-amber); border-color: rgba(255, 179, 71, 0.35); }
.tool-btn.fx-btn.off { opacity: 0.5; color: var(--text-dim); }

.node-wrap.discovered .node {
  box-shadow: inset 0 0 0 1px rgba(85, 255, 159, 0.15);
}
.node-wrap.discovered::before {
  content: '✦';
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  color: var(--accent);
  z-index: 5;
  opacity: 0.7;
  pointer-events: none;
}
.node-wrap.search-hidden {
  display: none !important;
}
.node-wrap.search-match .node {
  box-shadow: 0 0 30px var(--card-glow, rgba(85, 255, 159, 0.4));
  animation: searchPulse 1.5s ease infinite;
}
@keyframes searchPulse {
  50% { transform: scale(1.02); }
}

.dropdown.open .dropdown-body {
  animation: loreReveal 0.5s ease;
}
@keyframes loreReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-discover {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 200;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(5, 46, 38, 0.95), rgba(32, 28, 79, 0.95));
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--accent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 40%, transparent);
  transform: translateX(120%);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.toast-discover.show { transform: translateX(0); }

#lore-svg .map-node-group { cursor: none; }
#lore-svg .map-node-group.map-active circle {
  stroke-width: 4;
  filter: drop-shadow(0 0 12px currentColor);
  animation: mapPulse 1.2s ease infinite;
}
#lore-svg .map-node-group:not(.map-discovered) circle { opacity: 0.45; }
#lore-svg .lore-link.link-active {
  stroke: var(--accent);
  stroke-width: 2.5;
  opacity: 1;
}

@keyframes mapPulse {
  50% { r: calc(var(--r, 22) + 4px); }
}

.timeline-step.active .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent);
  transform: scale(1.3);
}

@media (prefers-reduced-motion: reduce) {
  .hero h1.title-glitch .line,
  .node-wrap.search-match .node,
  #lore-svg .map-node-group.map-active circle {
    animation: none !important;
  }
  .hero-content { transition: none; }
}

@media (max-width: 768px) {
  .discovery-hud { left: 12px; right: 12px; width: auto; bottom: 12px; }
  .lore-search-wrap { max-width: 100%; order: 10; flex: 1 1 100%; }
}
