/* ========================================
   ENHANCED REPLAY CSS - MOBILE-FIRST RESPONSIVE MODALS
   Full-screen modals + CSV-compatible design
======================================== */

:root {
  /* === Enhanced Design Tokens === */
  --color-primary: #6366f1;
  --color-secondary: #8b5cf6;
  --color-accent: #f59e0b;
  --color-background: #0a0f1c;
  --color-surface: #1e293b;
  --color-card: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  --status-success: #10b981;
  --status-warning: #f59e0b;
  --status-error: #ef4444;

  /* Game Dynamic Colors (JS controlled) */
  --game-primary: var(--color-accent);
  --game-secondary: #d97706;
  --game-gradient: linear-gradient(135deg, var(--game-primary), var(--game-secondary));

  /* Typography Scale */
  --fs-heading-xl: clamp(28px, 6vw, 48px);
  --fs-heading-l: clamp(22px, 5vw, 32px);
  --fs-heading-m: clamp(18px, 4vw, 24px);
  --fs-heading-s: clamp(16px, 3vw, 20px);
  --fs-body-l: clamp(14px, 2.5vw, 18px);
  --fs-body-m: clamp(13px, 2vw, 16px);
  --fs-body-s: clamp(12px, 1.8vw, 14px);
  --fs-caption: clamp(10px, 1.5vw, 12px);

  /* Spacing System */
  --sp-xs: 4px; --sp-sm: 8px; --sp-md: 12px; --sp-lg: 16px;
  --sp-xl: 24px; --sp-2xl: 32px; --sp-3xl: 48px; --sp-4xl: 64px;

  /* Layout Constants */
  --layout-header: 70px;
  --layout-bottom-nav: 80px;
  --layout-touch: 48px;
  
  /* Border Radius */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px;
  --radius-xl: 20px; --radius-2xl: 28px; --radius-full: 9999px;

  /* Shadows (Performance Optimized) */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
  
  /* Transitions */
  --transition-fast: 0.15s ease-out;
  --transition-normal: 0.2s ease-out;
  --transition-slow: 0.3s ease-out;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Z-Index Scale */
  --z-header: 1000;
  --z-modal: 2000;
  --z-toast: 3000;
}

/* === BASE STYLES === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', system-ui, sans-serif;
    background: var(--color-background);
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.06) 0%, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.app-container {
    max-width: 100vw;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* === ENHANCED HEADER === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--layout-header);
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: var(--z-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--sp-lg);
    transition: all var(--transition-normal);
}

.header.scrolled {
    background: rgba(30, 41, 59, 0.95);
    box-shadow: var(--shadow-md);
}

.logo {
    font-size: var(--fs-heading-s);
    font-weight: 800;
    background: var(--game-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    gap: var(--sp-lg);
    align-items: center;
}

.header-btn {
    width: var(--layout-touch);
    height: var(--layout-touch);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 20px;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

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

/* === MAIN CONTENT === */
.main-content {
    margin-top: var(--layout-header);
    padding-bottom: var(--layout-bottom-nav);
    min-height: calc(100vh - var(--layout-header) - var(--layout-bottom-nav));
}

/* === ENHANCED HERO SECTION === */
.hero-section {
    position: relative;
    height: clamp(400px, 60vh, 700px);
    background: linear-gradient(0deg, var(--color-background) 0%, rgba(20,20,20,0.4) 40%, transparent 70%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    margin-bottom: var(--sp-2xl);
}

.hero-background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.6) blur(1px);
    transform: scale(1.05);
    z-index: 1;
    transition: all var(--transition-slow);
}

.hero-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(10, 15, 28, 0.3) 30%,
        rgba(10, 15, 28, 0.7) 70%,
        rgba(10, 15, 28, 0.9) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: var(--sp-2xl) var(--sp-lg) var(--sp-3xl);
    max-width: 600px;
}

.hero-title {
    font-size: var(--fs-heading-xl);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--sp-lg);
    text-shadow: 2px 4px 12px rgba(0, 0, 0, 0.8);
    color: var(--text-primary);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: var(--sp-lg);
    margin-bottom: var(--sp-lg);
    font-size: var(--fs-body-s);
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.hero-multiplier {
    background: var(--game-gradient);
    color: white;
    padding: var(--sp-sm) var(--sp-lg);
    border-radius: var(--radius-full);
    font-weight: 800;
    font-size: var(--fs-body-l);
    box-shadow: var(--shadow-md);
    text-shadow: none;
}

.hero-description {
    font-size: var(--fs-body-l);
    color: var(--text-secondary);
    margin-bottom: var(--sp-xl);
    line-height: 1.5;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.8);
}

.hero-buttons {
    display: flex;
    gap: var(--sp-lg);
    flex-wrap: wrap;
}

.hero-btn {
    padding: var(--sp-lg) var(--sp-2xl);
    border: none;
    border-radius: var(--radius-xl);
    font-size: var(--fs-body-l);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    min-height: 56px;
    flex: 1;
    justify-content: center;
    min-width: 140px;
}

.hero-btn-primary {
    background: white;
    color: #000000;
    box-shadow: var(--shadow-lg);
}

.hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.hero-btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
}

.hero-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

.hero-btn:active {
    transform: scale(0.98);
}

/* === AFFILIATE SLIDER === */
.affiliate-section {
    margin: var(--sp-3xl) 0;
    padding: 0 var(--sp-lg);
}

.section-header {
    font-size: var(--fs-heading-s);
    font-weight: 700;
    margin-bottom: var(--sp-xl);
    padding: 0;
    color: var(--text-primary);
}

.slider-container {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--sp-sm);
}

.slider-container::-webkit-scrollbar {
    display: none;
}

.slider-track {
    display: flex;
    gap: var(--sp-lg);
    width: max-content;
    padding-right: var(--sp-lg);
}

.affiliate-card {
    width: 320px;
    height: 140px;
    background: var(--game-gradient);
    border-radius: var(--radius-xl);
    padding: var(--sp-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.affiliate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.affiliate-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

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

.affiliate-content {
    display: flex;
    align-items: center;
    gap: var(--sp-lg);
    height: 100%;
}

.affiliate-logo {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #333;
    flex-shrink: 0;
    font-size: var(--fs-body-l);
    box-shadow: var(--shadow-sm);
}

.affiliate-info {
    flex: 1;
    color: white;
}

.affiliate-name {
    font-size: var(--fs-heading-s);
    font-weight: 800;
    margin-bottom: var(--sp-xs);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.affiliate-bonus {
    font-size: var(--fs-body-m);
    opacity: 0.95;
    margin-bottom: var(--sp-sm);
    font-weight: 500;
}

.affiliate-features {
    display: flex;
    gap: var(--sp-sm);
    flex-wrap: wrap;
}

.feature-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: var(--sp-xs) var(--sp-sm);
    border-radius: var(--radius-sm);
    font-size: var(--fs-caption);
    font-weight: 600;
    backdrop-filter: blur(4px);
}

/* === FILTERS SECTION === */
.filters-section {
    padding: var(--sp-xl) var(--sp-lg);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: var(--sp-2xl);
}

.filter-header {
    font-size: var(--fs-heading-s);
    font-weight: 700;
    margin-bottom: var(--sp-lg);
    color: var(--text-primary);
}

.search-container {
    position: relative;
    margin-bottom: var(--sp-lg);
}

.search-input {
    width: 100%;
    padding: var(--sp-lg) var(--sp-lg) var(--sp-lg) 48px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-size: var(--fs-body-m);
    backdrop-filter: blur(4px);
    transition: all var(--transition-normal);
    min-height: var(--layout-touch);
}

.search-input:focus {
    outline: none;
    border-color: var(--game-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: rgba(255, 255, 255, 0.12);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: var(--sp-lg);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 20px;
}

.filter-tabs {
    display: flex;
    gap: var(--sp-sm);
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: var(--sp-sm);
    -webkit-overflow-scrolling: touch;
}

.filter-tabs::-webkit-scrollbar {
    display: none;
}

.filter-tab {
    padding: var(--sp-md) var(--sp-lg);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--fs-body-s);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 40px;
}

.filter-tab.active {
    background: var(--game-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}

.filter-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.filter-tab:active {
    transform: scale(0.96);
}

/* === CATEGORY SECTIONS === */
.category-section {
    margin-bottom: var(--sp-3xl);
    padding: 0 var(--sp-lg);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-xl);
}

.category-header h2 {
    font-size: var(--fs-heading-s);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.see-all-btn {
    background: none;
    border: none;
    color: var(--game-primary);
    font-size: var(--fs-body-s);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    padding: var(--sp-sm) var(--sp-md);
    border-radius: var(--radius-md);
}

.see-all-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(2px);
}

.see-all-btn:active {
    transform: scale(0.96);
}

.category-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-left: calc(var(--sp-lg) * -1);
    margin-right: calc(var(--sp-lg) * -1);
    padding-left: var(--sp-lg);
    padding-right: var(--sp-lg);
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.card-row {
    display: flex;
    gap: var(--sp-lg);
    width: max-content;
    padding-bottom: var(--sp-sm);
}

/* === ENHANCED GAME CARDS === */
.game-card {
    position: relative;
    width: 160px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.game-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: var(--shadow-xl);
    border-color: rgba(255, 255, 255, 0.2);
}

.game-card:active {
    transform: translateY(-2px) scale(1.01);
}

.game-card-image {
    width: 100%;
    height: 120px;
    background: var(--color-surface);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: var(--fs-body-s);
    font-weight: 700;
    color: white;
    text-align: center;
    padding: var(--sp-md);
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
}

.game-card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

.game-card-info {
    padding: var(--sp-lg);
    background: rgba(255, 255, 255, 0.02);
}

.game-card-title {
    font-size: var(--fs-body-m);
    font-weight: 600;
    margin-bottom: var(--sp-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.game-card-subtitle {
    font-size: var(--fs-body-s);
    color: var(--text-muted);
}

.multiplier-badge {
    position: absolute;
    top: var(--sp-sm);
    right: var(--sp-sm);
    background: var(--game-gradient);
    color: white;
    font-size: var(--fs-body-s);
    font-weight: 800;
    padding: var(--sp-xs) var(--sp-sm);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(4px);
}

.new-badge {
    position: absolute;
    top: var(--sp-sm);
    left: var(--sp-sm);
    background: var(--status-success);
    color: white;
    font-size: var(--fs-caption);
    font-weight: 700;
    padding: var(--sp-xs) var(--sp-sm);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rank-badge {
    position: absolute;
    top: var(--sp-sm);
    left: var(--sp-sm);
    background: var(--game-gradient);
    color: white;
    font-size: var(--fs-caption);
    font-weight: 800;
    padding: var(--sp-xs) var(--sp-sm);
    border-radius: var(--radius-sm);
    min-width: 24px;
    text-align: center;
}

/* === FULL-SCREEN MODAL SYSTEM (Mobile-First) === */
.game-detail-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: var(--z-modal);
    display: none;
    overflow-y: auto;
    overscroll-behavior: none;
}

.game-detail-modal.active {
    display: block;
}

/* Mobile-First: Full-Screen Modal */
.modal-content {
    width: 100%;
    height: 100%;
    background: var(--color-background);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Modal Header (Mobile-Optimized) */
.modal-header {
    position: sticky;
    top: 0;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: var(--sp-lg) var(--sp-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    min-height: var(--layout-header);
}

.modal-title {
    font-size: var(--fs-heading-s);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.close-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

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

/* Modal Body (Scrollable Content) */
.modal-body {
    flex: 1;
    padding: var(--sp-xl) var(--sp-lg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Enhanced Game Player (Full-Screen Ready) */
.game-player {
    width: 100%;
    height: clamp(250px, 50vh, 500px);
    background: #000;
    border-radius: var(--radius-lg);
    margin-bottom: var(--sp-xl);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.game-player.loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-iframe {
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.game-iframe.loaded {
    opacity: 1;
}

/* Video Error State */
.video-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-lg);
    padding: var(--sp-3xl);
    text-align: center;
    color: var(--text-secondary);
}

.error-icon {
    font-size: 64px;
    opacity: 0.6;
}

.error-title {
    font-size: var(--fs-heading-s);
    font-weight: 600;
    color: var(--text-primary);
}

.error-description {
    font-size: var(--fs-body-m);
    margin-bottom: var(--sp-lg);
}

.error-actions {
    display: flex;
    gap: var(--sp-lg);
    flex-wrap: wrap;
    justify-content: center;
}

/* Play Real Money Button (Enhanced) */
.play-real-money-btn {
    width: 100%;
    padding: var(--sp-xl);
    background: var(--game-gradient);
    border: none;
    border-radius: var(--radius-xl);
    color: white;
    font-size: var(--fs-body-l);
    font-weight: 700;
    cursor: pointer;
    margin-bottom: var(--sp-xl);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.play-real-money-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.play-real-money-btn:hover::before {
    left: 100%;
}

.play-real-money-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.play-real-money-btn:active {
    transform: scale(0.98);
}

/* === FREESPIN CTA SECTION (Under Play Button) === */
.freespin-cta-section {
    margin: var(--sp-xl) 0;
    padding: var(--sp-xl);
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(8px);
}

.freespin-header {
    text-align: center;
    margin-bottom: var(--sp-xl);
}

.freespin-title {
    font-size: var(--fs-heading-s);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--sp-sm);
}

.freespin-subtitle {
    font-size: var(--fs-body-s);
    color: var(--text-secondary);
}

.freespin-events {
    display: flex;
    flex-direction: column;
    gap: var(--sp-lg);
}

/* Compact Event Cards (For Modal) */
.compact-event-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--sp-lg);
    transition: all var(--transition-normal);
}

.compact-event-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.event-card-header {
    display: flex;
    align-items: center;
    gap: var(--sp-lg);
    margin-bottom: var(--sp-md);
}

.casino-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: white;
    flex-shrink: 0;
}

.casino-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.casino-info {
    flex: 1;
}

.casino-name {
    font-size: var(--fs-body-m);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--sp-xs);
}

.casino-badges {
    display: flex;
    gap: var(--sp-xs);
    flex-wrap: wrap;
}

.trust-badge {
    background: var(--status-success);
    color: white;
    padding: 2px var(--sp-sm);
    border-radius: var(--radius-sm);
    font-size: var(--fs-caption);
    font-weight: 600;
}

.bonus-amount {
    font-size: var(--fs-body-l);
    font-weight: 800;
    color: var(--color-accent);
    text-align: center;
    min-width: 80px;
}

.event-content {
    margin-bottom: var(--sp-lg);
}

.event-title {
    font-size: var(--fs-body-m);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-sm);
}

.event-description {
    font-size: var(--fs-body-s);
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: var(--sp-sm);
}

.event-validity {
    font-size: var(--fs-caption);
    color: var(--status-warning);
    font-weight: 600;
}

.event-actions {
    text-align: center;
}

.compact-cta-btn {
    background: var(--game-gradient);
    color: white;
    border: none;
    padding: var(--sp-md) var(--sp-xl);
    border-radius: var(--radius-lg);
    font-size: var(--fs-body-m);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    min-width: 120px;
}

.compact-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.compact-cta-btn:active {
    transform: scale(0.98);
}

/* === RECOMMENDED SECTION (Modal Bottom) === */
.recommended-section {
    margin-top: var(--sp-3xl);
    padding-top: var(--sp-xl);
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.recommended-header {
    font-size: var(--fs-heading-s);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--sp-xl);
    text-align: center;
}

.recommended-scroll {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;     /* dış kaydırmaları etkilemesin */
  scroll-snap-type: x proximity;      /* kartlara hizalı kaydırma */
  margin-left: calc(var(--sp-lg) * -1);
  margin-right: calc(var(--sp-lg) * -1);
  padding-left: var(--sp-lg);
  padding-right: var(--sp-lg);
}
.recommended-card { scroll-snap-align: start; }

.recommended-scroll::-webkit-scrollbar {
    display: none;
}

.recommended-track {
    display: flex;
    gap: var(--sp-lg);
    width: max-content;
    padding-bottom: var(--sp-sm);
}

.recommended-card {
    width: 140px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.recommended-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg);
}

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

.recommended-thumbnail {
    width: 100%;
    height: 80px;
    position: relative;
    background: var(--color-surface);
    overflow: hidden;
}

.recommended-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recommended-multiplier {
    position: absolute;
    top: var(--sp-xs);
    right: var(--sp-xs);
    background: rgba(0, 0, 0, 0.8);
    color: var(--color-accent);
    padding: 2px var(--sp-sm);
    border-radius: var(--radius-sm);
    font-size: var(--fs-caption);
    font-weight: 700;
    backdrop-filter: blur(4px);
}

.recommended-info {
    padding: var(--sp-md);
}

.recommended-title {
    font-size: var(--fs-body-s);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recommended-time {
    font-size: var(--fs-caption);
    color: var(--text-muted);
}

/* === CASINO POPUP (Freespin Events) === */
.casino-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--sp-lg);
    overflow-y: auto;
}

.casino-popup.active {
    display: flex;
}

.casino-popup-content {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-2xl);
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
}

.casino-popup-header {
    padding: var(--sp-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.casino-popup-title {
    font-size: var(--fs-heading-s);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.casino-list {
    padding: var(--sp-xl);
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* === BOTTOM NAVIGATION (Enhanced) === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--layout-bottom-nav);
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: var(--z-header);
    padding: 0 var(--sp-lg);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-xs);
    cursor: pointer;
    transition: all var(--transition-normal);
    padding: var(--sp-sm);
    border-radius: var(--radius-lg);
    min-width: 60px;
    min-height: 60px;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--game-gradient);
    opacity: 0;
    border-radius: var(--radius-lg);
    transition: opacity var(--transition-normal);
}

.nav-item.active::before {
    opacity: 0.15;
}

.nav-item.active {
    color: var(--game-primary);
    transform: translateY(-2px);
}

.nav-item:hover:not(.active) {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-icon {
    font-size: 22px;
    transition: transform var(--transition-normal);
    position: relative;
    z-index: 1;
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-label {
    font-size: var(--fs-caption);
    font-weight: 600;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* === LOADING STATES === */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-3xl);
    color: var(--text-secondary);
    flex-direction: column;
    gap: var(--sp-lg);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--game-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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


/* === EMPTY STATES === */
.empty-state {
    text-align: center;
    padding: var(--sp-4xl);
    color: var(--text-muted);
}

.empty-icon {
    font-size: 80px;
    margin-bottom: var(--sp-xl);
    opacity: 0.5;
}

.empty-state h4 {
    font-size: var(--fs-heading-s);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--sp-md);
}

.empty-state p {
    font-size: var(--fs-body-m);
    line-height: 1.5;
}

/* === RESPONSIVE DESIGN === */

/* Mobile Portrait (Default) */
@media (max-width: 767px) {
    /* Full-screen modal on mobile */
    .modal-content {
        border-radius: 0;
        height: 100vh;
    }
    
    .casino-popup-content {
        border-radius: 0;
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
    }
    
    /* Adjust hero for mobile */
    .hero-content {
        padding: var(--sp-xl) var(--sp-lg) var(--sp-2xl);
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Game cards mobile optimization */
    .game-card {
        width: 140px;
    }
    
    .game-card-image {
        height: 100px;
        font-size: var(--fs-caption);
    }
    
    /* Freespin cards stack on mobile */
    .event-card-header {
        flex-direction: column;
        text-align: center;
        gap: var(--sp-md);
    }
    
    .casino-info {
        text-align: center;
    }
    
    .bonus-amount {
        margin-top: var(--sp-sm);
    }
}

/* Mobile Landscape */
@media (max-width: 967px) and (orientation: landscape) {
    .hero-section {
        height: clamp(300px, 80vh, 500px);
    }
    
    .hero-content {
        padding: var(--sp-xl) var(--sp-lg);
    }
    
    .hero-buttons {
        flex-direction: row;
    }
    
    .game-player {
        height: clamp(200px, 40vh, 350px);
    }
}

/* Tablets */
@media (min-width: 768px) {
    /* Non-full-screen modals on tablets+ */
    .modal-content {
        width: 90vw;
        max-width: 900px;
        height: auto;
        max-height: 90vh;
        margin: auto;
        border-radius: var(--radius-2xl);
        box-shadow: var(--shadow-2xl);
    }
    
    .casino-popup-content {
        max-width: 600px;
        height: auto;
        max-height: 85vh;
        border-radius: var(--radius-2xl);
    }
    
    /* Enhanced game player on larger screens */
    .game-player {
        height: clamp(350px, 50vh, 600px);
    }
    
    /* Better card layouts */
    .game-card {
        width: 180px;
    }
    
    .game-card-image {
        height: 135px;
    }
    
    /* Horizontal event cards on tablets */
    .event-card-header {
        flex-direction: row;
        text-align: left;
    }
    
    .casino-info {
        text-align: left;
    }
    
    .bonus-amount {
        margin-top: 0;
    }
    
    /* Hide bottom nav on tablets+ */
    .bottom-nav {
        display: none;
    }
    
    .main-content {
        padding-bottom: 0;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .modal-content {
        max-width: 1100px;
    }
    
    .game-player {
        height: clamp(400px, 55vh, 700px);
    }
    
    .game-card {
        width: 200px;
    }
    
    .game-card-image {
        height: 150px;
    }
    
    .recommended-card {
        width: 160px;
    }
    
    .recommended-thumbnail {
        height: 90px;
    }
    
    /* Better spacing on desktop */
    .category-section {
        padding: 0 var(--sp-2xl);
    }
    
    .affiliate-section {
        padding: 0 var(--sp-2xl);
    }
    
    .modal-body {
        padding: var(--sp-2xl);
    }
}

/* Large Desktop */
@media (min-width: 1440px) {
    .game-card {
        width: 220px;
    }
    
    .game-card-image {
        height: 165px;
    }
    
    .recommended-card {
        width: 180px;
    }
    
    .affiliate-card {
        width: 360px;
        height: 160px;
    }
}

/* === 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) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #e0e0e0;
        --color-surface: #2a2a2a;
        --color-card: #3a3a3a;
    }
    
    .game-card,
    .modal-content,
    .casino-popup-content {
        border-width: 2px;
    }
}

/* === CUSTOM SCROLLBARS (Desktop) === */
@media (min-width: 768px) {
    .category-scroll::-webkit-scrollbar,
    .recommended-scroll::-webkit-scrollbar,
    .casino-list::-webkit-scrollbar {
        height: 6px;
        width: 6px;
    }
    
    .category-scroll::-webkit-scrollbar-track,
    .recommended-scroll::-webkit-scrollbar-track,
    .casino-list::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: var(--radius-sm);
    }
    
    .category-scroll::-webkit-scrollbar-thumb,
    .recommended-scroll::-webkit-scrollbar-thumb,
    .casino-list::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: var(--radius-sm);
    }
    
    .category-scroll::-webkit-scrollbar-thumb:hover,
    .recommended-scroll::-webkit-scrollbar-thumb:hover,
    .casino-list::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.3);
    }
}

/* === PULL-TO-REFRESH INDICATOR === */
.pull-indicator {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-background);
    padding: var(--sp-md) var(--sp-xl);
    border-radius: var(--radius-full);
    font-size: var(--fs-body-s);
    font-weight: 600;
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 5;
}

.pull-indicator.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(60px);
}

/* === DRAG HANDLE (Mobile Modal) === */
.modal-drag-handle {
    position: absolute;
    top: var(--sp-md);
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    z-index: 10;
}

/* === ADDITIONAL BUTTON STYLES === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
    padding: var(--sp-md) var(--sp-xl);
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--fs-body-m);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    min-height: var(--layout-touch);
    user-select: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--game-gradient);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-small {
    padding: var(--sp-sm) var(--sp-lg);
    font-size: var(--fs-body-s);
    min-height: 36px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: scale(0.98);
}

/* === UTILITY CLASSES === */
.hidden { display: none !important; }
.visible { display: block !important; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }

.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* === PERFORMANCE OPTIMIZATIONS === */
.game-card,
.affiliate-card,
.recommended-card,
.compact-event-card {
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Reduce paint complexity on mobile */
@media (max-width: 767px) {
    .hero-background {
        filter: brightness(0.6); /* Remove blur on mobile for performance */
    }
    
    .modal-content,
    .casino-popup-content {
        backdrop-filter: blur(8px); /* Reduce blur intensity */
        -webkit-backdrop-filter: blur(8px);
    }
}

/* === DARK THEME (Already default) === */

/* === HIGH DPI SUPPORT === */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .game-card,
    .modal-content,
    .casino-popup-content {
        border-width: 0.5px;
    }
    
    .multiplier-badge,
    .new-badge,
    .rank-badge {
        border: 0.5px solid rgba(255, 255, 255, 0.1);
    }
}

/* === NOTCH SUPPORT (iPhone X+) === */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: env(safe-area-inset-top);
        height: calc(var(--layout-header) + env(safe-area-inset-top));
    }
    
    .main-content {
        margin-top: calc(var(--layout-header) + env(safe-area-inset-top));
    }
    
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(var(--layout-bottom-nav) + env(safe-area-inset-bottom));
    }
    
    .modal-content.fullscreen-mobile {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* === LANDSCAPE MOBILE OPTIMIZATIONS === */
@media (max-width: 967px) and (orientation: landscape) {
    .hero-section {
        height: clamp(250px, 70vh, 400px);
    }
    
    .hero-content {
        padding: var(--sp-lg);
    }
    
    .hero-title {
        font-size: clamp(24px, 5vw, 36px);
    }
    
    .game-player {
        height: clamp(200px, 45vh, 350px);
    }
    
    .modal-header {
        padding: var(--sp-md) var(--sp-lg);
        min-height: 50px;
    }
    
    .modal-body {
        padding: var(--sp-lg);
    }
}

/* === PRINT STYLES === */
@media print {
    .header,
    .bottom-nav,
    .hero-buttons,
    .modal-overlay,
    .casino-popup {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
        padding-bottom: 0;
    }
    
    .game-card,
    .affiliate-card {
        break-inside: avoid;
    }
}

/* === FOCUS MANAGEMENT === */
.modal-content:focus-within .close-btn {
    outline: 2px solid var(--game-primary);
    outline-offset: 2px;
}

.game-card:focus,
.affiliate-card:focus,
.nav-item:focus {
    outline: 2px solid var(--game-primary);
    outline-offset: 2px;
    border-radius: var(--radius-lg);
}

/* === ANIMATION PERFORMANCE === */
@media (max-width: 767px) {
    /* Disable expensive animations on low-end mobile devices */
    .game-card:hover,
    .affiliate-card:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    
    .btn:hover {
        transform: none;
    }
}

/* === CONTAINER SAFETY === */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: max(var(--sp-lg), env(safe-area-inset-left));
    padding-right: max(var(--sp-lg), env(safe-area-inset-right));
}

/* === MODAL STACK MANAGEMENT === */
.modal-overlay.stacked {
    z-index: calc(var(--z-modal) + 10);
    background: rgba(0, 0, 0, 0.8);
}

/* === TOUCH FEEDBACK === */
.game-card:active,
.affiliate-card:active,
.recommended-card:active,
.compact-event-card:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* === LOADING OVERLAY === */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-background);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-toast);
    transition: opacity var(--transition-slow);
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
/* Video Error Overlay (iFrame'i kaldırmadan üstte göster) */
.video-error-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3xl);
  background: linear-gradient(180deg, rgba(0,0,0,.75), rgba(0,0,0,.6));
  z-index: 2;
}
/* === AUTHENTICATION MODAL === */
.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--sp-lg);
    overflow-y: auto;
}

.auth-modal.active {
    display: flex;
}

.auth-modal-content {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-2xl);
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.auth-modal-header {
    padding: var(--sp-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.auth-modal-title {
    font-size: var(--fs-heading-s);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.auth-modal-body {
    padding: var(--sp-xl);
}

.auth-tabs {
    display: flex;
    margin-bottom: var(--sp-xl);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: var(--sp-md) var(--sp-lg);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--fs-body-m);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.auth-tab.active {
    background: var(--game-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.auth-form {
    margin-bottom: var(--sp-xl);
}

.form-group {
    margin-bottom: var(--sp-lg);
}

.auth-input {
    width: 100%;
    padding: var(--sp-lg);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--fs-body-m);
    backdrop-filter: blur(4px);
    transition: all var(--transition-normal);
}

.auth-input:focus {
    outline: none;
    border-color: var(--game-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: rgba(255, 255, 255, 0.12);
}

.auth-input::placeholder {
    color: var(--text-muted);
}

.auth-btn {
    width: 100%;
    padding: var(--sp-lg) var(--sp-xl);
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--fs-body-m);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
    min-height: 48px;
    margin-bottom: var(--sp-md);
}

.auth-btn-primary {
    background: var(--game-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.auth-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.auth-btn-google {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-btn-google:hover {
    background: rgba(255, 255, 255, 0.15);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-divider {
    text-align: center;
    position: relative;
    margin: var(--sp-xl) 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    background: rgba(30, 41, 59, 0.95);
    padding: 0 var(--sp-lg);
    color: var(--text-muted);
    font-size: var(--fs-body-s);
}

/* === USER WELCOME SECTION === */
.user-welcome-section {
    padding: var(--sp-xl) var(--sp-lg);
    margin-bottom: var(--sp-xl);
}

.welcome-card {
    background: var(--game-gradient);
    border-radius: var(--radius-xl);
    padding: var(--sp-xl);
    display: flex;
    align-items: center;
    gap: var(--sp-lg);
    box-shadow: var(--shadow-lg);
}

.welcome-content {
    flex: 1;
}

.welcome-title {
    font-size: var(--fs-heading-s);
    font-weight: 700;
    color: white;
    margin: 0 0 var(--sp-sm) 0;
}

.welcome-text {
    font-size: var(--fs-body-m);
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.welcome-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: var(--sp-md) var(--sp-lg);
    border-radius: var(--radius-lg);
    font-size: var(--fs-body-s);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

.welcome-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* === NOTIFICATION ENHANCEMENTS === */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--status-error);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--status-error);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}


/* === AUTH REQUIRED OVERLAY === */
.auth-required-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-md);
    border-radius: var(--radius-lg);
    padding: var(--sp-lg);
    text-align: center;
}

.auth-text {
    color: var(--text-primary);
    font-size: var(--fs-body-s);
    font-weight: 600;
}

/* === RESPONSIVE AUTH MODAL === */
@media (max-width: 767px) {
    .auth-modal-content {
        margin: var(--sp-lg);
        max-width: none;
        width: calc(100% - var(--sp-2xl));
    }
    
    .welcome-card {
        flex-direction: column;
        text-align: center;
        gap: var(--sp-md);
    }
    
    .welcome-btn {
        align-self: stretch;
    }
}

/* === USER PROFILE MODAL === */
.user-profile-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--sp-lg);
    overflow-y: auto;
}

.user-profile-modal.active {
    display: flex;
}

.profile-modal-content {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-2xl);
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
}

.profile-modal-header {
    padding: var(--sp-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.profile-modal-title {
    font-size: var(--fs-heading-s);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.profile-modal-body {
    padding: var(--sp-xl);
    overflow-y: auto;
    flex: 1;
}

.profile-user-info {
    display: flex;
    align-items: center;
    gap: var(--sp-lg);
    margin-bottom: var(--sp-xl);
    padding: var(--sp-lg);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-surface);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-details {
    flex: 1;
}

.profile-details h4 {
    font-size: var(--fs-heading-s);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--sp-xs) 0;
}

.profile-details p {
    font-size: var(--fs-body-s);
    color: var(--text-secondary);
    margin: 0 0 var(--sp-sm) 0;
}

.profile-badges {
    display: flex;
    gap: var(--sp-sm);
}

.badge-membership {
    background: var(--game-gradient);
    color: white;
    padding: var(--sp-xs) var(--sp-sm);
    border-radius: var(--radius-sm);
    font-size: var(--fs-caption);
    font-weight: 600;
}

.profile-tabs {
    display: flex;
    margin-bottom: var(--sp-xl);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 4px;
}

.profile-tab {
    flex: 1;
    padding: var(--sp-md) var(--sp-sm);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--fs-body-s);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-xs);
}

.profile-tab.active {
    background: var(--game-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.count-badge {
    background: var(--status-error);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-lg);
}

.profile-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
}

.profile-form label {
    font-size: var(--fs-body-s);
    font-weight: 600;
    color: var(--text-primary);
}

.profile-input {
    width: 100%;
    padding: var(--sp-md) var(--sp-lg);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--fs-body-m);
    backdrop-filter: blur(4px);
    transition: all var(--transition-normal);
}

.profile-input:focus {
    outline: none;
    border-color: var(--game-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
    background: rgba(255, 255, 255, 0.12);
}

.profile-save-btn {
    background: var(--game-gradient);
    color: white;
    border: none;
    padding: var(--sp-md) var(--sp-xl);
    border-radius: var(--radius-lg);
    font-size: var(--fs-body-m);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    align-self: flex-start;
}

.profile-save-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.profile-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* === CASINO ACCOUNTS SECTION === */
.casino-accounts-section {
    display: flex;
    flex-direction: column;
    gap: var(--sp-lg);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-md);
}

.section-header h5 {
    font-size: var(--fs-heading-s);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.add-casino-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: var(--sp-sm) var(--sp-md);
    border-radius: var(--radius-md);
    font-size: var(--fs-body-s);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.add-casino-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.casino-accounts-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
}

.casino-account-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--sp-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.casino-account-info h6 {
    font-size: var(--fs-body-m);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--sp-xs) 0;
}

.casino-account-info p {
    font-size: var(--fs-body-s);
    color: var(--text-secondary);
    margin: 0;
}

.casino-status {
    padding: var(--sp-xs) var(--sp-sm);
    border-radius: var(--radius-sm);
    font-size: var(--fs-caption);
    font-weight: 600;
}

.casino-status.active {
    background: var(--status-success);
    color: white;
}

.casino-status.inactive {
    background: var(--text-muted);
    color: white;
}

/* === MESSAGES SECTION === */
.messages-section {
    display: flex;
    flex-direction: column;
    gap: var(--sp-lg);
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
    max-height: 300px;
    overflow-y: auto;
}

.message-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--sp-lg);
    transition: all var(--transition-normal);
}

.message-card.unread {
    border-color: var(--game-primary);
    background: rgba(99, 102, 241, 0.1);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--sp-sm);
}

.message-title {
    font-size: var(--fs-body-m);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.message-date {
    font-size: var(--fs-caption);
    color: var(--text-muted);
}

.message-content {
    font-size: var(--fs-body-s);
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: var(--sp-sm);
}

.message-link {
    color: var(--game-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--fs-body-s);
}

.message-link:hover {
    text-decoration: underline;
}

/* === PROFILE MODAL FOOTER === */
.profile-modal-footer {
    padding: var(--sp-lg) var(--sp-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.profile-logout-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-error);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: var(--sp-md) var(--sp-lg);
    border-radius: var(--radius-lg);
    font-size: var(--fs-body-m);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
}

.profile-logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

/* === RESPONSIVE PROFILE MODAL === */
@media (max-width: 767px) {
    .profile-modal-content {
        margin: var(--sp-lg);
        max-width: none;
        width: calc(100% - var(--sp-2xl));
        max-height: 90vh;
    }
    
    .profile-user-info {
        flex-direction: column;
        text-align: center;
        gap: var(--sp-md);
    }
    
    .profile-tabs {
        flex-direction: column;
    }
    
    .profile-tab {
        justify-content: flex-start;
        padding: var(--sp-md);
    }
    
    .section-header {
        flex-direction: column;
        gap: var(--sp-sm);
        align-items: stretch;
    }
    
    .casino-account-card {
        flex-direction: column;
        gap: var(--sp-sm);
        align-items: flex-start;
    }
}
/* === ADD CASINO FORM === */
.add-casino-form {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--sp-lg);
    margin-bottom: var(--sp-lg);
}

.add-casino-form h6 {
    font-size: var(--fs-body-m);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--sp-md) 0;
}

.form-actions {
    display: flex;
    gap: var(--sp-md);
    margin-top: var(--sp-lg);
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: var(--sp-md) var(--sp-lg);
    border-radius: var(--radius-md);
    font-size: var(--fs-body-m);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

/* === EMPTY & ERROR STATES === */
.empty-state,
.error-state,
.loading {
    text-align: center;
    padding: var(--sp-3xl);
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: var(--sp-lg);
}

.empty-state h4 {
    font-size: var(--fs-heading-s);
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 var(--sp-sm) 0;
}

.empty-state p {
    font-size: var(--fs-body-s);
    margin: 0;
}

.error-state {
    color: var(--status-error);
    font-weight: 600;
}
/* === MOBILE RESPONSIVE FREESPIN CARDS === */
@media (max-width: 767px) {
    .event-card-header {
        flex-direction: column;
        text-align: center;
        gap: var(--sp-md);
    }
    
    .casino-info {
        text-align: center;
    }
    
    .bonus-amount {
        margin-top: var(--sp-sm);
    }
}

/* === TABLETS AND DESKTOP === */
@media (min-width: 768px) {
    .event-card-header {
        flex-direction: row;
        text-align: left;
    }
    
    .casino-info {
        text-align: left;
    }
    
    .bonus-amount {
        margin-top: 0;
    }
}

/* === Toast / Snackbar (NEW) === */
#toastContainer {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none; /* container tıklanamaz, sadece toast tıklanır */
}

#toastContainer .toast {
  pointer-events: auto;
  min-width: 240px;
  max-width: 92vw;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  color: #fff;
  background: #2b2f3a;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

#toastContainer .toast.is-shown {
  opacity: 1;
  transform: translateY(0);
}

#toastContainer .toast.is-hiding {
  opacity: 0;
  transform: translateY(8px);
}

#toastContainer .toast__msg {
  line-height: 1.35;
}

#toastContainer .toast__close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  opacity: .8;
}
#toastContainer .toast__close:hover { opacity: 1; }

/* Varyantlar */
#toastContainer .toast--info    { background: #2b2f3a; }
#toastContainer .toast--success { background: #1e7f3a; }
#toastContainer .toast--warning { background: #af7a00; }
#toastContainer .toast--error   { background: #9d1c1c; }

/* Body scroll lock için sınıf */
body.scroll-lock {
  overflow: hidden;            /* desktop için güvenli */
}

/* Profil modalının kaydırılabilir alanları iOS/WebKit uyumlu olsun */
.user-profile-modal,
.profile-modal-body {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;   /* scroll zinciri dışarı taşmasın */
  touch-action: pan-y;            /* dikey kaydırmayı garanti et */
}
