/* assets/css/style.css - Flag Recognition Game Stylesheet */

:root {
    --bg-dark: #090d16;
    --bg-surface: #111827;
    --bg-surface-elevated: #1e293b;
    --bg-surface-hover: #273549;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(99, 102, 241, 0.3);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.35);

    --accent-cyan: #06b6d4;
    --accent-amber: #f59e0b;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --danger: #f43f5e;
    --danger-bg: rgba(244, 63, 94, 0.15);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
    --shadow-glow: 0 0 25px var(--primary-glow);
    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 15% 15%, rgba(99, 102, 241, 0.12) 0px, transparent 45%),
        radial-gradient(at 85% 85%, rgba(6, 182, 212, 0.1) 0px, transparent 45%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: #818cf8;
}

/* ================= Navbar ================= */
.navbar {
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    letter-spacing: -0.5px;
}

.brand-icon {
    font-size: 1.7rem;
    display: inline-block;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.5));
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-link:hover, .nav-link.active {
    color: #fff;
    background: var(--bg-surface-elevated);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.btn-icon-sound {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}
.btn-icon-sound:hover {
    background: var(--bg-surface-hover);
    transform: scale(1.05);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}
.user-pill:hover {
    border-color: var(--border-highlight);
    background: var(--bg-surface-hover);
}

.user-avatar-small {
    font-size: 1.2rem;
}

/* ================= Buttons ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4338ca);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #7174fc, var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--bg-surface-hover);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-outline:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #e11d48;
}

.btn-lg {
    padding: 0.85rem 1.8rem;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
}

/* ================= Layout ================= */
.main-wrapper {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ================= Hero / Welcome ================= */
.hero-banner {
    text-align: center;
    padding: 3rem 1rem 2.5rem;
    position: relative;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.15;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 650px;
    margin: 0 auto 2rem;
}

/* ================= Modes Grid ================= */
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.section-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.section-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.mode-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}
.mode-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-highlight);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6), 0 0 20px var(--primary-glow);
}

.mode-card.featured {
    border-color: var(--primary);
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.12), var(--bg-surface));
}

.mode-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

.mode-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.mode-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}

.mode-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

/* ================= Continent Cards ================= */
.continents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.continent-btn-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem 1rem;
    text-align: center;
    color: var(--text-main);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.continent-btn-card:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--accent-cyan);
    transform: translateY(-3px);
    color: #fff;
}
.continent-icon {
    font-size: 2rem;
}
.continent-name {
    font-weight: 700;
    font-size: 0.95rem;
}
.continent-count {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ================= Game Arena ================= */
.game-container {
    max-width: 760px;
    margin: 0 auto;
}

.game-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hud-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    font-weight: 700;
}
.hud-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
}
.hud-total {
    font-size: 0.95rem;
    color: var(--text-dim);
    font-weight: 500;
}

.hud-item.streak-active .hud-value {
    color: var(--accent-amber);
    animation: flamePulse 1.2s infinite alternate;
}

.hud-timer .hud-value {
    color: var(--accent-cyan);
}
.timer-pulse {
    animation: urgentPulse 0.6s infinite alternate;
}

/* Flag presentation */
.flag-card-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.25rem;
}

.flag-image-box {
    width: 100%;
    max-width: 420px;
    height: 250px;
    background: #0f172a;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.flag-display-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.25s ease-in;
}
.flag-display-img.loaded {
    opacity: 1;
}

.flag-loader {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

.flag-continent-badge {
    margin-top: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface-elevated);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
}

/* Hint section */
.hint-container {
    text-align: center;
    margin-bottom: 1.25rem;
    min-height: 35px;
}
.btn-hint {
    background: transparent;
    border: 1px dashed var(--text-dim);
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
}
.btn-hint:hover {
    border-color: var(--accent-amber);
    color: var(--accent-amber);
}
.hint-text {
    font-size: 0.9rem;
    color: #fde047;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.25);
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    animation: fadeIn 0.3s ease;
}
.hint-text.hidden {
    display: none;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.option-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.option-btn:hover:not(:disabled) {
    background: var(--bg-surface-elevated);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.option-key {
    width: 28px;
    height: 28px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 700;
    flex-shrink: 0;
}

.option-name {
    flex: 1;
}

.option-btn.btn-correct {
    background: linear-gradient(135deg, #059669, #047857) !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4) !important;
    animation: correctPulse 0.4s ease;
}

.option-btn.btn-wrong {
    background: linear-gradient(135deg, #e11d48, #be123c) !important;
    border-color: #f43f5e !important;
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.4) !important;
    animation: wrongShake 0.4s ease;
}

/* Typing Mode */
.typing-arena {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.typing-input-wrapper {
    display: flex;
    gap: 0.75rem;
}
.typing-input {
    flex: 1;
    background: var(--bg-surface-elevated);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.25rem;
    font-size: 1.15rem;
    color: #fff;
    outline: none;
    transition: var(--transition);
}
.typing-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}
.typing-input.input-correct {
    border-color: var(--success);
    background: var(--success-bg);
}
.typing-input.input-wrong {
    border-color: var(--danger);
    background: var(--danger-bg);
}
.btn-submit-type {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 0 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.btn-submit-type:hover {
    background: var(--primary-hover);
}
.type-feedback {
    margin-top: 1rem;
    font-weight: 600;
    font-size: 1.05rem;
    text-align: center;
    min-height: 25px;
}

/* ================= Results Screen ================= */
.results-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-card);
}
.results-header {
    text-align: center;
    margin-bottom: 2rem;
}
.results-trophy {
    font-size: 4.5rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 15px rgba(245, 158, 11, 0.4));
}
.results-title {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.35rem;
}
.results-subtitle {
    color: var(--text-muted);
}

.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.summary-stat-box {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.1rem 0.8rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.summary-stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 700;
}
.summary-stat-val {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
}

/* New achievements banner */
.achievements-unlocked-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.4s ease;
}
.banner-title {
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}
.banner-badges {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.badge-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-sm);
}
.badge-icon {
    font-size: 1.8rem;
}
.badge-text strong {
    display: block;
    color: #fff;
    font-size: 0.95rem;
}
.badge-text span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Guest Alert Card */
.guest-alert-card {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}
.guest-alert-icon {
    font-size: 2rem;
}
.guest-alert-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0.3rem 0 0.8rem;
}
.guest-buttons {
    display: flex;
    gap: 0.6rem;
}

/* Mistakes Review Section */
.mistakes-section {
    margin-bottom: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}
.mistakes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.mistake-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    gap: 0.9rem;
    align-items: center;
}
.mistake-flag {
    width: 68px;
    height: 46px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.mistake-country {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}
.mistake-details {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    gap: 0.5rem;
}
.mistake-guess {
    font-size: 0.8rem;
    margin-top: 0.2rem;
}
.text-wrong {
    color: var(--danger);
    font-weight: 600;
}

.flawless-badge-card {
    text-align: center;
    padding: 1.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}
.flawless-icon {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 0.3rem;
}

.results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

/* ================= Profile & Records Page ================= */
.profile-header-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
}
.profile-avatar-box {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    box-shadow: 0 0 25px var(--primary-glow);
    flex-shrink: 0;
}
.profile-info h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}
.profile-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    gap: 1rem;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}
.achievement-badge-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    transition: var(--transition);
}
.achievement-badge-card.locked {
    opacity: 0.45;
    filter: grayscale(1);
}
.achievement-badge-card.unlocked {
    border-color: rgba(245, 158, 11, 0.4);
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.08), var(--bg-surface));
}
.achieve-icon {
    font-size: 2.2rem;
}
.achieve-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}
.achieve-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* History table */
.records-table-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    margin-bottom: 2rem;
}
.records-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
}
.records-table th {
    background: var(--bg-surface-elevated);
    padding: 1rem 1.25rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border-color);
}
.records-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}
.records-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ================= Leaderboard ================= */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1.5rem;
    margin: 2rem 0 3rem;
}
.podium-step {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.5rem 1rem 1rem;
    text-align: center;
    width: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-card);
    position: relative;
}
.podium-step.rank-1 {
    height: 240px;
    border-color: #fbbf24;
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.15), var(--bg-surface));
}
.podium-step.rank-2 {
    height: 200px;
    border-color: #94a3b8;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.15), var(--bg-surface));
}
.podium-step.rank-3 {
    height: 175px;
    border-color: #b45309;
    background: linear-gradient(180deg, rgba(180, 83, 9, 0.15), var(--bg-surface));
}

.podium-crown {
    font-size: 1.8rem;
    position: absolute;
    top: -1.2rem;
}
.podium-avatar {
    font-size: 2.2rem;
    margin-bottom: 0.3rem;
}
.podium-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.podium-score {
    font-weight: 900;
    font-size: 1.35rem;
    color: #fbbf24;
    margin-top: auto;
}

/* ================= Study Library ================= */
.search-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
}
.search-input {
    flex: 1;
    min-width: 250px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
}
.filter-select {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1.25rem;
}
.country-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}
.country-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
.country-card-img {
    width: 100%;
    height: 125px;
    object-fit: cover;
    background: #020617;
    border-bottom: 1px solid var(--border-color);
}
.country-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.country-card-name {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}
.country-card-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.country-card-capital {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ================= Auth Forms ================= */
.auth-wrapper {
    max-width: 440px;
    margin: 3rem auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-card);
}
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.4rem;
}
.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.25rem;
}
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.form-control {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: #fff;
    outline: none;
    transition: var(--transition);
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.avatar-selector-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-top: 0.5rem;
}
.avatar-option {
    display: none;
}
.avatar-label {
    background: var(--bg-surface-elevated);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.5rem;
    text-align: center;
    cursor: pointer;
    font-size: 1.75rem;
    transition: var(--transition);
}
.avatar-label:hover {
    border-color: var(--text-muted);
}
.avatar-option:checked + .avatar-label {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
    transform: scale(1.05);
}

.alert-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    color: #fecdd3;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}
.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success);
    color: #a7f3d0;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

/* ================= Footer ================= */
.site-footer {
    background: #080b13;
    border-top: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    margin-top: auto;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.88rem;
}
.site-footer a {
    color: var(--text-muted);
}
.site-footer a:hover {
    color: #fff;
}

/* ================= Utilities & Animations ================= */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--accent-amber); }

@keyframes spin {
    100% { transform: rotate(360deg); }
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@keyframes flamePulse {
    from { transform: scale(1); filter: drop-shadow(0 0 4px #f59e0b); }
    to { transform: scale(1.08); filter: drop-shadow(0 0 10px #f59e0b); }
}

@keyframes urgentPulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); color: var(--danger); }
}

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

.animate-pop {
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-scale-up {
    animation: fadeIn 0.4s ease;
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .hero-title {
        font-size: 2.2rem;
    }
    .options-grid {
        grid-template-columns: 1fr;
    }
    .flag-image-box {
        height: 180px;
    }
    .podium-container {
        flex-direction: column;
        align-items: center;
    }
    .podium-step {
        width: 100%;
        height: auto !important;
        border-radius: var(--radius-md);
    }
    .profile-header-card {
        flex-direction: column;
        text-align: center;
    }
}

/* ================= Advertisement Units ================= */
.ad-slot-container {
    width: 100%;
    margin: 1.5rem auto;
    text-align: center;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.ad-slot-top {
    max-width: 970px;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}
.ad-slot-bottom {
    max-width: 970px;
    margin-top: 3rem;
    margin-bottom: 2rem;
}
.ad-post-game {
    max-width: 600px;
    margin: 1.5rem auto 2rem;
}
.ad-test-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 0.35rem;
}
.ad-test-box {
    width: 100%;
    max-width: 728px;
    min-height: 80px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px dashed rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--text-muted);
}

/* ================= SEO Articles & FAQs ================= */
.seo-article-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}
.faq-accordion-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.faq-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}
.faq-item[open] {
    border-color: var(--border-highlight);
    background: var(--bg-surface-elevated);
}
.faq-question {
    padding: 1.1rem 1.25rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-question::-webkit-details-marker {
    display: none;
}
.faq-question::after {
    content: '+';
    font-size: 1.4rem;
    color: var(--primary);
    transition: var(--transition);
}
.faq-item[open] .faq-question::after {
    transform: rotate(45deg);
    color: var(--danger);
}
.faq-answer {
    padding: 0 1.25rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 0.75rem;
}

