/* Global Utility */
.hidden {
    display: none !important;
}

:root {
    /* DEFAULT: Clean Light Theme */
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-main: #333333;
    --text-sub: #666666;
    --accent-color: #FF6B6B;
    /* Soft Coral Red/Pink */
    --accent-glow: none;
    --danger-color: #FF4757;
    --header-bg: rgba(255, 255, 255, 0.95);
    --nav-bg: #FFFFFF;
    --border-color: #E0E0E0;

    --font-main: 'Inter', sans-serif;
    --font-retro: 'Press Start 2P', cursive;
    --bottom-nav-height: 60px;
    --header-height: 60px;
}

/* CYBERPUNK THEME (Optional) */
body.theme-cyberpunk {
    --bg-color: #0F0F0F;
    --card-bg: #1A1A1A;
    --text-main: #FFFFFF;
    --text-sub: #888888;
    --accent-color: #00FF99;
    --accent-glow: 0 0 10px rgba(0, 255, 153, 0.5);
    --danger-color: #FF0055;
    --header-bg: rgba(15, 15, 15, 0.95);
    --nav-bg: #151515;
    --border-color: #333333;
}

* {
    box-sizing: border-box;
    user-select: none;
    /* Prevent text selection for app-like feel */
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    overscroll-behavior-y: none;
    /* Prevent pull-to-refresh */
    padding-bottom: 120px;
    /* Increased to prevent cut-off by banner */
}

/* Header */
.mobile-header {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-family: var(--font-retro);
    font-size: 14px;
    letter-spacing: -1px;
}

.highlight {
    color: var(--accent-color);
    text-shadow: var(--accent-glow);
}

.lang-switch button {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-sub);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
}

/* Ranking Marquee */
.ranking-marquee {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    white-space: nowrap;
    height: 30px;
    display: flex;
    align-items: center;
    position: sticky;
    top: var(--header-height);
    z-index: 99;
}

.marquee-label {
    background: var(--nav-bg);
    padding: 0 10px;
    font-weight: bold;
    font-size: 11px;
    color: var(--danger-color);
    z-index: 2;
    /* On top */
    height: 100%;
    display: flex;
    align-items: center;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.marquee-content {
    flex: 1;
    /* Take remaining space */
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.marquee-track {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 240s linear infinite;
    padding-left: 100%;
    /* Start off-screen */
    color: var(--accent-color);
    font-family: var(--font-retro);
    font-size: 10px;
}

.marquee-item {
    display: inline-block;
    margin-right: 30px;
}

@keyframes marquee {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-100%, 0);
    }
}

/* Hot Section */
.hot-section {
    padding: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 15px 0;
}

.game-card.featured {
    width: 100%;
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    /* Lighter shadow default */
    transition: transform 0.1s;
}

body.theme-cyberpunk .game-card.featured {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.game-card.featured:active {
    transform: scale(0.98);
}

.game-card .badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 1;
}

.game-card.featured .thumbnail {
    height: 180px;
    width: 100%;
}

.game-card.featured .info {
    padding: 15px;
}

.game-card h3 {
    margin: 0;
    font-size: 16px;
    margin-bottom: 5px;
}

.game-card p {
    margin: 0;
    font-size: 12px;
    color: var(--text-sub);
}

/* Game Grid */
.game-grid-section {
    padding: 0 20px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.game-card.small {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    padding-bottom: 10px;
}

.game-card .thumbnail {
    height: 120px;
    background-color: #333;
    /* Fallback */
    background-size: cover;
    background-position: center;
    width: 100%;
}

.game-card.small h3 {
    font-size: 11px;
    margin: 5px 0 0 0;
    color: var(--text-sub);
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background: var(--nav-bg);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-sub);
    font-size: 10px;
    gap: 4px;
}

.nav-item.active {
    color: var(--accent-color);
}

.nav-item .icon {
    font-size: 20px;
}

/* Game Runner */
/* Game Runner Overlay - Unified Resolution */
#game-runner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.98);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-frame {
    width: 100%;
    height: 100%;
    /* Forced Mobile Aspect Ratio on Desktop */
    max-width: 450px;
    max-height: 800px;
    border: none;
    background: #000;
    box-shadow: 0 0 50px rgba(0, 0, 0, 1);
    border-radius: 0;
    aspect-ratio: 9 / 16;
}

#close-game-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 6000;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
}

#close-game-btn:hover {
    transform: scale(1.1);
}

/* Install Banner */
.install-banner {
    position: fixed;
    bottom: 90px;
    /* Raised above bottom nav */
    left: 20px;
    right: 20px;
    background: var(--accent-color);
    color: #000;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
    box-shadow: 0 5px 15px rgba(0, 255, 153, 0.3);
}

.hidden {
    display: none;
}

/* Search Overlay */
#search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2500;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

#search-overlay.hidden {
    display: none;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: #333;
    border-radius: 25px;
    padding: 10px 15px;
    border: 1px solid #444;
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    margin-left: 10px;
    font-size: 16px;
    width: 100%;
    outline: none;
}

#close-search-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.search-results {
    flex: 1;
    overflow-y: auto;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.search-item:hover {
    background: #222;
}

.search-item img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    margin-right: 15px;
    object-fit: cover;
}

.search-item-info h4 {
    margin: 0;
    color: var(--text-main);
    font-size: 16px;
}

.search-item-info p {
    margin: 5px 0 0;
    color: #888;
    font-size: 12px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

/* Coin Display Removed */

.header-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    margin-right: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide theme button on very small screens if needed, or just shrink padding */
@media (max-width: 360px) {
    #theme-btn {
        display: none;
    }

    .header-btn {
        font-size: 16px;
        margin-right: 2px;
    }

    #coin-display {
        font-size: 10px;
        padding: 4px 6px;
        max-width: 100px;
    }

    .mobile-header {
        padding: 0 10px;
        /* Reduce padding */
    }
}

#search-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--accent-color);
    border-radius: 15px;
    padding: 25px;
    width: 85%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 255, 153, 0.3);
}

.modal-content h2 {
    margin-top: 0;
    color: #00ff99;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group label {
    display: block;
    color: #aaa;
    margin-bottom: 5px;
    font-size: 12px;
}

.input-group select,
.input-group input {
    width: 100%;
    padding: 10px;
    background: #333;
    border: 1px solid #444;
    color: white;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

#submit-score-btn {
    width: 100%;
    background: #00ff99;
    color: black;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

#submit-score-btn:hover {
    background: #00cc7a;
}

/* Hot Carousel */
.hot-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    /* Hide scrollbar */
    scrollbar-width: none;
}

.hot-carousel::-webkit-scrollbar {
    display: none;
}

.hot-carousel .game-card.featured {
    flex: 0 0 85%;
    scroll-snap-align: center;
}

/* Autocomplete Styles */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 3001;
    text-align: left;
}

/* Profile Modal Country Dropdown Overrides */
#profile-modal #country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: #1a1a1a;
    border: 1px solid #00ff99;
    border-radius: 8px;
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
}

#profile-modal #country-dropdown.hidden {
    display: none !important;
}

#profile-modal #country-dropdown:not(.hidden) {
    display: block !important;
}

#profile-modal #country-list {
    max-height: 180px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #333;
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.autocomplete-item:hover {
    background: #00ff99;
    color: black;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.flag {
    font-size: 18px;
}

/* Desktop Responsiveness */
@media (min-width: 768px) {
    #app {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
        min-height: 100vh;
        background: var(--bg-color);
        position: relative;
    }

    body {
        background: #E0E0E0;
        /* Light gray outer bg for desktop default */
    }

    body.theme-cyberpunk {
        background: #050505;
    }

    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }

    .install-banner {
        max-width: 440px;
        left: 50%;
        transform: translateX(-50%);
    }

    .mobile-header,
    .ranking-marquee {
        max-width: 480px;
        /* Constrain header width too */
        margin: 0 auto;
        /* Center it */
        /* Since they are sticky, they need careful positioning in a centered container.
           Standard sticky works within the #app container if #app has overflow visible (default).
        */
    }

    /* Fix sticky header centering issue on desktop */
    .mobile-header {
        position: sticky;
        width: 100%;
    }

    .ranking-marquee {
        position: sticky;
        width: 100%;
        top: 60px;
        /* Ensure it sticks below header */
    }

    /* Modal adjustments */
    .modal-content {
        max-width: 400px;
    }

    /* Hot Carousel Items */
    .hot-carousel .game-card.featured {
        flex: 0 0 300px;
        /* Fixed width on desktop instead of percentage */
    }
}

/* --- Ranking View and Social Styles --- */
#ranking-view {
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.ranking-header h2 {
    text-align: center;
    color: var(--accent-color);
    margin-bottom: 20px;
    font-family: var(--font-retro);
    font-size: 18px;
}

/* Consolidate Rankings Style - Force Stack */
.country-podium {
    display: flex;
    flex-direction: column !important;
    /* Force vertical stack */
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.ranking-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Old Podium spots removed */

/* Social Share Buttons */
.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.share-btn.twitter {
    background: #1DA1F2;
}

.share-btn.facebook {
    background: #4267B2;
}

.share-btn.copy {
    background: #555;
}

/* New Record Animation */
.new-record-anim {
    animation: bounce 1s infinite alternate;
    color: #FF4757;
    text-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-5px);
    }
}

.podium-spot.rank-2 {
    height: 75%;
    background: linear-gradient(to bottom, silver, var(--card-bg));
    border-color: silver;
}

.podium-spot.rank-3 {
    height: 60%;
    background: linear-gradient(to bottom, #cd7f32, var(--card-bg));
    border-color: #cd7f32;
}

.podium-spot .flag {
    font-size: 32px;
    margin-bottom: 5px;
}

.podium-spot .country-code {
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 5px;
    font-size: 14px;
}

.podium-spot .score-count {
    font-size: 10px;
    opacity: 0.8;
    margin-bottom: 10px;
    color: var(--text-sub);
    font-weight: bold;
}

.podium-spot .rank-badge {
    position: absolute;
    width: 24px;
    height: 24px;
    bottom: -12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rank-1 .rank-badge {
    background: gold;
}

.rank-2 .rank-badge {
    background: silver;
}

.rank-3 .rank-badge {
    background: #cd7f32;
}

.live-timeline-container h3 {
    margin-bottom: 15px;
    border-left: 4px solid var(--accent-color);
    padding-left: 10px;
    font-size: 16px;
}

.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.t-avatar {
    font-size: 24px;
    background: var(--bg-color);
    padding: 8px;
    border-radius: 50%;
}

.t-info {
    flex: 1;
    overflow: hidden;
}

.t-header {
    font-size: 14px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.t-game {
    color: var(--accent-color);
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.t-score {
    color: var(--text-main);
    font-weight: bold;
}

.t-details {
    font-size: 11px;
    color: var(--text-sub);
    opacity: 0.8;
}

#install-banner {
    display: none;
    /* Hidden by default */
    position: fixed;
    bottom: 80px;
    /* Above bottom nav */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid var(--neon-green);
    padding: 12px 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 255, 153, 0.2);
    z-index: 9999;
    /* Ensure it's on top but check overlap */
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    animation: slideUp 0.3s ease-out;
}

#install-banner p {
    margin: 0;
    font-size: 0.9rem;
    color: #fff;
    flex-grow: 1;
}

#install-button {
    background: var(--neon-green);
    color: #000;
    border: none;
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
    margin-left: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

#install-button:active {
    transform: scale(0.95);
}

#install-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 10px;
    padding: 0 5px;
    transition: transform 0.1s;
}

.profile-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.replay-btn {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
}

.replay-btn:active {
    transform: scale(0.95);
}

@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Favorites System Styles */
.fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    font-size: 16px;
    transition: transform 0.2s, background 0.2s;
}

.fav-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.7);
}

.fav-btn.active {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

.fav-btn.active .icon {
    color: #FF4757;
    animation: pulse 0.3s;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }

    100% {
        transform: scale(1);
    }
}

/* Game Overlay Fix */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    /* Fixed height */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 60px 0 10px;
    /* Right padding for Close Btn */
    box-sizing: border-box;
    pointer-events: none;
    z-index: 2002;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
}

.top-ranks {
    color: #fff;
    font-size: 10px;
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
    gap: 10px;
    pointer-events: auto;
    text-shadow: 1px 1px 2px black;
    max-width: 60%;
    /* Prevent hitting right side */
}

.top-ranks span {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 5px;
    border-radius: 4px;
}

/* Close Button Adjustment */
#close-game-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 2003;
    /* Above overlay */
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: 2px solid white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 10px var(--danger-color);
}

.controls .help-btn {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #fff;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    font-weight: bold;
}

/* --- Phase 2: Growth & Scale Styles --- */

/* Settings Modal */
.settings-content {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    width: 300px;
    text-align: left;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 16px;
    color: var(--text-main);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

/* Daily Reward Popup */
.daily-reward-popup {
    text-align: center;
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.reward-chest {
    font-size: 60px;
    margin: 20px 0;
    animation: bounce 1s infinite alternate;
}

.streak-count {
    color: var(--accent-color);
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    font-family: var(--font-retro);
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Invite Modal Removed */

/* --- Rankings UI Refinement --- */
#ranking-view {
    padding: 20px;
    animation: fadeIn 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 100px;
    /* Space for bottom nav */
}

.ranking-header {
    text-align: center;
    margin-bottom: 10px;
}

.ranking-header h2 {
    font-family: var(--font-retro);
    font-size: 16px;
    color: var(--accent-color);
    margin: 0;
}

.country-championship-title {
    color: #00ff99;
    font-size: 14px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.podium-item {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    padding: 12px 15px;
    border-radius: 12px;
    border-left: 4px solid #444;
    margin-bottom: 8px;
    transition: transform 0.2s;
}

.podium-item:hover {
    transform: translateX(5px);
}

.rank-medal {
    font-size: 24px;
    width: 35px;
    font-weight: bold;
    display: flex;
    justify-content: center;
}

.rank-number {
    font-size: 18px;
    width: 35px;
    font-weight: bold;
    color: #888;
    text-align: center;
}

.flag-icon-container {
    margin-right: 12px;
    display: flex;
    align-items: center;
}

.podium-info {
    flex-grow: 1;
}

.podium-name {
    font-weight: bold;
    color: white;
    font-size: 15px;
}

.podium-games {
    font-size: 11px;
    color: #666;
}

.podium-points-box {
    text-align: right;
}

.points-val {
    font-size: 18px;
    font-weight: bold;
    color: #00ff99;
}

.points-unit {
    font-size: 10px;
    color: #888;
    margin-left: 2px;
}

.points-info-card {
    padding: 20px;
    background: #111;
    border-radius: 15px;
    border: 1px solid #333;
    width: 100%;
    /* Ensure full width to prevent overlap */
    box-sizing: border-box;
}

.points-info-header {
    font-size: 11px;
    color: #666;
    margin-bottom: 10px;
}

.points-tag-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns (5 rows total) */
    gap: 8px;
}

.point-tag {
    background: #1a1a1a;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #333;
}

.tag-rank {
    font-weight: bold;
}

.tag-plus {
    color: #00ff99;
}

.live-feed-header {
    font-size: 18px;
    font-weight: 800;
    margin: 20px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-list {
    list-style: none;
    padding: 0;
}

.timeline-entry {
    margin-bottom: 10px;
    padding: 12px;
    background: #1a1a1a;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entry-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.entry-flag {
    width: 24px;
    height: 18px;
}