/* ===============
   CSS VARIABLES - CASINO THEME
   =============== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #ffd700;
    --primary-dark: #ffb700;
    --primary-light: #ffe44d;
    --secondary-color: #dc2626;
    --secondary-light: #ef4444;
    --accent-color: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --bg-color: #0a0118;
    --bg-elevated: #1a0b2e;
    --bg-card: #2d1b4e;
    --text-primary: #ffffff;
    --text-secondary: #e0d4ff;
    --text-muted: #a78bfa;
    --border-color: #4c1d95;
    --border-light: #6d28d9;
    --border-glow: #a855f7;
    --shadow-sm: 0 2px 8px 0 rgba(139, 92, 246, 0.15);
    --shadow: 0 4px 16px rgba(139, 92, 246, 0.25), 0 0 40px rgba(255, 215, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(139, 92, 246, 0.35), 0 0 60px rgba(255, 215, 0, 0.15);
    --shadow-xl: 0 20px 50px rgba(139, 92, 246, 0.45), 0 0 80px rgba(255, 215, 0, 0.2);
    --shadow-glow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(139, 92, 246, 0.4);
    --shadow-red: 0 0 30px rgba(220, 38, 38, 0.5);
    --radius-sm: 10px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --transition-speed: 0.3s;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Montserrat', sans-serif;
}

/* ===============
   RESET
   =============== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    min-height: 100vh;
    font-family: var(--font-body);
    background: radial-gradient(ellipse at top, #1a0b2e 0%, #0a0118 50%, #000000 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 215, 0, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(220, 38, 38, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body>* {
    position: relative;
    z-index: 1;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-speed) ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===============
   GLOBAL COMPONENTS
   =============== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===============
   HEADER - CASINO GLASSMORPHISM
   =============== */
.header {
    background: rgba(26, 11, 46, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 4px 30px rgba(139, 92, 246, 0.2), 0 0 40px rgba(255, 215, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header.scroll-down {
    /* Keep header fixed, do not hide on scroll */
    transform: translateY(0);
}

.header.scroll-up {
    transform: translateY(0);
    box-shadow: 0 6px 40px rgba(139, 92, 246, 0.3), 0 0 50px rgba(255, 215, 0, 0.15);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.logo img {
    height: 32px;
    width: auto;
    object-fit: contain;
    filter: none;
    transition: transform var(--transition-speed);
}

.logo:hover img {
    transform: scale(1.05);
}

.nav-list {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-list a {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    position: relative;
    padding: 8px 12px;
    border-radius: 50px;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.nav-list a:hover,
.nav-list a.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #000;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary-color);
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #00d2ff, #3a7bd5);
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    border: none;
    transition: all 0.3s ease;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
}

.mobile-menu-toggle {
    display: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    font-size: 24px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

/* ===============
   ADS BLOCK
   =============== */
.ad-banner-container {
    margin-top: 76px;
    text-align: center;
}

.ad-banner-container a {
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.ad-banner-container img {
    width: 100%;
    height: auto;
    min-height: 50px;
    max-height: 120px;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-lg);
    transition: transform 0.5s ease;
}

.ad-banner-container a:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.ad-banner-container a:hover img {
    transform: scale(1.03);
}

/* ===============
   FOOTER - CASINO STYLE
   =============== */
.footer {
    background: linear-gradient(180deg, var(--bg-elevated) 0%, #000000 100%);
    padding: 80px 0 30px;
    margin-top: 100px;
    position: relative;
    border-top: 3px solid var(--border-glow);
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--secondary-color), var(--accent-pink));
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 48px;
    margin-bottom: 60px;
}

.footer-col h4 {
    font-family: var(--font-heading);
    font-size: 18px;
    margin-bottom: 24px;
    color: #fff;
    font-weight: 600;
    position: relative;
    padding-bottom: 12px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    box-shadow: 0 0 10px var(--primary-color);
}

.footer-col p {
    color: #94a3b8;
    line-height: 1.7;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col a {
    color: #94a3b8;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.footer-col a::before {
    content: '💎';
    font-size: 12px;
    opacity: 0;
    transition: all 0.3s;
}

.footer-col a:hover {
    color: var(--primary-color);
    padding-left: 8px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.footer-col a:hover::before {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #64748b;
    font-size: 14px;
}

/* ===============
   RESPONSIVE
   =============== */

/* Tablet and below */
@media (max-width: 992px) {
    .nav-list {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .container {
        padding: 0 20px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
}

/* Mobile landscape and below */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header .container {
        height: 56px;
        padding: 0 16px;
    }

    .logo img {
        height: 32px;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .header-right {
        gap: 6px;
        /* tighter gap for mobile header */
    }

    .nav-list {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 56px;
        left: 0;
        width: 100%;
        background: rgba(26, 11, 46, 0.98);
        backdrop-filter: blur(20px);
        padding: 0;
        border-bottom: 2px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, padding 0.4s ease;
    }

    .nav-list.active {
        max-height: 500px;
        padding: 16px 20px;
    }

    .nav-list a {
        padding: 14px 16px;
        width: 100%;
        text-align: left;
        border-radius: var(--radius-sm);
        margin: 4px 0;
    }

    .nav-list a:hover {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        transform: none;
        color: #000;
    }

    .btn-login,
    .btn-register {
        padding: 6px 10px;
        font-size: 11px;
        border-radius: 6px;
    }

    .footer {
        padding: 60px 0 24px;
        margin-top: 60px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .footer-col h4 {
        font-size: 16px;
    }

    .footer-col p,
    .footer-col a {
        font-size: 14px;
    }

    .footer-bottom {
        font-size: 13px;
        padding-top: 24px;
    }

    .ad-banner-container {
        margin-top: 66px;
        /* closer to the 56px header */
        padding: 0 10px;
    }

    .ad-banner-container img {
        height: auto;
        min-height: 40px;
        border-radius: var(--radius);
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .header .container {
        height: 50px;
        /* slightly shorter header for mobile portrait */
        padding: 0 10px;
    }

    .logo img {
        height: 28px;
    }

    .btn-login,
    .btn-register {
        padding: 5px 8px;
        font-size: 10px;
    }

    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .footer {
        padding: 40px 0 20px;
        margin-top: 40px;
    }

    .footer-grid {
        gap: 28px;
    }

    .footer-col h4 {
        font-size: 15px;
        margin-bottom: 16px;
    }

    .footer-col p,
    .footer-col a {
        font-size: 13px;
    }

    .footer-bottom {
        font-size: 12px;
        padding-top: 20px;
    }

    .ad-banner-container {
        margin-top: 60px;
        /* Adjusted for shorter header */
    }

    .ad-banner-container img {
        height: auto;
        min-height: 35px;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .header .container {
        height: 56px;
    }

    .logo img {
        height: 28px;
    }

    .btn-login,
    .btn-register {
        padding: 4px 8px;
        font-size: 10px;
    }

    .mobile-menu-toggle {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}


/* ===============
   TOUCH & MOBILE OPTIMIZATIONS
   =============== */

/* Improve touch targets */
@media (max-width: 768px) {

    a,
    button,
    .btn-login,
    .btn-register,
    .mobile-menu-toggle {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-list a {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
}

/* Prevent text selection on buttons */
button,
.btn-login,
.btn-register,
.mobile-menu-toggle {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Smooth scrolling for all devices */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}

/* Better focus states for accessibility */
a:focus-visible,
button:focus-visible,
.btn-login:focus-visible,
.btn-register:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Optimize images for mobile */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 768px) {

    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .header .container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .footer {
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .header {
        border-bottom: 3px solid var(--primary-color);
    }

    .game-card,
    .news-card,
    .feature-card {
        border-width: 3px;
    }
}

/* Dark mode adjustments (if system prefers dark) */
@media (prefers-color-scheme: dark) {
    /* Already dark theme, but can add overrides if needed */
}