/* ========================================
   npc.quest -- Neon Electric Gaming UI
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --void-black: #0A0A0F;
    --neon-cyan: #00F5D4;
    --electric-magenta: #F72585;
    --plasma-yellow: #FFE66D;
    --ghost-white: #E8E8E8;
    --deep-indigo: #141428;

    --font-primary: 'Orbitron', sans-serif;
    --font-body: 'Exo 2', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--void-black);
    color: var(--ghost-white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Dot-grid HUD overlay on body */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, var(--ghost-white) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   HERO SECTION
   ======================================== */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.hero-content {
    text-align: center;
    z-index: 2;
    animation: fadeInTitle 1s ease-out forwards;
}

.hero-title {
    font-family: var(--font-primary);
    font-size: clamp(1.8rem, 4vw, 3.6rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--neon-cyan);
    text-shadow:
        0 0 30px rgba(0, 245, 212, 0.6),
        0 0 60px rgba(0, 245, 212, 0.3),
        0 0 100px rgba(0, 245, 212, 0.15);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: clamp(0.8rem, 1.5vw, 1.2rem);
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--ghost-white);
    opacity: 0;
    animation: fadeInSubtitle 0.8s ease-out 0.5s forwards;
}

@keyframes fadeInTitle {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInSubtitle {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 0.9; transform: translateY(0); }
}

/* --- Orbital Hexagons --- */
.orbital-ring {
    position: absolute;
    width: 520px;
    height: 520px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    animation: orbitSpin 60s linear infinite;
}

@keyframes orbitSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.orbital-hex {
    position: absolute;
    width: 90px;
    height: 90px;
    top: 50%;
    left: 50%;
    /* Position each hex around a circle */
    transform:
        translate(-50%, -50%)
        rotate(calc(var(--i) * 60deg))
        translateY(-230px)
        rotate(calc(var(--i) * -60deg));
    opacity: 0;
    animation: orbitalEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) calc(1s + var(--i) * 100ms) forwards;
}

/* Counter-rotate so content stays upright despite parent spin */
.orbital-hex-inner {
    animation: orbitCounterSpin 60s linear infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--deep-indigo);
    border: 2px solid var(--neon-cyan);
    position: relative;
}

/* Hex border via pseudo-element since clip-path cuts borders */
.orbital-hex-inner::before {
    content: '';
    position: absolute;
    inset: -2px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--neon-cyan);
    z-index: -1;
}

@keyframes orbitCounterSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}

@keyframes orbitalEnter {
    from { opacity: 0; transform: translate(-50%, -50%) rotate(calc(var(--i) * 60deg)) translateY(-230px) rotate(calc(var(--i) * -60deg)) scale(0.6); }
    to   { opacity: 1; transform: translate(-50%, -50%) rotate(calc(var(--i) * 60deg)) translateY(-230px) rotate(calc(var(--i) * -60deg)) scale(1); }
}

.orbital-label {
    font-family: var(--font-primary);
    font-size: 0.55rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--ghost-white);
    margin-top: 2px;
    text-transform: uppercase;
}

/* ========================================
   HUD NAVIGATION
   ======================================== */
#hud-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 2rem;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 245, 212, 0.2);
}

.hud-link {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--neon-cyan);
    text-decoration: none;
    padding: 0.3rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.hud-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--electric-magenta);
    box-shadow: 0 0 8px var(--electric-magenta);
    transition: width 0.3s ease;
}

.hud-link:hover {
    color: var(--electric-magenta);
}

.hud-link:hover::after {
    width: 100%;
}

/* ========================================
   SECTION TITLES
   ======================================== */
.section-title {
    font-family: var(--font-primary);
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--neon-cyan);
    text-align: center;
    padding: 3rem 0 2rem;
    text-shadow: 0 0 20px rgba(0, 245, 212, 0.4);
}

/* ========================================
   HONEYCOMB GRID
   ======================================== */
#roster {
    position: relative;
    z-index: 1;
    padding: 0 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.honeycomb-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hex-row {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.hex-row--offset {
    transform: translateX(0);
    margin-top: -28px;
}

/* Individual hex tile */
.hex-tile {
    width: 160px;
    height: 180px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    transform: scale(0.6);
}

.hex-tile.visible {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: calc(var(--i) * 100ms);
}

.hex-tile:hover {
    transform: scale(1.08);
    z-index: 10;
}

.hex-clip {
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.hex-bg {
    position: absolute;
    inset: 0;
    background: var(--deep-indigo);
    z-index: 0;
}

/* Hex border via pseudo-element (behind clip-path) */
.hex-clip::before {
    content: '';
    position: absolute;
    inset: -2px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: -1;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Rarity border colors */
.hex-tile--common .hex-clip::before {
    background: var(--neon-cyan);
}
.hex-tile--rare .hex-clip::before {
    background: var(--plasma-yellow);
}
.hex-tile--legendary .hex-clip::before {
    background: var(--electric-magenta);
}

/* Hover glow */
.hex-tile--common:hover .hex-clip::before {
    background: var(--electric-magenta);
    box-shadow: 0 0 20px var(--neon-cyan), 0 0 40px rgba(0, 245, 212, 0.3);
}
.hex-tile--rare:hover .hex-clip::before {
    background: var(--electric-magenta);
    box-shadow: 0 0 20px var(--plasma-yellow), 0 0 40px rgba(255, 230, 109, 0.3);
}
.hex-tile--legendary:hover .hex-clip::before {
    background: var(--neon-cyan);
    box-shadow: 0 0 20px var(--electric-magenta), 0 0 40px rgba(247, 37, 133, 0.3);
}

/* Hex info text */
.hex-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    margin-top: 4px;
}

.hex-name {
    font-family: var(--font-primary);
    font-size: clamp(0.65rem, 1.5vw, 0.8rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--ghost-white);
}

.hex-role {
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--ghost-white);
    opacity: 0.7;
}

.hex-rarity {
    font-family: var(--font-primary);
    font-size: 0.45rem;
    letter-spacing: 0.1em;
    font-weight: 400;
    z-index: 1;
    margin-top: 2px;
}

.hex-tile--common .hex-rarity { color: var(--neon-cyan); }
.hex-tile--rare .hex-rarity { color: var(--plasma-yellow); }
.hex-tile--legendary .hex-rarity { color: var(--electric-magenta); }

/* Neon connecting lines between hexagons */
.honeycomb-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(60deg, transparent 48%, rgba(0, 245, 212, 0.06) 49%, rgba(0, 245, 212, 0.06) 51%, transparent 52%),
        linear-gradient(-60deg, transparent 48%, rgba(0, 245, 212, 0.06) 49%, rgba(0, 245, 212, 0.06) 51%, transparent 52%),
        linear-gradient(0deg, transparent 48%, rgba(0, 245, 212, 0.06) 49%, rgba(0, 245, 212, 0.06) 51%, transparent 52%);
    background-size: 80px 140px;
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   PIXEL ART CHARACTERS (CSS box-shadow)
   ======================================== */
.pixel-char {
    width: 48px;
    height: 48px;
    position: relative;
    z-index: 1;
    image-rendering: pixelated;
}

.pixel-body {
    position: absolute;
    width: 4px;
    height: 4px;
    top: 0;
    left: 0;
    background: transparent;
}

/* Pixel art characters using box-shadow technique
   Each shadow = 4px block at (x*4, y*4) from origin
   All characters are ~12x12 grid (48x48 px) */

/* Guard character */
.pixel-char--cyan .pixel-body[data-char="guard"] {
    box-shadow:
        /* Head */
        16px 0 0 var(--neon-cyan), 20px 0 0 var(--neon-cyan),
        16px 4px 0 var(--neon-cyan), 20px 4px 0 var(--neon-cyan),
        /* Helmet */
        12px 0 0 var(--neon-cyan), 24px 0 0 var(--neon-cyan),
        16px -4px 0 var(--neon-cyan), 20px -4px 0 var(--neon-cyan),
        /* Body */
        12px 8px 0 var(--neon-cyan), 16px 8px 0 var(--neon-cyan), 20px 8px 0 var(--neon-cyan), 24px 8px 0 var(--neon-cyan),
        12px 12px 0 var(--neon-cyan), 16px 12px 0 var(--neon-cyan), 20px 12px 0 var(--neon-cyan), 24px 12px 0 var(--neon-cyan),
        16px 16px 0 var(--neon-cyan), 20px 16px 0 var(--neon-cyan),
        /* Shield */
        4px 8px 0 var(--neon-cyan), 8px 8px 0 var(--neon-cyan),
        4px 12px 0 var(--neon-cyan), 8px 12px 0 var(--neon-cyan),
        /* Sword */
        28px 4px 0 var(--neon-cyan), 32px 0 0 var(--neon-cyan),
        28px 8px 0 var(--neon-cyan),
        /* Legs */
        12px 20px 0 var(--neon-cyan), 16px 20px 0 var(--neon-cyan),
        20px 20px 0 var(--neon-cyan), 24px 20px 0 var(--neon-cyan),
        12px 24px 0 var(--neon-cyan), 24px 24px 0 var(--neon-cyan);
}

/* Mage character */
.pixel-char--yellow .pixel-body[data-char="mage"],
.pixel-char--magenta .pixel-body[data-char="mage"] {
    box-shadow:
        /* Hat */
        16px -8px 0 currentColor, 20px -8px 0 currentColor,
        12px -4px 0 currentColor, 16px -4px 0 currentColor, 20px -4px 0 currentColor, 24px -4px 0 currentColor,
        /* Head */
        16px 0 0 currentColor, 20px 0 0 currentColor,
        16px 4px 0 currentColor, 20px 4px 0 currentColor,
        /* Body/Robe */
        12px 8px 0 currentColor, 16px 8px 0 currentColor, 20px 8px 0 currentColor, 24px 8px 0 currentColor,
        12px 12px 0 currentColor, 16px 12px 0 currentColor, 20px 12px 0 currentColor, 24px 12px 0 currentColor,
        8px 16px 0 currentColor, 12px 16px 0 currentColor, 16px 16px 0 currentColor, 20px 16px 0 currentColor, 24px 16px 0 currentColor, 28px 16px 0 currentColor,
        8px 20px 0 currentColor, 12px 20px 0 currentColor, 24px 20px 0 currentColor, 28px 20px 0 currentColor,
        /* Staff */
        32px 0 0 currentColor, 32px 4px 0 currentColor, 32px 8px 0 currentColor, 32px 12px 0 currentColor,
        32px 16px 0 currentColor, 32px 20px 0 currentColor,
        32px -4px 0 currentColor, 36px -8px 0 currentColor;
}

.pixel-char--yellow .pixel-body[data-char="mage"] { color: var(--plasma-yellow); }
.pixel-char--magenta .pixel-body[data-char="mage"] { color: var(--electric-magenta); }

/* Knight character */
.pixel-char--yellow .pixel-body[data-char="knight"],
.pixel-char--magenta .pixel-body[data-char="knight"] {
    box-shadow:
        /* Helmet with visor */
        16px -4px 0 currentColor, 20px -4px 0 currentColor,
        12px 0 0 currentColor, 16px 0 0 currentColor, 20px 0 0 currentColor, 24px 0 0 currentColor,
        12px 4px 0 currentColor, 24px 4px 0 currentColor,
        /* Body armor */
        8px 8px 0 currentColor, 12px 8px 0 currentColor, 16px 8px 0 currentColor, 20px 8px 0 currentColor, 24px 8px 0 currentColor, 28px 8px 0 currentColor,
        8px 12px 0 currentColor, 12px 12px 0 currentColor, 16px 12px 0 currentColor, 20px 12px 0 currentColor, 24px 12px 0 currentColor, 28px 12px 0 currentColor,
        12px 16px 0 currentColor, 16px 16px 0 currentColor, 20px 16px 0 currentColor, 24px 16px 0 currentColor,
        /* Legs */
        12px 20px 0 currentColor, 16px 20px 0 currentColor, 20px 20px 0 currentColor, 24px 20px 0 currentColor,
        12px 24px 0 currentColor, 24px 24px 0 currentColor,
        /* Sword */
        32px 0 0 currentColor, 32px 4px 0 currentColor, 32px 8px 0 currentColor,
        32px -4px 0 currentColor, 32px -8px 0 currentColor;
}

.pixel-char--yellow .pixel-body[data-char="knight"] { color: var(--plasma-yellow); }
.pixel-char--magenta .pixel-body[data-char="knight"] { color: var(--electric-magenta); }

/* Scout character */
.pixel-char--cyan .pixel-body[data-char="scout"] {
    box-shadow:
        /* Head */
        16px 0 0 var(--neon-cyan), 20px 0 0 var(--neon-cyan),
        16px 4px 0 var(--neon-cyan), 20px 4px 0 var(--neon-cyan),
        /* Hood */
        12px -4px 0 var(--neon-cyan), 16px -4px 0 var(--neon-cyan), 20px -4px 0 var(--neon-cyan), 24px -4px 0 var(--neon-cyan),
        /* Body */
        12px 8px 0 var(--neon-cyan), 16px 8px 0 var(--neon-cyan), 20px 8px 0 var(--neon-cyan), 24px 8px 0 var(--neon-cyan),
        16px 12px 0 var(--neon-cyan), 20px 12px 0 var(--neon-cyan),
        16px 16px 0 var(--neon-cyan), 20px 16px 0 var(--neon-cyan),
        /* Legs */
        12px 20px 0 var(--neon-cyan), 24px 20px 0 var(--neon-cyan),
        12px 24px 0 var(--neon-cyan), 24px 24px 0 var(--neon-cyan),
        /* Bow */
        28px 4px 0 var(--neon-cyan), 32px 0 0 var(--neon-cyan), 32px 8px 0 var(--neon-cyan),
        36px -4px 0 var(--neon-cyan), 36px 12px 0 var(--neon-cyan);
}

/* Healer character */
.pixel-char--cyan .pixel-body[data-char="healer"] {
    box-shadow:
        /* Head */
        16px 0 0 var(--neon-cyan), 20px 0 0 var(--neon-cyan),
        16px 4px 0 var(--neon-cyan), 20px 4px 0 var(--neon-cyan),
        /* Halo */
        16px -4px 0 var(--neon-cyan), 20px -4px 0 var(--neon-cyan),
        12px -4px 0 var(--neon-cyan), 24px -4px 0 var(--neon-cyan),
        /* Body/Robe */
        12px 8px 0 var(--neon-cyan), 16px 8px 0 var(--neon-cyan), 20px 8px 0 var(--neon-cyan), 24px 8px 0 var(--neon-cyan),
        12px 12px 0 var(--neon-cyan), 16px 12px 0 var(--neon-cyan), 20px 12px 0 var(--neon-cyan), 24px 12px 0 var(--neon-cyan),
        8px 16px 0 var(--neon-cyan), 12px 16px 0 var(--neon-cyan), 16px 16px 0 var(--neon-cyan), 20px 16px 0 var(--neon-cyan), 24px 16px 0 var(--neon-cyan), 28px 16px 0 var(--neon-cyan),
        12px 20px 0 var(--neon-cyan), 24px 20px 0 var(--neon-cyan),
        /* Cross on chest */
        16px 10px 0 var(--plasma-yellow), 20px 10px 0 var(--plasma-yellow);
}

/* Rogue character */
.pixel-char--magenta .pixel-body[data-char="rogue"],
.pixel-char--yellow .pixel-body[data-char="rogue"] {
    box-shadow:
        /* Head */
        16px 0 0 currentColor, 20px 0 0 currentColor,
        16px 4px 0 currentColor, 20px 4px 0 currentColor,
        /* Hood */
        12px -4px 0 currentColor, 16px -4px 0 currentColor, 20px -4px 0 currentColor,
        24px -4px 0 currentColor, 28px -8px 0 currentColor,
        /* Body */
        12px 8px 0 currentColor, 16px 8px 0 currentColor, 20px 8px 0 currentColor, 24px 8px 0 currentColor,
        16px 12px 0 currentColor, 20px 12px 0 currentColor,
        /* Cape */
        8px 8px 0 currentColor, 4px 12px 0 currentColor, 4px 16px 0 currentColor,
        /* Daggers */
        28px 8px 0 currentColor, 32px 4px 0 currentColor,
        /* Legs */
        12px 16px 0 currentColor, 24px 16px 0 currentColor,
        12px 20px 0 currentColor, 24px 20px 0 currentColor;
}

.pixel-char--magenta .pixel-body[data-char="rogue"] { color: var(--electric-magenta); }
.pixel-char--yellow .pixel-body[data-char="rogue"] { color: var(--plasma-yellow); }

/* Bard character */
.pixel-char--cyan .pixel-body[data-char="bard"],
.pixel-char--yellow .pixel-body[data-char="bard"] {
    box-shadow:
        /* Head */
        16px 0 0 currentColor, 20px 0 0 currentColor,
        16px 4px 0 currentColor, 20px 4px 0 currentColor,
        /* Feathered hat */
        12px -4px 0 currentColor, 16px -4px 0 currentColor, 20px -4px 0 currentColor, 24px -4px 0 currentColor,
        28px -8px 0 currentColor,
        /* Body */
        12px 8px 0 currentColor, 16px 8px 0 currentColor, 20px 8px 0 currentColor, 24px 8px 0 currentColor,
        16px 12px 0 currentColor, 20px 12px 0 currentColor,
        /* Lute */
        28px 8px 0 currentColor, 32px 8px 0 currentColor,
        28px 12px 0 currentColor, 32px 12px 0 currentColor, 36px 12px 0 currentColor,
        32px 16px 0 currentColor,
        /* Legs */
        12px 16px 0 currentColor, 24px 16px 0 currentColor,
        12px 20px 0 currentColor, 24px 20px 0 currentColor;
}

.pixel-char--cyan .pixel-body[data-char="bard"] { color: var(--neon-cyan); }
.pixel-char--yellow .pixel-body[data-char="bard"] { color: var(--plasma-yellow); }

/* Oracle character */
.pixel-char--magenta .pixel-body[data-char="oracle"] {
    box-shadow:
        /* Head */
        16px 0 0 var(--electric-magenta), 20px 0 0 var(--electric-magenta),
        16px 4px 0 var(--electric-magenta), 20px 4px 0 var(--electric-magenta),
        /* Third eye */
        18px -4px 0 var(--plasma-yellow),
        /* Crown */
        12px -4px 0 var(--electric-magenta), 24px -4px 0 var(--electric-magenta),
        10px -8px 0 var(--electric-magenta), 26px -8px 0 var(--electric-magenta),
        /* Body/Robe */
        12px 8px 0 var(--electric-magenta), 16px 8px 0 var(--electric-magenta), 20px 8px 0 var(--electric-magenta), 24px 8px 0 var(--electric-magenta),
        8px 12px 0 var(--electric-magenta), 12px 12px 0 var(--electric-magenta), 16px 12px 0 var(--electric-magenta),
        20px 12px 0 var(--electric-magenta), 24px 12px 0 var(--electric-magenta), 28px 12px 0 var(--electric-magenta),
        8px 16px 0 var(--electric-magenta), 12px 16px 0 var(--electric-magenta), 24px 16px 0 var(--electric-magenta), 28px 16px 0 var(--electric-magenta),
        12px 20px 0 var(--electric-magenta), 24px 20px 0 var(--electric-magenta);
}

/* Smith character */
.pixel-char--cyan .pixel-body[data-char="smith"] {
    box-shadow:
        /* Head */
        16px 0 0 var(--neon-cyan), 20px 0 0 var(--neon-cyan),
        16px 4px 0 var(--neon-cyan), 20px 4px 0 var(--neon-cyan),
        /* Body (stocky) */
        8px 8px 0 var(--neon-cyan), 12px 8px 0 var(--neon-cyan), 16px 8px 0 var(--neon-cyan), 20px 8px 0 var(--neon-cyan), 24px 8px 0 var(--neon-cyan), 28px 8px 0 var(--neon-cyan),
        8px 12px 0 var(--neon-cyan), 12px 12px 0 var(--neon-cyan), 16px 12px 0 var(--neon-cyan), 20px 12px 0 var(--neon-cyan), 24px 12px 0 var(--neon-cyan), 28px 12px 0 var(--neon-cyan),
        12px 16px 0 var(--neon-cyan), 16px 16px 0 var(--neon-cyan), 20px 16px 0 var(--neon-cyan), 24px 16px 0 var(--neon-cyan),
        /* Hammer */
        32px 4px 0 var(--neon-cyan), 36px 4px 0 var(--neon-cyan),
        32px 0 0 var(--neon-cyan), 36px 0 0 var(--neon-cyan),
        32px 8px 0 var(--neon-cyan),
        /* Legs */
        12px 20px 0 var(--neon-cyan), 16px 20px 0 var(--neon-cyan),
        20px 20px 0 var(--neon-cyan), 24px 20px 0 var(--neon-cyan);
}

/* Innkeeper character */
.pixel-char--cyan .pixel-body[data-char="innkeeper"] {
    box-shadow:
        /* Head */
        16px 0 0 var(--neon-cyan), 20px 0 0 var(--neon-cyan),
        16px 4px 0 var(--neon-cyan), 20px 4px 0 var(--neon-cyan),
        /* Apron/Body */
        12px 8px 0 var(--neon-cyan), 16px 8px 0 var(--neon-cyan), 20px 8px 0 var(--neon-cyan), 24px 8px 0 var(--neon-cyan),
        12px 12px 0 var(--neon-cyan), 16px 12px 0 var(--neon-cyan), 20px 12px 0 var(--neon-cyan), 24px 12px 0 var(--neon-cyan),
        16px 16px 0 var(--neon-cyan), 20px 16px 0 var(--neon-cyan),
        /* Mug */
        28px 8px 0 var(--plasma-yellow), 32px 8px 0 var(--plasma-yellow),
        28px 12px 0 var(--plasma-yellow), 32px 12px 0 var(--plasma-yellow),
        36px 10px 0 var(--plasma-yellow),
        /* Legs */
        12px 20px 0 var(--neon-cyan), 24px 20px 0 var(--neon-cyan);
}

/* Alchemist character */
.pixel-char--yellow .pixel-body[data-char="alchemist"] {
    box-shadow:
        /* Head */
        16px 0 0 var(--plasma-yellow), 20px 0 0 var(--plasma-yellow),
        16px 4px 0 var(--plasma-yellow), 20px 4px 0 var(--plasma-yellow),
        /* Goggles */
        12px 0 0 var(--plasma-yellow), 24px 0 0 var(--plasma-yellow),
        /* Body */
        12px 8px 0 var(--plasma-yellow), 16px 8px 0 var(--plasma-yellow), 20px 8px 0 var(--plasma-yellow), 24px 8px 0 var(--plasma-yellow),
        12px 12px 0 var(--plasma-yellow), 16px 12px 0 var(--plasma-yellow), 20px 12px 0 var(--plasma-yellow), 24px 12px 0 var(--plasma-yellow),
        16px 16px 0 var(--plasma-yellow), 20px 16px 0 var(--plasma-yellow),
        /* Flask */
        28px 4px 0 var(--neon-cyan), 32px 4px 0 var(--neon-cyan),
        28px 8px 0 var(--neon-cyan), 32px 8px 0 var(--neon-cyan),
        30px 0 0 var(--neon-cyan),
        /* Legs */
        12px 20px 0 var(--plasma-yellow), 24px 20px 0 var(--plasma-yellow);
}

/* Tamer character */
.pixel-char--yellow .pixel-body[data-char="tamer"] {
    box-shadow:
        /* Head */
        16px 0 0 var(--plasma-yellow), 20px 0 0 var(--plasma-yellow),
        16px 4px 0 var(--plasma-yellow), 20px 4px 0 var(--plasma-yellow),
        /* Body */
        12px 8px 0 var(--plasma-yellow), 16px 8px 0 var(--plasma-yellow), 20px 8px 0 var(--plasma-yellow), 24px 8px 0 var(--plasma-yellow),
        16px 12px 0 var(--plasma-yellow), 20px 12px 0 var(--plasma-yellow),
        16px 16px 0 var(--plasma-yellow), 20px 16px 0 var(--plasma-yellow),
        /* Whip */
        28px 8px 0 var(--plasma-yellow), 32px 4px 0 var(--plasma-yellow), 36px 0 0 var(--plasma-yellow),
        /* Pet (small creature) */
        0px 16px 0 var(--neon-cyan), 4px 16px 0 var(--neon-cyan),
        0px 20px 0 var(--neon-cyan), 4px 20px 0 var(--neon-cyan),
        /* Legs */
        12px 20px 0 var(--plasma-yellow), 24px 20px 0 var(--plasma-yellow);
}

/* Character bounce animation on tile hover */
.hex-tile:hover .pixel-char {
    animation: charBounce 0.3s steps(2) infinite;
}

@keyframes charBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Neon glow pulse on hex tiles */
.hex-tile--common .hex-clip {
    box-shadow: inset 0 0 20px rgba(0, 245, 212, 0.05);
}
.hex-tile--rare .hex-clip {
    box-shadow: inset 0 0 20px rgba(255, 230, 109, 0.05);
}
.hex-tile--legendary .hex-clip {
    box-shadow: inset 0 0 20px rgba(247, 37, 133, 0.05);
    animation: legendaryPulse 2s ease-in-out infinite;
}

@keyframes legendaryPulse {
    0%, 100% { box-shadow: inset 0 0 20px rgba(247, 37, 133, 0.05); }
    50% { box-shadow: inset 0 0 30px rgba(247, 37, 133, 0.15); }
}

/* ========================================
   CHARACTER MODAL
   ======================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--deep-indigo);
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 40px rgba(0, 245, 212, 0.2), 0 0 80px rgba(0, 245, 212, 0.1);
    padding: 2.5rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    clip-path: polygon(5% 0%, 95% 0%, 100% 5%, 100% 95%, 95% 100%, 5% 100%, 0% 95%, 0% 5%);
    animation: modalEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalEnter {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: none;
    border: none;
    color: var(--ghost-white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
    font-family: var(--font-body);
    line-height: 1;
}

.modal-close:hover {
    color: var(--electric-magenta);
}

.modal-hex-portrait {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--void-black);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-name {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--ghost-white);
    margin-bottom: 0.25rem;
}

.modal-role {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--ghost-white);
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.modal-rarity {
    font-family: var(--font-primary);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    display: inline-block;
    padding: 0.2rem 0.6rem;
    margin-bottom: 1.5rem;
    border-radius: 2px;
}

.modal-rarity[data-rarity="Common"] {
    color: var(--void-black);
    background: var(--neon-cyan);
}
.modal-rarity[data-rarity="Rare"] {
    color: var(--void-black);
    background: var(--plasma-yellow);
}
.modal-rarity[data-rarity="Legendary"] {
    color: var(--ghost-white);
    background: var(--electric-magenta);
}

/* Stat bars */
.modal-stats {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-align: left;
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    font-family: var(--font-primary);
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--ghost-white);
    width: 2.5rem;
    text-align: right;
}

.stat-track {
    flex: 1;
    height: 8px;
    background: var(--void-black);
    border: 1px solid rgba(0, 245, 212, 0.2);
    position: relative;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-fill--str { background: var(--electric-magenta); }
.stat-fill--dex { background: var(--neon-cyan); }
.stat-fill--int { background: var(--plasma-yellow); }
.stat-fill--hp  { background: var(--neon-cyan); }

.stat-value {
    font-family: var(--font-primary);
    font-size: 0.6rem;
    color: var(--ghost-white);
    width: 2rem;
    text-align: left;
}

/* ========================================
   QUEST LOG
   ======================================== */
#quest-log {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.quest-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quest-entry {
    background: var(--deep-indigo);
    border-left: 3px solid var(--neon-cyan);
    padding: 1.2rem 1.5rem;
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.quest-entry:hover {
    border-color: var(--electric-magenta);
    box-shadow: 0 0 15px rgba(247, 37, 133, 0.1);
}

.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.quest-timestamp {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--ghost-white);
    opacity: 0.5;
}

.quest-status {
    font-family: var(--font-primary);
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
}

.quest-status--active {
    color: var(--void-black);
    background: var(--neon-cyan);
}

.quest-status--complete {
    color: var(--void-black);
    background: var(--plasma-yellow);
}

.quest-title {
    font-family: var(--font-primary);
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--ghost-white);
    margin-bottom: 0.4rem;
}

.quest-desc {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--ghost-white);
    opacity: 0.7;
    line-height: 1.5;
}

/* ========================================
   HUD FOOTER
   ======================================== */
#hud-footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background: var(--deep-indigo);
    border-top: 1px solid rgba(0, 245, 212, 0.2);
    font-family: var(--font-primary);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.08em;
}

.hud-domain {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 245, 212, 0.4);
}

.hud-level {
    color: var(--plasma-yellow);
    text-shadow: 0 0 10px rgba(255, 230, 109, 0.4);
}

.hud-hp {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 245, 212, 0.4);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
    .orbital-ring {
        width: 380px;
        height: 380px;
    }

    .orbital-hex {
        width: 70px;
        height: 70px;
        transform:
            translate(-50%, -50%)
            rotate(calc(var(--i) * 60deg))
            translateY(-170px)
            rotate(calc(var(--i) * -60deg));
    }

    @keyframes orbitalEnter {
        from { opacity: 0; transform: translate(-50%, -50%) rotate(calc(var(--i) * 60deg)) translateY(-170px) rotate(calc(var(--i) * -60deg)) scale(0.6); }
        to   { opacity: 1; transform: translate(-50%, -50%) rotate(calc(var(--i) * 60deg)) translateY(-170px) rotate(calc(var(--i) * -60deg)) scale(1); }
    }

    .hex-tile {
        width: 120px;
        height: 135px;
    }

    .hex-row--offset {
        margin-top: -20px;
    }

    .pixel-char {
        width: 36px;
        height: 36px;
    }

    .pixel-body {
        width: 3px;
        height: 3px;
    }
}

@media (max-width: 600px) {
    .orbital-ring {
        width: 300px;
        height: 300px;
    }

    .orbital-hex {
        width: 55px;
        height: 55px;
        transform:
            translate(-50%, -50%)
            rotate(calc(var(--i) * 60deg))
            translateY(-130px)
            rotate(calc(var(--i) * -60deg));
    }

    @keyframes orbitalEnter {
        from { opacity: 0; transform: translate(-50%, -50%) rotate(calc(var(--i) * 60deg)) translateY(-130px) rotate(calc(var(--i) * -60deg)) scale(0.6); }
        to   { opacity: 1; transform: translate(-50%, -50%) rotate(calc(var(--i) * 60deg)) translateY(-130px) rotate(calc(var(--i) * -60deg)) scale(1); }
    }

    .hex-tile {
        width: 95px;
        height: 108px;
    }

    .hex-row--offset {
        margin-top: -16px;
    }

    .hex-row {
        gap: 6px;
    }

    .hex-name {
        font-size: 0.55rem;
    }

    .hex-role {
        font-size: 0.45rem;
    }

    .hex-rarity {
        font-size: 0.35rem;
    }

    #hud-nav {
        gap: 1rem;
    }

    .hud-link {
        font-size: 0.6rem;
    }

    .pixel-char {
        width: 28px;
        height: 28px;
    }

    .pixel-body {
        width: 2px;
        height: 2px;
    }

    .quest-entry {
        padding: 0.8rem 1rem;
    }

    #hud-footer {
        font-size: 0.55rem;
        padding: 0.6rem 1rem;
    }
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--void-black);
}

::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--electric-magenta);
}
