* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Advanced Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    
    /* Sophisticated Color Palette */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* Borders & Effects */
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

[data-theme="dark"] {
    /* Advanced Dark Theme */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --secondary: #a78bfa;
    --accent: #f472b6;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Animated Mesh Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
    animation: meshMove 20s ease-in-out infinite;
}

@keyframes meshMove {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* ============================================
   ADVANCED HEADER WITH GLASSMORPHISM
   ============================================ */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

[data-theme="dark"] .main-header {
    background: rgba(30, 41, 59, 0.8);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.logo-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-icon::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: logoShine 3s infinite;
}

@keyframes logoShine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.logo-icon img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.logo-text {
    font-size: 28px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle {
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.theme-toggle i {
    font-size: 20px;
    color: var(--text-primary);
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(20deg);
}

.header-live {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gradient-secondary);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    box-shadow: var(--shadow-lg);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); box-shadow: var(--shadow-lg); }
    50% { transform: scale(1.05); box-shadow: 0 15px 30px -5px rgba(236, 72, 153, 0.4); }
}

.header-live .dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: dotBlink 1.5s infinite;
}

@keyframes dotBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================
   ADVANCED HERO SECTION
   ============================================ */
.hero-banner {
    position: relative;
    min-height: 500px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 48px;
}

[data-theme="dark"] .hero-banner {
    background: linear-gradient(135deg, #4338ca 0%, #6b21a8 100%);
}

#heroCanvas {
    display: none;
}

.hero-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.shape {
    position: absolute;
    opacity: 0.1;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    top: -100px;
    right: -100px;
    animation: float1 20s infinite;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    bottom: -50px;
    left: 10%;
    animation: float2 15s infinite;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: 50%;
    left: -50px;
    animation: float3 18s infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(50px, 50px) rotate(180deg); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-30px, 30px) rotate(-180deg); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    padding: 60px 24px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 50px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-title {
    font-size: 60px;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    letter-spacing: 0px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    line-height: 1.1;
}

.hero-content > p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 32px;
    line-height: 1.8;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.hero-btn {
    padding: 16px 32px;
    border-radius: 12px;
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    align-items: center;
    gap: 10px;
}

.hero-btn-primary {
    background: white;
    color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.hero-btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.hero-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(16, 185, 129, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(16, 185, 129, 0.3);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
}

.availability-badge i {
    font-size: 18px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 48px;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
    color: white;
}

.hero-stat-value {
    font-size: 36px;
    font-weight: 800;
    display: block;
    margin-bottom: 4px;
}

.hero-stat-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 24px;
    position: relative;
    z-index: 1;
}

/* ============================================
   FLASH MESSAGE - MODERN CARD
   ============================================ */
.admin-flash-message {
    margin-bottom: 32px;
}

.flash-wrapper {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.flash-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
}

.flash-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    animation: flashGlowRotate 8s linear infinite;
}

@keyframes flashGlowRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.flash-content {
    position: relative;
    z-index: 2;
}

.flash-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.flash-text::before {
    content: '📢';
    font-size: 24px;
}

.flash-decoration {
    display: none;
}

/* ============================================
   GAME SECTION - MODERN CARD DESIGN
   ============================================ */
.game-section {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 48px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 20px;
}

.game-title {
    font-size: 32px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.game-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--gradient-secondary);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: var(--shadow-md);
}

.game-live-badge i {
    animation: dotBlink 1.5s infinite;
}

.date-display {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 28px;
    padding: 12px 28px;
    background: var(--bg-tertiary);
    border-radius: 50px;
    display: inline-block;
    border: 2px solid var(--border-color);
}

/* ============================================
   RESULTS TABLE - MODERN GRID
   ============================================ */
.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 32px;
    display: block;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.results-table tbody {
    display: table;
    width: 100%;
}

.results-table tbody tr {
    background: var(--bg-tertiary);
    transition: all 0.3s ease;
    display: table-row;
}

.results-table tbody tr:first-child {
    background: var(--gradient-primary);
}

.results-table tbody tr:first-child td {
    color: white;
    font-weight: 700;
}

.results-table td {
    padding: 16px 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    font-weight: 600;
    min-width: 80px;
}

.baji-cell {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.time-cell {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: normal;
}

.result-cell {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

.positionCell {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.bonusCell {
    font-size: 12px;
    font-weight: 600;
    color: red;
    margin-top: 4px;
    display: block;
}

/* ============================================
   MODERN BUTTONS
   ============================================ */
.refresh-btn {
    width: 100%;
    padding: 16px 32px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.refresh-btn:active {
    transform: translateY(0);
}

.refresh-btn i {
    margin-right: 10px;
}

/* ============================================
   RECORD SECTION
   ============================================ */
.section-header {
    text-align: center;
    margin: 48px 0 32px;
}

.section-title {
    font-size: 32px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.section-title i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 12px;
}

/* ============================================
   RECORD TABLE
   ============================================ */
.record-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0px;
    overflow-x: auto;
    display: block;
}

.record-table tbody {
    display: table;
    width: 100%;
}

.record-row {
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    display: table-row;
}

.record-row:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.record-date-cell {
    background: var(--gradient-success);
    color: white;
    font-weight: 800;
    font-size: 18px;
    padding: 16px;
    text-align: center;
}

.record-row.bajiRow {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

[data-theme="dark"] .record-row.bajiRow {
    background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
}

.record-baji-cell {
    color: var(--text-primary);
    font-weight: 700;
    text-align: center;
    padding: 12px 6px;
    border: 1px solid var(--border-color);
    font-size: 13px;
    white-space: nowrap;
    min-width: 70px;
}

.record-row.timeRow {
    background: var(--bg-tertiary);
}

.record-time-cell {
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
    padding: 10px 6px;
    border: 1px solid var(--border-color);
    font-size: 11px;
    white-space: normal;
    min-width: 70px;
}

.record-row.cellRow {
    background: var(--bg-card);
}

.record-number-cell {
    font-weight: 800;
    text-align: center;
    padding: 14px 6px;
    border: 1px solid var(--border-color);
    min-width: 70px;
}

.record-number-cell .positionCell {
    font-size: 16px;
    color: var(--primary);
    line-height: 1.2;
}

.record-number-cell .bonusCell {
    font-size: 11px;
    color: red;
    margin-top: 4px;
    display: block;
}

/* ============================================
   SCROLL BUTTONS - MODERN
   ============================================ */
.scroll-btn {
    position: fixed;
    right: 24px;
    padding: 14px 24px;
    background: var(--bg-card);
    color: var(--primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.scroll-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.scroll-top {
    bottom: 24px;
}

.scroll-bottom {
    bottom: 90px;
}

.scroll-refresh {
    bottom: 156px;
}

/* ============================================
   SOPHISTICATED FOOTER
   ============================================ */
.footer {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 80px 24px 32px;
    margin-top: 80px;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.05);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-section h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 24px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-logo-section {
    max-width: 400px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.footer-logo .logo-icon {
    width: 48px;
    height: 48px;
}

.footer-logo-text {
    font-size: 24px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.footer-newsletter {
    margin-top: 24px;
}

.newsletter-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.newsletter-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Kanit', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.newsletter-btn {
    padding: 12px 24px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.social-links a {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 18px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-links a:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(4px);
}

.footer-links a i {
    font-size: 14px;
}

.contact-info {
    color: var(--text-secondary);
    font-size: 15px;
}

.contact-info p {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-info i {
    color: var(--primary);
    font-size: 16px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom-left p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.footer-bottom-left a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.footer-bottom-right {
    display: flex;
    gap: 24px;
    align-items: center;
}

.footer-bottom-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.footer-bottom-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-bottom-links a:hover {
    color: var(--primary);
}

/* ============================================
   DISCLAIMER - MODERN ALERT
   ============================================ */
.disclaimer-section {
    background: var(--bg-card);
    border-left: 4px solid var(--danger);
    padding: 32px 40px;
    margin: 60px auto 40px;
    border-radius: 16px;
    max-width: 1360px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--danger);
}

.disclaimer-section h2 {
    font-size: 20px;
    color: var(--danger);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
}

.disclaimer-section p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 14px;
}

.disclaimer-section strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   BOTTOM NAVIGATION - MODERN
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border-color);
    z-index: 9999;
}

[data-theme="dark"] .bottom-nav {
    background: rgba(30, 41, 59, 0.9);
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    transition: all 0.3s ease;
    font-family: 'Kanit', sans-serif;
    border-radius: 12px;
}

.nav-item i {
    font-size: 22px;
    transition: all 0.3s ease;
}

.nav-item span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.nav-item.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav-item:hover {
    color: var(--primary);
}

.nav-item.refresh-nav {
    background: var(--gradient-primary);
    color: white;
    border-radius: 16px;
    width: 56px;
    height: 56px;
    margin-top: -28px;
    box-shadow: var(--shadow-xl);
}

.nav-item.refresh-nav i {
    font-size: 24px;
    animation: rotateRefresh 3s linear infinite;
}

@keyframes rotateRefresh {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nav-item.refresh-nav span {
    display: none;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .footer-logo-section {
        grid-column: 1 / -1;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 12px 20px;
    }

    .logo-text {
        font-size: 16px;
    }

    .logo-icon {
        width: 48px;
        height: 48px;
    }

    .header-live {
        padding: 10px 16px;
        font-size: 12px;
    }

    .hero-title {
        font-size: 40px;
    }

    .hero-content > p {
        font-size: 16px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-btn {
        width: 100%;
    }

    .game-section {
        padding: 24px 16px;
        border-radius: 16px;
    }

    .game-title {
        font-size: 24px;
    }

    /* Mobile Optimized Results Table */
    .results-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }

    .results-table tbody {
        display: table;
        min-width: 100%;
    }

    .results-table td {
        padding: 12px 4px;
        font-size: 11px;
        min-width: 60px;
    }

    .baji-cell {
        font-size: 11px;
    }

    .time-cell {
        font-size: 10px;
    }

    .result-cell {
        font-size: 14px;
    }

    .positionCell {
        font-size: 16px;
    }

    .bonusCell {
        font-size: 10px;
    }

    /* Mobile Optimized Record Table */
    .record-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    .record-table tbody {
        display: table;
        min-width: 100%;
    }

    .record-date-cell {
        font-size: 16px;
        padding: 12px 8px;
    }

    .record-baji-cell {
        font-size: 11px;
        padding: 10px 4px;
        min-width: 60px;
    }

    .record-time-cell {
        font-size: 10px;
        padding: 8px 4px;
        min-width: 60px;
    }

    .record-number-cell {
        padding: 10px 4px;
        min-width: 60px;
    }

    .record-number-cell .positionCell {
        font-size: 14px;
    }

    .record-number-cell .bonusCell {
        font-size: 10px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-bottom-right {
        flex-direction: column;
    }

    .scroll-btn {
        display: none !important;
    }

    .bottom-nav {
        display: none !important;
    }

    body {
        padding-bottom: 80px;
    }

    .disclaimer-section {
        padding: 24px 20px;
        margin: 40px 16px;
    }

    .section-title {
        font-size: 24px;
    }

    .newsletter-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 32px;
    }

    .game-title {
        font-size: 20px;
    }

    .hero-stat-value {
        font-size: 28px;
    }

    .hero-stat-label {
        font-size: 12px;
    }

    .flash-text {
        font-size: 16px;
    }

    .container {
        padding: 20px 12px;
    }

    .nav-item i {
        font-size: 20px;
    }

    .nav-item.refresh-nav {
        width: 52px;
        height: 52px;
        margin-top: -26px;
    }

    /* Extra Small Mobile - Results Table */
    .results-table td {
        padding: 10px 3px;
        font-size: 10px;
        min-width: 39px;
        font-weight: 700;
    }

    .baji-cell {
        font-size: 10px;
    }

    .time-cell {
        font-size: 9px;
    }

    .result-cell {
        font-size: 13px;
    }

    .positionCell {
        font-size: 17px;
        font-weight: 700;
    }

    .bonusCell {
        font-size: 18px;
        font-weight: 700;
    }

    /* Extra Small Mobile - Record Table */
    .record-date-cell {
        font-size: 14px;
        padding: 10px 6px;
    }

    .record-baji-cell {
        font-size: 10px;
        padding: 8px 3px;
        min-width: 40px;
    }

    .record-time-cell {
        font-size: 9px;
        padding: 6px 3px;
        min-width: 40px;
    }

    .record-number-cell {
        padding: 8px 3px;
        min-width: 40px;
    }

    .record-number-cell .positionCell {
        font-size: 17px;
    }

    .record-number-cell .bonusCell {
        font-size: 18px;
    }

    .date-display {
        font-size: 14px;
        padding: 10px 20px;
    }

    .game-section {
        padding: 20px 12px;
    }

    .section-title {
        font-size: 20px;
    }
}

@media (min-width: 769px) {
    .bottom-nav {
        display: none !important;
    }

    .desktop-only {
        display: block !important;
    }
}

.load-more-container {
    text-align: center;
    margin: 24px 0;
}

html {
    scroll-behavior: smooth;
}

/* Theme Toggle Animation */
[data-theme="dark"] .theme-toggle .fa-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .fa-sun {
    display: inline-block;
}

[data-theme="light"] .theme-toggle .fa-sun {
    display: none;
}

[data-theme="light"] .theme-toggle .fa-moon {
    display: inline-block;
}