:root {
    --cyan: #00f3ff;
    --magenta: #ff00ff;
    --gold: #ffd700;
    --dark: #0a0a12;
    --panel-bg: rgba(10, 10, 18, 0.85);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    background: url('bg.png') center/cover no-repeat var(--dark);
    font-family: 'Rajdhani', sans-serif;
    color: #fff;
}

/* Background Canvas */
#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* UI Layer */
#ui-layer {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10% 0 15% 0;
}

/* Typography */
.hero-header {
    text-align: center;
}

.glitch {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--cyan), 0 0 20px var(--magenta);
    animation: pulseGlow 3s infinite alternate;
}

.subtitle {
    font-size: 1.2rem;
    color: #a0a0b0;
    margin-top: 5px;
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* Central Stage */
.center-stage {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.central-emblem {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.4), 0 0 50px rgba(255, 0, 255, 0.4);
    animation: floatEmblem 6s ease-in-out infinite, rotateSlow 20s linear infinite;
    z-index: 5;
}

/* Interactive Nodes */
.node {
    position: absolute;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform-origin: center;
    /* Circular positioning calculation */
    top: calc(50% - 30px + Math.sin(var(--angle)) * 120px);
    left: calc(50% - 30px + Math.cos(var(--angle)) * 120px);
    animation: orbitFloat 4s ease-in-out infinite alternate;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.node:active {
    transform: scale(0.9);
}

.node-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(20, 20, 30, 0.6);
    border: 1px solid var(--cyan);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    margin-bottom: 5px;
}

#node-fantasy .node-icon {
    border-color: var(--magenta);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

#node-myth .node-icon {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.node span {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-shadow: 0 0 5px #000;
}

/* Bottom Sheet */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--panel-bg);
    border-top: 1px solid var(--cyan);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    z-index: 30;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    box-shadow: 0 -10px 40px rgba(0, 243, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.bottom-sheet.active {
    transform: translateY(0);
}

.drag-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 auto 20px auto;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    padding: 0;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}

.sheet-content {
    padding-bottom: 20px;
}

.sheet-content h2 {
    font-family: 'Orbitron', sans-serif;
    margin: 0 0 10px 0;
    font-size: 1.5rem;
}

.sheet-content p {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #d0d0e0;
    margin-bottom: 15px;
}

.cyan-glow { color: var(--cyan); text-shadow: 0 0 10px rgba(0, 243, 255, 0.5); }
.magenta-glow { color: var(--magenta); text-shadow: 0 0 10px rgba(255, 0, 255, 0.5); }
.gold-glow { color: var(--gold); text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }

/* Stats Display */
.stats {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.stat {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 8px;
    border-left: 2px solid var(--cyan);
}

.stat .label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
}

.stat .value {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    margin-top: 4px;
}

/* Animations */
@keyframes pulseGlow {
    0% { text-shadow: 0 0 10px var(--cyan), 0 0 20px rgba(0,243,255,0.5); }
    100% { text-shadow: 0 0 15px var(--magenta), 0 0 30px rgba(255,0,255,0.6); }
}

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

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

@keyframes orbitFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

/* Set specific circular positions using CSS variables for nodes */
#node-scifi { top: calc(50% - 30px + min(120px, 35vw) * -0.5); left: calc(50% - 30px + min(120px, 35vw) * -0.866); }
#node-fantasy { top: calc(50% - 30px + min(120px, 35vw) * -0.5); left: calc(50% - 30px + min(120px, 35vw) * 0.866); }
#node-myth { top: calc(50% - 30px + min(120px, 35vw) * 1); left: calc(50% - 30px); }