:root {
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #0ea5e9;
    --accent: #f59e0b;
    --success: #10b981;
    --error: #ef4444;
    --bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --glass-border: rgba(255, 255, 255, 0.5);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation Menu */
.nav-menu {
    position: fixed;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 0.5rem;
    z-index: 1100;
    background: white;
    padding: 0.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.nav-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.nav-btn:hover {
    background: #f1f5f9;
}

.nav-btn.active {
    background: var(--primary);
    color: white;
}

/* Progress Bar */
.progress-container {
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 1200;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.4s ease;
}

/* Overlays */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    padding: 3rem;
    text-align: center;
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 90%;
}

.glass-card.full-width {
    max-width: 800px;
}

/* Map Game */
.map-game-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    gap: 1.5rem;
}

.map-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    background: white;
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.world-svg {
    width: 100%;
    display: block;
    opacity: 0.8;
    filter: saturate(0.5);
}

.drop-zones-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.drop-zone {
    position: absolute;
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%);
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

.drop-zone.interactive:hover {
    transform: translate(-50%, -50%) scale(1.2);
    background: var(--primary);
    color: white;
}

.drop-zone.filled {
    width: auto;
    height: auto;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    border-style: solid;
    border-color: var(--success);
    background: var(--success);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
    font-size: 0.85rem;
    cursor: default;
    z-index: 10;
}

.marker {
    pointer-events: none;
}

/* Map Dropdown */
.map-dropdown {
    position: absolute;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    z-index: 2000;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    max-width: 300px;
    animation: fadeIn 0.2s ease;
    border: 1px solid var(--primary-light);
}

.dropdown-option {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
    text-align: center;
}

.dropdown-option:hover {
    background: var(--primary-light);
    color: white;
}

.name-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    max-width: 1000px;
    background: white;
    padding: 1.5rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
}

.drag-chip {
    padding: 0.6rem 1.2rem;
    background: white;
    border: 1px solid var(--primary-light);
    border-radius: 0.75rem;
    cursor: grab;
    font-weight: 600;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.drag-chip:active {
    cursor: grabbing;
    opacity: 0.7;
}

/* Main UI */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 60px auto 0;
    width: 100%;
}

.phase {
    animation: fadeIn 0.4s ease;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-layout-split {
    display: flex;
    gap: 3rem;
    align-items: center;
    flex: 1;
    justify-content: center;
    max-height: 70vh;
}

.image-area-large {
    flex: 1.2;
    max-width: 600px;
    display: flex;
    justify-content: center;
}

.image-area-large img {
    max-width: 100%;
    max-height: 55vh;
    object-fit: contain;
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
    border: 8px solid white;
}

.info-area-side {
    flex: 0.8;
    background: white;
    padding: 2rem;
    border-radius: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.header-inline h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.info-area-side h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.info-area-side p {
    font-size: 1.25rem;
    line-height: 1.5;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.btn-audio-text {
    background: #f1f5f9;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    width: fit-content;
}

.navigation {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
}

.navigation.center {
    justify-content: center;
}

/* Game Elements */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stats {
    display: flex;
    gap: 1rem;
}

.stat-item {
    background: white;
    padding: 0.4rem 0.8rem;
    border-radius: 0.75rem;
    font-weight: 700;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.timer-display {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    font-family: monospace;
}

.game-layout-split {
    display: flex;
    gap: 3rem;
    align-items: center;
    flex: 1;
    justify-content: center;
    max-height: 65vh;
}

.game-image-side {
    flex: 1;
    max-width: 500px;
    display: flex;
    justify-content: center;
}

.game-image-side img {
    max-width: 100%;
    max-height: 45vh;
    object-fit: contain;
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
    border: 8px solid white;
}

.game-interactive-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fact-hint-box {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    border-left: 5px solid var(--accent);
}

.fact-hint-box p {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.4;
}

.word-container {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0.8rem 0;
}

.letter-slot {
    width: 3.5rem;
    height: 4.5rem;
    border-radius: 0.75rem;
    background: white;
    border: 3px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.letter-input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    text-align: center;
    font-size: inherit;
    font-weight: inherit;
    color: var(--primary);
    outline: none;
}

.letter-slot.active {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.letter-slot.correct {
    border-color: var(--success);
    background: #ecfdf5;
    color: var(--success);
}

.letter-slot.incorrect {
    border-color: var(--error);
    background: #fef2f2;
    animation: shake 0.4s ease;
}

/* Buttons */
.btn {
    border: none;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0.8rem;
    transition: all 0.2s;
    padding: 0.8rem 1.6rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.audio-btn {
    background: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    box-shadow: var(--shadow);
    cursor: pointer;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.audio-btn.large {
    width: auto;
    padding: 0 2rem;
    border-radius: 2rem;
    gap: 0.8rem;
    height: 60px;
    font-size: 1.2rem;
}

/* Results */
.total-score {
    font-size: 6rem;
    font-weight: 800;
    color: var(--primary);
    margin: 1rem 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    50% {
        transform: translateX(8px);
    }

    75% {
        transform: translateX(-8px);
    }
}

.hide {
    display: none !important;
}

@media (max-width: 900px) {
    .card-layout {
        flex-direction: column;
    }

    .nav-menu {
        position: static;
        margin-bottom: 1rem;
        width: 100%;
        overflow-x: auto;
        padding: 0.5rem;
        justify-content: center;
    }
}