:root {
    --bg-dark: #0a0a0f;
    --primary-glow: #4a90e2;
    --accent: #d4af37; /* Gold */
    --error: #e74c3c;
    --glass-bg: rgba(20, 20, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    background: radial-gradient(circle at center, #1a1a2e 0%, var(--bg-dark) 100%);
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background particles effect (pure CSS) */
#particles {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(74, 144, 226, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
    z-index: 1;
    animation: pulseBg 10s infinite alternate;
}

@keyframes pulseBg {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

.game-container {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
    transition: all 0.5s ease;
}

header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 20px;
}

h1.glow-text {
    font-family: 'Cinzel Decorative', cursive;
    color: #fff;
    font-size: 3rem;
    text-shadow: 0 0 10px var(--primary-glow), 0 0 20px var(--primary-glow);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.level-indicator {
    font-family: 'MedievalSharp', cursive;
    color: var(--accent);
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.scene-description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    text-align: justify;
    color: #cccccc;
}

.puzzle-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.equation {
    font-family: 'MedievalSharp', cursive;
    font-size: 2.5rem;
    color: var(--primary-glow);
    text-shadow: 0 0 15px rgba(74, 144, 226, 0.6);
    letter-spacing: 2px;
}

.input-section {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.magic-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    padding: 12px 20px;
    width: 120px;
    text-align: center;
    outline: none;
    transition: all 0.3s;
}

.magic-input:focus {
    border-color: var(--primary-glow);
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.4);
    background: rgba(255, 255, 255, 0.1);
}

.magic-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.runic-btn {
    display: block;
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2), rgba(212, 175, 55, 0.2));
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Cinzel Decorative', cursive;
    font-size: 1.2rem;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.runic-btn:hover {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.4), rgba(212, 175, 55, 0.4));
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
    transform: translateY(-2px);
    color: #fff;
}

.feedback {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.feedback.error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--error);
    color: #ff6b6b;
}

.feedback.success {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid #2ecc71;
    color: #55efc4;
}

.hidden {
    display: none !important;
}

/* Animations */
.fade-out {
    animation: fadeOut 0.5s forwards;
}

.fade-in {
    animation: fadeIn 0.8s forwards;
}

@keyframes fadeOut {
    to { opacity: 0; transform: scale(0.95); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(1.05); }
    to { opacity: 1; transform: scale(1); }
}

#victory-screen {
    text-align: center;
    padding: 40px 20px;
}

#victory-screen p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    line-height: 1.6;
    color: #e0e0e0;
}
.mt-4 { margin-top: 2rem; }
.text-xl { font-size: 4rem !important; color: var(--accent) !important; text-shadow: 0 0 20px var(--accent) !important; }

@media (max-width: 600px) {
    h1.glow-text { font-size: 2rem; }
    .equation { font-size: 1.8rem; }
    .game-container { padding: 20px; }
}
