/* =====================================================
   PUZZLE EUROPA - STYLES
   ===================================================== */

/* CSS Variables */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --error-color: #f43f5e;
    --warning-color: #f59e0b;
    --bg-color: #0b0f1e;
    --bg-secondary: #14192e;
    --bg-card: #1c2340;
    --text-color: #e2e8f0;
    --text-muted: #7c8ab8;
    --text-secondary: #a0aec0;
    --border-color: #2a3158;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Board colors */
    --board-bg: #0d1525;
    --country-fill: #3b7dd8;
    --country-stroke: #1e3a6e;
    --country-hover: #8b5cf6;
    --country-selected: #f59e0b;
    
    /* Font size scale */
    --font-scale: 1;
    --country-snapped: #10b981;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Icon styles */
.icon {
    width: 1.25em;
    height: 1.25em;
    vertical-align: middle;
    flex-shrink: 0;
    overflow: visible;
}

.icon.hidden {
    display: none;
}

.icon-puzzle {
    width: 1.5em;
    height: 1.5em;
    margin-right: 0.25em;
}

.icon-trophy {
    width: 80px;
    height: 80px;
    stroke: var(--warning-color);
    margin-bottom: 1rem;
}

.error-icon {
    margin-bottom: 1rem;
}

html, body {
    height: 100%;
    overflow: hidden;
}

.account-page-root,
.account-page-root body {
    min-height: 100%;
    height: auto;
    overflow-y: auto;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

/* =====================================================
   HEADER
   ===================================================== */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    gap: 1rem;
    flex-wrap: wrap;
    z-index: 1100;
    position: relative;
}

/* #btn-play-again-header appearance is handled by .btn-play-again; positioning by .play-again-bar */

.game-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fbbf24;
    letter-spacing: -0.02em;
}

.game-header h1 .icon-puzzle {
    width: 2.5rem;
    height: 2.5rem;
    filter: drop-shadow(0 0 6px rgba(0,0,0,0.4));
    border-radius: 4px;
}

.btn-menu-inline,
.btn-menu-inline:link,
.btn-menu-inline:visited {
    font-size: 0.85rem;
    padding: 0.25rem 0.65rem;
    vertical-align: middle;
    margin-left: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.game-account-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    margin-left: 0.15rem;
}

.game-account-icon:hover {
    color: var(--primary-light);
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.16);
}

.game-account-icon svg {
    width: 1.18rem;
    height: 1.18rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: rgba(255,255,255,0.05);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary-light);
    color: var(--primary-light);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.btn:active {
    transform: scale(0.97);
    background: rgba(99, 102, 241, 0.25);
}

.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Primary / CTA button */
.btn-cta {
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: transparent;
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 0.625rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-cta:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
    transform: translateY(-1px);
}

.btn-cta:active {
    transform: translateY(0) scale(0.97);
}

/* Ghost / secondary button */
.btn-ghost {
    background: transparent;
    border-color: rgba(255,255,255,0.15);
    color: var(--text-muted);
    font-weight: 500;
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.3);
    color: var(--text-color);
    box-shadow: none;
}

/* Small button modifier */
.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-large:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.55);
    transform: translateY(-2px);
}

.btn.muted {
    color: var(--text-muted);
}

.btn.muted:hover {
    color: var(--text-color);
}

/* Progress */
.progress-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-color);
}

#progress-text {
    font-size: 0.875rem;
    font-weight: 700;
    min-width: 50px;
    color: var(--primary-light);
    letter-spacing: 0.03em;
}

.progress-bar {
    width: 80px;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--success-color);
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* =====================================================
   MAIN GAME AREA
   ===================================================== */
.game-main {
    display: flex;
    height: calc(100vh - 60px);
    position: relative;
}

/* Board Container */
.board-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: 
        radial-gradient(ellipse at 25% 75%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 25%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 60%),
        var(--board-bg);
}

.game-board {
    width: 100%;
    height: 100%;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Country paths styling */
.country-path {
    fill: var(--country-fill);
    stroke: var(--country-stroke);
    stroke-width: 0.5px;
    cursor: grab;
    transition: fill 0.15s ease, stroke 0.15s ease;
}

.country-path:hover {
    fill: var(--country-hover);
}

.country-path.selected {
    fill: var(--country-selected);
    stroke: #d97706;
    stroke-width: 1.5px;
}

.country-path.dragging {
    cursor: grabbing;
    filter: url(#drop-shadow);
    fill-opacity: 0.9;
    stroke: var(--text-color);
    stroke-width: 2px;
    z-index: 1000;
}

.country-path.snap-preview {
    stroke: var(--success-color);
    stroke-width: 2px;
    filter: url(#glow-green);
}

.country-path.snap-error {
    animation: shake 0.3s ease;
    filter: url(#glow-red);
}

.country-path.snapped {
    fill: var(--country-snapped);
}

.country-path.snap-connect {
    animation: snapConnectFlash 0.5s ease forwards;
}

@keyframes snapConnectFlash {
    0%   { fill: #ffffff; filter: brightness(3); }
    30%  { fill: #a7f3d0; filter: brightness(1.5); }
    100% { fill: var(--country-snapped); filter: brightness(1); }
}

/* Cluster group */
.cluster-group {
    cursor: grab;
}

.cluster-group.dragging {
    cursor: grabbing;
    will-change: transform;
}

.cluster-group:focus {
    outline: none;
}

.cluster-group:focus-visible .country-path {
    stroke: var(--warning-color);
    stroke-width: 2px;
}

/* =====================================================
   ZOOM CONTROLS
   ===================================================== */
.zoom-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 100;
}

.zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.zoom-btn:hover {
    background: var(--border-color);
}

.zoom-btn:first-child {
    border-radius: 0.5rem 0 0 0.5rem;
}

.zoom-btn:last-child {
    border-radius: 0 0.5rem 0.5rem 0;
}

.zoom-btn svg {
    width: 18px;
    height: 18px;
}

.zoom-btn.zoom-level {
    width: auto;
    padding: 0 0.75rem;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-radius: 0;
}

.zoom-btn.zoom-level svg {
    width: 14px;
    height: 14px;
}

/* Shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* =====================================================
   INFO PANEL
   ===================================================== */
.info-panel {
    width: 320px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, opacity 0.3s ease;
    overflow-y: auto;
}

.info-panel.hidden {
    display: none;
    width: 0;
    opacity: 0;
    overflow: hidden;
}

.info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.info-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-close:hover {
    background: var(--border-color);
}

.info-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-flag {
    width: 100%;
    aspect-ratio: 3/2;
    background: var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.info-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-flag svg {
    width: 100%;
    height: 100%;
}

.info-flag img[src=""] {
    display: none;
}

.info-flag::after {
    content: '';
    width: 60px;
    height: 40px;
    background: linear-gradient(135deg, var(--border-color) 25%, var(--bg-color) 25%, var(--bg-color) 50%, var(--border-color) 50%, var(--border-color) 75%, var(--bg-color) 75%);
    background-size: 10px 10px;
    border-radius: 4px;
    position: absolute;
    inset: 0;
    margin: auto;
}

.info-flag:has(img[src]:not([src=""]))::after,
.info-flag:has(svg)::after {
    display: none;
}

.info-details p {
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.info-details strong {
    color: var(--primary-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-fact {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    padding: 1rem;
    border-radius: 0.5rem;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-left: 3px solid var(--primary-color);
    line-height: 1.7;
}

.info-status {
    margin-top: auto;
    padding-top: 1rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-badge.connected {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success-color);
}

.status-badge.loose {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

/* =====================================================
   COMPLETION OVERLAY
   ===================================================== */
.completion-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.completion-overlay.hidden {
    display: none;
}

.completion-content {
    text-align: center;
    padding: 3rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    animation: scaleIn 0.4s ease;
}

.completion-content h2 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #fbbf24, #f97316, #fbbf24);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2s linear infinite;
    letter-spacing: -0.02em;
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

.completion-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* =====================================================
   CONFIRM MODAL
   ===================================================== */
.confirm-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9500;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.confirm-modal.hidden {
    display: none;
}

.confirm-content {
    background: linear-gradient(145deg, #1c2340 0%, #14192e 60%, #1a1435 100%);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 1.25rem;
    padding: 2.25rem 2rem 2rem;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 30px rgba(239, 68, 68, 0.1), inset 0 1px 0 rgba(255,255,255,0.06);
    animation: confirmSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

@keyframes confirmSlideIn {
    from { transform: translateY(20px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.confirm-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: #fbbf24;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}

.confirm-content h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 0.65rem;
}

.confirm-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: transparent;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.55);
    transform: translateY(-1px);
}

/* =====================================================
   HEADER PLAY-AGAIN BUTTON BAR (below header, not inside it)
   ===================================================== */
.play-again-bar {
    position: fixed;
    top: 90px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
    z-index: 1050;
    pointer-events: none;
}

.play-again-bar.hidden {
    display: none;
}

.play-again-bar > button {
    pointer-events: auto;
}

/* =====================================================
   HEADER PLAY-AGAIN BUTTON
   ===================================================== */
.btn-play-again {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: transparent;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.55), 0 4px 12px rgba(0,0,0,0.3);
    animation: playAgainGlow 2s ease-in-out infinite;
}

.btn-play-again.hidden {
    display: none;
}

.btn-play-again:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.75), 0 6px 16px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

@keyframes playAgainGlow {
    0%, 100% { box-shadow: 0 0 16px rgba(16, 185, 129, 0.55), 0 4px 12px rgba(0,0,0,0.3); }
    50%       { box-shadow: 0 0 28px rgba(16, 185, 129, 0.85), 0 4px 16px rgba(0,0,0,0.3); }
}

/* =====================================================
   COMPLETION ACTIONS ROW
   ===================================================== */
.completion-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

#leaderboard-submit-widget {
    margin: 0.85rem 0 1.15rem;
}

#leaderboard-submit-widget .lb-widget {
    margin-top: 0;
}



/* =====================================================
   MOBILE STYLES
   ===================================================== */
@media (max-width: 768px) {
    .game-header {
        padding: 0.5rem 1rem;
    }
    
    .game-header h1 {
        font-size: 1.125rem;
    }
    
    .header-controls {
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .btn span {
        display: none;
    }
    
    .progress-bar {
        width: 60px;
    }
    
    /* Info panel as bottom sheet */
    .game-main {
        flex-direction: column;
    }
    
    .info-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 50vh;
        border-left: none;
        border-top: 1px solid var(--border-color);
        border-radius: 1rem 1rem 0 0;
        transform: translateY(100%);
        z-index: 200;
    }
    
    .info-panel.visible {
        transform: translateY(0);
    }
    
    .info-panel.hidden {
        transform: translateY(100%);
    }
    
    .board-container {
        height: 100%;
    }
    


    .zoom-controls {
        bottom: 4.25rem;
        right: 0.75rem;
    }

    .zoom-btn {
        width: 44px;
        height: 44px;
    }

    .zoom-btn.zoom-level {
        padding: 0 0.6rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .header-controls {
        width: 100%;
        justify-content: space-between;
    }

    .zoom-controls {
        bottom: 4.75rem;
    }
}

/* =====================================================
   HINT HIGHLIGHT
   ===================================================== */
.hint-highlight {
    animation: pulse 1s ease infinite;
}

/* Hint Circle */
.hint-circle {
    fill: none;
    stroke: var(--warning-color);
    stroke-width: 3px;
    stroke-dasharray: 8 6;
    transform-box: fill-box;
    transform-origin: center;
    animation: hint-circle-anim 3s ease-out forwards;
    pointer-events: none;
    opacity: 0;
}

@keyframes hint-circle-anim {
    0% { transform: scale(0.3); opacity: 0; stroke-width: 5px; }
    15% { transform: scale(1.3); opacity: 1; stroke-width: 3px; }
    30% { transform: scale(1.1); opacity: 1; }
    45% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; stroke-width: 0px; }
}

/* =====================================================
   TOOLTIP
   ===================================================== */
.country-tooltip {
    position: fixed;
    background: var(--bg-secondary);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 1000;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transform: translate(-50%, -100%);
    margin-top: -10px;
    white-space: nowrap;
}

.country-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: var(--border-color) transparent transparent;
}

/* =====================================================
   LOADING STATE
   ===================================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 2000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 1.125rem;
    color: var(--text-muted);
}

/* =====================================================
   ANCHORED POPUP & MARKER
   ===================================================== */
.country-marker {
    cursor: pointer;
    /* transition removed to avoid conflict */
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5));
}



/* Apply hover effect to inner element to avoid layout thrashing */
.marker-pin {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Initial state matches JS setAttribute but CSS overrides it, so we must define it here */
    transform: translate(-18px, -36px) scale(1.5); 
    transform-origin: 0 0; /* Fallback */
    transform-box: fill-box; /* Relative to element bounding box if needed, but here we use explicit translate */
    /* Actually for consistency with existing JS transform logic, we just use the transform string */
}

.country-marker:hover .marker-pin {
    /* Adjust translate to keep the tip (12,24) fixed at (0,0) relative to parent */
    /* Target scale 1.8. tx = -12*1.8 = -21.6, ty = -24*1.8 = -43.2 */
    transform: translate(-21.6px, -43.2px) scale(1.8);
}

.anchored-popup {
    position: fixed;
    background: #ffffff !important;
    color: #000000 !important;
    border: none;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.05); /* Deep shade */
    z-index: 7200;
    min-width: 360px; /* Slightly larger min-width */
    width: auto;
    max-width: 90vw;
    pointer-events: auto;
    /* animation handled by specific orientation classes */
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Orientation: TOP (Default) */
.anchored-popup.orientation-top {
    transform: translate(-50%, -100%);
    margin-top: -20px;
    animation: popInTop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.anchored-popup.orientation-top::after {
    bottom: -8px;
    left: calc(50% + var(--arrow-offset, 0px));
    transform: translateX(-50%) rotate(45deg);
}

/* Orientation: RIGHT */
.anchored-popup.orientation-right {
    transform: translate(0, -50%);
    margin-left: 20px;
    animation: popInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.anchored-popup.orientation-right::after {
    left: -8px;
    top: calc(50% + var(--arrow-offset, 0px));
    transform: translateY(-50%) rotate(45deg);
}

/* Orientation: LEFT */
.anchored-popup.orientation-left {
    transform: translate(-100%, -50%);
    margin-left: -20px;
    animation: popInLeft 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.anchored-popup.orientation-left::after {
    right: -8px;
    top: calc(50% + var(--arrow-offset, 0px));
    transform: translateY(-50%) rotate(45deg);
}

/* Orientation: BOTTOM */
.anchored-popup.orientation-bottom {
    transform: translate(-50%, 0);
    margin-top: 20px;
    animation: popInBottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.anchored-popup.orientation-bottom::after {
    top: -8px;
    left: calc(50% + var(--arrow-offset, 0px));
    transform: translateX(-50%) rotate(45deg);
}


.anchored-popup.closing {
    animation: fadeOut 0.2s ease forwards !important; /* Simple fade out for all */
}

@keyframes popInTop {
    0% { opacity: 0; transform: translate(-50%, -80%) scale(0.8); }
    100% { opacity: 1; transform: translate(-50%, -100%) scale(1); }
}
@keyframes popInRight {
    0% { opacity: 0; transform: translate(-20%, -50%) scale(0.8); }
    100% { opacity: 1; transform: translate(0, -50%) scale(1); }
}
@keyframes popInLeft {
    0% { opacity: 0; transform: translate(-80%, -50%) scale(0.8); }
    100% { opacity: 1; transform: translate(-100%, -50%) scale(1); }
}
@keyframes popInBottom {
    0% { opacity: 0; transform: translate(-50%, 20%) scale(0.8); }
    100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes fadeOut {
    to { opacity: 0; }
}

.anchored-popup::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border: none;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.1); /* Soft shadow */
    z-index: -1; 
}

.anchored-popup h3 {
    margin: 0;
    padding: 16px 16px 12px 16px;
    color: #ffffff !important;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid #fbbf24;
}

.popup-details {
    font-size: 0.95rem;
    color: #000000 !important;
    margin: 0;
    padding: 16px;
    background: #ffffff;
}

.popup-row {
    margin-bottom: 12px;
    color: #000000 !important;
    display: flex;
    align-items: baseline;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.popup-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.popup-row strong {
    color: #6366f1 !important;
    font-weight: 700;
    min-width: 130px;
    display: block;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.popup-row-value {
    color: #333333 !important;
    font-size: 1.1rem;
    font-weight: 600;
}

.popup-fact {
    font-size: 0.9rem;
    line-height: 1.6;
    background-color: #f0f4ff;
    border-radius: 0 0 8px 8px;
    padding: 14px 16px;
    color: #333333 !important;
    border: none;
    margin: 0;
    border-top: 2px solid #e5ecff;
}

.popup-fact strong {
    display: block;
    color: #6366f1 !important;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* =====================================================
   SNAP BURST ANIMATION
   ===================================================== */
@keyframes snapBurstParticle {
    0%   { transform: translate(0, 0) scale(1); opacity: 0.9; }
    100% { transform: var(--tx) var(--ty) scale(0); opacity: 0; }
}

.snap-burst-particle {
    animation: snapBurstParticle 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    pointer-events: none;
}

@keyframes snapRipple {
    0%   { r: 0; opacity: 0.7; stroke-width: 4; }
    100% { r: 60; opacity: 0; stroke-width: 0; }
}

.snap-ripple {
    fill: none;
    stroke: var(--success-color);
    animation: snapRipple 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes progressPulse {
    0%, 100% { box-shadow: none; }
    50%       { box-shadow: 0 0 10px var(--success-color); }
}

.progress-fill.pulse {
    animation: progressPulse 0.6s ease;
}

.popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.2) !important;
    border: none;
    color: #ffffff !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1;
    padding: 0;
    z-index: 10;
}

.popup-close:hover {
    background: rgba(255,255,255,0.3) !important;
    color: #ffffff !important;
    transform: scale(1.1);
}

/* =====================================================
   WELCOME MODAL
   ===================================================== */
.welcome-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

.welcome-modal.hidden {
    display: none;
}

@keyframes fadeInBg {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.welcome-content {
    background: linear-gradient(145deg, #1c2340 0%, #14192e 60%, #1a1435 100%);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 1.5rem;
    padding: 2.5rem 2.25rem 2rem;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 40px rgba(245, 158, 11, 0.12), inset 0 1px 0 rgba(255,255,255,0.06);
    animation: welcomeSlideIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 158, 11, 0.4) transparent;
}

@keyframes welcomeSlideIn {
    from { transform: translateY(30px) scale(0.92); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.welcome-eu-emblem {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(250, 204, 21, 0.4));
    animation: floatBadge 3s ease-in-out infinite;
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 50%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.welcome-subtitle {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.welcome-lvl-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--success-color);
    opacity: 0.85;
    margin-top: 0.25rem;
}

.welcome-section-label {
    display: none;
}

.welcome-section-label svg {
    width: 18px;
    height: 18px;
    stroke: #f59e0b;
    flex-shrink: 0;
}

/* Mouse Diagram */
:root {
    --mouse-body: rgba(20, 25, 46, 0.9);
    --mouse-stroke: #22d3ee;
    --mouse-btn-left: rgba(34, 211, 238, 0.12);
    --mouse-btn-right: rgba(34, 211, 238, 0.12);
    --mouse-wheel: rgba(34, 211, 238, 0.18);
}

.mouse-diagram {
    position: relative;
    margin: 1.5rem auto 2rem;
    max-width: 500px;
    height: 210px;
}

.mouse-svg-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
}

.mouse-svg {
    width: 100%;
    height: auto;
    overflow: visible;
    filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.25));
}

.mouse-label {
    position: absolute;
}

.mouse-label-left {
    right: calc(50% + 64px);
    top: calc(50% - 25px);
    transform: translateY(-50%);
}

.mouse-label-right-top {
    left: calc(50% + 64px);
    top: calc(50% - 25px);
    transform: translateY(-50%);
}

.mouse-label-right-bottom {
    left: calc(50% + 64px);
    top: calc(50% + 38px);
    transform: translateY(-50%);
}

.mouse-label-box {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 0.5rem;
    padding: 0.45rem 0.75rem;
    white-space: nowrap;
}

.mouse-label-box svg {
    stroke: #22d3ee;
    flex-shrink: 0;
}

.mouse-label-box span {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
}

.welcome-controls-grid {
    display: none;
}

.control-card,
.control-icon-wrap,
.control-card strong,
.control-card span,
.control-card span em {
    display: none;
}

kbd {
    display: inline-block;
    padding: 0.1em 0.35em;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 0.25rem;
    font-size: 0.75em;
    font-family: monospace;
    color: var(--text-color);
    line-height: 1.4;
}

/* Color Legend (hidden in simplified modal) */
.welcome-color-legend {
    display: none;
}

.color-legend-item,
.color-swatch,
.color-legend-item div,
.color-legend-item strong,
.color-legend-item strong svg,
.color-legend-item span {
    display: none;
}

.welcome-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.welcome-actions .btn-ghost {
    padding: 0.8rem 1.6rem;
    font-size: 1.1rem;
}

.welcome-actions .btn-cta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    font-size: 1.1rem;
}

/* =====================================================
   TUTORIAL OVERLAY & TOOLTIP
   ===================================================== */
.tutorial-spotlight {
    position: fixed;
    z-index: 7000;
    pointer-events: none;
    border-radius: 0.75rem;
    /* The giant box-shadow creates the dimming effect */
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.72),
        0 0 0 3px #f59e0b,
        0 0 20px rgba(245, 158, 11, 0.55),
        0 0 60px rgba(245, 158, 11, 0.22);
    transition: top 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tutorial-spotlight.hidden {
    display: none;
}

.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 6900;
    pointer-events: auto;
    background: transparent;
}

.tutorial-overlay.hidden {
    display: none;
}

.tutorial-tooltip {
    position: fixed;
    z-index: 7100;
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid rgba(245, 158, 11, 0.5);
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 440px; /* Wider popup */
    width: calc(100vw - 2rem);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px rgba(245, 158, 11, 0.18);
    pointer-events: auto;
}

.tutorial-tooltip.hidden {
    display: none;
}

.tutorial-tooltip.animating {
    animation: tutorialTooltipIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tutorial-tooltip.animating-centered {
    animation: tutorialTooltipInCentered 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tutorial-tooltip.animating-x-centered {
    animation: tutorialTooltipInXCentered 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes tutorialTooltipIn {
    from { transform: scale(0.88) translateY(8px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes tutorialTooltipInCentered {
    from { transform: translate(-50%, -50%) scale(0.88) translateY(8px); opacity: 0; }
    to   { transform: translate(-50%, -50%) scale(1) translateY(0); opacity: 1; }
}

@keyframes tutorialTooltipInXCentered {
    from { transform: translateX(-50%) scale(0.88) translateY(8px); opacity: 0; }
    to   { transform: translateX(-50%) scale(1) translateY(0); opacity: 1; }
}

.tutorial-step-indicator {
    font-size: 0.7rem;
    font-weight: 700;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.tutorial-step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.tutorial-step-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(251, 191, 36, 0.15));
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 0.75rem;
    color: #f59e0b;
}

.tutorial-step-icon-wrap svg {
    overflow: visible;
}

.tutorial-step-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin: 0;
}

.tutorial-step-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1.25rem;
    margin-top: 0.5rem;
}

.tutorial-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 1rem;
}

.tutorial-actions .btn {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}
.tutorial-btn-back {
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
}

.tutorial-btn-back:hover {
    color: var(--text-color);
}

/* Tutorial color list (step 3) */
.tutorial-color-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.tutorial-color-item {
    display: grid;
    grid-template-columns: 16px auto 1fr;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.65rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 0.5rem;
    font-size: 0.95rem;
}

.tutorial-color-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.tutorial-color-label {
    color: var(--text-color);
    white-space: nowrap;
}

.tutorial-color-label strong {
    font-weight: 700;
}

.tutorial-color-desc {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.tutorial-progress-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 1rem;
}

.tutorial-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background 0.3s ease, transform 0.3s ease;
}

.tutorial-dot.active {
    background: #f59e0b;
    transform: scale(1.3);
}

.tutorial-dot.done {
    background: var(--success-color);
}

/* =====================================================
   SNAP FEEDBACK PARTICLES (SVG)
   ===================================================== */
.puzzle-icon-pulse {
    animation: iconPulse 0.5s ease;
}

@keyframes iconPulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.4) rotate(-5deg); }
    70%  { transform: scale(0.9) rotate(3deg); }
    100% { transform: scale(1); }
}

/* =====================================================
   TUTORIAL MAP GLOW
   Pulsing glow applied to the board-container
   during map-related tutorial steps
   ===================================================== */
@keyframes tutorialMapPulse {
    0%, 100% {
        box-shadow:
            inset 0 0 0 0px rgba(245, 158, 11, 0),
            inset 0 0 0px 0px rgba(245, 158, 11, 0);
    }
    50% {
        box-shadow:
            inset 0 0 0 4px rgba(245, 158, 11, 0.9),
            inset 0 0 100px 30px rgba(245, 158, 11, 0.4);
    }
}

/* Tutorial step 4: snap demo country glow */
.tutorial-snap-highlight {
    stroke: #f59e0b !important;
    stroke-width: 2.5px !important;
    animation: tutorialSnapGlow 1.4s ease-in-out infinite;
}

@keyframes tutorialSnapGlow {
    0%, 100% { filter: drop-shadow(0 0 3px rgba(245,158,11,0.2)); }
    50%       { filter: drop-shadow(0 0 12px rgba(245,158,11,0.9)); }
}

.tutorial-snap-arrow {
    animation: tutorialArrowMarch 0.9s linear infinite;
}

@keyframes tutorialArrowMarch {
    to { stroke-dashoffset: -30; }
}

.tutorial-snap-dot {
    animation: tutorialSnapDotPulse 1.2s ease-in-out infinite;
}

@keyframes tutorialSnapDotPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

.tutorial-snap-target {
    animation: tutorialSnapTargetPulse 1.2s ease-in-out infinite;
}

@keyframes tutorialSnapTargetPulse {
    0%, 100% { opacity: 0.9; stroke-width: 3; }
    50%       { opacity: 0.3; stroke-width: 6; }
}

.tutorial-map-glow {
    animation: tutorialMapPulse 4s ease-in-out infinite;
}

@media (max-width: 480px) {
    .mouse-diagram {
        height: 260px;
    }

    .mouse-label-left {
        right: auto;
        left: 50%;
        top: auto;
        bottom: 2px;
        transform: translateX(-50%);
    }

    .mouse-label-right-top {
        left: auto;
        right: 8px;
        top: 8px;
        transform: none;
    }

    .mouse-label-right-bottom {
        left: auto;
        right: 8px;
        top: auto;
        bottom: 50px;
        transform: none;
    }
    
    .welcome-content {
        padding: 1.75rem 1.25rem 1.5rem;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .tutorial-tooltip {
        max-width: none;
    }
}

/* =====================================================
   FONT SIZE SCALE VARIANTS
   ===================================================== */
html[data-font-size="small"]  { font-size: 87.5%; }
html[data-font-size="medium"] { font-size: 100%; }
html[data-font-size="large"]  { font-size: 112.5%; }
html[data-font-size="xlarge"] { font-size: 125%; }

/* =====================================================
   SETTINGS MODAL
   ===================================================== */
.settings-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9400;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.settings-modal.hidden {
    display: none;
}

.settings-content {
    background: linear-gradient(145deg, #1c2340 0%, #14192e 60%, #1a1f3a 100%);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 1.25rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 30px rgba(99, 102, 241, 0.12), inset 0 1px 0 rgba(255,255,255,0.06);
    animation: settingsSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}

@keyframes settingsSlideIn {
    from { transform: translateY(20px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: linear-gradient(145deg, #1c2340, #14192e);
    z-index: 1;
}

.settings-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.settings-header h3 svg {
    opacity: 0.85;
    color: var(--primary-light);
    stroke: var(--primary-light);
}

.settings-body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.settings-section-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary-light);
    opacity: 0.85;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.settings-section-title svg {
    stroke: var(--primary-light);
    flex-shrink: 0;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.875rem;
    color: var(--text-color);
    min-width: 130px;
    flex-shrink: 0;
}

.settings-label svg {
    opacity: 0.7;
    flex-shrink: 0;
}

.settings-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

/* Font size buttons */
.font-size-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.font-size-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.75rem 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    border-radius: 0.625rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.font-size-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary-light);
    color: var(--text-color);
}

.font-size-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-light);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.font-size-preview {
    font-weight: 800;
    line-height: 1;
    color: currentColor;
}

/* Volume sliders */
.volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.5);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.7);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.5);
}

.volume-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 36px;
    text-align: right;
}

/* Mute button */
.mute-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.mute-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.mute-btn.muted {
    background: rgba(244, 63, 94, 0.15);
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Single-SVG mute icon: show waves by default, show X lines when muted */
.mute-btn .mute-x { display: none; }
.mute-btn .mute-waves { display: inline; }
.mute-btn.muted .mute-x { display: inline; }
.mute-btn.muted .mute-waves { display: none; }

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 12px;
    transition: background 0.2s ease;
}

.toggle-track::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: left 0.2s ease, background 0.2s ease;
}

.toggle-switch input:checked + .toggle-track {
    background: rgba(99, 102, 241, 0.35);
    border: 1px solid var(--primary-color);
}

.toggle-switch input:checked + .toggle-track::before {
    left: calc(100% - 20px);
    background: var(--primary-light);
}

.toggle-switch input:focus-visible + .toggle-track {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .settings-content {
        max-width: 100%;
        border-radius: 1rem 1rem 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 85vh;
        animation: settingsSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    @keyframes settingsSlideUp {
        from { transform: translateY(100%); opacity: 0; }
        to   { transform: translateY(0); opacity: 1; }
    }

    .settings-modal {
        align-items: flex-end;
    }

    .font-size-options {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* =====================================================
   MAIN MENU PAGE
   ===================================================== */
body.menu-page {
    height: 100%;
    min-height: 100vh;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
}

/* Background slideshow */
.menu-bg-wrap {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.menu-bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: opacity 1.5s ease;
    opacity: 0;
    image-rendering: auto;
    will-change: opacity;
}

/* Overlay so the card stays readable over photos */
.menu-bg-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(99, 102, 241, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.18) 0%, transparent 55%),
        rgba(15, 15, 30, 0.55);
}

.menu-container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.menu-account-icon {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 320;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(15, 15, 35, 0.68);
    color: rgba(255, 255, 255, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
}

.menu-account-icon:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(99, 102, 241, 0.38);
}

.menu-account-icon svg {
    width: 1.22rem;
    height: 1.22rem;
}


.menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    width: 100%;
    max-width: 400px;
    animation: menuFadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.menu-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.menu-logo-icon {
    width: 150px;
    height: 150px;
    filter: drop-shadow(0 0 20px rgba(0, 51, 153, 0.6));
    border-radius: 20px;
}

.menu-title {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: #fbbf24;
    line-height: 1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

.menu-subtitle {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.01em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    width: 100%;
}

.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.9rem 1.5rem;
    border-radius: 0.875rem;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.menu-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.menu-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.65), inset 0 1px 0 rgba(255,255,255,0.25);
    font-size: 1.25rem;
    padding: 1.1rem 2rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.menu-btn-primary:hover {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    box-shadow: 0 10px 36px rgba(99, 102, 241, 0.75), inset 0 1px 0 rgba(255,255,255,0.3);
    transform: translateY(-2px);
    color: #fff;
}

.menu-btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.menu-btn-secondary {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.4);
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.menu-btn-secondary:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.7);
    color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transform: translateY(-1px);
}

.menu-btn-secondary:active {
    transform: translateY(0) scale(0.98);
}

.menu-btn-quiz {
    position: relative;
    justify-content: center;
    overflow: visible;
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
    padding-right: 2.2rem;
}

.menu-btn-quiz:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.52);
}

.menu-btn-quiz-icon {
    position: static;
    width: 20px;
    height: 20px;
}

.menu-btn-quiz-label {
    display: inline;
    text-align: left;
}

.menu-btn-tag {
    position: absolute;
    right: -18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.62rem;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #111827;
    background: #fde047;
    border-radius: 0 999px 999px 0;
    clip-path: polygon(14% 0, 100% 0, 100% 100%, 14% 100%, 0 50%);
    padding: 0.36rem 0.56rem 0.36rem 0.66rem;
    border: 1px solid rgba(17, 24, 39, 0.18);
    box-shadow: 0 8px 14px rgba(2, 6, 23, 0.3);
}

.menu-side-banner {
    position: fixed;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: min(320px, 32vw);
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.1rem 1.2rem 1.1rem 1.4rem;
    color: #fff;
    text-decoration: none;
    border-radius: 1rem;
    background:
        radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.22) 0, transparent 34%),
        linear-gradient(145deg, rgba(14, 165, 233, 0.88), rgba(37, 99, 235, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 22px 40px rgba(5, 16, 55, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
    z-index: 25;
}

.menu-side-banner:hover {
    transform: translateY(calc(-50% - 4px));
    box-shadow: 0 30px 46px rgba(5, 16, 55, 0.58);
}

.menu-side-banner-badge {
    align-self: flex-start;
    background: #111827;
    color: #fff;
    border-radius: 999px;
    padding: 0.28rem 0.6rem;
    font-size: 0.67rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    font-weight: 700;
}

.menu-side-banner h2 {
    font-size: 1.15rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.menu-side-banner p {
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.9);
}

.menu-side-banner-cta {
    align-self: flex-start;
    font-weight: 700;
    border-bottom: 2px solid rgba(255, 255, 255, 0.8);
}

/* Credits content */
.credits-entry {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.credits-entry:last-child {
    border-bottom: none;
}

.credits-name {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-color);
}

.credits-role {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .menu-title {
        font-size: 2rem;
    }

    .menu-logo-icon {
        width: 80px;
        height: 80px;
    }

    .menu-card {
        gap: 2rem;
    }

    .menu-btn-tag {
        font-size: 0.62rem;
        right: -13px;
        padding: 0.28rem 0.46rem 0.28rem 0.56rem;
    }
}

@media (max-width: 1080px) {
    .menu-side-banner {
        width: min(270px, 45vw);
        min-width: 180px;
        right: 0.65rem;
        padding: 0.95rem;
    }

    .menu-side-banner:hover {
        transform: translateY(calc(-50% - 2px));
    }
}

/* =====================================================
   MENU VOLUME CONTROL (fixed overlay)
   ===================================================== */
.menu-volume-control {
    position: fixed;
    top: 1rem;
    right: 4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 15, 35, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 2rem;
    padding: 0.375rem 0.75rem;
    z-index: 10;
    transition: background 0.2s;
}

.menu-volume-control:hover {
    background: rgba(15, 15, 35, 0.8);
    border-color: rgba(255, 255, 255, 0.22);
}

.menu-volume-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    padding: 0;
    transition: color 0.2s;
    flex-shrink: 0;
}

.menu-volume-btn:hover {
    color: #fff;
}

.menu-volume-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.menu-volume-btn svg {
    width: 20px;
    height: 20px;
}

.menu-volume-btn .icon-vol-off {
    display: none;
}

.menu-volume-btn.muted .icon-vol-on {
    display: none;
}

.menu-volume-btn.muted .icon-vol-off {
    display: block;
    color: rgba(255, 255, 255, 0.45);
}

.menu-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    cursor: pointer;
    accent-color: var(--primary-light);
}

.menu-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s;
}

.menu-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.menu-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* =====================================================
   MENU GITHUB LINK
   ===================================================== */
.menu-github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color 0.2s;
    padding: 0.25rem 0.25rem;
    border-radius: 0.375rem;
}

.menu-github-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

.menu-github-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .menu-volume-control {
        top: 0.625rem;
        right: 3.9rem;
        padding: 0.3rem 0.6rem;
    }

    .menu-account-icon {
        top: 0.5rem;
        right: 0.5rem;
    }

    .menu-volume-slider {
        width: 60px;
    }
}

/* =====================================================
   LANGUAGE SELECTOR
   ===================================================== */

.lang-selector {
    position: relative;
    z-index: 200;
    flex-shrink: 0;
}

/* Button that shows current flag + code */
.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.lang-btn:hover,
.lang-btn:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
    outline: none;
}

/* Flag image inside the button */
.lang-flag-current {
    width: 26px;
    height: 17px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.15);
}

/* Chevron arrow */
.lang-chevron {
    width: 12px;
    height: 12px;
    opacity: 0.65;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.lang-selector:has(.lang-dropdown.open) .lang-chevron {
    transform: rotate(180deg);
}

/* Dropdown list */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0,0,0,0.06);
    list-style: none;
    margin: 0;
    padding: 5px;
    min-width: 148px;
    display: none;
    z-index: 1000;
    animation: langDropIn 0.15s ease;
}

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

.lang-dropdown.open {
    display: block;
}

/* Individual language option */
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    cursor: pointer;
    color: #1e2a4a;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.12s;
    user-select: none;
}

.lang-option:hover {
    background: #f0f4ff;
}

.lang-option.active {
    background: #e8eeff;
    color: var(--primary-dark);
    font-weight: 700;
}

.lang-option .lang-flag-opt {
    width: 26px;
    height: 17px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.10);
}

/* ---- Menu-page placement (fixed top-left corner with right-opening dropdown) ---- */
.menu-lang-selector {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 300;
}

.menu-lang-selector .lang-dropdown {
    left: 0;
    right: auto;
}

/* On very small screens, tuck it further in */
@media (max-width: 480px) {
    .menu-lang-selector {
        top: 0.5rem;
        left: 0.5rem;
    }
}

/* ---- In-game header: sits inline with other header controls ---- */
.game-header .lang-selector .lang-dropdown {
    top: calc(100% + 8px);
    z-index: 1001;
}

/* =====================================================
   DIFFICULTY MODAL
   ===================================================== */
.difficulty-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9200;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

.difficulty-modal.hidden {
    display: none;
}

.difficulty-content {
    background: linear-gradient(145deg, #1c2340 0%, #14192e 60%, #1a1435 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 1.5rem;
    padding: 2.5rem 2rem 2rem;
    max-width: 760px;
    width: 100%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 40px rgba(99, 102, 241, 0.15), inset 0 1px 0 rgba(255,255,255,0.06);
    animation: confirmSlideIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

.difficulty-title {
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(90deg, #fbbf24, var(--primary-light), #fbbf24);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.difficulty-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.difficulty-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (max-width: 600px) {
    .difficulty-cards {
        grid-template-columns: 1fr;
    }
}

.difficulty-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.5rem 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--border-color);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-color);
    text-align: center;
    overflow: hidden;
}

.difficulty-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.22s ease;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.difficulty-card:hover::before,
.difficulty-card:focus-visible::before {
    opacity: 1;
}

.difficulty-card:hover,
.difficulty-card:focus-visible {
    border-color: var(--primary-light);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-3px);
}

.difficulty-card:active {
    transform: translateY(-1px) scale(0.98);
}

.difficulty-card--recommended {
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.04);
}

.difficulty-card--recommended::before {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12) 0%, rgba(245, 158, 11, 0.08) 100%);
}

.difficulty-card--recommended:hover {
    border-color: #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
}

.difficulty-recommended-badge {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    color: #000;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2rem 0.8rem;
    border-radius: 0 0 0.6rem 0.6rem;
    white-space: nowrap;
}

.difficulty-card-icon {
    color: var(--primary-light);
    margin-top: 0.5rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.difficulty-card--recommended .difficulty-card-icon {
    color: #fbbf24;
}

.difficulty-card:hover .difficulty-card-icon {
    transform: scale(1.12);
}

.difficulty-card-label {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.difficulty-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.difficulty-card-features {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-align: left;
    width: 100%;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* =====================================================
   DIFFICULTY BADGE (in game header)
   ===================================================== */
.difficulty-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: default;
    border: 1px solid;
    transition: var(--transition);
    white-space: nowrap;
    margin-left: 0.25rem;
    user-select: none;
}

.difficulty-badge[data-difficulty="easy"] {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
}

.difficulty-badge[data-difficulty="medium"] {
    background: rgba(251, 191, 36, 0.13);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.4);
}

.difficulty-badge[data-difficulty="hard"] {
    background: rgba(244, 63, 94, 0.14);
    color: #f43f5e;
    border-color: rgba(244, 63, 94, 0.4);
}

/* =====================================================
   GHOST OUTLINES (Easy mode - country outlines at correct positions)
   ===================================================== */
.ghost-outline {
    fill: var(--country-fill);
    stroke: var(--country-stroke);
    stroke-width: 0.5px;
    opacity: 0.18;
    pointer-events: none;
}

/* Hard mode: show a rotation cursor hint on cluster groups */
body[data-difficulty="hard"] .cluster-group {
    cursor: grab;
}

body[data-difficulty="hard"] .cluster-group.has-rotation {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='white' stroke='black' stroke-width='1' d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z'/%3E%3Cpath fill='white' d='M13 7v4.586l2.707 2.707-1.414 1.414L11 12.414V7z'/%3E%3C/svg%3E") 12 12, grab;
}

/* =====================================================
   TIMER
   ===================================================== */
.timer {
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary-light);
    letter-spacing: 0.05em;
    min-width: 42px;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-color);
}

/* =====================================================
   COMPLETION STATS
   ===================================================== */
.completion-time-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    color: var(--text-muted);
}

.completion-time-row strong {
    font-size: 1.4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--success-color);
}

.completion-stats {
    margin-bottom: 1.5rem;
}

.completion-stats h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.stats-row + .stats-row {
    margin-top: 0.25rem;
}

.stats-row--active {
    background: rgba(99, 102, 241, 0.12);
    font-weight: 700;
}

.stats-label {
    color: var(--text-muted);
}

.stats-row--active .stats-label {
    color: var(--text-primary);
}

.stats-value {
    font-variant-numeric: tabular-nums;
    color: var(--primary-light);
}

.stats-row--active .stats-value {
    color: var(--success-color);
}

/* =====================================================
   QUIZ MODE PAGE
   ===================================================== */
body.quiz-page {
    overflow-y: auto;
    min-height: 100vh;
    height: auto;
    background:
        radial-gradient(ellipse at 15% 0%, rgba(244, 114, 182, 0.2) 0%, transparent 45%),
        radial-gradient(ellipse at 88% 15%, rgba(16, 185, 129, 0.16) 0%, transparent 40%),
        #0c1224;
}

.quiz-main {
    width: min(1160px, 100% - 2rem);
    margin: 1.15rem auto 2rem;
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 6.5rem);
    display: flex;
    align-items: center;
}

.quiz-header {
    z-index: 320;
}

.quiz-header .quiz-menu-back {
    gap: 0.375rem;
    padding: 0.25rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.quiz-header .quiz-menu-back span {
    display: inline;
}

.quiz-header .quiz-menu-back:hover {
    color: var(--primary-light);
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.15);
}

.quiz-shell {
    width: 100%;
    background: linear-gradient(160deg, rgba(16, 22, 44, 0.92), rgba(8, 11, 28, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 1.25rem;
    box-shadow: 0 24px 54px rgba(2, 8, 30, 0.6);
    overflow: hidden;
}

.quiz-top {
    padding: 1.45rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.quiz-top-stats {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.quiz-stat-pill {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 0.34rem 0.62rem;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.85);
}

.quiz-stat-pill strong {
    color: #fff;
}

.quiz-sync-ok {
    border-color: rgba(16, 185, 129, 0.45);
    color: #a7f3d0;
}

.quiz-sync-local {
    border-color: rgba(251, 191, 36, 0.45);
    color: #fde68a;
}

.quiz-top h1 {
    font-size: 1.45rem;
    letter-spacing: -0.03em;
    color: #fff;
}

.quiz-top p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.92rem;
}

.quiz-compact-action {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    color: #f9fafb;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.48rem 0.82rem;
    background: rgba(255, 255, 255, 0.05);
}

.quiz-top .quiz-compact-action {
    display: none;
}

.quiz-stage {
    padding: 1.45rem;
}

.quiz-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 1fr;
    gap: 1rem;
}

.quiz-category-card {
    display: block;
    height: 100%;
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 1.2rem;
    padding: 0;
    overflow: hidden;
    background: transparent;
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 14px 26px rgba(3, 10, 28, 0.5);
}

.quiz-category-card:hover,
.quiz-category-card:focus-visible {
    transform: translateY(-5px);
}

.quiz-ticket {
    position: relative;
    height: 100%;
    min-height: 360px;
    border-radius: 1.2rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    justify-content: flex-start;
    isolation: isolate;
}

.quiz-ticket::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
}

.quiz-ticket::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 16px;
    border-bottom-left-radius: 1.2rem;
    border-bottom-right-radius: 1.2rem;
    background:
        linear-gradient(-45deg, rgba(255, 255, 255, 0.22) 8px, transparent 0) 0 100% / 16px 16px repeat-x,
        linear-gradient(45deg, rgba(255, 255, 255, 0.22) 8px, transparent 0) 8px 100% / 16px 16px repeat-x;
}

.quiz-ticket h3 {
    margin-top: 0;
    font-size: 1.34rem;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.quiz-ticket p {
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.45;
    position: relative;
    z-index: 2;
}

.quiz-ticket-icon {
    margin-top: 1.35rem;
    border-radius: 0.75rem;
    overflow: hidden;
    background: transparent;
    height: 124px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.quiz-ticket-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.quiz-ticket-copy {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 8px;
}

.quiz-ticket-desc {
    margin-top: 0.15rem;
}

.quiz-category-best-badge {
    margin-top: auto;
    align-self: center;
    margin-bottom: 28px;
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    border-radius: 999px;
    padding: 0.28rem 0.62rem;
    background: rgba(8, 15, 37, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: rgba(255, 255, 255, 0.94);
    font-size: 0.76rem;
    font-weight: 800;
    position: relative;
    z-index: 2;
}

.quiz-category-best-icon {
    font-size: 0.88rem;
    line-height: 1;
}

.quiz-category-best-text {
    letter-spacing: 0.01em;
}

.quiz-ticket-what {
    background: linear-gradient(165deg, #0891b2, #0284c7);
}

.quiz-ticket-how {
    background: linear-gradient(165deg, #84cc16, #65a30d);
}

.quiz-ticket-life {
    background: linear-gradient(165deg, #f59e0b, #ea580c);
}

.quiz-ticket-agenda {
    background: linear-gradient(165deg, #ec4899, #db2777);
}

.quiz-live {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem;
}

.quiz-question-panel,
.quiz-media-panel {
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.1rem;
}

.quiz-category-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 0.7rem;
}

.quiz-theme-what .quiz-category-chip { background: rgba(8,145,178,0.22); color: #67e8f9; }
.quiz-theme-how .quiz-category-chip { background: rgba(101,163,13,0.24); color: #d9f99d; }
.quiz-theme-life .quiz-category-chip { background: rgba(234,88,12,0.22); color: #fdba74; }
.quiz-theme-agenda .quiz-category-chip { background: rgba(219,39,119,0.22); color: #f9a8d4; }

.quiz-progress {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-bottom: 0.55rem;
}

.quiz-question-title {
    font-size: 1.22rem;
    line-height: 1.34;
    margin-bottom: 0.95rem;
}

.quiz-question-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: -0.35rem;
    margin-bottom: 0.9rem;
    flex-wrap: wrap;
}

.quiz-question-meta.is-hidden {
    display: none;
}

.quiz-source-label {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.8rem;
    font-weight: 700;
}

.quiz-source-link {
    color: #93c5fd;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.quiz-source-link:hover {
    color: #bfdbfe;
}

.quiz-options {
    display: grid;
    gap: 0.65rem;
}

.quiz-option {
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0.78rem;
    padding: 0.78rem 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    color: #f8fafc;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    position: relative;
}

.quiz-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.quiz-option:disabled {
    cursor: default;
}

.quiz-option.is-correct {
    border-color: rgba(16, 185, 129, 0.95);
    background: rgba(16, 185, 129, 0.2);
}

.quiz-option.is-wrong {
    border-color: rgba(244, 63, 94, 0.95);
    background: rgba(244, 63, 94, 0.2);
}

.quiz-option.has-help-icon {
    padding-right: 2.4rem;
}

.quiz-option-help-icon {
    position: absolute;
    right: 0.62rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    border: 1px solid rgba(250, 204, 21, 0.8);
    background: rgba(250, 204, 21, 0.2);
    color: #fde047;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.quiz-feedback {
    margin-top: 0.9rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.04);
}

.quiz-wrong-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 22, 0.75);
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.quiz-wrong-modal-card {
    width: min(680px, 100%);
    max-height: 84vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    background: linear-gradient(165deg, #10182f, #0f172a);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    padding: 1rem 1rem 0.9rem;
}

.quiz-wrong-modal-card.is-error {
    border-color: rgba(248, 113, 113, 0.75);
    background: linear-gradient(165deg, #3f0d18, #1f0a11);
}

.quiz-wrong-modal-card.is-error .quiz-source-link {
    color: #ffffff;
}

.quiz-wrong-modal-card.is-error .quiz-source-link:hover {
    color: #ffffff;
    opacity: 0.9;
}

.quiz-wrong-modal-card h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #f8fafc;
}

.quiz-wrong-title {
    font-size: 1.42rem;
    color: #fecaca;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.quiz-wrong-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 900;
    border: 1px solid rgba(248, 113, 113, 0.85);
    background: rgba(248, 113, 113, 0.18);
    color: #fca5a5;
}

.quiz-wrong-modal-row {
    margin-top: 0.72rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.48;
}

.quiz-correct-answer-label {
    color: #86efac;
}

.quiz-correct-answer-value {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
}


.quiz-wrong-modal-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.quiz-media-panel img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.3);
}

.quiz-media-caption {
    margin-top: 0.7rem;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.72);
}

.quiz-actions {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    justify-content: space-between;
}

.quiz-action-btn {
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.8rem;
    padding: 0.62rem 0.9rem;
    font-size: 0.87rem;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.quiz-action-btn.primary {
    border-color: transparent;
    background: linear-gradient(145deg, #3b82f6, #2563eb);
}

.quiz-result {
    text-align: center;
    padding: 1.6rem 1rem;
    width: min(980px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.quiz-stage.is-result {
    max-height: calc(100vh - 10.5rem);
    overflow-y: auto;
}

.quiz-result h2 {
    font-size: 1.7rem;
    letter-spacing: -0.03em;
}

.quiz-result-score {
    margin-top: 0.6rem;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.82);
}

.quiz-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0.72rem auto 0;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-weight: 800;
    border: 1px solid transparent;
    font-size: 1.15rem;
    min-width: 80px;
}

.quiz-score-badge.is-red {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.quiz-score-badge.is-orange {
    color: #fed7aa;
    background: rgba(249, 115, 22, 0.2);
    border-color: rgba(249, 115, 22, 0.52);
}

.quiz-score-badge.is-green {
    color: #bbf7d0;
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.52);
}

.quiz-category-skeleton {
    border-radius: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    min-height: 360px;
    padding: 1rem;
    background: linear-gradient(130deg, rgba(27, 37, 71, 0.56), rgba(15, 23, 42, 0.66));
    position: relative;
    overflow: hidden;
}

.quiz-category-skeleton::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.18) 48%, transparent 76%);
    transform: translateX(-100%);
    animation: quiz-skeleton-shimmer 1.2s linear infinite;
}

.quiz-category-skeleton-icon,
.quiz-category-skeleton-line {
    background: rgba(255, 255, 255, 0.14);
    position: relative;
    z-index: 1;
}

.quiz-category-skeleton-icon {
    margin-top: 1.35rem;
    border-radius: 0.75rem;
    height: 124px;
}

.quiz-category-skeleton-line {
    margin-top: 0.9rem;
    height: 16px;
    border-radius: 999px;
}

.quiz-category-skeleton-line.lg {
    margin-top: 1.1rem;
    width: 72%;
}

.quiz-category-skeleton-line.sm {
    width: 56%;
}

@keyframes quiz-skeleton-shimmer {
    to {
        transform: translateX(100%);
    }
}

.quiz-result-actions {
    margin-top: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.quiz-review {
    margin-top: 1rem;
    text-align: left;
    display: grid;
    gap: 0.8rem;
    width: 100%;
    max-width: 100%;
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.quiz-review[hidden] {
    display: none;
}

.quiz-review-item {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.9rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.quiz-review-item.is-correct {
    border-color: rgba(16, 185, 129, 0.65);
}

.quiz-review-item.is-wrong {
    border-color: rgba(244, 63, 94, 0.65);
}

.quiz-review-item h3 {
    margin: 0;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.86);
}

.quiz-review-question {
    margin-top: 0.35rem;
    color: #f8fafc;
    font-weight: 700;
}

.quiz-review-line {
    margin-top: 0.42rem;
    color: rgba(255, 255, 255, 0.87);
    line-height: 1.45;
}

.quiz-review-line strong {
    color: rgba(255, 255, 255, 0.97);
}

.quiz-confetti-layer {
    position: fixed;
    inset: 0;
    z-index: 1450;
    pointer-events: none;
    overflow: visible;
}

.quiz-confetti-piece {
    position: absolute;
    width: 10px;
    height: 16px;
    border-radius: 2px;
    opacity: 0.95;
    animation: quiz-confetti-pop 0.9s ease-out forwards;
    animation-delay: var(--delay);
}

@keyframes quiz-confetti-pop {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate3d(var(--tx), var(--ty), 0) rotate(var(--rot));
        opacity: 0;
    }
}

@media (max-width: 980px) {
    .quiz-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quiz-live {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .quiz-main {
        width: calc(100% - 1rem);
        margin-top: 0.85rem;
        min-height: calc(100vh - 5.2rem);
        align-items: flex-start;
    }

    .quiz-stage {
        padding: 0.9rem;
    }

    .quiz-stage.is-result {
        max-height: calc(100vh - 9rem);
    }

    .quiz-top {
        padding: 1rem;
    }

    .quiz-top-stats {
        width: 100%;
        order: 3;
    }

    .quiz-categories-grid {
        grid-template-columns: 1fr;
    }

    .quiz-ticket {
        min-height: 330px;
    }

    .quiz-ticket h3 {
        font-size: 1.24rem;
    }

    .quiz-result-actions {
        flex-direction: column;
    }

    .quiz-question-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* =====================================================
   STATISTICS PAGE
   ===================================================== */

/* Allow scrolling on the stats page */
body.stats-page {
    overflow-y: auto;
    min-height: 100vh;
    height: auto;
}

/* ── Header ─────────────────────────────────────────── */
.stats-header {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    background: rgba(11, 15, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.stats-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    white-space: nowrap;
}

.stats-back-btn span { display: none; } /* hide "Play" text, just show arrow */

.stats-back-btn:hover {
    color: var(--text-color);
    background: var(--bg-card);
}

.stats-page-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.01em;
    margin: 0;
    max-width: calc(100% - 12rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.stats-lang-selector {
    margin-left: auto;
    flex-shrink: 0;
}

.stats-settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 2.45rem;
    padding: 0 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
}

.stats-settings-btn:hover {
    color: var(--primary-light);
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.15);
}

.stats-settings-btn svg {
    width: 1rem;
    height: 1rem;
}

.stats-account-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.04);
}

.stats-account-icon:hover {
    color: var(--primary-light);
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.15);
}

.stats-account-icon svg {
    width: 1.18rem;
    height: 1.18rem;
}

/* ── Main layout ─────────────────────────────────────── */
.stats-main {
    position: relative;
    z-index: 1;
    max-width: 820px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 4rem;
}

/* ── Main tab bar ──────────────────────────────────── */
.stats-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.35rem;
}

.stats-tab {
    flex: 1;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    letter-spacing: 0.01em;
}

.stats-tab:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

.stats-tab.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ── Tab content panels ─────────────────────────────── */
.tab-content { animation: fadeIn 0.2s ease; }
.tab-content.hidden { display: none; }

/* ── Section titles ─────────────────────────────────── */
.stats-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.1rem;
}

/* ── Local records grid ─────────────────────────────── */
.local-records-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.record-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.4rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    text-align: center;
    transition: var(--transition);
}

.record-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.record-card-icon {
    color: var(--success-color);
    margin-bottom: 0.6rem;
}

.record-card-icon--medium { color: var(--accent-color); }
.record-card-icon--hard   { color: var(--error-color); }

.record-card-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.record-card-time {
    font-size: 1.9rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    letter-spacing: -0.02em;
}

.record-card-time--set {
    color: var(--primary-light);
}

/* ── Auth card ──────────────────────────────────────── */
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    min-height: 3rem;
}

.auth-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.auth-inner--signed-in {
    gap: 0.5rem;
}

.auth-inner--sent {
    flex-direction: column;
    align-items: flex-start;
    color: var(--success-color);
    gap: 0.35rem;
}

.auth-inner--sent svg { flex-shrink: 0; }

.auth-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex: 1 1 auto;
}

.auth-form {
    display: flex;
    gap: 0.5rem;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
}

.auth-guest-note {
    width: 100%;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.auth-user-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-color);
    font-size: 0.875rem;
    flex: 1;
}

.auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
}

.auth-error {
    color: var(--error-color);
    font-size: 0.8rem;
    width: 100%;
}

/* ── Difficulty sub-tabs ─────────────────────────────── */
.diff-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.diff-tab {
    padding: 0.45rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.diff-tab:hover {
    color: var(--text-color);
    border-color: var(--primary-color);
}

.diff-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ── Leaderboard table ──────────────────────────────── */
.leaderboard-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.lb-table thead {
    background: rgba(99, 102, 241, 0.08);
    border-bottom: 1px solid var(--border-color);
}

.lb-table th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.lb-table td {
    padding: 0.65rem 1rem;
    color: var(--text-color);
    border-bottom: 1px solid rgba(42, 49, 88, 0.5);
}

.lb-table tbody tr:last-child td {
    border-bottom: none;
}

.lb-table tbody tr:hover td {
    background: rgba(99, 102, 241, 0.05);
}

/* Column widths */
.lb-col-rank    { width: 3rem; text-align: center; }
.lb-col-name    { min-width: 8rem; }
.lb-col-country { min-width: 7rem; color: var(--text-secondary); }
.lb-col-time    { width: 6rem; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--primary-light); }
.lb-col-date    { width: 9rem; color: var(--text-muted); font-size: 0.8rem; }

/* Rank badge */
.lb-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--bg-secondary);
    color: var(--text-muted);
}

/* Top 3 rows */
.lb-row-top-1 td { background: rgba(251, 191, 36, 0.06); }
.lb-row-top-1 .lb-rank-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1000;
}
.lb-row-top-2 td { background: rgba(148, 163, 184, 0.06); }
.lb-row-top-2 .lb-rank-badge {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #fff;
}
.lb-row-top-3 td { background: rgba(180, 120, 72, 0.06); }
.lb-row-top-3 .lb-rank-badge {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
    color: #fff;
}

/* States */
.lb-loading-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.lb-empty {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.lb-not-configured {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

.lb-nc-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Show more */
.lb-show-more-wrap {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0 0.25rem;
}

.lb-show-more-btn {
    padding: 0.55rem 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.lb-show-more-btn:hover:not(:disabled) {
    color: var(--text-color);
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
}

.lb-show-more-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ── Loading spinner ─────────────────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.lb-spinner {
    display: inline-block;
    width: 1.4rem;
    height: 1.4rem;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

/* ── Shared widget inputs / buttons ─────────────────── */
.lb-input {
    flex: 1;
    min-width: 9rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-color);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.lb-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.lb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
    text-decoration: none;
}

.lb-btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.lb-btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.lb-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.lb-btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #f87171, #ef4444);
}

.lb-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.lb-btn-ghost:hover:not(:disabled) {
    color: var(--text-color);
    border-color: var(--primary-color);
}

.lb-btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.lb-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.lb-link {
    font-size: 0.8rem;
    color: var(--primary-light);
    text-decoration: none;
    white-space: nowrap;
}

.lb-link:hover { text-decoration: underline; }

/* ── Completion overlay leaderboard widget ──────────── */
.lb-widget {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    margin-top: 1rem;
}

.lb-widget.lb-loading {
    justify-content: center;
    border-color: var(--border-color);
    background: transparent;
}

.lb-as {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.lb-setup-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    width: 100%;
}

.lb-setup { flex-direction: column; align-items: flex-start; }
.lb-login { flex-direction: column; align-items: flex-start; }

.lb-result-msg {
    font-size: 0.875rem;
    color: var(--text-color);
}

.lb-success {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.07);
}

.lb-neutral {
    border-color: var(--border-color);
    background: transparent;
}

.lb-error {
    border-color: rgba(244, 63, 94, 0.35);
    background: rgba(244, 63, 94, 0.07);
    color: var(--error-color);
    font-size: 0.8rem;
}

/* ── Profile setup modal ─────────────────────────────── */
.lb-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lb-modal.hidden { display: none; }

.lb-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem 1.75rem;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow);
    animation: scaleIn 0.25s ease;
}

.lb-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.lb-modal-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.lb-modal-field {
    margin-bottom: 1rem;
}

.lb-modal-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lb-modal-field label small {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
}

.lb-modal-field .lb-input { min-width: unset; width: 100%; }

.lb-field-error {
    display: block;
    font-size: 0.78rem;
    color: var(--error-color);
    margin-top: 0.3rem;
    min-height: 1em;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
    .stats-main {
        padding: 1rem 0.75rem 3rem;
    }

    .local-records-grid {
        grid-template-columns: 1fr;
        max-width: 280px;
        margin: 0 auto;
    }

    .record-card { flex-direction: row; gap: 0.75rem; padding: 1rem; }
    .record-card-icon { margin-bottom: 0; }
    .record-card-time { margin-left: auto; font-size: 1.4rem; }

    .lb-table th:nth-child(3),
    .lb-table td:nth-child(3) { display: none; } /* hide Country on small screens */

    .lb-col-date { display: none; }

    .auth-form { flex-direction: column; }
    .auth-form .lb-input { width: 100%; }

    .stats-header { padding: 0.65rem 1rem; }
}

/* =====================================================
   SIGN-IN SUGGESTION BANNERS
   ===================================================== */
.auth-suggest-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: linear-gradient(120deg, rgba(14, 116, 144, 0.2), rgba(67, 56, 202, 0.12));
}

.auth-suggest-banner p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    flex: 1;
}

.auth-suggest-banner--global {
    margin-bottom: 1.25rem;
}

.auth-suggest-banner.hidden {
    display: none;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-main {
    min-height: calc(100vh - 7rem);
    min-height: calc(100dvh - 7rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

body.account-scroll-root {
    overflow-y: auto;
    min-height: 100vh;
    height: auto;
}

body.account-scroll-root .login-main {
    min-height: auto;
    justify-content: flex-start;
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
}

.login-card {
    width: min(100%, 520px);
    background: rgba(10, 20, 42, 0.86);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(2, 6, 23, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.8rem 1.5rem;
}

.login-loading {
    min-height: 6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: var(--primary-light);
}

.login-icon--success {
    color: var(--success-color);
}

.login-title {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    color: var(--text-color);
    text-align: center;
}

.login-subtitle {
    margin: 0 0 1.1rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.45;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.login-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.login-input {
    width: 100%;
}

.login-btn {
    width: 100%;
}

.login-actions-row {
    display: flex;
    gap: 0.5rem;
}

.login-actions-row .lb-btn {
    flex: 1;
}

.login-error {
    min-height: 1.1em;
    color: var(--error-color);
    font-size: 0.8rem;
}

.login-email-badge {
    display: block;
    width: fit-content;
    margin: 0 auto 1rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.75);
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-align: center;
}

.login-saved {
    font-size: 0.8rem;
    color: var(--success-color);
    margin-left: 0.5rem;
    align-self: center;
}

.login-nav-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.login-nav-links a,
.login-privacy-link a {
    color: var(--primary-light);
    text-decoration: none;
}

.login-nav-links a:hover,
.login-privacy-link a:hover {
    text-decoration: underline;
}

.login-privacy-link {
    margin: 1rem 0 0;
    font-size: 0.85rem;
}

.account-bests {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.account-danger-zone {
    margin-top: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(244, 63, 94, 0.25);
}

.account-danger-zone h3 {
    margin: 0 0 0.4rem;
    color: #fecaca;
    font-size: 0.95rem;
}

.account-danger-zone p {
    margin: 0 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.account-delete-link {
    color: #fca5a5;
    text-decoration: underline;
    text-decoration-color: rgba(248, 113, 113, 0.6);
    font-size: 0.85rem;
    font-weight: 600;
}

.account-delete-link:hover {
    color: #f87171;
}

.account-footer-actions {
    margin-top: 0.9rem;
    display: flex;
    justify-content: flex-end;
}

.account-sign-out-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fca5a5;
}

.account-sign-out-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(248, 113, 113, 0.6);
    color: #fecaca;
}

.account-delete-modal-content {
    max-width: 440px;
}

.account-delete-warning {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(244, 63, 94, 0.35);
    background: rgba(244, 63, 94, 0.1);
}

.account-delete-warning.hidden {
    display: none;
}

.account-delete-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* =====================================================
   PRIVACY PAGE
   ===================================================== */
.privacy-main {
    padding-top: 1.25rem;
}

.privacy-card {
    background: rgba(8, 18, 38, 0.88);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 16px;
    box-shadow: 0 14px 36px rgba(2, 6, 23, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.5rem;
}

.privacy-intro {
    margin-top: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.privacy-section + .privacy-section {
    margin-top: 1.1rem;
}

.privacy-section h2 {
    margin: 0 0 0.45rem;
    font-size: 1rem;
    color: var(--text-color);
}

.privacy-section p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.privacy-contact {
    margin-top: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .auth-suggest-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-suggest-banner .lb-btn {
        width: 100%;
    }

    .login-card,
    .privacy-card {
        padding: 1.15rem;
    }

    .login-actions-row {
        flex-direction: column;
    }
}
