:root {
    /* Paleta Capital Quest - Colores Pastel Kawaii */
    --bg-gradient-start: #E0F7FA;
    --bg-gradient-end: #FFF8E1;
    --primary-color: #B39DDB;
    --primary-light: #D1C4E9;
    --secondary-color: #81D4FA;
    --accent-color: #A5D6A7;
    --yellow-color: #FFE082;
    --pink-color: #F8BBD0;
    --peach-color: #FFCCBC;
    --mint-color: #B2DFDB;
    --text-color: #5D4E6D;
    --white: #FFFFFF;
    --error-color: #EF9A9A;
    --success-color: #81C784;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Quicksand', sans-serif;
    --shadow-soft: 0 8px 20px rgba(179, 157, 219, 0.25);
    --shadow-3d: 0 6px 0 rgba(0, 0, 0, 0.1);
    --text-shadow-3d: 3px 3px 0 rgba(255, 255, 255, 0.8),
        -1px -1px 0 rgba(179, 157, 219, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body), "Segoe UI Emoji", "Noto Color Emoji", "Apple Color Emoji", sans-serif;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-color);
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-bottom: 50px;
}

#app {
    flex-direction: column;
    width: 100%;
    max-width: 500px;
    height: 90vh;
    max-height: 800px;
    min-height: 600px;
    background: transparent;
    position: relative;
    overflow: hidden;
    z-index: 10;
    margin-bottom: 40px;
    flex-shrink: 0;
}

/* SEO Content Section */
.game-info-content {
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin: 20px 20px 60px 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    z-index: 5;
}

.game-info-content h2 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 20px;
    margin-top: 30px;
}

.game-info-content h2:first-child {
    margin-top: 0;
}

.game-info-content h3 {
    font-family: var(--font-heading);
    color: var(--text-color);
    font-size: 1.5rem;
    margin-bottom: 15px;
    margin-top: 25px;
}

.game-info-content p {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4a4a4a;
    margin-bottom: 15px;
}

.game-info-content ul {
    list-style-type: none;
    margin-bottom: 20px;
}

.game-info-content ul li {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
}

.game-info-content ul li::before {
    content: "✨";
    position: absolute;
    left: 0;
    top: 2px;
}

/* Screens Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateY(20px);
    z-index: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
    z-index: 2;
}

/* Top Navigation Bar */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    margin: 8px;
    box-shadow: 0 4px 15px rgba(179, 157, 219, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.home-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.home-logo {
    height: 32px;
    width: auto;
    transition: transform 0.2s;
}

.home-logo:hover {
    transform: scale(1.05);
}

.nav-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Logo & Menu */
.logo-container {
    text-align: center;
    margin-top: 5px;
    margin-bottom: 8px;
}

.main-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 50%;
    border: 4px solid var(--white);
    box-shadow: var(--shadow-soft), var(--shadow-3d);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--pink-color) 100%);
    animation: floating 3s ease-in-out infinite;
    display: block;
    margin: 0 auto;
}

h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg,
            #D1C4E9 0%,
            #81D4FA 20%,
            #A5D6A7 40%,
            #FFE082 60%,
            #FFCCBC 80%,
            #F8BBD0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 8px;
    margin-bottom: 8px;
    text-align: center;
    filter: drop-shadow(3px 3px 0 rgba(255, 255, 255, 0.8)) drop-shadow(-1px -1px 0 rgba(179, 157, 219, 0.3));
    letter-spacing: 1px;
}

/* Ko-fi Wrapper */
.kofi-wrapper {
    display: flex;
    justify-content: center;
    margin: 10px 0 15px 0;
}

/* Language Buttons */

.lang-btn {
    border: 3px solid var(--white);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    width: 45px;
    height: 34px;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
}

.lang-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lang-btn.active {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(179, 157, 219, 0.3), var(--shadow-soft);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
    padding-bottom: 20px;
}

/* Base Button Styles */
.menu-btn {
    font-family: var(--font-heading);
    padding: 8px 16px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
    box-shadow: 0 6px 0px rgba(0, 0, 0, 0.15), var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
}

.menu-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(179, 157, 219, 0.2);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

.secondary-btn {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--mint-color) 100%);
    color: var(--text-color);
}

.accent-btn {
    background: linear-gradient(135deg, var(--yellow-color) 0%, var(--peach-color) 100%);
    color: var(--text-color);
}

.btn-sub {
    font-size: 0.75rem;
    font-family: var(--font-body);
    font-weight: normal;
    opacity: 0.9;
    margin-top: 2px;
}

.sound-toggle-mini {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 2px solid var(--white);
    background: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.sound-toggle-mini:active {
    transform: scale(0.95);
}

.sound-toggle-mini.muted::after {
    content: "/";
    position: absolute;
    color: var(--error-color);
    font-size: 2rem;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 248, 225, 0.95) 100%);
    padding: 30px;
    border-radius: 30px;
    width: 85%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(179, 157, 219, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.9);
}

.time-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px auto;
    width: 100%;
    max-width: 250px;
}

.time-opt-btn {
    padding: 15px;
    border-radius: 18px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    background: var(--white);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-soft), 0 4px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, background 0.3s;
}

.time-opt-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--mint-color) 100%);
    transform: translateY(-2px);
}

/* Game Area */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mini-btn {
    width: 45px;
    height: 45px;
    border-radius: 15px;
    border: 2px solid var(--white);
    background: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stats {
    display: flex;
    gap: 15px;
    font-weight: 700;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.flag-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-soft), 0 6px 0 rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    aspect-ratio: 3/2;
    border: 3px solid rgba(255, 255, 255, 0.8);
}

#current-flag {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 12px 10px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-soft), 0 4px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, background-color 0.2s, border-color 0.2s;
    min-height: 60px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.option-btn:active {
    transform: translateY(3px);
}

.option-btn.correct {
    background-color: var(--success-color) !important;
    color: white;
    animation: pulse 0.5s;
}

.option-btn.wrong {
    background-color: var(--error-color) !important;
    color: white;
    animation: shake 0.5s;
}

.mode-msg {
    margin-top: auto;
    text-align: center;
    font-weight: 700;
    color: var(--primary-color);
}

/* Results */
.results-content {
    text-align: center;
    margin: auto;
}

.result-emoji {
    font-size: 5rem;
    margin-bottom: 20px;
}

#result-message {
    margin: 15px 0;
    line-height: 1.4;
}

.final-stats {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 24px;
    margin: 20px 0;
    box-shadow: var(--shadow-soft), 0 6px 0 rgba(0, 0, 0, 0.08);
    font-size: 1.5rem;
    font-weight: 700;
    border: 3px solid rgba(255, 255, 255, 0.8);
}

.results-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

/* Animations */
@keyframes floating {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Responsive Styles for Mobile */
@media (max-width: 600px) {

    /* Reduce screen padding significantly */
    .screen {
        padding: 6px;
    }

    /* Make game screen use flexbox to manage vertical space - critical for Chrome */
    #screen-game {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        height: 100%;
        max-height: 100vh;
        overflow: hidden;
    }

    /* Compact Top Navigation */
    .top-nav {
        padding: 5px 8px;
        margin: 0 0 4px 0;
        background: rgba(255, 255, 255, 0.6);
        flex-shrink: 0;
    }

    .home-logo {
        height: 22px;
    }

    .lang-btn {
        width: 34px;
        height: 26px;
        border-width: 2px;
    }

    .sound-toggle-mini {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    .nav-controls {
        gap: 5px;
    }

    /* Compact Logo & Title */
    .logo-container {
        margin-top: 2px;
        margin-bottom: 4px;
    }

    .main-logo {
        width: 70px;
        height: 70px;
        border-width: 3px;
    }

    h1 {
        font-size: 1.2rem;
        margin: 3px 0;
    }

    /* Compact Menu Buttons */
    .menu-buttons {
        gap: 7px;
        padding: 0 6px;
        padding-bottom: 8px;
    }

    .menu-btn {
        padding: 8px 12px;
        font-size: 0.95rem;
        border-radius: 12px;
    }

    /* Game Area - Compact header */
    .game-header {
        margin-bottom: 6px;
        flex-shrink: 0;
    }

    .stats {
        padding: 5px 10px;
        font-size: 0.9rem;
        gap: 8px;
    }

    /* Compact question visual area to save vertical space - critical for Chrome */
    .question-visual {
        flex: 0 0 auto;
        min-height: 0;
        margin-top: 10px;
        /* Small margin from the top navigation */
        margin-bottom: 15px;
        gap: 0.8rem;
        overflow: visible;
        background: transparent;
        /* No background */
        border: none;
        padding: 0;
        box-shadow: none;
        width: 100%;
        align-self: center;
    }

    .flag-container {
        padding: 6px;
        margin-bottom: 6px;
        aspect-ratio: auto;
        min-height: auto;
        border-radius: 10px;
    }

    #current-flag {
        max-height: 55px;
        max-width: 100%;
        object-fit: contain;
    }

    .flag-main {
        width: 80px;
        height: 50px;
        object-fit: cover;
    }

    .country-name,
    .capital-display {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
        max-width: 90%;
        word-wrap: break-word;
    }

    /* Options grid - ensure it fits within viewport - critical for Chrome */
    .options-grid {
        gap: 10px;
        flex-shrink: 0;
        margin-top: 0;
        margin-bottom: 20px;
        /* Keep some bottom space */
        padding-bottom: 10px;
        width: 100%;
    }

    .option-btn {
        min-height: 50px;
        height: auto;
        padding: 8px 6px;
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .option-btn img {
        max-height: 28px;
    }

    .mini-btn {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
        border-radius: 10px;
    }

    /* Compact Skyline for Mobile */
    .skyline-container {
        height: 25px;
        margin-bottom: 0.2rem;
    }

    .skyline-item {
        font-size: 1.1rem;
    }

    /* Reduce Ko-fi spacing */
    .kofi-wrapper {
        margin: 4px 0 6px 0;
    }
}

/* Extra small devices - even more compact */
@media (max-width: 400px) {
    .screen {
        padding: 4px;
    }

    #screen-game {
        padding: 4px;
        max-height: 100vh;
    }

    .top-nav {
        padding: 4px 6px;
        margin: 0 0 3px 0;
    }

    .game-header {
        margin-bottom: 4px;
    }

    .stats {
        padding: 4px 8px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .question-visual {
        margin-bottom: 6px;
        gap: 0.2rem;
        max-height: 150px;
    }

    .flag-main {
        width: 75px;
        height: 48px;
    }

    #current-flag {
        max-height: 60px;
    }

    .country-name,
    .capital-display {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .options-grid {
        gap: 6px;
        padding-bottom: 2px;
    }

    .option-btn {
        min-height: 45px;
        height: auto;
        padding: 6px 4px;
        font-size: 0.75rem;
        line-height: 1.15;
    }

    .option-btn img {
        max-height: 24px;
    }

    .mini-btn {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
}

/* --- Simply Capitals Specific Styles --- */

.skyline-container {
    width: 100%;
    height: 45px;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    margin-bottom: 0.6rem;
}

.skyline-item {
    font-size: 1.8rem;
    animation: floating 3s ease-in-out infinite;
}

.skyline-item:nth-child(2) {
    animation-delay: 0.5s;
}

.skyline-item:nth-child(3) {
    animation-delay: 1s;
}

.skyline-item:nth-child(4) {
    animation-delay: 1.5s;
}

.question-visual {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    gap: 1.2rem;
    margin-top: 20px;
    /* Desktop margin */
    margin-bottom: 20px;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.flag-main {
    width: 140px;
    height: 90px;
    border-radius: 12px;
    box-shadow: none;
    border: none;
}

.country-name,
.capital-display {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--yellow-color) 0%, var(--peach-color) 100%);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    color: var(--text-color);
    text-align: center;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.option-btn img {
    max-height: 40px;
    border-radius: 6px;
}

/* Rankings Button */
.rankings-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFB347 100%) !important;
    color: var(--text-color) !important;
    border: 3px solid rgba(255, 255, 255, 0.8) !important;
}

/* Nickname Screen */
.nickname-content {
    text-align: center;
    margin: auto;
    max-width: 400px;
    width: 100%;
}

.nickname-emoji {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

#nickname-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

#nickname-message {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.nickname-form {
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 24px;
    box-shadow: var(--shadow-soft), 0 6px 0 rgba(0, 0, 0, 0.08);
    border: 3px solid rgba(255, 255, 255, 0.8);
}

#nickname-input {
    width: 100%;
    padding: 15px;
    border: 3px solid var(--primary-light);
    border-radius: 18px;
    font-family: var(--font-body);
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 10px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: rgba(255, 255, 255, 0.8);
}

#nickname-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(179, 157, 219, 0.2);
}

.nickname-hint {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 20px;
}

.nickname-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Rankings Screen Styles */
.rankings-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.rankings-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

#rankings-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--primary-color);
    flex: 1;
    margin: 0;
    text-align: left;
}

.rankings-filters {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.mode-selector,
.country-selector {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mode-selector label,
.country-selector label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-color);
}

#mode-filter,
#country-filter {
    padding: 10px;
    border: 2px solid var(--primary-light);
    border-radius: 15px;
    font-family: var(--font-body);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#mode-filter:focus,
#country-filter:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(179, 157, 219, 0.2);
}

.rankings-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.rankings-list::-webkit-scrollbar {
    width: 8px;
}

.rankings-list::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 10px;
}

.rankings-list::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

.rankings-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.ranking-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 18px;
    margin-bottom: 10px;
    box-shadow: 0 4px 10px rgba(179, 157, 219, 0.2), 0 4px 0 rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: slideIn 0.3s ease-out;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.ranking-item:hover {
    transform: translateX(5px) translateY(-2px);
    box-shadow: 0 6px 15px rgba(179, 157, 219, 0.3), 0 6px 0 rgba(0, 0, 0, 0.08);
}

.rank-position {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.rank-position.top-1 {
    color: #FFD700;
    font-size: 1.8rem;
}

.rank-position.top-2 {
    color: #C0C0C0;
    font-size: 1.7rem;
}

.rank-position.top-3 {
    color: #CD7F32;
    font-size: 1.6rem;
}

.rank-flag {
    font-size: 2rem;
    min-width: 40px;
    text-align: center;
}

.rank-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.rank-nickname {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
}

.rank-date {
    font-size: 0.8rem;
    color: #999;
}

.rank-score {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 60px;
    text-align: right;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.no-rankings {
    text-align: center;
    padding: 40px;
    color: var(--text-color);
    font-size: 1rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* Feedback Overlay */
.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    pointer-events: none;
    transition: opacity 0.3s;
}

.feedback-card {
    background: white;
    padding: 30px;
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 250px;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    border: 4px solid white;
}

.feedback-overlay:not(.hidden) .feedback-card {
    transform: scale(1);
    opacity: 1;
}

.feedback-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

.feedback-text {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.feedback-correct-answer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px dashed #eee;
    font-size: 1.1rem;
    color: var(--text-color);
}

#correct-answer-value {
    display: block;
    font-weight: 800;
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-top: 5px;
}

/* Modifier Classes */
.feedback-overlay.correct .feedback-card {
    border-color: var(--success-color);
}

.feedback-overlay.wrong .feedback-card {
    border-color: var(--error-color);
}

.feedback-overlay.correct .feedback-text {
    color: var(--success-color);
}

.feedback-overlay.wrong .feedback-text {
    color: var(--error-color);
}

.animate-pop {
    animation: popCenter 0.6s ease-out forwards;
}

@keyframes popCenter {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    20% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* Minimal pop for success */
.feedback-overlay.correct.animate-pop .feedback-card {
    animation: none;
    /* Let the overlay handle it or keep it simple */
    box-shadow: 0 10px 30px rgba(129, 199, 132, 0.4);
}

.feedback-overlay.wrong .feedback-card {
    box-shadow: 0 10px 30px rgba(239, 154, 154, 0.4);
}

/* Decorative Clouds - Capital Quest Style */
.cloud-decoration {
    position: fixed;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 100px;
    z-index: 0;
    pointer-events: none;
}

.cloud-decoration::before,
.cloud-decoration::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 100px;
}

.cloud-1 {
    width: 100px;
    height: 40px;
    top: 10%;
    left: 5%;
    animation: floatCloud 20s ease-in-out infinite;
}

.cloud-1::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 10px;
}

.cloud-1::after {
    width: 60px;
    height: 40px;
    top: -15px;
    right: 10px;
}

.cloud-2 {
    width: 120px;
    height: 45px;
    top: 15%;
    right: 8%;
    animation: floatCloud 25s ease-in-out infinite;
    animation-delay: 5s;
}

.cloud-2::before {
    width: 55px;
    height: 55px;
    top: -28px;
    left: 15px;
}

.cloud-2::after {
    width: 65px;
    height: 45px;
    top: -18px;
    right: 15px;
}

.cloud-3 {
    width: 80px;
    height: 35px;
    bottom: 20%;
    left: 10%;
    animation: floatCloud 18s ease-in-out infinite;
    animation-delay: 10s;
}

.cloud-3::before {
    width: 45px;
    height: 45px;
    top: -22px;
    left: 8px;
}

.cloud-3::after {
    width: 50px;
    height: 35px;
    top: -12px;
    right: 8px;
}

.cloud-4 {
    width: 90px;
    height: 38px;
    bottom: 25%;
    right: 12%;
    animation: floatCloud 22s ease-in-out infinite;
    animation-delay: 15s;
}

.cloud-4::before {
    width: 48px;
    height: 48px;
    top: -24px;
    left: 12px;
}

.cloud-4::after {
    width: 55px;
    height: 38px;
    top: -14px;
    right: 12px;
}

@keyframes floatCloud {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(-20px) translateX(10px);
    }
}
#app {
    width: 100%;
    height: 90vh; /* Constrain game area */
    position: relative;
    overflow: hidden; /* Keep game clipped */
    border-bottom: 5px solid white;
}

#app {
    width: 100%;
    height: 90vh;
    position: relative;
    overflow: hidden;
    border-bottom: 5px solid white;
}
