:root {
    --primary: #22c55e;
    /* Green for Explorer theme */
    --primary-glow: rgba(34, 197, 94, 0.4);
    --secondary: #fbbf24;
    --danger: #ef4444;
    --bg-dark: #020617;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, #064e3b 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, #1e1b4b 0%, transparent 40%),
        #020617;
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 800px;
    /* Wider for map */
    padding: 20px;
    perspective: 1200px;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: none;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.glass-card.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(to right, #4ade80, #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-dim);
    margin-bottom: 30px;
}

.instructions {
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 16px;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.instructions p {
    margin-bottom: 8px;
}

/* Game Elements */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stat-item .label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.stat-item .value {
    font-size: 1.8rem;
    font-weight: 800;
    display: block;
}

.lives-container {
    font-size: 1.2rem;
    margin-top: 5px;
    letter-spacing: 2px;
}

.timer-container {
    flex: 1;
    margin: 0 30px;
    height: 35px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.timer-bar {
    position: absolute;
    height: 100%;
    width: 100%;
    background: linear-gradient(to right, #22c55e, #eab308);
    transition: width 0.1s linear;
}

.timer-text {
    position: relative;
    z-index: 2;
    line-height: 35px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Map Styling */
#map-container {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    margin-bottom: 25px;
}

#map {
    width: 100%;
    height: 100%;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: transparent;
}

/* Question Area */
.input-wrapper {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

#answer-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-size: 1.1rem;
    outline: none;
}

#submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 25px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.feedback {
    position: absolute;
    bottom: -30px;
    left: 0;
    width: 100%;
    font-size: 0.9rem;
    font-weight: 600;
    height: 20px;
}

.feedback.correct {
    color: #4ade80;
}

.feedback.wrong {
    color: #f87171;
}

/* Result Page */
.final-stats {
    display: flex;
    gap: 20px;
    margin: 30px 0;
}

.stat-box {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 20px;
}

.leaderboard {
    margin: 20px 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 10px;
    max-height: 250px;
    overflow-y: auto;
}

.rank-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rank-item.highlight {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border-radius: 8px;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 15px 30px;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    margin-top: 10px;
}

/* Animations */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.4s ease-in-out;
}