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

body {
    font-family: 'JetBrains Mono', monospace;
    background: #0a0612;
    color: #e0d0ff;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

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

/* Screens */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(10, 6, 18, 0.97) 0%, rgba(26, 10, 46, 0.95) 100%);
    z-index: 100;
    backdrop-filter: blur(10px);
}

.screen.hidden {
    display: none;
}

/* Start Screen */
.start-content, .victory-content {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    animation: fadeIn 0.8s ease-out;
}

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

.title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 900;
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.subtitle {
    font-family: 'Cinzel', serif;
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: #00ffff;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.tagline {
    font-size: 0.9rem;
    color: #a090c0;
    font-style: italic;
    margin-bottom: 2rem;
}

.instructions {
    background: rgba(30, 20, 50, 0.6);
    border: 1px solid #3d2b5e;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.instructions h3 {
    font-family: 'Cinzel', serif;
    color: #ffd700;
    margin-bottom: 1rem;
}

.instructions p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.key {
    display: inline-block;
    background: #2d1b4e;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #4d3b6e;
    font-weight: bold;
}

.golden {
    color: #ffd700;
}

.mobile-note {
    color: #00ffff;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.glow-btn {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 1rem 3rem;
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 100%);
    border: 2px solid #ffd700;
    color: #ffd700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.glow-btn:hover {
    background: linear-gradient(135deg, #2d1b4e 0%, #4d3b6e 100%);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
    transform: scale(1.05);
}

.glow-btn.secondary {
    border-color: #00ffff;
    color: #00ffff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.glow-btn.secondary:hover {
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.5);
}

.footer-text {
    margin-top: 2rem;
    font-size: 0.75rem;
    color: #6050a0;
}

.footer-text a {
    color: #ff69b4;
    text-decoration: none;
}

.footer-text a:hover {
    text-decoration: underline;
}

/* HUD */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

#hud.hidden {
    display: none;
}

#thread-counter {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(10, 6, 18, 0.8);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    border: 1px solid #ffd700;
    font-size: 1.1rem;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#timer {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(10, 6, 18, 0.8);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    border: 1px solid #00ffff;
    font-size: 1rem;
    color: #00ffff;
}

#skills-bar {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.skill-icon {
    width: 40px;
    height: 40px;
    background: rgba(10, 6, 18, 0.9);
    border: 2px solid #ffd700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    animation: skillPop 0.3s ease-out;
}

@keyframes skillPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

#message-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 140, 0, 0.2) 100%);
    border: 2px solid #ffd700;
    padding: 1.5rem 3rem;
    border-radius: 12px;
    font-size: 1.3rem;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: messagePop 0.4s ease-out;
}

#message-popup.hidden {
    display: none;
}

@keyframes messagePop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

#easter-egg {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(51, 0, 51, 0.9);
    border: 1px solid #660066;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-style: italic;
    color: #cc99cc;
    animation: eggFloat 0.5s ease-out;
}

#easter-egg.hidden {
    display: none;
}

@keyframes eggFloat {
    0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Mobile Controls */
#mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    pointer-events: none;
    z-index: 60;
}

#mobile-controls.hidden {
    display: none;
}

#joystick-zone {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50%;
    height: 100%;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#joystick-base {
    width: 120px;
    height: 120px;
    background: rgba(0, 255, 255, 0.15);
    border: 2px solid rgba(0, 255, 255, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#joystick-thumb {
    width: 50px;
    height: 50px;
    background: rgba(0, 255, 255, 0.5);
    border: 2px solid #00ffff;
    border-radius: 50%;
    transition: background 0.1s;
}

#look-zone {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 50%;
    height: 100%;
    pointer-events: auto;
}

/* Victory Screen */
.victory-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 8vw, 3.5rem);
    background: linear-gradient(135deg, #00ffff 0%, #00ff88 50%, #00ffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: victoryPulse 2s ease-in-out infinite;
}

@keyframes victoryPulse {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.5)); }
    50% { filter: drop-shadow(0 0 40px rgba(0, 255, 255, 0.8)); }
}

.victory-content h2 {
    font-family: 'Cinzel', serif;
    color: #e0d0ff;
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

.certificate {
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 100%);
    border: 3px solid #ffd700;
    border-radius: 16px;
    padding: 2px;
    margin: 1.5rem 0;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.cert-inner {
    background: rgba(10, 6, 18, 0.9);
    border-radius: 14px;
    padding: 1.5rem;
}

.cert-header {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: #ffd700;
    margin-bottom: 1rem;
}

.cert-name {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: #00ffff;
    margin-bottom: 0.5rem;
}

.cert-text {
    color: #a090c0;
    margin-bottom: 1rem;
}

.cert-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.cert-stats p {
    color: #e0d0ff;
}

.cert-skills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.skill-badge {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid #ffd700;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #ffd700;
}

.victory-note {
    font-style: italic;
    color: #8070b0;
    font-size: 0.9rem;
    margin: 1.5rem 0;
}

.victory-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 600px) {
    .start-content, .victory-content {
        padding: 1rem;
    }

    .instructions {
        padding: 1rem;
    }

    .glow-btn {
        padding: 0.8rem 2rem;
        font-size: 1.1rem;
    }

    .cert-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    #thread-counter, #timer {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Crosshair */
#scene-container::after {
    content: '+';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: rgba(0, 255, 255, 0.5);
    pointer-events: none;
    z-index: 40;
    font-weight: 100;
}