/* =====================================================================
   PLAYER ONE — Retro-futuristic arcade portfolio
   Colors live in the theme tokens below. You normally don't need to
   edit this file — change `settings.theme` in js/data.js instead.
   ===================================================================== */

/* ---------- THEME TOKENS ---------- */
:root,
[data-theme="synthwave"] {
  --bg: #07051a;
  --bg-2: #0e0a2b;
  --panel: rgba(22, 15, 60, 0.62);
  --panel-solid: #140e38;
  --line: rgba(160, 140, 255, 0.16);
  --line-2: rgba(160, 140, 255, 0.32);
  --text: #f1edff;
  --muted: #a7a0d4;
  --a1: #ff2bd6;   /* primary neon */
  --a2: #22e7ff;   /* secondary neon */
  --a3: #b6ff3b;   /* success / xp */
  --a4: #ffcf33;   /* gold */
  --sun-1: #ffd23f;
  --sun-2: #ff2bd6;
  --glow-1: rgba(255, 43, 214, 0.45);
  --glow-2: rgba(34, 231, 255, 0.4);
}
[data-theme="matrix"] {
  --bg: #020a05; --bg-2: #04140a; --panel: rgba(6, 30, 15, 0.65); --panel-solid: #061a0d;
  --line: rgba(80, 255, 140, 0.15); --line-2: rgba(80, 255, 140, 0.32);
  --text: #e6ffee; --muted: #8fc7a2;
  --a1: #39ff88; --a2: #00e0b0; --a3: #d6ff3b; --a4: #f5ff6b;
  --sun-1: #d6ff3b; --sun-2: #00c46a;
  --glow-1: rgba(57, 255, 136, 0.45); --glow-2: rgba(0, 224, 176, 0.4);
}
[data-theme="sunset"] {
  --bg: #12040c; --bg-2: #1f0814; --panel: rgba(50, 12, 30, 0.62); --panel-solid: #2a0b1c;
  --line: rgba(255, 150, 120, 0.16); --line-2: rgba(255, 150, 120, 0.34);
  --text: #fff1ea; --muted: #d6a99c;
  --a1: #ff5d3b; --a2: #ffb03b; --a3: #ffe14d; --a4: #ff3b8d;
  --sun-1: #ffe14d; --sun-2: #ff3b5c;
  --glow-1: rgba(255, 93, 59, 0.45); --glow-2: rgba(255, 176, 59, 0.4);
}
[data-theme="ocean"] {
  --bg: #020b18; --bg-2: #051a2e; --panel: rgba(8, 34, 60, 0.62); --panel-solid: #08223c;
  --line: rgba(110, 200, 255, 0.16); --line-2: rgba(110, 200, 255, 0.34);
  --text: #eaf7ff; --muted: #94bcd6;
  --a1: #3b9dff; --a2: #3bffe4; --a3: #8dff6b; --a4: #ffd36b;
  --sun-1: #3bffe4; --sun-2: #3b6bff;
  --glow-1: rgba(59, 157, 255, 0.45); --glow-2: rgba(59, 255, 228, 0.4);
}

:root {
  --f-pixel: "Press Start 2P", monospace;
  --f-head: "Chakra Petch", system-ui, sans-serif;
  --f-body: "Outfit", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --r-common: #9aa4b8;
  --r-rare: #3ba8ff;
  --r-epic: #b65cff;
  --r-legendary: #ffb627;
  --hud-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--hud-h) + 12px); }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .6s;
}
body.booting { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
::selection { background: var(--a1); color: var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--a1), var(--a2)); border-radius: 0; }
:focus-visible { outline: 2px dashed var(--a2); outline-offset: 3px; }
.dim { color: var(--muted); }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- BACKGROUND FX ---------- */
#stars, #confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#stars { z-index: 0; }
#confetti { z-index: 120; }
.noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.crt {
  position: fixed; inset: 0; z-index: 110; pointer-events: none; opacity: 0; transition: opacity .4s;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.65) 100%);
}
body.crt-on .crt { opacity: 1; }
body.crt-on main { animation: flicker 4s infinite steps(1); }
@keyframes flicker { 0%, 97%, 100% { opacity: 1; } 98% { opacity: .92; } }

main, .footer { position: relative; z-index: 2; }

/* ---------- CUSTOM CURSOR ---------- */
.cursor, .cursor-dot { position: fixed; top: 0; left: 0; z-index: 130; pointer-events: none; opacity: 0; }
body.has-cursor .cursor, body.has-cursor .cursor-dot { opacity: 1; }
body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
body.has-cursor input, body.has-cursor textarea, body.has-cursor select { cursor: text; }
.cursor {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1.5px solid var(--a2);
  transition: width .2s, height .2s, margin .2s, border-color .2s, transform .08s linear;
  clip-path: polygon(0 0, 30% 0, 30% 8%, 70% 8%, 70% 0, 100% 0, 100% 30%, 92% 30%, 92% 70%, 100% 70%, 100% 100%, 70% 100%, 70% 92%, 30% 92%, 30% 100%, 0 100%, 0 70%, 8% 70%, 8% 30%, 0 30%);
}
.cursor.hover { width: 52px; height: 52px; margin: -26px 0 0 -26px; border-color: var(--a1); }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--a1); box-shadow: 0 0 10px var(--a1); }

/* ---------- BOOT SCREEN ---------- */
.boot {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 30%, var(--bg-2), var(--bg) 70%);
  transition: opacity .7s var(--ease), visibility .7s;
  padding: 16px;
}
.boot.hide { opacity: 0; visibility: hidden; }
.boot.off { display: none; }
.boot-inner { width: min(560px, 100%); }
.boot-logo {
  font-family: var(--f-pixel); font-size: clamp(26px, 7vw, 46px); line-height: 1.2; letter-spacing: 2px;
  color: var(--text); text-shadow: 4px 4px 0 var(--a1), -2px -2px 0 var(--a2); margin-bottom: 28px; text-align: center;
}
.boot-logo span { display: block; color: var(--a3); text-shadow: 4px 4px 0 var(--a1); }
.boot-log { font-family: var(--f-mono); font-size: 13px; color: var(--a3); min-height: 120px; white-space: pre-wrap; }
.boot-bar { height: 14px; border: 2px solid var(--a2); margin: 18px 0; padding: 2px; }
.boot-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--a2) 0 10px, transparent 10px 13px); transition: width .2s; }
.boot-start { font-family: var(--f-pixel); font-size: 12px; text-align: center; color: var(--a4); opacity: 0; letter-spacing: 1px; }
.boot-start.show { animation: blink 1s steps(1) infinite; }
.boot-hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 12px; }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* ---------- HUD ---------- */
.hud {
  position: fixed; top: 0; left: 0; right: 0; height: var(--hud-h); z-index: 90;
  display: flex; align-items: center; gap: 18px; padding: 0 22px;
  background: linear-gradient(to bottom, rgba(7, 5, 26, .9), rgba(7, 5, 26, .55));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: transform .4s var(--ease);
}
.hud.hidden-up { transform: translateY(-100%); }
.hud-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-badge {
  font-family: var(--f-pixel); font-size: 11px; padding: 8px 7px; color: var(--bg);
  background: linear-gradient(135deg, var(--a1), var(--a2)); box-shadow: 3px 3px 0 var(--a3);
}
.logo-text { font-family: var(--f-mono); font-size: 14px; font-weight: 600; }
.hud-nav { display: flex; gap: 2px; margin-inline: auto; }
.hud-nav a {
  position: relative; padding: 8px 11px; font-family: var(--f-head); font-weight: 600; font-size: 14px;
  letter-spacing: .5px; color: var(--muted); text-transform: uppercase; transition: color .2s;
}
.hud-nav a::before {
  content: "▶"; position: absolute; left: -4px; top: 50%; transform: translateY(-50%) scale(0);
  font-size: 9px; color: var(--a1); transition: transform .2s var(--ease);
}
.hud-nav a:hover, .hud-nav a.active { color: var(--text); }
.hud-nav a.active::before { transform: translateY(-50%) scale(1); }
.hud-nav a.active { text-shadow: 0 0 12px var(--glow-1); }
.hud-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.visitor-xp { display: flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.vx-lv b, .vx-num b { color: var(--a3); }
.vx-bar { width: 70px; height: 8px; border: 1px solid var(--line-2); padding: 1px; }
.vx-bar i { display: block; height: 100%; width: 0; background: var(--a3); box-shadow: 0 0 8px var(--a3); transition: width .6s var(--ease); }
.tool-btn {
  width: 36px; height: 36px; display: grid; place-items: center; font-size: 15px;
  border: 1px solid var(--line-2); background: var(--panel); transition: border-color .2s, transform .2s, background .2s;
}
.tool-btn:hover { border-color: var(--a2); transform: translateY(-2px); }
.tool-btn.on { border-color: var(--a3); background: color-mix(in srgb, var(--a3) 15%, transparent); }
.tool-btn.kbd { width: auto; padding: 0 10px; font-family: var(--f-mono); font-size: 12px; }

/* Mobile dock */
.dock {
  display: none; position: fixed; z-index: 90; left: 50%; bottom: 12px; transform: translateX(-50%);
  width: calc(100% - 24px); max-width: 520px; padding: 6px; gap: 2px;
  background: rgba(14, 10, 43, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.dock::-webkit-scrollbar { display: none; }
.dock a { flex: 1 0 auto; min-width: 54px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; font-size: 18px; color: var(--muted); }
.dock a small { font-family: var(--f-head); font-size: 10px; letter-spacing: .4px; text-transform: uppercase; }
.dock a.active { color: var(--text); background: color-mix(in srgb, var(--a1) 18%, transparent); box-shadow: inset 0 -2px 0 var(--a1); }

/* ---------- BUTTONS ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; font-family: var(--f-head); font-weight: 700; font-size: 15px; letter-spacing: 1px; text-transform: uppercase;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s, color .2s;
}
.btn-primary {
  color: var(--bg); background: linear-gradient(135deg, var(--a1), var(--a2));
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.btn-primary:hover { transform: translate(-2px, -2px); filter: brightness(1.12); }
.btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s; }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-ghost { border: 1px solid var(--line-2); background: var(--panel); color: var(--text); }
.btn-ghost:hover { border-color: var(--a2); box-shadow: 4px 4px 0 var(--a2); transform: translate(-2px, -2px); }
.btn-sm { padding: 9px 14px; font-size: 13px; }

/* ---------- PANELS ---------- */
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 22px;
}
.panel::before, .panel::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--a2); pointer-events: none; }
.panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.panel::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-color: var(--a1); }
.panel-title { font-family: var(--f-pixel); font-size: 11px; letter-spacing: 1px; margin-bottom: 18px; color: var(--a2); }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center;
  padding: calc(var(--hud-h) + 30px) 0 120px; overflow: hidden;
}
.hero-sun {
  position: absolute; left: 50%; bottom: 26%; width: min(560px, 90vw); aspect-ratio: 1; transform: translateX(-50%);
  border-radius: 50%; z-index: -1; opacity: .55;
  background: linear-gradient(to bottom, var(--sun-1), var(--sun-2) 70%);
  -webkit-mask: linear-gradient(to bottom, #000 0 48%, transparent 48% 52%, #000 52% 60%, transparent 60% 65%, #000 65% 72%, transparent 72% 78%, #000 78% 84%, transparent 84% 91%, #000 91%);
  mask: linear-gradient(to bottom, #000 0 48%, transparent 48% 52%, #000 52% 60%, transparent 60% 65%, #000 65% 72%, transparent 72% 78%, #000 78% 84%, transparent 84% 91%, #000 91%);
  filter: drop-shadow(0 0 60px var(--glow-1));
}
.hero-grid {
  position: absolute; left: -50%; right: -50%; bottom: 0; height: 42%; z-index: -1;
  background-image:
    linear-gradient(var(--a1) 1.5px, transparent 1.5px),
    linear-gradient(90deg, var(--a1) 1.5px, transparent 1.5px);
  background-size: 60px 60px;
  transform: perspective(380px) rotateX(62deg);
  transform-origin: center top;
  opacity: .35;
  -webkit-mask: linear-gradient(to bottom, transparent, #000 40%);
  mask: linear-gradient(to bottom, transparent, #000 40%);
  animation: gridMove 2.4s linear infinite;
}
@keyframes gridMove { to { background-position: 0 60px; } }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 140px; background: linear-gradient(transparent, var(--bg)); z-index: -1; }

.hero-wrap { width: min(1180px, 100% - 32px); margin-inline: auto; display: grid; grid-template-columns: 1.2fr .8fr; gap: 50px; align-items: center; }
.ready-tag {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; margin-bottom: 22px;
  font-family: var(--f-pixel); font-size: 10px; letter-spacing: 1px; color: var(--a3);
  border: 1px solid color-mix(in srgb, var(--a3) 40%, transparent); background: color-mix(in srgb, var(--a3) 8%, transparent);
}
.blink-dot { width: 8px; height: 8px; background: var(--a3); box-shadow: 0 0 10px var(--a3); animation: blink 1.1s steps(1) infinite; }
.hero-hi { font-family: var(--f-mono); color: var(--a2); font-size: 16px; margin-bottom: 4px; }

.glitch {
  position: relative; font-family: var(--f-head); font-weight: 700; line-height: .95;
  font-size: clamp(46px, 8.2vw, 104px); letter-spacing: -1px; text-transform: uppercase;
  background: linear-gradient(100deg, var(--text) 30%, var(--a2) 60%, var(--a1));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px var(--glow-1));
}
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; background: inherit;
  -webkit-background-clip: text; background-clip: text; color: transparent; opacity: 0;
}
.glitch:hover::before, .glitch.glitching::before { opacity: .9; color: var(--a1); -webkit-text-fill-color: var(--a1); animation: glitchA .35s steps(2) infinite; }
.glitch:hover::after, .glitch.glitching::after { opacity: .9; color: var(--a2); -webkit-text-fill-color: var(--a2); animation: glitchB .35s steps(2) infinite; }
@keyframes glitchA { 0% { clip-path: inset(10% 0 60% 0); transform: translate(-4px, 0); } 50% { clip-path: inset(55% 0 20% 0); transform: translate(4px, 0); } 100% { clip-path: inset(30% 0 40% 0); transform: translate(-2px, 0); } }
@keyframes glitchB { 0% { clip-path: inset(65% 0 5% 0); transform: translate(4px, 0); } 50% { clip-path: inset(5% 0 75% 0); transform: translate(-4px, 0); } 100% { clip-path: inset(40% 0 30% 0); transform: translate(3px, 0); } }

.hero-class { margin: 18px 0 18px; font-family: var(--f-mono); font-size: clamp(16px, 2.2vw, 22px); }
.hc-label { color: var(--muted); margin-right: 8px; }
.typed { color: var(--a4); font-weight: 600; }
.caret { color: var(--a4); animation: blink 1s steps(1) infinite; }
.hero-intro { max-width: 560px; color: var(--muted); font-size: clamp(16px, 1.6vw, 18px); margin-bottom: 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }

.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.socials a {
  width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--panel);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s, color .25s; color: var(--muted);
}
.socials a:hover { transform: translateY(-4px) rotate(-6deg); border-color: var(--a1); color: var(--text); box-shadow: 0 8px 24px var(--glow-1); }
.socials svg { width: 19px; height: 19px; fill: currentColor; }
.socials.big a { width: 48px; height: 48px; }
.lore { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.lore span { font-size: 13px; padding: 5px 11px; border: 1px dashed var(--line-2); color: var(--muted); border-radius: 99px; }

/* Character card */
.hero-right { perspective: 1000px; }
.char-card {
  position: relative; padding: 24px; border: 1px solid var(--line-2); overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--a1) 14%, var(--panel-solid)), var(--panel-solid) 45%, color-mix(in srgb, var(--a2) 12%, var(--panel-solid)));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255,255,255,.03) inset, 0 0 60px var(--glow-2);
  transform-style: preserve-3d; transition: transform .15s ease-out; will-change: transform;
  animation: floaty 6s ease-in-out infinite;
}
.char-card:hover { animation-play-state: paused; }
@keyframes floaty { 50% { translate: 0 -10px; } }
.cc-shine { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.16), transparent 45%); }
.cc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.cc-tag { font-family: var(--f-pixel); font-size: 9px; color: var(--muted); letter-spacing: 1px; }
.cc-lv { font-family: var(--f-pixel); font-size: 11px; color: var(--bg); background: var(--a4); padding: 6px 8px; box-shadow: 3px 3px 0 var(--a1); }
.cc-avatar-wrap { position: relative; width: 128px; height: 128px; margin: 0 auto 14px; display: grid; place-items: center; }
.cc-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--a1), var(--a2), var(--a3), var(--a1)); animation: spin 6s linear infinite; }
.cc-ring::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--panel-solid); }
@keyframes spin { to { transform: rotate(360deg); } }
.cc-avatar { position: relative; width: 112px; height: 112px; border-radius: 50%; object-fit: cover; background: var(--bg-2); }
.cc-name { text-align: center; font-family: var(--f-head); font-size: 24px; line-height: 1.2; }
.cc-sub { text-align: center; font-size: 14px; }
.cc-sub.dim { font-size: 13px; }
.cc-xp { margin: 18px 0 14px; }
.cc-xp-row { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.xp-bar { height: 12px; border: 1px solid var(--line-2); padding: 2px; }
.xp-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--a3) 0 8px, color-mix(in srgb, var(--a3) 60%, transparent) 8px 10px); box-shadow: 0 0 12px var(--a3); transition: width 1.6s var(--ease); }
.cc-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.cc-meta div { padding: 8px 6px; border: 1px solid var(--line); text-align: center; background: rgba(0,0,0,.18); min-width: 0; }
.cc-meta small { display: block; font-family: var(--f-mono); font-size: 9.5px; color: var(--muted); letter-spacing: 1px; }
.cc-meta b { font-family: var(--f-head); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cc-attrs { list-style: none; display: grid; gap: 8px; margin-bottom: 16px; }
.cc-attrs li { display: grid; grid-template-columns: 82px 1fr 28px; align-items: center; gap: 10px; font-family: var(--f-mono); font-size: 11.5px; }
.cc-attrs .ab { height: 6px; background: rgba(255,255,255,.07); }
.cc-attrs .ab i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--a1), var(--a2)); transition: width 1.4s var(--ease); }
.cc-attrs b { color: var(--a2); text-align: right; }
.cc-status { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 10px 12px; border: 1px solid var(--line); background: rgba(0,0,0,.2); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--a3); box-shadow: 0 0 0 0 var(--a3); animation: pulse 2s infinite; flex-shrink: 0; }
.status-dot.away { background: var(--a4); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--a3) 70%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }

.scroll-hint { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); font-family: var(--f-pixel); font-size: 8px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; letter-spacing: 2px; }
.scroll-hint span { width: 22px; height: 34px; border: 2px solid var(--muted); border-radius: 12px; position: relative; }
.scroll-hint span::after { content: ""; position: absolute; left: 50%; top: 6px; width: 4px; height: 7px; margin-left: -2px; background: var(--a2); animation: wheel 1.6s infinite; }
@keyframes wheel { to { transform: translateY(12px); opacity: 0; } }

/* ---------- TICKER ---------- */
.ticker { position: relative; z-index: 2; overflow: hidden; border-block: 1px solid var(--line-2); background: color-mix(in srgb, var(--a1) 10%, var(--bg)); transform: rotate(-1.5deg) scale(1.03); margin: 10px 0 30px; }
.ticker-track { display: flex; width: max-content; gap: 34px; padding: 14px 0; animation: tick 40s linear infinite; font-family: var(--f-pixel); font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.ticker-track span:nth-child(odd) { color: var(--a2); }
.ticker-track span.star { color: var(--a1); }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- ZONES ---------- */
.zone { position: relative; padding: 100px 0; }
.zone-head { margin-bottom: 44px; max-width: 760px; }
.zh-tag { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-pixel); font-size: 10px; letter-spacing: 1.5px; color: var(--a1); margin-bottom: 14px; }
.zh-tag::after { content: ""; width: 60px; height: 2px; background: linear-gradient(90deg, var(--a1), transparent); }
.zh-title { font-family: var(--f-head); font-weight: 700; font-size: clamp(34px, 5.4vw, 60px); line-height: 1.05; text-transform: uppercase; letter-spacing: -.5px; }
.zh-title .ic { display: inline-block; margin-right: 12px; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-6deg); } }
.zh-sub { color: var(--muted); margin-top: 12px; font-size: 17px; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- STATS ---------- */
.stats-zone { padding: 40px 0 60px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat {
  position: relative; padding: 22px 20px; border: 1px solid var(--line); background: var(--panel); overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s;
}
.stat:hover { transform: translateY(-6px); border-color: var(--a2); }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--glow-2); filter: blur(30px); opacity: .5; }
.stat-ic { font-size: 24px; }
.stat-num { font-family: var(--f-pixel); font-size: clamp(22px, 3vw, 30px); margin: 12px 0 8px; color: var(--text); text-shadow: 3px 3px 0 var(--a1); }
.stat-lbl { font-family: var(--f-mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- SKILL TREE ---------- */
.skill-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.skill-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--line-2); background: var(--panel);
  font-family: var(--f-head); font-weight: 600; font-size: 15px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted);
  transition: all .2s;
}
.skill-tab:hover { color: var(--text); border-color: var(--a2); }
.skill-tab.active { color: var(--bg); background: var(--a2); border-color: var(--a2); box-shadow: 4px 4px 0 var(--a1); }
.skill-tab .cnt { font-family: var(--f-mono); font-size: 11px; opacity: .7; }
.skill-legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; margin-bottom: 26px; align-items: center; }
.lg { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: middle; }
.lg-unlocked { background: var(--a3); box-shadow: 0 0 8px var(--a3); }
.lg-learning { border: 1px dashed var(--a4); }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.skill {
  position: relative; padding: 22px 16px 18px; text-align: center; border: 1px solid var(--line); background: var(--panel);
  transition: transform .35s var(--ease), border-color .3s, box-shadow .3s;
  animation: popIn .5s var(--ease) both; animation-delay: var(--d, 0s);
}
@keyframes popIn { from { opacity: 0; transform: scale(.85) translateY(16px); } }
.skill:hover { transform: translateY(-8px); border-color: var(--a1); box-shadow: 0 16px 40px rgba(0,0,0,.45), 0 0 30px var(--glow-1); }
.skill.learning { border-style: dashed; border-color: color-mix(in srgb, var(--a4) 45%, transparent); }
.skill-ring { position: relative; width: 92px; height: 92px; margin: 0 auto 14px; }
.skill-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.skill-ring circle { fill: none; stroke-width: 6; }
.skill-ring .bgc { stroke: rgba(255,255,255,.07); }
.skill-ring .fgc { stroke: url(#ringGrad); stroke-linecap: butt; transition: stroke-dashoffset 1.4s var(--ease); }
.skill.learning .fgc { stroke: var(--a4); stroke-dasharray: 4 3; }
.skill-ico { position: absolute; inset: 18px; display: grid; place-items: center; font-size: 30px; }
.skill-ico img { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.skill.learning .skill-ico img { filter: grayscale(.6) brightness(.8); }
.skill-name { font-family: var(--f-head); font-weight: 600; font-size: 16px; line-height: 1.25; }
.skill-tier { font-family: var(--f-mono); font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }
.skill-lv { position: absolute; top: 10px; right: 10px; font-family: var(--f-pixel); font-size: 8px; color: var(--a3); }
.skill.learning .skill-lv { color: var(--a4); }
.skill-lock { position: absolute; top: 9px; left: 10px; font-size: 13px; }

/* ---------- LOADOUT ---------- */
.loadout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.inv-slot {
  --rc: var(--r-common);
  position: relative; aspect-ratio: 1; display: grid; place-items: center; border: 2px solid color-mix(in srgb, var(--rc) 55%, transparent);
  background: radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--rc) 35%, transparent), rgba(0,0,0,.25) 70%);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.inv-slot[data-r="rare"] { --rc: var(--r-rare); }
.inv-slot[data-r="epic"] { --rc: var(--r-epic); }
.inv-slot[data-r="legendary"] { --rc: var(--r-legendary); animation: legend 2.4s ease-in-out infinite; }
@keyframes legend { 50% { box-shadow: 0 0 20px color-mix(in srgb, var(--r-legendary) 60%, transparent); } }
.inv-slot:hover, .inv-slot.sel { transform: scale(1.08); box-shadow: 0 0 22px color-mix(in srgb, var(--rc) 70%, transparent); z-index: 2; }
.inv-slot.sel { outline: 2px solid var(--text); outline-offset: 2px; }
.inv-slot img { width: 58%; height: 58%; object-fit: contain; }
.inv-slot .em { font-size: 30px; }
img[src*="github-original"], img[src*="nextjs-original"], img[src*="express-original"] { filter: invert(1) brightness(1.2); }
.inv-slot.empty { border-style: dashed; border-color: var(--line); background: rgba(0,0,0,.15); opacity: .5; }
.inv-detail { margin-top: 16px; padding: 12px 14px; font-family: var(--f-mono); font-size: 13px; color: var(--muted); border: 1px dashed var(--line-2); min-height: 62px; }
.inv-detail b { color: var(--text); }
.inv-detail .rar { text-transform: uppercase; font-size: 11px; letter-spacing: 1px; }
.learn-item { margin-bottom: 22px; }
.learn-item:last-child { margin-bottom: 0; }
.li-row { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; margin-bottom: 8px; }
.li-row b { font-family: var(--f-head); font-weight: 600; }
.li-row span { font-family: var(--f-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.load-bar { position: relative; height: 18px; border: 2px solid var(--a2); padding: 2px; }
.load-bar i { display: block; height: 100%; width: 0; transition: width 1.6s var(--ease);
  background: repeating-linear-gradient(-45deg, var(--a2) 0 8px, color-mix(in srgb, var(--a2) 55%, transparent) 8px 16px); background-size: 22px 22px; animation: stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 22px 0; } }
.load-bar em { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-family: var(--f-pixel); font-size: 8px; font-style: normal; text-shadow: 1px 1px 0 var(--bg); }

/* ---------- QUESTS ---------- */
.quest-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.qf {
  padding: 9px 16px; border: 1px solid var(--line-2); font-family: var(--f-mono); font-size: 13px; color: var(--muted); background: var(--panel);
  transition: all .2s;
}
.qf:hover { color: var(--text); border-color: var(--a1); }
.qf.active { color: var(--bg); background: var(--a1); border-color: var(--a1); box-shadow: 4px 4px 0 var(--a2); }
.quest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 24px; }
.quest {
  position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--panel); overflow: hidden;
  transition: transform .4s var(--ease), border-color .3s, box-shadow .4s;
}
.quest:hover { transform: translateY(-10px); border-color: var(--a2); box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 0 40px var(--glow-2); }
.quest.hide { display: none; }
.q-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); }
.q-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .5s; filter: saturate(.85); }
.quest:hover .q-media img { transform: scale(1.08); filter: saturate(1.15); }
.q-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--panel-solid), transparent 55%); }
.q-type { position: absolute; z-index: 2; top: 12px; left: 12px; font-family: var(--f-pixel); font-size: 8px; padding: 7px 8px; letter-spacing: 1px; color: var(--bg); background: var(--a4); }
.q-type.side { background: var(--a2); }
.q-status { position: absolute; z-index: 2; top: 12px; right: 12px; font-family: var(--f-mono); font-size: 11px; padding: 4px 9px; background: rgba(0,0,0,.6); border: 1px solid var(--line-2); backdrop-filter: blur(4px); }
.q-status.done { color: var(--a3); }
.q-status.prog { color: var(--a4); }
.q-body { padding: 4px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.q-meta { display: flex; justify-content: space-between; align-items: center; font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.stars { color: var(--a4); letter-spacing: 2px; }
.stars .off { color: rgba(255,255,255,.15); }
.q-title { font-family: var(--f-head); font-size: 22px; line-height: 1.2; margin-bottom: 8px; }
.q-sum { color: var(--muted); font-size: 15px; margin-bottom: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tags span { font-family: var(--f-mono); font-size: 11px; padding: 3px 8px; border: 1px solid var(--line-2); color: var(--a2); background: color-mix(in srgb, var(--a2) 6%, transparent); }
.q-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.q-xp { font-family: var(--f-pixel); font-size: 9px; color: var(--a3); }
.q-open { font-family: var(--f-head); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--a1); display: inline-flex; gap: 6px; align-items: center; }
.q-open:hover { color: var(--text); }

/* ---------- JOURNEY MAP ---------- */
.map-scroll { overflow-x: auto; padding: 50px 0 30px; cursor: grab; scrollbar-width: thin; scrollbar-color: var(--a1) transparent; }
.map-scroll.drag { cursor: grabbing; user-select: none; }
.map-track { position: relative; display: flex; gap: 26px; width: max-content; padding: 0 max(16px, calc((100vw - 1180px) / 2)); }
.map-track::before { content: ""; position: absolute; left: 0; right: 0; top: 34px; height: 4px; background: repeating-linear-gradient(90deg, var(--line-2) 0 14px, transparent 14px 24px); }
.lvl { position: relative; width: 270px; flex-shrink: 0; padding-top: 80px; }
.lvl-node {
  position: absolute; top: 12px; left: 24px; width: 48px; height: 48px; display: grid; place-items: center;
  font-family: var(--f-pixel); font-size: 13px; background: var(--panel-solid); border: 3px solid var(--line-2); transform: rotate(45deg); z-index: 1;
}
.lvl-node span { transform: rotate(-45deg); }
.lvl.done .lvl-node { border-color: var(--a3); color: var(--a3); box-shadow: 0 0 18px color-mix(in srgb, var(--a3) 45%, transparent); }
.lvl.current .lvl-node { border-color: var(--a1); color: var(--text); background: var(--a1); box-shadow: 0 0 30px var(--glow-1); animation: nodePulse 1.6s ease-in-out infinite; }
@keyframes nodePulse { 50% { box-shadow: 0 0 50px var(--glow-1); } }
.lvl.done .lvl-path, .lvl.current .lvl-path { position: absolute; top: 34px; left: 0; right: -26px; height: 4px; background: var(--a3); box-shadow: 0 0 10px var(--a3); }
.lvl.current .lvl-path { right: auto; width: 48px; background: linear-gradient(90deg, var(--a3), var(--a1)); }
.lvl:first-child .lvl-path { left: 24px; }
.lvl-pin { position: absolute; top: -44px; left: 18px; width: 60px; text-align: center; animation: bob 1.6s ease-in-out infinite; z-index: 2; }
.lvl-pin img { width: 44px; height: 44px; margin: 0 auto; border-radius: 50%; border: 2px solid var(--a4); background: var(--bg-2); }
.lvl-pin small { display: block; font-family: var(--f-pixel); font-size: 7px; color: var(--a4); margin-top: 4px; }
.lvl-card { padding: 18px; border: 1px solid var(--line); background: var(--panel); min-height: 250px; transition: transform .3s var(--ease), border-color .3s; }
.lvl:hover .lvl-card { transform: translateY(-6px); border-color: var(--a2); }
.lvl.current .lvl-card { border-color: var(--a1); box-shadow: 0 0 40px color-mix(in srgb, var(--a1) 18%, transparent); }
.lvl-label { font-family: var(--f-pixel); font-size: 8px; color: var(--muted); letter-spacing: 1px; }
.lvl.current .lvl-label { color: var(--a1); }
.lvl-title { font-family: var(--f-head); font-size: 20px; line-height: 1.2; margin: 8px 0 2px; }
.lvl-period { font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.lvl-boss { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 8px 10px; margin-bottom: 12px; background: rgba(0,0,0,.22); border-left: 3px solid var(--a1); }
.lvl-boss b { color: var(--a4); font-family: var(--f-mono); font-size: 12px; white-space: nowrap; }
.lvl ul { list-style: none; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.lvl li::before { content: "◆ "; color: var(--a2); font-size: 10px; }
.lvl.locked .lvl-card { display: grid; place-items: center; text-align: center; border-style: dashed; background: repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 12px, transparent 12px 24px); }
.lvl.locked .lvl-node { color: var(--muted); }
.lock-big { font-size: 34px; margin-bottom: 8px; filter: grayscale(1); opacity: .7; }
.lvl.locked .lvl-title { color: var(--muted); }
.map-hint { text-align: center; font-size: 13px; font-family: var(--f-mono); }

/* ---------- TROPHIES ---------- */
.trophy-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.trophy-summary span { font-family: var(--f-mono); font-size: 12px; padding: 6px 12px; border: 1px solid var(--line-2); background: var(--panel); }
.trophy-summary b { color: var(--a4); }
.trophy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.trophy { --rc: var(--r-common); height: 290px; perspective: 1000px; }
.trophy[data-r="rare"] { --rc: var(--r-rare); }
.trophy[data-r="epic"] { --rc: var(--r-epic); }
.trophy[data-r="legendary"] { --rc: var(--r-legendary); }
.t-inner { position: relative; width: 100%; height: 100%; transition: transform .8s var(--ease); transform-style: preserve-3d; cursor: pointer; }
.trophy:hover .t-inner, .trophy.flip .t-inner { transform: rotateY(180deg); }
.t-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; padding: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--rc) 22%, transparent), var(--panel) 65%);
}
.t-back { transform: rotateY(180deg); background: linear-gradient(160deg, color-mix(in srgb, var(--rc) 20%, var(--panel-solid)), var(--panel-solid)); }
.t-hex {
  width: 96px; height: 106px; display: grid; place-items: center; font-size: 42px; margin-bottom: 16px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(160deg, var(--rc), color-mix(in srgb, var(--rc) 30%, #000));
  filter: drop-shadow(0 0 18px var(--rc));
}
.trophy[data-r="legendary"] .t-hex { animation: shimmer 3s linear infinite; background-size: 200% 200%; background-image: linear-gradient(120deg, var(--r-legendary), #fff3c4, var(--r-legendary), #b36b00); }
@keyframes shimmer { to { background-position: 200% 0; } }
.t-rar { font-family: var(--f-pixel); font-size: 8px; letter-spacing: 1.5px; color: var(--rc); margin-bottom: 8px; text-transform: uppercase; }
.t-title { font-family: var(--f-head); font-size: 19px; line-height: 1.2; }
.t-iss { color: var(--muted); font-size: 13px; margin-top: 4px; }
.t-back p { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.t-date { font-family: var(--f-mono); font-size: 12px; color: var(--rc); margin-bottom: 12px; }
.trophy.locked .t-hex { background: #2a2a3a; filter: none; color: transparent; text-shadow: 0 0 0 rgba(255,255,255,.25); }
.trophy.locked .t-face { border-style: dashed; border-color: var(--line-2); background: var(--panel); }
.trophy.locked .t-title::after { content: " 🔒"; }

/* ---------- GUILDS ---------- */
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.guild { position: relative; padding: 26px 22px 22px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; transition: transform .35s var(--ease), border-color .3s; }
.guild:hover { transform: translateY(-8px) rotate(-.5deg); border-color: var(--a3); }
.guild::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--a1), var(--a2), var(--a3)); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.guild:hover::before { transform: scaleX(1); }
.g-crest { width: 58px; height: 64px; display: grid; place-items: center; font-size: 28px; margin-bottom: 16px; clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%); background: linear-gradient(160deg, color-mix(in srgb, var(--a1) 50%, var(--panel-solid)), var(--panel-solid)); }
.g-name { font-family: var(--f-head); font-size: 20px; line-height: 1.2; }
.g-role { font-family: var(--f-mono); font-size: 12px; color: var(--a3); margin: 6px 0 2px; }
.g-period { font-size: 12px; color: var(--muted); font-family: var(--f-mono); margin-bottom: 10px; }
.g-desc { color: var(--muted); font-size: 14.5px; }

/* ---------- CONTACT ---------- */
.contact-wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; align-items: start; }
.ci-title { font-family: var(--f-head); font-size: clamp(26px, 3.4vw, 36px); line-height: 1.1; margin-bottom: 12px; background: linear-gradient(90deg, var(--a4), var(--a1)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.contact-info p { margin-bottom: 20px; }
.email-chip { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); text-align: left; transition: border-color .2s; margin-bottom: 16px; }
.email-chip:hover { border-color: var(--a3); }
.ec-label { font-family: var(--f-pixel); font-size: 8px; color: var(--a3); }
.ec-val { flex: 1; font-family: var(--f-mono); font-size: 14px; overflow-wrap: anywhere; }
.ec-copy { font-family: var(--f-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.ci-rows { display: grid; gap: 8px; margin-bottom: 20px; font-size: 14px; }
.ci-rows div { display: flex; gap: 10px; }
.ci-rows span:first-child { width: 22px; }
.terminal { border: 1px solid var(--line-2); background: rgba(5, 3, 18, .85); box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 50px var(--glow-2); font-family: var(--f-mono); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.03); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: auto; font-size: 12px; color: var(--muted); }
.term-body { padding: 22px; display: grid; gap: 14px; }
.term-line { font-size: 13px; }
.term-field { display: flex; align-items: center; gap: 12px; font-size: 14px; border-bottom: 1px dashed var(--line-2); padding-bottom: 8px; }
.term-field.col { flex-direction: column; align-items: stretch; }
.term-field > span { color: var(--a3); white-space: nowrap; }
.term-field input, .term-field select, .term-field textarea { flex: 1; width: 100%; background: transparent; border: 0; outline: 0; font-family: var(--f-mono); font-size: 14px; color: var(--text); caret-color: var(--a1); resize: vertical; min-width: 0; }
.term-field select option { background: var(--panel-solid); }
.term-field:focus-within { border-bottom-color: var(--a1); }
.term-field:focus-within > span { color: var(--a1); }
.term-field input::placeholder, .term-field textarea::placeholder { color: color-mix(in srgb, var(--muted) 60%, transparent); }
.term-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 6px; }
.term-out { font-size: 13px; color: var(--a3); }
.term-out.err { color: var(--a1); }

/* ---------- FOOTER ---------- */
.footer { padding: 90px 0 120px; text-align: center; border-top: 1px solid var(--line); background: linear-gradient(transparent, color-mix(in srgb, var(--a1) 8%, var(--bg))); }
.credits { font-family: var(--f-pixel); font-size: clamp(18px, 4vw, 34px); line-height: 1.4; color: var(--text); text-shadow: 4px 4px 0 var(--a1), -2px -2px 0 var(--a2); margin-bottom: 20px; }
.footer-zones { font-family: var(--f-mono); font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.footer-zones b { color: var(--a3); }
.footer-note { margin-top: 30px; font-size: 13px; }

/* ---------- MODAL ---------- */
.modal, .palette { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px; }
.modal[hidden], .palette[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 2, 12, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.modal-box { position: relative; width: min(820px, 100%); max-height: 90vh; overflow: auto; border: 1px solid var(--line-2); background: var(--panel-solid); box-shadow: 0 40px 120px rgba(0,0,0,.7), 0 0 60px var(--glow-1); animation: modalIn .45s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(30px) scale(.96); } }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 38px; height: 38px; background: rgba(0,0,0,.6); border: 1px solid var(--line-2); font-size: 16px; }
.modal-close:hover { border-color: var(--a1); color: var(--a1); }
.m-hero { position: relative; aspect-ratio: 21 / 9; overflow: hidden; background: var(--bg-2); }
.m-hero img { width: 100%; height: 100%; object-fit: cover; }
.m-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--panel-solid), transparent 60%); }
.m-body { padding: 0 28px 28px; margin-top: -40px; position: relative; z-index: 2; }
.m-kicker { font-family: var(--f-pixel); font-size: 9px; color: var(--a4); letter-spacing: 1px; }
.m-title { font-family: var(--f-head); font-size: clamp(26px, 4vw, 38px); line-height: 1.1; margin: 10px 0 10px; }
.m-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); margin-bottom: 22px; }
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 18px 0 22px; }
.m-block h4 { font-family: var(--f-pixel); font-size: 9px; letter-spacing: 1px; color: var(--a2); margin-bottom: 10px; }
.m-block p, .m-block li { color: var(--muted); font-size: 15px; }
.m-block ul { list-style: none; display: grid; gap: 6px; }
.m-block li::before { content: "▸ "; color: var(--a1); }
.m-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* ---------- PALETTE ---------- */
.palette { place-items: start center; padding-top: 14vh; }
.palette-box { position: relative; width: min(560px, 100%); border: 1px solid var(--line-2); background: var(--panel-solid); box-shadow: 0 40px 120px rgba(0,0,0,.7), 0 0 60px var(--glow-2); animation: modalIn .3s var(--ease); font-family: var(--f-mono); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.palette-input span { color: var(--a1); font-size: 20px; }
.palette-input input { flex: 1; background: none; border: 0; outline: 0; font-size: 16px; min-width: 0; }
.palette-list { list-style: none; max-height: 340px; overflow: auto; padding: 8px; }
.palette-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; font-size: 14px; color: var(--muted); cursor: pointer; }
.palette-list li .pi { width: 24px; text-align: center; }
.palette-list li small { margin-left: auto; font-size: 11px; opacity: .6; }
.palette-list li.sel { background: color-mix(in srgb, var(--a1) 18%, transparent); color: var(--text); box-shadow: inset 3px 0 0 var(--a1); }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }

/* ---------- TOASTS ---------- */
.toasts { position: fixed; z-index: 160; right: 18px; top: calc(var(--hud-h) + 14px); display: grid; gap: 10px; width: min(330px, calc(100% - 36px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--a4); background: rgba(14, 10, 43, .94);
  box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 24px color-mix(in srgb, var(--a4) 30%, transparent);
  animation: toastIn .5s var(--ease), toastOut .5s var(--ease) forwards; animation-delay: 0s, var(--life, 3.2s);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
.toast .ti { font-size: 24px; width: 40px; height: 40px; display: grid; place-items: center; background: color-mix(in srgb, var(--a4) 18%, transparent); flex-shrink: 0; }
.toast small { display: block; font-family: var(--f-pixel); font-size: 7.5px; color: var(--a4); letter-spacing: 1px; margin-bottom: 4px; }
.toast b { font-family: var(--f-head); font-size: 15px; line-height: 1.25; display: block; }

/* ---------- CHEAT MODE (Konami) ---------- */
body.cheat .glitch, body.cheat .zh-title { animation: rainbow 2s linear infinite; }
@keyframes rainbow { to { filter: hue-rotate(360deg); } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1180px) {
  .hud-nav { display: none; }
  .hud-tools { margin-left: auto; }
  .dock { display: flex; }
  .footer { padding-bottom: 140px; }
}
@media (max-width: 900px) {
  .hero-wrap { grid-template-columns: 1fr; gap: 50px; }
  .hero-right { max-width: 420px; width: 100%; margin-inline: auto; }
  .loadout, .contact-wrap { grid-template-columns: 1fr; }
  .zone { padding: 80px 0; }
  .visitor-xp .vx-num { display: none; }
}
@media (max-width: 600px) {
  :root { --hud-h: 58px; }
  .hud { padding: 0 16px; gap: 10px; }
  .logo-text { display: none; }
  .vx-bar { width: 50px; }
  .tool-btn { width: 34px; height: 34px; }
  .hero { padding-bottom: 90px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .quest-grid { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .skill { padding: 18px 10px 14px; }
  .skill-ring { width: 76px; height: 76px; }
  .skill-ico { inset: 14px; }
  .skill-ico img { width: 34px; height: 34px; }
  .m-grid { grid-template-columns: 1fr; }
  .m-body { padding: 0 18px 22px; }
  .panel { padding: 18px; }
  .lvl { width: 240px; }
  .scroll-hint { display: none; }
  .cc-attrs li { grid-template-columns: 74px 1fr 26px; }
  .cc-meta b { font-size: 12px; white-space: normal; }
  .char-card { padding: 20px 16px; }
  .term-field { flex-direction: column; align-items: stretch; gap: 4px; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
