:root {
    --primary-red: #f95959;
    --secondary-red: #ff4d4d;
    --accent-gold: #ffd700;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f7f8ff;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

html {
    background-color: #959599 !important; /* Professional dark grey for desktop view */
}

body {
    background-color: #f6f7fb; 
    color: var(--text-dark);
    max-width: 450px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 70px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow-x: hidden;
    zoom: 0.9; /* Scale UI to 90% size */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Header */
header {
    background: var(--white);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.logo img {
    height: 32px;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wallet-balance {
    color: var(--primary-red);
    font-weight: 700;
    font-size: 14px;
}

.user-avatar i {
    font-size: 24px;
    color: #999;
}

.btn-login {
    padding: 6px 18px;
    border: 1.5px solid var(--primary-red);
    color: var(--primary-red);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-register {
    padding: 6px 18px;
    background: var(--primary-red);
    color: var(--white);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

/* Banner Section */
.banner-container {
    padding: 12px 16px;
    margin-top: 4px;
}

.banner-slider {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
    aspect-ratio: 16 / 7;
}

.banner-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.banner-slide {
    min-width: 100%;
    height: 100%;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Announcement */
.announcement {
    margin: 8px 16px;
    background: var(--white);
    border-radius: 25px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.announcement i {
    color: var(--primary-red);
    font-size: 18px;
}

.announcement marquee {
    flex: 1;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.detail-btn {
    background: var(--primary-red);
    color: var(--white);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    border: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Game Categories Grid */
/* Category Tabs Slider */
.category-tabs-container {
    padding: 15px;
    background: #fdfdfd;
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.category-tabs-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.category-tabs {
    display: flex;
    gap: 12px;
    min-width: max-content;
}

.category-tab {
    background: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 12px;
    min-width: 75px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: var(--transition);
    cursor: pointer;
}

.category-tab.active {
    background: linear-gradient(135deg, #ff5e5e, #ff8080);
}

.category-tab .tab-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-tab .tab-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-tab .tab-name {
    font-size: 11px;
    font-weight: 500;
    color: #666;
}

.category-tab.active .tab-name {
    color: var(--white);
    font-weight: 600;
}

/* Game Grid Layouts */
.top-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 10px 16px;
}

.small-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 0 16px 10px;
}

.game-card {
    border-radius: 12px;
    position: relative;
    color: var(--white);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.game-card.large {
    height: 100px;
}

.game-card.small {
    height: 85px;
}

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

/* Specific backgrounds - Darker & More Vibrant */
.game-card.popular {
    background: linear-gradient(135deg, #1d976c 0%, #93f9b9 100%);
}

.game-card.lottery {
    background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
}

.game-card.casino {
    background: linear-gradient(135deg, #f85032 0%, #e73827 100%);
}

.game-card.slots {
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
}

.game-card.sports {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
}

.game-card.rummy {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.game-card.phishing {
    background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
}

.game-card.original {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
}

.game-card-title {
    font-weight: 700;
    font-size: 14px;
    z-index: 2;
    position: absolute;
    right: 10px;
    bottom: 10px;
}

.card-bg-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 90%;
    height: 100%;
    object-fit: contain;
    opacity: 0.9;
    z-index: 1;
}

.game-card.small .game-card-title {
    font-size: 11px;
    right: 5px;
    bottom: 5px;
}

.game-card.small .card-bg-icon {
    width: 100%;
}

/* Platform Recommendation */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 16px 12px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
}

.view-all {
    color: var(--text-light);
    font-size: 12px;
    text-decoration: none;
    border: 1px solid #eee;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
    background: var(--white);
}

/* Winning List */
.winning-list-container {
    padding: 0 16px;
    height: 180px;
    overflow: hidden;
    position: relative;
}

.win-item {
    background: var(--white);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    animation: slideUp 10s linear infinite;
}

.win-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
}

.win-details {
    flex: 1;
}

.win-user {
    font-size: 13px;
    font-weight: 600;
}

.win-game {
    font-size: 11px;
    color: var(--text-light);
}

.win-amount {
    font-weight: 700;
    color: var(--primary-red);
    font-size: 14px;
}

@keyframes slideUp {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-300%);
    }
}

/* Rec Cards */
.rec-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 16px 20px;
}

.rec-card {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    aspect-ratio: 1 / 1.5; /* Much taller shape */
    background: #2a2a2a;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.rec-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rtp-badge {
    display: none !important;
}

/* Spinner */
.loader-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 0;
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 14px;
    color: #999;
    font-weight: 500;
}

.game-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 8px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    border-radius: 0 0 12px 12px;
    pointer-events: none;
}

.game-name-text {
    color: white;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.rtp-bar {
    display: none;
}

.rtp-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--primary-red);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
}

/* Floating Add to Desktop Button */
.desktop-fab {
    position: fixed;
    bottom: 105px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #ff7171, #f95959);
    padding: 5px 12px;
    border-radius: 30px;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(249, 89, 89, 0.3);
    z-index: 10001;
    white-space: nowrap;
    font-weight: 700;
    font-size: 11px;
    transition: var(--transition);
}

.fab-icon {
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Bottom Nav - Slimmer */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 450px;
    display: flex;
    justify-content: space-around;
    background: #ffffff !important;
    height: 58px; /* Reduced from 70px */
    box-shadow: 0 -10px 30px rgba(0,0,0,0.06);
    border-top: 1px solid rgba(0,0,0,0.02);
    align-items: center;
    z-index: 10000 !important;
}

.nav-item {
    text-decoration: none;
    color: #999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: 0.3s;
    width: 20%;
}

.nav-item i {
    font-size: 22px;
}

.nav-item span {
    font-size: 11px;
    font-weight: 600;
}

.nav-item.active {
    color: #f95959;
}

.nav-center {
    position: relative;
    width: 20%;
    display: flex;
    justify-content: center;
}

.center-btn {
    width: 80px;
    height: 80px;
    background: #ffffff;
    border: 5px solid #ffffff;
    box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    top: -30px;
    cursor: pointer;
    z-index: 2001;
}

.wheel-icon {
    width: 100%;
    height: auto;
    animation: rotate 10s linear infinite;
}

.center-btn span {
    position: absolute;
    bottom: -15px;
    font-size: 11px;
    font-weight: 700;
    width: 100px;
    text-align: center;
    color: var(--primary-red);
}

/* Game Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 20000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--white);
    width: 85%;
    max-width: 320px;
    border-radius: 20px;
    overflow: hidden;
    animation: zoomIn 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 24px 20px 10px;
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    color: var(--text-dark);
}

.modal-body {
    padding: 10px 30px 24px;
    text-align: center;
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    border-top: 1px solid #f0f0f0;
}

.modal-footer button {
    flex: 1;
    padding: 16px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel {
    border-right: 1px solid #f0f0f0 !important;
    color: var(--text-dark);
}

.btn-confirm {
    color: #007aff; /* Premium iOS-style blue */
    font-weight: 600 !important;
}

.modal-footer button:active {
    background: #f9f9f9;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}