:root {
    /* Core Colors */
    --bg-dark: #050505;
    --bg-darker: #000000;
    --bg-card: #121212;
    --text-light: #ffffff;
    --text-muted: #a0a0a0;

    /* Brand Accents */
    --accent-gold: #ffc928;
    --accent-gold-dark: #c88700;
    --accent-gold-glow: rgba(255, 201, 40, 0.5);
    --accent-purple: #d99200;
    --accent-purple-glow: rgba(217, 146, 0, 0.5);
    --accent-cyan: #ffe16b;

    /* Status Colors */
    --success-green: #00ff9d;
    --warning-orange: #ff9100;
    --danger-red: #ff004c;

    /* UI Elements */
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-radius: 16px;
    --input-radius: 12px;
    --nav-height: 70px;

    /* Gradients */
    --gradient-gold: linear-gradient(135deg, #ffe16b 0%, #e6a400 55%, #a96500 100%);
    --gradient-dark: linear-gradient(180deg, rgba(20, 20, 20, 0.8) 0%, rgba(10, 10, 10, 1) 100%);
    --gradient-glow: radial-gradient(circle at 50% 50%, rgba(255, 201, 40, 0.15) 0%, rgba(5, 5, 5, 0) 70%);
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(255, 201, 40, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255, 201, 40, 0.05) 0%, transparent 25%);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-light);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 4rem 1rem 3rem;
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Ensures content is centered */
}

.hero::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: var(--accent-gold);
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.05;
    z-index: -1;
}

.hero .logo-container {
    margin-bottom: 1.5rem;
    animation: float 6s ease-in-out infinite;
    display: flex;
    /* Flexbox for perfect centering */
    justify-content: center;
    /* horizontal center */
    align-items: center;
    /* vertical center */
    width: 100%;
    /* full width to allow centering */
}

.hero .logo {
    height: 100px;
    /* Slight adjust for neatness */
    width: auto;
    filter: drop-shadow(0 0 20px rgba(255, 201, 40, 0.2));
}

.hero h1 {
    font-size: clamp(1.5rem, 3.5vw, 2.8rem);
    /* Reduced from 2rem-4rem range */
    margin-bottom: 0.8rem;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 201, 40, 0.3);
    max-width: 90%;
}

.hero p {
    font-size: 0.95rem;
    /* Reduced from 1.1rem */
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Live Stats Dashboard */
.live-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
    margin-top: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 201, 40, 0.3);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-light);
    font-family: 'Montserrat', sans-serif;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-trend {
    font-size: 0.8rem;
    color: var(--success-green);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

/* Marquee */
.marquee-section {
    background: linear-gradient(90deg, rgba(20, 20, 20, 0.9) 0%, rgba(30, 30, 30, 0.9) 50%, rgba(20, 20, 20, 0.9) 100%);
    border-top: 1px solid var(--accent-gold);
    border-bottom: 1px solid var(--accent-gold);
    padding: 0.8rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-container {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 20s linear infinite;
}

.marquee-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

/* Marquee  mobile */
@media (max-width: 768px) {
    .marquee-section {
        padding: 0.3rem 0;
        margin-bottom: 1rem;
    }

    .marquee-container {
        padding-left: 50%;
    }

    .marquee-text {
        font-size: 0.7rem;
    }
}

/* Provider Menu - Neat Grid System */
.provider-menu {
    display: flex;
    /* Changed from grid to flex for easy centering */
    justify-content: center;
    /* Center items */
    gap: 1.5rem;
    /* Space between items */
    margin-bottom: 2.5rem;
    padding-bottom: 0.5rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    flex-wrap: wrap;
    /* Wrap if needed, but intended for single row of 5 */
}

.provider-item {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    /* Fixed width */
    height: 100px;
    /* Fixed height for square */
    aspect-ratio: 1/1;
    /* Enforce Square Shape */
}

.provider-item.active,
.provider-item:hover {
    border-color: var(--accent-gold);
    background: rgba(255, 201, 40, 0.1);
    box-shadow: inset 0 0 20px rgba(255, 201, 40, 0.05);
    transform: translateY(-3px);
}

.provider-logo {
    width: 40px;
    /* Strictly 40px */
    height: 40px;
    /* Strictly 40px */
    object-fit: contain;
    filter: grayscale(100%) brightness(1.2);
    transition: all 0.3s;
    margin-bottom: 0.5rem;
}

.provider-item.active .provider-logo,
.provider-item:hover .provider-logo {
    filter: none;
    transform: scale(1.1);
}

.provider-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: auto;
    text-align: center;
}

/* Mobile Scrollable Provider Menu (Override Grid) */
@media (max-width: 768px) {
    .provider-menu {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        /* Left align for scroll */
        overflow-x: auto;
        padding: 0 1.5rem 1.5rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
        margin: 0 -1.5rem 2rem;
        -webkit-overflow-scrolling: touch;
        scroll-padding: 0 1.5rem;
        gap: 0.8rem;
    }

    .provider-item {
        flex: 0 0 auto;
        /* Don't shrink/grow */
        width: 80px;
        /* Slightly smaller on mobile if needed, or keep 100px */
        height: 80px;
        aspect-ratio: 1/1;
        min-width: 80px;
        padding: 0.5rem;
    }

    .provider-logo {
        width: 35px;
        /* Adjust slightly for mobile square */
        height: 35px;
        margin-bottom: 0.3rem;
    }

    .provider-name {
        font-size: 0.65rem;
    }
}

/* Game Stats (Horizontal Bar) - Desktop Default */
.game-stats {
    display: flex;
    justify-content: space-around;
    background: var(--glass-bg);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.game-stats .stat-item {
    text-align: center;
}

.game-stats .stat-value {
    font-size: 1.5rem;
    color: var(--accent-gold);
}

/* Controls */
.sort-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

select#sort-by {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

select#sort-by:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.view-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.view-btn.active,
.view-btn:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--bg-dark);
}

/* Game Grid - Desktop High-End Look */
.game-grid {
    display: grid;
    /* Improved grid logic */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    padding-bottom: 4rem;
    width: 100%;
}

.game-grid.list-view {
    grid-template-columns: 1fr;
}

/* Game Card Styles */
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    /* More breathing room inside card */
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    height: 100%;

    /* Safety constraint: Prevent giant cards if grid collapses */
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* Default hover (fallback) */
.game-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold);
    box-shadow: 0 5px 20px rgba(255, 201, 40, 0.15);
}

/* Specific glows based on winrate class added by JS */
.game-card.high:hover {
    border-color: #ffe16b;
    box-shadow: 0 0 25px rgba(255, 225, 107, 0.5);
    transform: translateY(-7px) scale(1.02);
}

.game-card.medium:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 0 25px var(--accent-gold-glow);
    transform: translateY(-7px) scale(1.02);
}

.game-card.low:hover {
    border-color: #d99200;
    box-shadow: 0 0 20px rgba(255, 185, 35, 0.35);
    transform: translateY(-5px);
}

/* Card Images */
.game-card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: contain;
    background: #000;
    border-radius: 12px;
    padding: 0.5rem;
}

/* Tags */
.jackpot-tag,
.prediction-badge {
    position: absolute;
    top: 10px;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    z-index: 2;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.jackpot-tag {
    right: 10px;
    background: var(--gradient-gold);
    color: #000;
}

.prediction-badge {
    left: 10px;
    background: var(--success-green);
    color: #000;
}

/* Card Info */
.game-card .game-info {
    text-align: center;
}

.game-card .game-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
}

/* Progress Bar (Winrate) */
.progress-bar-container {
    height: 18px;
    /* Slightly slimmer */
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

/* Glowing effects based on winrate */
.progress-bar-container.high .progress-bar {
    background: linear-gradient(90deg, #ffe16b 0%, #e6a400 100%);
    box-shadow: 0 0 15px rgba(255, 201, 40, 0.5);
}

.progress-bar-container.medium .progress-bar {
    background: linear-gradient(90deg, #d99200 0%, #ffe16b 100%);
    box-shadow: 0 0 10px rgba(248, 181, 0, 0.5);
}

.progress-bar-container.low .progress-bar {
    background: linear-gradient(90deg, #b97800 0%, #e6a400 100%);
    box-shadow: 0 0 10px rgba(230, 164, 0, 0.5);
}

/* Animated stripes overlay */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(45deg,
            rgba(255, 255, 255, 0.15) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.15) 75%,
            transparent 75%,
            transparent);
    background-size: 20px 20px;
    animation: moveStripes 1s linear infinite;
    z-index: 1;
}

@keyframes moveStripes {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 20px 0;
    }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65rem;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 1);
    z-index: 2;
}

/* Card Hover Overlay */
.game-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.game-card:hover .game-hover-overlay {
    opacity: 1;
}

.game-hover-overlay i {
    font-size: 1.5rem;
    color: var(--accent-gold);
}

.game-hover-overlay span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
}

/* Withdraw Notification */
.withdraw-notification {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--success-green);
    padding: 1rem;
    border-radius: 8px;
    z-index: 9999;
    transform: translateX(-150%);
    transition: transform 0.5s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.withdraw-notification.show {
    transform: translateX(0);
}

.withdraw-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.withdraw-icon {
    color: var(--success-green);
    font-size: 1.5rem;
    animation: bounce 1s infinite alternate;
}

.withdraw-info {
    display: flex;
    flex-direction: column;
}

.withdraw-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
}

.withdraw-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-3px);
    }
}

/* Load More Button */
.load-more-btn {
    display: block;
    margin: 3rem auto;
    padding: 1rem 3rem;
    background: var(--gradient-gold);
    color: #000;
    font-weight: 800;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 30px rgba(255, 201, 40, 0.2);
}

.load-more-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 201, 40, 0.4);
}

.load-more-btn.hidden {
    display: none;
}

/* Loading Spinner */
.loading-state {
    text-align: center;
    padding: 4rem 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 201, 40, 0.2);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Social Media Button Colors */
/* Social Media Button Colors */
.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.social-btn.whatsapp {
    background: #25D366;
    /* WhatsApp Green */
    border-color: #25D366;
}

.social-btn.telegram {
    background: #0088cc;
    /* Telegram Blue */
    border-color: #0088cc;
}

.social-btn:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.social-media-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    flex-direction: column;
    /* Always vertical */
    gap: 1rem;
    z-index: 1001;
}

@media (max-width: 768px) {
    .social-media-container {
        bottom: 1.5rem;
        left: 1rem;
        /* Kept vertical (column) implicitly by not overriding common style */
        gap: 0.8rem;
    }

    .social-btn {
        width: 45px;
        /* Slightly smaller on mobile */
        height: 45px;
        font-size: 1.2rem;
    }
}

/* Modal System */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
        max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.game-tips-modal {
    background: #111;
    border: 1px solid var(--accent-gold);
    width: min(100%, 520px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(255, 201, 40, 0.15);
    max-height: min(90vh, 800px);
    max-height: min(90dvh, 800px);
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-sizing: border-box;
}

.modal-header {
    background: linear-gradient(to right, #1a1a1a, #111);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    flex: 1;
}

.modal-game-image {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 10px;
    border: 2px solid var(--accent-gold);
    object-fit: cover;
    background: var(--bg-card);
}

.modal-game-info {
    min-width: 0;
    flex: 1;
}

.modal-game-name {
    font-size: clamp(1rem, 4vw, 1.15rem);
    color: var(--accent-gold);
    margin: 0 0 0.2rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.modal-provider {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
    margin: 0;
    overflow-wrap: anywhere;
}

.tips-category {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.45rem;
    padding: 0.25rem 0.55rem;
    border: 1px solid rgba(255, 201, 40, 0.3);
    border-radius: 999px;
    color: var(--accent-gold);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.04em;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.tips-category .ui-icon {
    width: 0.85rem;
    height: 0.85rem;
    flex: 0 0 auto;
}

.close-modal {
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.close-modal:hover {
    color: var(--accent-gold);
    background: rgba(255, 201, 40, 0.12);
}

.ui-icon {
    display: block;
    width: 1.2rem;
    height: 1.2rem;
    flex: 0 0 auto;
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
    scrollbar-gutter: stable;
}

.winrate-status {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.85rem 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.35;
}

.winrate-badge {
    text-align: right;
    font-weight: 800;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.winrate-badge.high {
    color: var(--success-green);
    text-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
}

.winrate-badge.medium {
    color: var(--warning-orange);
}

.winrate-badge.low {
    color: var(--danger-red);
}

.tip-item {
    background: rgba(20, 20, 20, 0.5);
    border-left: 3px solid var(--accent-gold);
    padding: 0.9rem;
    margin-bottom: 0.75rem;
    border-radius: 0 8px 8px 0;
}

.tip-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.tip-row > .ui-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.1rem;
}

.tip-content {
    min-width: 0;
    flex: 1;
}

.tip-title {
    color: var(--text-light);
    font-weight: 700;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.tip-description {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.warning-message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem;
    border: 1px solid rgba(255, 0, 76, 0.25);
    border-radius: 10px;
    color: var(--danger-red);
}

.warning-message .ui-icon {
    margin-top: 0.1rem;
}

.warning-message p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.55;
}

.modal-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.modal-btn {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.35;
}

.modal-btn span {
    overflow-wrap: anywhere;
}

.modal-btn.primary {
    background: var(--gradient-gold);
    color: #000;
}

.modal-btn.secondary {
    background: #222;
    color: #fff;
}

@media (max-width: 600px) {
    .modal-overlay {
        padding: max(0.5rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right))
            max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
    }

    .game-tips-modal {
        width: 100%;
        max-height: min(92vh, 800px);
        max-height: min(92dvh, 800px);
        border-radius: 14px;
    }

    .modal-header {
        padding: 0.85rem;
        gap: 0.5rem;
    }

    .modal-game-image {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }

    .modal-body {
        padding: 0.9rem;
        scrollbar-gutter: auto;
    }

    .modal-footer {
        padding: 0.75rem 0.85rem;
        gap: 0.5rem;
    }

    .modal-btn {
        padding: 0.65rem 0.5rem;
        font-size: 0.82rem;
    }
}

@media (max-width: 380px) {
    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-btn {
        width: 100%;
    }

    .winrate-status {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {

    /* Mobile Stats: Force 3 Columns Side-by-Side with Tight Spacing */
    .live-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.3rem;
        margin-bottom: 1.5rem;
    }

    .stat-card {
        padding: 0.6rem 0.2rem;
        min-height: auto;
        border-radius: 8px;
    }

    .stat-value {
        font-size: 0.9rem;
        margin: 0.1rem 0;
        font-weight: 700;
    }

    .stat-label {
        font-size: 0.50rem;
        line-height: 1.1;
        opacity: 0.8;
    }

    .stat-trend {
        font-size: 0.55rem;
        margin-top: 0.1rem;
        gap: 2px;
    }

    /* Tablet/Mobile Game Grid */
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 0.5rem;
    }

    .hero {
        padding-top: 20px;
        padding-bottom: 2rem;
        margin-top: 1rem;
    }

    .hero p {
        font-size: 0.75rem;
        padding: 0 1rem;
    }

    .hero h1 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .hero .logo-container {
        margin-bottom: 0.5rem;
    }

    .hero .logo {
        height: 60px;
    }

    /* Game Stats Mobile: Single Scrollable Row */
    .game-stats {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 1rem;
        justify-content: flex-start;
        padding: 1rem;
        margin: 0 -1rem 1.5rem;
        /* Negative margin to scroll edge-to-edge */
        -webkit-overflow-scrolling: touch;
        scroll-padding: 0 1rem;
    }

    .game-stats .stat-item {
        flex: 0 0 auto;
        min-width: 100px;
        /* Ensure consistency */
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        padding: 0.8rem;
    }

    .game-stats .stat-value {
        font-size: 1.2rem;
    }

    .game-stats .stat-label {
        font-size: 0.7rem;
        white-space: nowrap;
        /* Prevent text wrap */
        margin-top: 0.2rem;
    }

    /* Sort Controls Mobile */
    .sort-controls {
        flex-direction: row;
        flex-wrap: wrap;
        /* Allow wrapping if very narrow */
        align-items: flex-end;
        /* Align bottom so dropdown matches buttons */
        gap: 0.8rem;
    }

    .sort-group {
        flex: 1;
        /* Dropdown takes all available left space */
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
    }

    .sort-group label {
        font-size: 0.75rem;
        color: var(--text-muted);
        white-space: nowrap;
    }

    select#sort-by {
        width: 100%;
        padding: 0.8rem;
    }

    .view-toggle {
        width: auto;
        flex: 0 0 auto;
        /* Don't stretch */
        display: flex;
        gap: 0.5rem;
        margin-bottom: 2px;
        /* Slight alignment fix */
    }

    /* Load More Button Adjustment for Mobile */
    .load-more-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.80rem;
        margin: 1rem auto;
        width: 80%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {

    /* Small Phone: strictly 2 columns */
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .game-card {
        padding: 0.5rem;
        min-height: auto;
        border-radius: 10px;
    }

    .game-card .game-title {
        font-size: 0.75rem;
    }

    /* Game Stats Small Mobile */
    .game-stats {
        padding: 0.8rem 1rem;
        gap: 0.8rem;
    }

    .game-stats .stat-value {
        font-size: 1.1rem;
    }
}

/* Info Section - Neat Grid */
.info-section {
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(0, 0, 0, 0) 100%);
    border-top: 1px solid var(--glass-border);
    padding: 4rem 0;
    margin-top: 4rem;
}

.info-header {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.info-card {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    text-align: left;
    transition: transform 0.3s ease;
    height: 100%;
}

.info-card:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-5px);
    border-color: var(--accent-gold);
}

.info-card i {
    font-size: 2rem;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    display: inline-block;
}

.info-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.info-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.info-content {
    background: rgba(10, 10, 10, 0.5);
    padding: 2rem;
    border-radius: 16px;
    margin-top: 3rem;
    border-left: 4px solid var(--accent-gold);
}

.info-content p {
    margin-bottom: 1rem;
    color: #ccc;
}

/* Footer - Neat 3-Column Layout */
.footer {
    background: #000;
    padding: 4rem 1rem 2rem;
    margin-top: 0;
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
}

/* Mobile Footer & Info Stack */
@media (max-width: 768px) {

    /* Info Section Adjustments */
    .info-section {
        padding: 2.5rem 0 3rem;
        /* Reduced padding */
        margin-top: 2rem;
    }

    .info-header {
        margin-bottom: 1.5rem;
        /* Much tighter */
        padding: 0 1rem;
    }

    .info-header h2 {
        font-size: 1.1rem;
        /* Smaller title */
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }

    .info-subtitle {
        font-size: 0.8rem;
        color: var(--text-muted);
        line-height: 1.4;
    }

    /* Info Grid: Horizontal Scroll with Snap */
    .info-grid {
        display: flex;
        overflow-x: auto;
        gap: 1rem;
        /* Tighter gap */
        padding-bottom: 1rem;
        margin: 1rem -1rem 2rem;
        /* Adjusted margins */
        padding-left: 1.5rem;
        /* Center start visually */
        padding-right: 1.5rem;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        /* Snap effect */
        scrollbar-width: none;
    }

    .info-grid::-webkit-scrollbar {
        display: none;
    }

    .info-card {
        flex: 0 0 240px;
        /* Smaller card width */
        width: 240px;
        scroll-snap-align: center;
        /* Snap to center */
        padding: 1.5rem;
        /* Reduced inner padding */
    }

    /* Make sure info content clears floating buttons */
    .info-content {
        padding: 1.2rem;
        padding-bottom: 3rem;
    }

    /* Footer: Neater Stack */
    .footer-content {
        grid-template-columns: 1fr 1fr;
        text-align: left;
        gap: 2rem;
    }

    .footer-section:first-child {
        grid-column: 1 / -1;
        text-align: center;
        align-items: center;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .footer-section {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-section p {
        max-width: 100%;
        text-align: center;
    }

    .footer {
        padding: 3rem 1.5rem 6rem;
    }

    /* Small Text for Mobile Info & Footer as requested */
    .info-card h3 {
        font-size: 0.85rem;
    }

    .info-card p {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .info-content p {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .footer-section h4 {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .footer-section p,
    .footer-section a {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .footer-bottom {
        font-size: 0.65rem;
    }
}

.footer-section h4 {
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.footer-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 300px;
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    margin-bottom: 0.8rem;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--text-light);
    padding-left: 5px;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.footer-bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    font-size: 0.8rem;
    color: #555;
}