* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5f7e 100%);
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Generic entrance animation previously injected from TS */
.animate-in {
    animation: slideInUp 0.6s ease-out;
}

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

/* Header Styles */
.header {
    background: #1a334a;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2c5f7e;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-btn {
    background: #4caf50;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    cursor: pointer;
}

.menu-btn span {
    width: 20px;
    height: 3px;
    background: white;
    border-radius: 2px;
}

.chat-icon, .search-icon {
    background: #34495e;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #4caf50;
    letter-spacing: 2px;
}

.logo-img {
    height: 28px;
    width: auto;
    display: block;
}

.login-btn, .signup-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn {
    background: transparent;
    color: white;
    border: 2px solid #4caf50;
}

.login-btn:hover {
    background: #4caf50;
}

.signup-btn {
    background: #4caf50;
    color: white;
}

.signup-btn:hover {
    background: #45a049;
}

/* Main Container */
.main-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* Sidebar Styles */
.sidebar {
    width: 340px;
    flex: 0 0 340px;
    background: #1a334a;
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid #2c5f7e;
    box-sizing: border-box;
    transition: width 0.3s ease, padding 0.3s ease;
}

.promo-banners {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.promo-banner {
    flex: 1;
    background: linear-gradient(45deg, #4caf50, #66bb6a);
    padding: 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    font-size: 14px;
    font-weight: bold;
}

.promo-banner:hover {
    transform: translateY(-2px);
}

.promo-banner.vip-club {
    background: linear-gradient(45deg, #ff9800, #ffb74d);
}

.promo-character {
    font-size: 20px;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.auth-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn.login {
    background: #34495e;
    color: white;
}

.auth-btn.signup {
    background: #4caf50;
    color: white;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #b0bec5;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.nav-item:hover {
    background: #2c5f7e;
    color: white;
}

.nav-item.active {
    background: #4caf50 !important;
    color: white !important;
}

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5f7e 100%);
}

/* Promotional Cards */
.promo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.promo-card {
    background: #1a334a;
    border-radius: 15px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    border: 1px solid #2c5f7e;
    transition: transform 0.3s ease;
}

.promo-card:hover {
    transform: translateY(-5px);
}

.promo-tag {
    background: #4caf50;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 15px;
}

.promo-card h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: white;
}

.promo-card p {
    color: #b0bec5;
    margin-bottom: 20px;
    line-height: 1.4;
}

.promo-btn {
    background: #4caf50;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.promo-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.promo-graphic {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 60px;
    opacity: 0.7;
    animation: floatY 4s ease-in-out infinite;
}

.promo-image {
    width: 180px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.bonus-graphic {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bonus-coins, .bonus-stars {
    font-size: 30px;
    animation: bounce 2s infinite;
}

.bonus-text {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
    font-size: 24px;
}

.rewards-graphic {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rewards-coin {
    font-size: 40px;
    animation: spin 3s linear infinite;
}

.rewards-circle {
    background: linear-gradient(45deg, #4caf50, #8bc34a);
    color: white;
    padding: 8px 12px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-top: 10px;
}

.vip-graphic {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.vip-money {
    font-size: 40px;
}

.vip-stars {
    font-size: 20px;
    color: #ffd700;
}

/* Game Categories */
.game-categories {
    margin-bottom: 40px;
}

.category-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.filter-btn {
    background: #1a334a;
    border: 2px solid #2c5f7e;
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.filter-btn:hover, .filter-btn.active {
    background: #4caf50;
    border-color: #4caf50;
}

/* Games Section */
.games-section {
    background: #1a334a;
    border-radius: 15px;
    padding: 30px;
    border: 1px solid #2c5f7e;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-icon {
    font-size: 24px;
    color: #4caf50;
}

.section-title h2 {
    font-size: 24px;
    color: white;
    letter-spacing: 1px;
}

.section-subtitle {
    color: #b0bec5;
    margin-top: 5px;
    font-size: 14px;
}

.section-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn {
    background: #4caf50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.nav-arrow {
    background: #34495e;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.nav-arrow:hover {
    background: #4caf50;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.game-card {
    aspect-ratio: 1;
    border-radius: 12px;
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: #4caf50;
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.3);
}

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

/* Markdown content section */
.content-section {
    background: #1a334a;
    border: 1px solid #2c5f7e;
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
}

.markdown-content {
    color: #e3f2fd;
    line-height: 1.7;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    color: #ffffff;
    letter-spacing: 0.5px;
    margin: 20px 0 12px;
}

.markdown-content h1 { font-size: 28px; }
.markdown-content h2 { font-size: 24px; }
.markdown-content h3 { font-size: 20px; }
.markdown-content h4 { font-size: 18px; }
.markdown-content h5 { font-size: 16px; }
.markdown-content h6 { font-size: 14px; }

.markdown-content p { margin: 12px 0; color: #cfd8dc; }

.markdown-content ul,
.markdown-content ol {
    margin: 12px 0 16px 22px;
    padding-left: 18px;
}

.markdown-content li { margin: 6px 0; }

.markdown-content hr {
    border: 0;
    border-top: 1px solid #2c5f7e;
    margin: 24px 0;
}

.markdown-content strong { color: #ffffff; }
.markdown-content em { color: #b0bec5; }

.markdown-content a { color: #4caf50; text-decoration: underline; }
.markdown-content a:hover { color: #66bb6a; }

@media (max-width: 768px) {
    .content-section { padding: 20px; }
    .markdown-content h1 { font-size: 24px; }
    .markdown-content h2 { font-size: 20px; }
    .markdown-content h3 { font-size: 18px; }
}

/* Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

@keyframes floatY {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 15px;
    }

    .main-content {
        padding: 20px;
    }

    .promo-cards {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 10px 15px;
    }

    .logo-text {
        font-size: 18px;
    }

    .promo-banners {
        flex-direction: column;
    }

    .auth-buttons {
        flex-direction: column;
    }

    .category-filters {
        flex-wrap: wrap;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .header-left .chat-icon,
    .header-right .search-icon,
    .header-right .chat-icon {
        display: none;
    }

    /* Prevent logo overlapping auth buttons */
    .logo {
        position: static;
        left: auto;
        transform: none;
        margin: 0 auto;
    }

    .logo-img {
        height: 24px;
    }

    .header-right {
        gap: 8px;
    }

    .login-btn, .signup-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Mobile sidebar behavior */
    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        height: calc(100vh - 60px);
        z-index: 101;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        max-width: 85vw;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Backdrop behind sidebar */
    .backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 100; /* below sidebar (101), above content */
    }

    .backdrop.visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* Prevent page scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
        touch-action: none;
    }
}

/* Desktop collapse behavior */
@media (min-width: 769px) {
    .sidebar.collapsed {
        width: 0;
        flex: 0 0 0;
        padding: 0;
        border-right: 0;
        overflow: hidden;
    }
}

/* Footer */
.site-footer {
    background: #1a334a;
    border-top: 1px solid #2c5f7e;
    padding: 24px 30px;
    margin-top: 30px;
}

.site-footer .footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-footer .footer-logo img {
    height: 28px;
    width: auto;
    display: block;
}

.site-footer .footer-copy {
    color: #b0bec5;
    font-size: 14px;
}

@media (max-width: 768px) {
    .site-footer {
        padding: 20px;
    }
    .site-footer .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
