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

body {
    overflow: hidden;
    background: #000000;
    font-family: 'JetBrains Mono', monospace;
    color: #ffffff;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#scene-container canvas {
    display: block;
}

#vignette {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6) 100%);
}

/* Title Panel */
#title-panel {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 10;
    display: flex;
    gap: 0;
    transition: opacity 0.8s ease;
    max-width: 420px;
}

#title-panel.faded {
    opacity: 0;
    pointer-events: none;
}

.title-accent {
    width: 3px;
    background: linear-gradient(to bottom, #00BFFF, #8B5CF6, #06D6A0);
    border-radius: 2px;
    flex-shrink: 0;
}

.title-content {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 191, 255, 0.1);
    border-left: none;
    border-radius: 0 8px 8px 0;
}

#title-panel h1 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 18px;
    letter-spacing: 3px;
    background: linear-gradient(90deg, #00BFFF, #C77DFF, #06D6A0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.instructions {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 12px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
}

.instructions span {
    letter-spacing: 0.3px;
}

/* Stats Bar */
#stats-bar {
    position: fixed;
    bottom: 60px;
    left: 24px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid rgba(0, 191, 255, 0.08);
    font-size: 11px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

#stats-bar:hover {
    opacity: 1;
}

.stat-row {
    display: flex;
    gap: 6px;
    line-height: 1.7;
}

.stat-label {
    color: rgba(0, 191, 255, 0.6);
    font-weight: 500;
}

/* Progress Ring */
#progress-ring-container {
    position: fixed;
    bottom: 60px;
    right: 24px;
    z-index: 10;
    width: 64px;
    height: 64px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

#progress-ring-container:hover {
    opacity: 1;
}

#progress-ring-container.glow {
    filter: drop-shadow(0 0 8px rgba(0, 191, 255, 0.6));
}

#progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 3;
}

.ring-fill {
    fill: none;
    stroke: url(#ring-gradient);
    stroke: #00BFFF;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 213.628;
    stroke-dashoffset: 213.628;
    transition: stroke-dashoffset 0.6s ease;
}

#progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
}

/* Discover Button */
#discover-btn {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(0, 191, 255, 0.12);
    border: 1px solid rgba(0, 191, 255, 0.3);
    color: #00BFFF;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 10px 28px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    animation: pulse-btn 3s ease-in-out infinite;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#discover-btn:hover {
    background: rgba(0, 191, 255, 0.25);
    border-color: rgba(0, 191, 255, 0.6);
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
    transform: translateX(-50%) scale(1.05);
}

#discover-btn:active {
    transform: translateX(-50%) scale(0.97);
}

.btn-icon {
    font-size: 16px;
    animation: spin-slow 8s linear infinite;
}

@keyframes pulse-btn {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 191, 255, 0.1); }
    50% { box-shadow: 0 0 15px rgba(0, 191, 255, 0.25); }
}

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

/* Fate Modal */
#fate-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

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

#fate-modal.visible {
    opacity: 1;
    pointer-events: all;
}

#fate-card {
    background: rgba(5, 5, 20, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 191, 255, 0.2);
    border-radius: 12px;
    padding: 24px 28px;
    max-width: 500px;
    width: 90vw;
    transform: scale(0.85);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

#fate-modal.visible #fate-card {
    transform: scale(1);
}

#fate-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--fate-color, #00BFFF), transparent);
}

.fate-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.fate-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fate-color, #00BFFF);
    animation: fate-dot-pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 8px var(--fate-color, #00BFFF);
}

@keyframes fate-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.7); }
}

.fate-uid {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    flex: 1;
}

#fate-close {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#fate-close:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.fate-body {
    font-size: 18px;
    line-height: 1.6;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    text-shadow: 0 0 20px rgba(0, 191, 255, 0.15);
    min-height: 60px;
    margin-bottom: 20px;
}

.fate-footer {
    display: flex;
    justify-content: space-between;
}

.fate-meta {
    display: flex;
    gap: 16px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.5px;
}

/* Footer */
#footer-bar {
    position: fixed;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

#footer-bar a {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.2);
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

#footer-bar a:hover {
    color: rgba(0, 191, 255, 0.6);
    text-shadow: 0 0 8px rgba(0, 191, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    #title-panel {
        top: 16px;
        left: 16px;
        max-width: 280px;
    }

    #title-panel h1 {
        font-size: 13px;
        letter-spacing: 2px;
    }

    .subtitle {
        font-size: 10px;
    }

    .instructions {
        font-size: 9px;
    }

    #stats-bar {
        display: none;
    }

    #progress-ring-container {
        bottom: 70px;
        right: 16px;
        width: 50px;
        height: 50px;
    }

    #progress-text {
        font-size: 9px;
    }

    #discover-btn {
        padding: 8px 20px;
        font-size: 10px;
    }

    .fate-body {
        font-size: 15px;
    }

    #fate-card {
        padding: 18px 20px;
    }
}

@media (max-width: 480px) {
    #title-panel {
        max-width: 240px;
    }

    #title-panel h1 {
        font-size: 11px;
        letter-spacing: 1.5px;
    }

    .title-content {
        padding: 10px 14px;
    }
}