:root {
    --primary-color: #D4AF37;
    /* LCK Gold */
    --secondary-color: #0F1923;
    /* Dark Navy/Black */
    --accent-color: #FFFFFF;
    --text-color: #E0E0E0;
    --bg-gradient: linear-gradient(135deg, #09090b 0%, #1c1c24 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --hover-color: rgba(212, 175, 55, 0.2);
    --correct-color: #4CAF50;
    --wrong-color: #F44336;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Noto Sans KR', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, #1a1c29 0%, #09090b 100%);
    overflow: hidden;
}

.background-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        linear-gradient(rgba(212, 175, 55, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg);
    animation: gridMove 20s linear infinite;
    opacity: 0.3;
}

.background-animation::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: glowPulse 4s infinite alternate;
}

@keyframes gridMove {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0);
    }

    100% {
        transform: perspective(500px) rotateX(60deg) translateY(50px);
    }
}

@keyframes glowPulse {
    0% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.8);
    }

    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

.app-container {
    width: 90%;
    max-width: 600px;
    height: 90vh;
    /* Mobile friendly */
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding: 20px;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    /* Changed from pointer-events: none */
    transition: opacity 0.5s ease, visibility 0.5s;
    /* Added z-index relative */
    z-index: 1;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

.hidden {
    display: none !important;
    /* Force hide for structure */
}

/* Settings Bar */
.global-settings {
    position: fixed;
    /* Fixed relative to viewport - TOP RIGHT */
    top: 20px;
    right: 20px;
    z-index: 9999;
    /* Ensure it's above everything */
    display: flex;
    gap: 12px;
    align-items: center;
}

.icon-btn {
    background: rgba(20, 25, 40, 0.8);
    /* Darker for better visibility */
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #D4AF37;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    width: 44px;
    /* Fixed square size for perfect alignment */
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Specific styling for text in buttons (EN/KR) */
#lang-btn {
    width: auto;
    min-width: 60px;
    height: 44px;
}

.icon-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: #D4AF37;
    transform: translateY(-2px);
}

.icon-btn:active {
    transform: scale(0.95);
}

/* Typography & Layout */
h1.logo {
    font-family: var(--font-heading);
    font-size: 5rem;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: -2px;

    /* Gold Gradient Text */
    background: linear-gradient(to bottom, #F0E6D2 0%, #D4AF37 40%, #C59D1B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));

    position: relative;
    z-index: 2;
}

.highlight {
    /* Make the highlight distinctive */
    background: linear-gradient(to bottom, #ffffff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.3rem;
    color: #a0a0a0;
    margin-bottom: 50px;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
}

/* Glassmorphism Cards */
.question-card {
    background: rgba(20, 25, 40, 0.7);
    /* Darker, bluer bg */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    /* Gold border */
    padding: 30px;
    border-radius: 4px;
    /* Angled corners feel */
    margin-bottom: 30px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(212, 175, 55, 0.05);
    position: relative;
}

#question-text {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.5;
    color: #F0E6D2;
}

/* Buttons */
.btn {
    padding: 20px 60px;
    font-size: 1.5rem;
    font-weight: 900;
    border: none;
    border-radius: 2px;
    /* Hextech shape */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    font-family: var(--font-heading);
    position: relative;
    overflow: visible;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.primary-btn {
    background: linear-gradient(135deg, #D4AF37 0%, #B49225 100%);
    /* Gold gradient */
    color: #0F1923;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4), inset 0 0 0 2px rgba(255, 255, 255, 0.2);
    border: 1px solid #F0E6D2;
}

.primary-btn::after {
    content: '';
    position: absolute;
    top: -5px;
    bottom: -5px;
    left: -5px;
    right: -5px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    z-index: -1;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.6);
    background: linear-gradient(135deg, #E5C355 0%, #C5A132 100%);
}

.primary-btn:hover::after {
    top: -8px;
    bottom: -8px;
    left: -8px;
    right: -8px;
    border-color: rgba(212, 175, 55, 0.6);
}

.primary-btn:active {
    transform: scale(0.95);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    width: 100%;
}

.option-btn {
    background: var(--glass-bg);
    border: var(--glass-border);
    color: var(--text-color);
    padding: 20px;
    border-radius: 12px;
    font-size: 1.15rem;
    text-align: left;
    cursor: pointer;
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s;
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.option-btn:hover {
    background: var(--hover-color);
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.option-btn.correct {
    background: rgba(76, 175, 80, 0.3);
    border-color: var(--correct-color);
}

.option-btn.wrong {
    background: rgba(244, 67, 54, 0.3);
    border-color: var(--wrong-color);
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Header & Progress */
.header-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.progress-container {
    width: 70%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.question-count {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
}

/* Result Screen */
.score-circle {
    width: 200px;
    height: 200px;
    position: relative;
    margin-bottom: 30px;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 100%;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease-out;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

#final-score {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 900;
    display: block;
    line-height: 1;
}

.total-score {
    font-size: 1.2rem;
    color: #888;
}

.result-message {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--primary-color);
    font-weight: 700;
}

/* Responsive */
@media (max-width: 480px) {
    h1.logo {
        font-size: 2.5rem;
    }

    .question-card {
        padding: 20px;
    }

    #question-text {
        font-size: 1.2rem;
    }

    .option-btn {
        font-size: 1rem;
        padding: 15px;
    }
}

/* Result Actions (Added in v5) */
.result-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}

.icon-btn.large {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    border-radius: 12px;
    position: relative;
}

.icon-btn.large .tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    white-space: nowrap;
    color: #fff;
    font-family: var(--font-body);
}

.icon-btn.large:hover .tooltip {
    opacity: 1;
    visibility: visible;
    bottom: -35px;
}

/* Toast Notification (Added in v5) */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(212, 175, 55, 0.9);
    color: #0F1923;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s, transform 0.3s;
    font-family: var(--font-heading);
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}