:root {
    /* Color Palette from Icon - Green Theme */
    --primary-color: #1a5f3f;         /* สีเขียวเข้ม */
    --primary-gradient: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 50%, #0a3d25 100%); /* เขียวเข้มไล่เฉด */
    --secondary-color: #ffffff;       /* สีขาว */
    --accent-color: #00d4aa;          /* สีเขียวสดใส */
    --gold-color: #00d4aa;            /* สีเขียวสดใส */
    --gold-gradient: linear-gradient(135deg, #00d4aa, #00b894, #00a085); /* เขียวสดใสไล่เฉด */
    --background-color: #ffffff;      /* พื้นหลังขาว */
    --text-color: #1a5f3f;            /* ข้อความเขียวเข้ม */
    --text-secondary: #1a5f3f;        /* ข้อความรองสีเขียว */
    --border-color: #00d4aa;          /* ขอบสีเขียวสดใส */
    --background-light: #ffffff;       /* พื้นหลังขาว */
    --shadow-color: rgba(26, 95, 63, 0.2); /* เงาเขียว */
    --hover-color: #0f4a2e;           /* สีเขียวเข้มเมื่อ hover */
    --background-pattern: none;
    --card-bg: rgba(255, 255, 255, 0.95);
    --border-gold: 2px solid #00d4aa;
    --primary-gold: #1a5f3f;
    --primary-gold-dark: #0f4a2e;
    --border-card: 1.5px solid #00d4aa;
    --button-gold: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%);
    --button-gold-hover: #0f4a2e;
    --gold: #00d4aa;
    --background-dark: #1a5f3f;
    --text-dark: #ffffff;
    --text-gold: #00d4aa;
    
    /* Modern Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --glass-backdrop: blur(8px);
    
    /* Modern Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warm: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-cool: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    
    /* Dark theme variables */
    --dark-bg: #1a5f3f;
    --dark-card: #0f4a2e;
    --dark-text: #ffffff;
    --dark-primary: #1a5f3f;
    --dark-secondary: #0f4a2e;
    --dark-border: #00d4aa;
}

.dark-theme {
    --background-dark: #1a5f3f !important;
    --card-bg: #0f4a2e !important;
    --text-color: #ffffff !important;
    --primary-color: #1a5f3f !important;
    --primary-gradient: linear-gradient(90deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    --border-gold: 2px solid #00d4aa !important;
    --button-gold: linear-gradient(90deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    --button-gold-hover: #0f4a2e !important;
    --shadow-color: rgba(26, 95, 63, 0.3) !important;
    --hover-color: #0f4a2e !important;
    --gold: #00d4aa !important;
    --text-dark: #ffffff !important;
    --text-gold: #00d4aa !important;
}

.dark-theme body {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 50%, #0a3d25 100%) !important;
    color: var(--text-color) !important;
}

.dark-theme .lotto-section,
.dark-theme .result-box,
.dark-theme .sub-prizes,
.dark-theme .check-section,
.dark-theme .chat-container,
.dark-theme .camera-container,
.dark-theme .lucky-container {
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%) !important;
    border: 2px solid #00d4aa !important;
    box-shadow: 0 4px 24px rgba(0, 212, 170, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.dark-theme .lotto-header {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.4) !important;
}

.dark-theme .date-badge {
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%) !important;
    color: #00d4aa !important;
    border: 1.5px solid #00d4aa !important;
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.2) !important;
}

.dark-theme .result-box, .dark-theme .main-prize {
    background: linear-gradient(135deg, #0a3d25 0%, #0f4a2e 100%) !important;
    color: #00d4aa !important;
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.dark-theme .prize-box, .dark-theme .lotto-cell {
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%) !important;
    color: #00d4aa !important;
    border: 1.5px solid #00d4aa !important;
    box-shadow: 0 2px 12px rgba(0, 212, 170, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.dark-theme .tab {
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%) !important;
    color: #00d4aa !important;
    border: 2px solid transparent !important;
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.2) !important;
}

.dark-theme .tab.active {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    color: #ffffff !important;
    border: 2px solid #00d4aa !important;
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.4), 0 0 20px rgba(0, 212, 170, 0.2) !important;
}

.dark-theme .bottom-nav {
    background: linear-gradient(135deg, #0a3d25 0%, #0f4a2e 100%) !important;
    border-top: 3px solid #00d4aa !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5) !important;
}

.dark-theme .chat-header {
    background: #1a5f3f !important;
    color: #00d4aa !important;
}

.dark-theme .chat-input input {
    background: #0f4a2e !important;
    color: #ffffff !important;
    border: 1.5px solid #00d4aa !important;
}

.dark-theme .chat-input button {
    background: #1a5f3f !important;
    color: #ffffff !important;
}

.dark-theme .suggestion-btn {
    background: #0f4a2e !important;
    color: #00d4aa !important;
    border: 1.5px solid #00d4aa !important;
}

.dark-theme .suggestion-btn:active {
    background: #1a5f3f !important;
    color: #ffffff !important;
}

.dark-theme .cosmic-actions button:active {
    background: #1a5f3f !important;
    color: #ffffff !important;
}

.dark-theme #stats-table th, .dark-theme #stats-table td {
    background: #0f4a2e !important;
    color: #00d4aa !important;
    border: 1.5px solid #00d4aa !important;
}

.dark-theme #stats-table tr:nth-child(even) td {
    background: #1a5f3f !important;
}

.dark-theme .notification {
    background: #0f4a2e !important;
    color: #00d4aa !important;
    border: 1.5px solid #00d4aa !important;
}

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

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@400;600&family=Noto+Sans+Thai:wght@400;700&display=swap');

body, input, button, select, textarea, .prize-label, .prize-value, .lotto-header, .tab, .check-btn, .suggestion-btn, .date-badge, .stock-date, .prize-box, .result-box, .main-prize .prize-number, .chat-container, .chat-header, .chat-title, .message-content, .action-button, .lucky-number, .result-description, .camera-instructions, .bottom-nav, .bank-logo {
    font-family: 'Kanit', 'Noto Sans Thai', sans-serif !important;
}

.lotto-header, .prize-label, .tab, .check-btn, .suggestion-btn, .date-badge, .stock-date, .bank-logo {
    font-weight: 700 !important;
}

.prize-value, .main-prize .prize-number, .prize-box, .result-box, .lucky-number {
    font-weight: 600 !important;
}

body, input, button, select, textarea, .message-content, .result-description, .camera-instructions {
    font-weight: 400 !important;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Kanit', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.top-banner {
    background: var(--primary-gradient);
    padding: 24px 0 20px 0;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(197, 46, 11, 0.3);
    border-bottom: none;
    border-radius: 0 0 24px 24px;
    position: relative;
    overflow: hidden;
}

.top-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(228, 215, 35, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.top-banner img {
    box-shadow: 0 8px 32px rgba(197, 154, 11, 0.4);
    padding: 12px;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.top-banner img:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 12px 40px rgba(197, 157, 11, 0.5);
}

.banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(197, 132, 11, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: logoGlow 3s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes logoGlow {
    0% { 
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% { 
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

.banner-title {
    font-size: 2.2rem;
    margin: 0 0 8px 0;
    font-weight: 700;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ffffff, #00d4aa, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleShimmer 2s ease-in-out infinite alternate;
}

@keyframes titleShimmer {
    0% { 
        background-position: 0% 50%;
    }
    100% { 
        background-position: 100% 50%;
    }
}

.banner-subtitle {
    font-size: 1rem;
    margin: 0;
    opacity: 0.9;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-toggle-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 16px;
    border-radius: 25px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    cursor: pointer;
    font-weight: 600;
    z-index: 10;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.theme-toggle-btn i {
    font-size: 1rem;
}

.top-banner h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.last-update {
    font-size: 1.1rem;
    opacity: 0.9;
}

.lotto-results {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    padding-bottom: 200px;
}

.lotto-section, .result-box, .sub-prizes, .check-section, .chat-container, .camera-container, .lucky-container {
    border: 1px solid var(--glass-border) !important;
    border-radius: 24px !important;
    background: var(--glass-bg) !important;
    backdrop-filter: var(--glass-backdrop) !important;
    box-shadow: var(--glass-shadow) !important;
    margin-bottom: 24px !important;
    padding: 20px 0 0 0 !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease !important;
}

/* เพิ่ม padding ด้านล่างสำหรับ tab ตรวจรางวัล */
.lotto-section {
    padding-bottom: 150px !important;
}

/* เพิ่ม padding ด้านล่างสำหรับ tab สถิติย้อนหลัง */
.stats-section {
    padding-bottom: 150px !important;
}

/* เพิ่ม padding ด้านล่างสำหรับ tab สถิติย้อนหลัง - ใช้ class ที่ถูกต้อง */
#stats-content {
    padding-bottom: 150px !important;
}

.stats-container {
    padding-bottom: 150px !important;
}

/* เพิ่ม padding ด้านล่างสำหรับ tab หาเลขมงคล */
.lucky-container {
    padding-bottom: 150px !important;
}

/* เพิ่ม padding ด้านล่างสำหรับ tab หมอดูโชคชะตา */
.chat-container {
    padding-bottom: 150px !important;
}

.lotto-section:hover, .result-box:hover, .sub-prizes:hover, .check-section:hover, .chat-container:hover, .camera-container:hover, .lucky-container:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 40px rgba(197, 46, 11, 0.2) !important;
}

.lotto-section::before, .result-box::before, .sub-prizes::before, .check-section::before, .chat-container::before, .camera-container::before, .lucky-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(242, 188, 38, 0.05) 100%);
    border-radius: 24px;
    pointer-events: none;
    z-index: 1;
}

.lotto-header {
    border-radius: 24px 24px 0 0 !important;
    background: var(--primary-gradient) !important;
    color: #ffffff !important;
    padding: 20px 24px 16px 24px !important;
    display: flex !important;
    align-items: center !important;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 20px rgba(224, 200, 15, 0.3);
}

.lotto-header i {
    font-size: 1.5rem;
    margin-right: 12px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 2px 4px rgba(212, 120, 14, 0.3));
    }
    50% { 
        transform: scale(1.1);
        filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.3));
    }
}

.lotto-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(202, 177, 18, 0.1) 50%, transparent 70%);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
}

.lotto-header img {
    margin-right: 16px !important;
}

.date-badge {
    background: #ffffff !important;
    color: #1a5f3f !important;
    border-radius: 24px !important;
    padding: 6px 22px !important;
    font-weight: bold !important;
    margin-top: 8px !important;
    display: inline-block !important;
    border: 1px solid #1a5f3f !important;
}

.result-box, .main-prize {
    background: #ffffff !important;
    color: #1a5f3f !important;
    border-radius: 18px !important;
    font-size: 2.6rem !important;
    font-weight: bold !important;
    margin: 18px 0 12px 0 !important;
    padding: 18px 0 !important;
    text-align: center !important;
    border: 2px solid #1a5f3f !important;
}

.sub-prizes {
    display: flex !important;
    gap: 12px !important;
    margin-bottom: 8px !important;
    background: transparent !important;
}

.prize-box, .lotto-cell {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid var(--glass-border) !important;
    border-radius: 20px !important;
    flex: 1 1 0 !important;
    padding: 18px 14px 16px 18px !important;
    color: var(--text-color) !important;
    font-size: 1.3rem !important;
    min-height: 80px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    backdrop-filter: blur(15px) !important;
    box-shadow: 0 6px 20px rgba(197, 182, 11, 0.15) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
    font-weight: 600 !important;
}

.prize-box::before, .lotto-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(234, 219, 7, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px;
    pointer-events: none;
    z-index: 1;
}

.prize-box:hover, .lotto-cell:hover {
    transform: translateY(-6px) scale(1.05) !important;
    box-shadow: 0 12px 35px rgba(197, 182, 11, 0.25) !important;
    border-color: var(--accent-color) !important;
    background: rgba(255, 255, 255, 1) !important;
}

.prize-label, .lotto-cell .label {
    font-size: 1rem !important;
    font-weight: 500 !important;
    margin-bottom: 2px !important;
}

.prize-value, .lotto-cell .number {
    font-size: 1.4rem !important;
    font-weight: bold !important;
}

@media (max-width: 768px) {
    .lotto-section, .result-box, .sub-prizes, .check-section, .chat-container, .camera-container, .lucky-container {
        padding: 12px 0 0 0 !important;
        margin-bottom: 20px !important;
        border-radius: 20px !important;
    }
    
    .lotto-results {
        padding-bottom: 220px;
    }
    
    .lotto-section {
        padding-bottom: 160px !important;
    }
    
    .stats-section {
        padding-bottom: 160px !important;
    }
    
    #stats-content {
        padding-bottom: 160px !important;
    }
    
    .stats-container {
        padding-bottom: 160px !important;
    }
    
    .lucky-container {
        padding-bottom: 160px !important;
    }
    
    .chat-container {
        padding-bottom: 160px !important;
    }
    
    .result-box, .main-prize {
        font-size: 2.2rem !important;
        padding: 16px 0 !important;
        border-radius: 20px !important;
    }
    
    .prize-box, .lotto-cell {
        font-size: 1.1rem !important;
        min-height: 60px !important;
        padding: 12px 8px 10px 12px !important;
        border-radius: 16px !important;
    }
    
    .lotto-header {
        padding: 16px 20px 12px 20px !important;
        border-radius: 20px 20px 0 0 !important;
    }
    
    .top-banner {
        padding: 20px 0 16px 0;
        border-radius: 0 0 20px 20px;
    }
    
    .top-banner img {
        width: 70px;
        height: 70px;
        padding: 10px;
        border-radius: 16px;
    }
    .banner-title {
        font-size: 1.8rem;
    }
    .banner-subtitle {
        font-size: 0.9rem;
    }
    .theme-toggle-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    .logo-glow {
        width: 100px;
        height: 100px;
    }
}

/* Bank Lotto Styles */
.lotto-header.bank {
    position: relative;
}

.bank-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #ffffff;
    border: 2px solid var(--primary-color);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.8rem;
}

.bank-logo::before {
    content: "ธนาคาร";
    font-size: 0.7rem;
    color: var(--primary-color);
    font-weight: 700;
}

/* Stock Lotto Styles */
.lotto-header.stock {
    background: var(--primary-gold);
    padding: 15px;
    border-radius: 15px 15px 0 0;
    opacity: 0.95;
}

.stock-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 4px;
}

.stock-item {
    background: #ffffff;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stock-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(254, 224, 30, 0.2);
}

.stock-flag-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-weight: 600;
}

.stock-flag-name img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    filter: drop-shadow(0 2px 4px rgba(42, 189, 9, 0.2));
    transition: all 0.3s ease;
}

.stock-flag-name img:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(197, 166, 11, 0.3));
}

.stock-flag-name strong {
    font-size: 1rem;
    color: var(--primary-color);
}

.stock-result {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f1f1f;
}

.lotto-header.stock i {
    color: var(--primary-color);
}

.stock-date {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 12px;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    background: #ffffff;
    margin-left: 8px;
}

@media (max-width: 1024px) {
    .stock-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .lotto-results {
        padding: 0.5rem;
    }

    .main-prize .prize-number {
        font-size: 2.0rem;
    }

    .prize-value {
        font-size: 1.2rem;
    }
    
    .stock-item {
        padding: 10px;
    }
    
    .stock-flag-name {
        min-width: 100px;
    }
    
    .stock-flag-name strong {
        font-size: 0.85rem;
    }
    
    .stock-number {
        font-size: 0.8rem;
        padding: 4px 6px;
    }
}

.check-section {
    background: #ffffff;
    border-radius: 16px;
    border: var(--border-gold);
    box-shadow: 0 2px 8px rgba(99, 215, 16, 0.08);
    margin-bottom: 18px;
}

.check-section .lotto-header {
    background: #1a5f3f;
    color: #ffffff;
}

.check-section .lotto-header i {
    color: var(--primary-color);
}

.check-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.input-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 18px;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(197, 185, 11, 0.2));
    animation: inputIconGlow 2s ease-in-out infinite alternate;
}

@keyframes inputIconGlow {
    0% { 
        color: var(--primary-color);
        filter: drop-shadow(0 2px 4px rgba(197, 179, 11, 0.2));
    }
    100% { 
        color: var(--accent-color);
        filter: drop-shadow(0 4px 8px rgba(222, 156, 42, 0.4));
    }
}

#check-number {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
    background: #ffffff;
    color: #1f1f1f;
    transition: all 0.3s ease;
}

#check-number:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.1);
}

.check-btn, .suggestion-btn, #capture-btn {
    background: var(--button-gold);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(197, 157, 11, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.check-btn::before, .suggestion-btn::before, #capture-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.check-btn:hover::before, .suggestion-btn:hover::before, #capture-btn:hover::before {
    left: 100%;
}

.check-btn:hover, .suggestion-btn:hover, #capture-btn:hover {
    background: var(--button-gold-hover);
    color: #ffffff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(197, 172, 11, 0.4);
    position: relative;
}

.check-btn i, .suggestion-btn i, #capture-btn i {
    color: inherit;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.check-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    background: #ffffff;
    border: 2px solid var(--primary-color);
}

.check-result.win {
    background: #fef2f2;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.check-result.lose {
    background: #1f1f1f;
    border-color: #374151;
    color: #ffffff;
}

.refresh-btn {
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
    color: #1a5f3f;
    border: 2px solid #1a5f3f;
    padding: 10px 18px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(101, 196, 11, 0.1);
    position: relative;
    overflow: hidden;
}

.refresh-btn:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
    color: #1a5f3f;
    transform: translateY(-4px) scale(1.05);
    border: 2px solid #1a5f3f;
    box-shadow: 0 8px 20px rgba(254, 239, 30, 0.3);
    position: relative;
}

.refresh-btn i {
    font-size: 1rem;
    color: inherit;
    transition: all 0.3s ease;
}

footer {
    background: #1a5f3f;
    color: #ffffff;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
    border-top: 2px solid var(--primary-color);
}

footer p {
    margin: 0;
    font-size: 0.9rem;
    color: #e8f5e8;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    color: #007a3d;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .top-banner h1 {
        font-size: 2rem;
    }
    
    .lotto-results {
        padding: 1rem;
    }
    
    .lotto-card {
        padding: 1.2rem;
    }
    
    .prize-number {
        font-size: 1.8rem;
    }
    
    .check-form {
        flex-direction: column;
        align-items: center;
    }
    
    .check-form input {
        width: 100%;
        max-width: 300px;
    }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 600;
    z-index: 10000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(86, 223, 22, 0.15);
    max-width: 300px;
}

.notification.success {
    background: var(--primary-color);
    border-left: 4px solid #007a3d;
}

.notification.error {
    background: #1f1f1f;
    border-left: 4px solid var(--primary-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    padding: 16px 0;
    box-shadow: 0 -8px 32px rgba(76, 197, 11, 0.15);
    z-index: 1000;
    backdrop-filter: blur(20px);
    border-radius: 24px 24px 0 0;
}

/* เพิ่มลูกเล่นสำหรับ Tab Menu */
.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 65px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(90, 159, 7, 0.1);
    backdrop-filter: blur(10px);
}

.tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(247, 211, 78, 0.4), transparent);
    transition: left 0.6s ease;
}

.tab:hover::before {
    left: 100%;
}

.tab:hover {
    transform: translateY(-2px) scale(1.02);
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--primary-color);
    box-shadow: 0 6px 20px rgba(3, 246, 27, 0.2);
}

.tab.active {
    color: #ffffff;
    background: var(--primary-gradient);
    transform: translateY(-4px) scale(1.05);
    border: 1px solid var(--accent-color);
    box-shadow: 0 8px 25px rgba(197, 157, 11, 0.4), 0 0 20px rgba(222, 156, 42, 0.3);
    animation: tabActiveGlow 2s ease-in-out infinite alternate;
}

@keyframes tabActiveGlow {
    0% { 
        box-shadow: 0 16px 40px rgba(10, 169, 23, 0.4), 0 0 20px rgba(212, 175, 55, 0.3);
        transform: translateY(-8px) scale(1.12);
    }
    100% { 
        box-shadow: 0 20px 50px rgba(14, 197, 11, 0.6), 0 0 30px rgba(254, 213, 30, 0.5);
        transform: translateY(-10px) scale(1.15);
    }
}

.tab-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 4px rgba(197, 135, 11, 0.2));
    transform: scale(1);
}

.tab:hover .tab-icon {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 4px 8px rgba(197, 191, 11, 0.4));
    color: var(--primary-color);
}

.tab.active .tab-icon {
    transform: scale(1.3) rotate(0deg);
    color: #ffffff;
    animation: iconActiveFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.3));
}

@keyframes iconActiveFloat {
    0%, 100% { 
        transform: scale(1.3) translateY(0) rotate(0deg);
    }
    25% { 
        transform: scale(1.4) translateY(-2px) rotate(1deg);
    }
    50% { 
        transform: scale(1.3) translateY(-1px) rotate(0deg);
    }
    75% { 
        transform: scale(1.4) translateY(-2px) rotate(-1deg);
    }
}

.tab span {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    transition: all 0.3s ease;
    color: inherit;
    text-shadow: 0 1px 2px rgba(9, 144, 18, 0.1);
}

.tab:hover span {
    transform: scale(1.05);
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 2px 4px rgba(90, 172, 17, 0.2);
}

/* เพิ่มลูกเล่นสำหรับ Lotto Sections */
.lotto-section {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    padding-bottom: 80px; /* เพิ่ม padding ด้านล่างให้อยู่เหนือ tab menu */
    margin-bottom: 20px;
}

.lotto-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #1a5f3f, transparent);
    transition: left 0.6s ease;
}

.lotto-section:hover::before {
    left: 100%;
}

.lotto-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(22, 185, 7, 0.2);
}

.lotto-header {
    transition: all 0.4s ease;
    position: relative;
}

.lotto-header:hover {
    transform: scale(1.01);
    box-shadow: 0 6px 20px rgba(35, 159, 7, 0.3);
}

/* เพิ่มลูกเล่นสำหรับ Prize Boxes */
.prize-box, .lotto-cell {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.prize-box::after, .lotto-cell::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(41, 171, 15, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

.prize-box:hover::after, .lotto-cell:hover::after {
    width: 200px;
    height: 200px;
}

.prize-box:hover, .lotto-cell:hover {
    transform: scale(1.03) translateY(-2px);
    box-shadow: 0 6px 20px rgba(77, 185, 10, 0.2);
    z-index: 1;
}

/* เพิ่มลูกเล่นสำหรับ Buttons */
.check-btn, .suggestion-btn, #capture-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.check-btn::before, .suggestion-btn::before, #capture-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.check-btn:hover::before, .suggestion-btn:hover::before, #capture-btn:hover::before {
    left: 100%;
}

.check-btn:hover, .suggestion-btn:hover, #capture-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 20px rgba(13, 207, 10, 0.3);
}

/* ===== MOBILE-OPTIMIZED AI CHAT LAYOUT ===== */

/* Mobile Chat Header */
.chat-header-mobile {
    background: var(--primary-gradient);
    padding: 20px;
    border-radius: 0 0 24px 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(36, 157, 9, 0.3);
    backdrop-filter: blur(10px);
}

.chat-header-simple {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.chat-avatar-small {
    width: 45px;
    height: 45px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(18, 221, 11, 0.3);
    backdrop-filter: blur(10px);
}

.chat-title-simple {
    font-size: 1.2rem;
    font-weight: 600;
    flex: 1;
}

.chat-status-simple {
    background: rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Compact Welcome */
.welcome-compact {
    background: rgba(255, 255, 255, 0.98);
    margin: 0 20px 20px 20px;
    padding: 24px;
    border-radius: 24px;
    text-align: center;
    border: 2px solid rgba(222, 156, 42, 0.3);
    box-shadow: 0 12px 40px rgba(39, 225, 11, 0.2);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.welcome-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 24px;
    pointer-events: none;
    z-index: 1;
}

.welcome-compact:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 50px rgba(77, 140, 18, 0.3);
}

.welcome-text {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

/* Mobile Chat Messages */
.chat-messages-mobile {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    margin: 0 20px 20px 20px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    border: 2px solid rgba(222, 156, 42, 0.3);
    min-height: 350px;
    max-height: 550px;
    padding-bottom: 120px;
    backdrop-filter: blur(15px);
    box-shadow: 0 12px 40px rgba(60, 193, 8, 0.2);
    position: relative;
    transition: all 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: #1a5f3f #f0f0f0;
    scroll-behavior: smooth;
}

.chat-messages-mobile::-webkit-scrollbar {
    width: 8px;
}

.chat-messages-mobile::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.chat-messages-mobile::-webkit-scrollbar-thumb {
    background: #1a5f3f;
    border-radius: 4px;
}

.chat-messages-mobile::-webkit-scrollbar-thumb:hover {
    background: #0f4a2e;
}

.chat-messages-mobile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 24px;
    pointer-events: none;
    z-index: 1;
}

.chat-messages-mobile:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 50px rgba(88, 220, 11, 0.25);
}

/* Mobile Input Section - Removed duplicate */

/* Ensure chat container maintains proper layout */
#chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.chat-messages-mobile {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

/* Fix input section position */
.chat-input-mobile {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-top: 1px solid #1a5f3f;
    box-shadow: 0 -8px 32px rgba(30, 230, 11, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 24px 24px 0 0;
    margin-top: 20px;
    margin-bottom: 80px; /* เพิ่ม padding ใต้ input เพื่อไม่ให้ถูกเมนูบัง */
    z-index: 100;
    transform: translateZ(0);
    will-change: transform;
    /* Ensure input stays in place */
    position: -webkit-sticky;
    position: sticky;
    bottom: 0;
}

/* เพิ่ม CSS สำหรับการแสดงผลปุ่ม Like/Report บนมือถือ */
@media (max-width: 768px) {
    .ai-message .message-content {
        padding-right: 16px; /* ลด padding ด้านขวาบนมือถือเพราะปุ่มไม่ได้อยู่ด้านขวาแล้ว */
        margin-bottom: 10px; /* เพิ่ม margin-bottom บนมือถือ */
    }
    
    /* ปรับ padding ด้านขวาให้เหมาะสมกับปุ่มที่อยู่เหนือข้อความบนมือถือ */
    .ai-message .message-content:has(.message-actions) {
        padding-right: 16px; /* ลด padding ด้านขวาเพราะปุ่มไม่ได้อยู่ด้านขวาแล้ว */
        margin-bottom: 12px; /* เพิ่ม margin-bottom เมื่อมีปุ่ม Like/Report บนมือถือ */
    }
    
    .message-actions {
        top: -30px; /* ปรับตำแหน่งบนมือถือให้เหมาะสมกับปุ่มที่เล็กลง */
        right: 6px; /* ลดระยะห่างด้านขวาบนมือถือ */
        gap: 2px; /* ลด gap บนมือถือ */
        padding: 2px 4px; /* ลด padding บนมือถือ */
    }
    
    .action-button {
        padding: 4px 6px; /* ลดขนาดปุ่มบนมือถือ */
        min-height: 20px; /* ลดความสูงขั้นต่ำบนมือถือ */
        min-width: 36px; /* ลดความกว้างขั้นต่ำบนมือถือ */
        font-size: 0.7rem; /* ลดขนาดตัวอักษรบนมือถือ */
    }
}

/* เพิ่ม CSS สำหรับหน้าจอขนาดเล็กมาก */
@media (max-width: 480px) {
    .ai-message .message-content {
        padding-right: 16px; /* ลด padding ด้านขวาบนหน้าจอขนาดเล็กมากเพราะปุ่มไม่ได้อยู่ด้านขวาแล้ว */
    }
    
    /* ปรับ padding ด้านขวาให้เหมาะสมกับปุ่มที่อยู่เหนือข้อความบนหน้าจอขนาดเล็กมาก */
    .ai-message .message-content:has(.message-actions) {
        padding-right: 16px; /* ลด padding ด้านขวาเพราะปุ่มไม่ได้อยู่ด้านขวาแล้ว */
    }
    
    .message-actions {
        top: -25px; /* ปรับตำแหน่งบนหน้าจอขนาดเล็กมากให้เหมาะสมกับปุ่มที่เล็กลง */
        right: 4px; /* ลดระยะห่างด้านขวาบนหน้าจอขนาดเล็กมาก */
        gap: 2px; /* ลด gap บนหน้าจอขนาดเล็กมาก */
        padding: 1px 3px; /* ลด padding บนหน้าจอขนาดเล็กมาก */
    }
    
    .action-button {
        padding: 3px 5px; /* ลดขนาดปุ่มบนหน้าจอขนาดเล็กมาก */
        min-height: 18px; /* ลดความสูงขั้นต่ำบนหน้าจอขนาดเล็กมาก */
        min-width: 32px; /* ลดความกว้างขั้นต่ำบนหน้าจอขนาดเล็กมาก */
        font-size: 0.65rem; /* ลดขนาดตัวอักษรบนหน้าจอขนาดเล็กมาก */
    }
    
    .lotto-section {
        padding-bottom: 60px !important; /* ปรับ padding สำหรับหน้าจอเล็กมาก */
    }
}

.input-container-mobile {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.input-field-mobile {
    flex: 1;
    border: 2px solid var(--glass-border);
    border-radius: 25px;
    padding: 14px 20px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(50, 189, 19, 0.1);
}

.input-field-mobile:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(197, 46, 11, 0.1);
    transform: scale(1.02);
}

.send-btn-mobile {
    background: var(--button-gold);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
    box-shadow: 0 4px 15px rgba(19, 157, 58, 0.3);
    backdrop-filter: blur(10px);
}

.send-btn-mobile:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(197, 46, 11, 0.4);
}

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

/* Quick Actions Row */
.quick-actions-mobile {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    padding-bottom: 80px; /* เพิ่ม padding ด้านล่างให้อยู่เหนือ tab menu */
    margin-bottom: 20px;
}

.quick-btn {
    flex: 0 0 auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 36px;
    max-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    backdrop-filter: var(--glass-backdrop);
    box-shadow: 0 4px 15px rgba(25, 160, 36, 0.1);
}

.quick-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(14, 164, 41, 0.3);
}

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

/* Mobile Responsive Adjustments */
@media (max-width: 480px) {
    .chat-header-mobile {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .chat-avatar-small {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }
    
    .chat-title-simple {
        font-size: 1.1rem;
    }
    
    .welcome-compact {
        margin: 0 12px 12px 12px;
        padding: 12px;
    }
    
    .welcome-text {
        font-size: 0.9rem;
    }
    
    .chat-messages-mobile {
        margin: 0 12px 12px 12px;
        padding: 12px;
        min-height: 250px;
    }
    
    .chat-input-mobile {
        padding: 12px;
    }
    
    .input-field-mobile {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
    
    .send-btn-mobile {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .quick-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
        min-height: 28px;
        max-height: 28px;
    }
    
    .quick-actions-mobile {
        padding-bottom: 70px; /* ลด padding สำหรับหน้าจอเล็ก */
        gap: 4px;
    }
    
    /* Chat message adjustments for small screens */
    .welcome-chat-avatar,
    .example-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .welcome-chat-content,
    .example-content {
        padding: 12px;
    }
    
    .welcome-chat-name,
    .example-name {
        font-size: 0.85rem;
    }
    
    .welcome-chat-text,
    .example-text {
        font-size: 0.9rem;
    }
    
    .chat-tips {
        padding: 14px;
        margin-top: 18px;
    }
    
    .tips-header {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }
    
    .tip-item {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .chat-messages-mobile {
        min-height: 200px;
        max-height: 250px;
    }
    
    .chat-input-mobile {
        position: relative;
        margin-top: 16px;
    }
}

/* Chat Message Styling */
.welcome-chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: messageSlideIn 0.5s ease-out;
}

.welcome-chat-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1a5f3f, #0f4a2e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.welcome-chat-content {
    flex: 1;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #00d4aa;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(55, 180, 14, 0.08);
}

.welcome-chat-name {
    font-weight: 600;
    color: #1a5f3f;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.welcome-chat-text {
    color: #1a5f3f;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Example Message */
.example-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: flex-end;
    animation: messageSlideIn 0.5s ease-out 0.2s both;
}

.example-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1a5f3f, #0f4a2e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.example-content {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%);
    color: white;
    border-radius: 16px;
    padding: 16px;
    max-width: 80%;
    box-shadow: 0 2px 8px rgba(16, 106, 13, 0.2);
}

.example-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.example-text {
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Chat Tips */
.chat-tips {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #1a5f3f;
    border-radius: 14px;
    padding: 18px;
    margin-top: 24px;
    animation: messageSlideIn 0.5s ease-out 0.4s both;
}

.tips-header {
    font-weight: 700;
    color: #1a5f3f;
    font-size: 1rem;
    margin-bottom: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tips-header::before {
    content: '✨';
    font-size: 1.2rem;
    animation: tipsIconFloat 2s ease-in-out infinite;
}

@keyframes tipsIconFloat {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
    }
    25% { 
        transform: translateY(-3px) rotate(5deg);
    }
    50% { 
        transform: translateY(-1px) rotate(0deg);
    }
    75% { 
        transform: translateY(-3px) rotate(-5deg);
    }
}

.tips-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tip-item {
    color: #1a5f3f;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    border-left: 3px solid #1a5f3f;
}

/* Animation */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure chat messages are visible above fixed input */
.chat-messages {
    padding-bottom: 120px; /* Space for fixed input */
}

/* Touch-friendly improvements */
@media (max-width: 768px) {
    .quick-btn,
    .send-btn-mobile {
        min-height: 44px; /* Apple's recommended minimum touch target */
    }
    
    .input-field-mobile {
        min-height: 44px;
    }
    
    /* Prevent zoom on input focus */
    .input-field-mobile {
        font-size: 16px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-header-section {
        margin-bottom: 16px;
    }
    
    .chat-header-bg {
        padding: 20px 16px;
        border-radius: 16px;
    }
    
    .chat-header-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .chat-avatar {
        width: 70px;
        height: 70px;
    }
    
    .chat-avatar-icon {
        font-size: 1.8rem;
    }
    
    .chat-title {
        font-size: 1.4rem;
        margin-bottom: 6px;
    }
    
    .chat-subtitle {
        font-size: 0.9rem;
    }
    
    .chat-status {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .welcome-section {
        margin-bottom: 16px;
    }
    
    .welcome-card {
        padding: 24px 16px;
        border-radius: 16px;
    }
    
    .welcome-icon {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }
    
    .welcome-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .welcome-features {
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .feature-item {
        padding: 12px;
        gap: 12px;
    }
    
    .feature-icon {
        font-size: 1.3rem;
        width: 35px;
    }
    
    .feature-text {
        font-size: 0.95rem;
    }
    
    .welcome-message {
        padding: 16px;
        font-size: 0.9rem;
        margin: 0;
    }
    
    .chat-main-container {
        border-radius: 16px;
    }
    
    .chat-messages-container {
        height: 300px;
        padding: 16px;
    }
    
    .chat-input-section {
        padding: 16px;
    }
    
    .input-wrapper {
        padding: 2px;
        border-radius: 12px;
    }
    
    .input-icon {
        font-size: 1.1rem;
        margin-left: 8px;
    }
    
    .chat-input-field {
        padding: 14px 8px;
        font-size: 0.95rem;
    }
    
    .send-button {
        padding: 14px;
        border-radius: 10px;
    }
    
    .send-icon {
        font-size: 1.1rem;
    }
    
    .quick-actions {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .quick-action-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 16px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .quick-icon {
        font-size: 0.9rem;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
    .chat-header-bg {
        padding: 16px 12px;
        border-radius: 12px;
    }
    
    .chat-avatar {
        width: 60px;
        height: 60px;
    }
    
    .chat-avatar-icon {
        font-size: 1.5rem;
    }
    
    .chat-title {
        font-size: 1.3rem;
    }
    
    .chat-subtitle {
        font-size: 0.85rem;
    }
    
    .welcome-card {
        padding: 20px 12px;
        border-radius: 12px;
    }
    
    .welcome-icon {
        font-size: 2rem;
    }
    
    .welcome-title {
        font-size: 1.3rem;
        margin-bottom: 16px;
    }
    
    .feature-item {
        padding: 10px;
        gap: 10px;
    }
    
    .feature-icon {
        font-size: 1.2rem;
        width: 30px;
    }
    
    .feature-text {
        font-size: 0.9rem;
    }
    
    .welcome-message {
        padding: 12px;
        font-size: 0.85rem;
    }
    
    .chat-messages-container {
        height: 250px;
        padding: 12px;
    }
    
    .chat-input-section {
        padding: 12px;
    }
    
    .input-wrapper {
        border-radius: 10px;
    }
    
    .chat-input-field {
        padding: 12px 6px;
        font-size: 0.9rem;
    }
    
    .send-button {
        padding: 12px;
        border-radius: 8px;
    }
    
    .quick-action-btn {
        padding: 12px 14px;
        font-size: 0.85rem;
        border-radius: 8px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .chat-header-content {
        flex-direction: row;
        text-align: left;
        gap: 12px;
    }
    
    .chat-avatar {
        width: 50px;
        height: 50px;
    }
    
    .chat-avatar-icon {
        font-size: 1.3rem;
    }
    
    .chat-title {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }
    
    .chat-subtitle {
        font-size: 0.8rem;
    }
    
    .welcome-card {
        padding: 20px;
    }
    
    .welcome-features {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .feature-item {
        flex: 1;
        min-width: 120px;
        padding: 10px;
    }
    
    .chat-messages-container {
        height: 200px;
    }
}

/* ===== MOBILE TOUCH ENHANCEMENTS ===== */

/* Touch-friendly button sizes */
@media (max-width: 768px) {
    .send-button,
    .quick-action-btn,
    .feature-item {
        min-height: 44px; /* Apple's recommended minimum touch target size */
    }
    
    .chat-input-field {
        min-height: 44px;
    }
    
    /* Improve touch scrolling */
    .chat-messages-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Better touch feedback */
    .quick-action-btn:active,
    .send-button:active,
    .feature-item:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    /* Prevent text selection on buttons */
    .quick-action-btn,
    .send-button {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* ===== OLD CHAT STYLES (KEEP FOR COMPATIBILITY) ===== */

/* เพิ่มลูกเล่นสำหรับ Chat Messages */
.message {
    animation: messageSlideIn 0.5s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-content {
    transition: all 0.3s ease;
}

.message-content:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(204, 134, 18, 0.2);
}

/* เพิ่มลูกเล่นสำหรับ Cosmic Number */
#cosmic-number {
    animation: numberGlow 2s ease-in-out infinite alternate;
}

@keyframes numberGlow {
    0% { 
        text-shadow: 0 0 20px #1a5f3f;
        transform: scale(1);
    }
    100% { 
        text-shadow: 0 0 30px #1a5f3f;
        transform: scale(1.05);
    }
}

.cosmic-instruction {
    animation: instructionFloat 3s ease-in-out infinite;
}

@keyframes instructionFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* เพิ่มลูกเล่นสำหรับ Stats Chart */
#stats-chart {
    animation: chartAppear 1s ease-out;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    height: clamp(240px, 40vh, 360px);
    padding: 0;
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.12);
    border: 2px solid #8a761e;
    display: block;
}

@keyframes chartAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* เพิ่มลูกเล่นสำหรับ Loading */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.loading-shimmer {
    background: linear-gradient(90deg, #f8f8f8 25%, #e8e8e8 50%, #f8f8f8 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* เพิ่มลูกเล่นสำหรับ Notification */
.notification {
    animation: notificationSlide 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes notificationSlide {
    from {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* เพิ่มลูกเล่นสำหรับ Stock Items */
.stock-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.stock-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(127, 254, 30, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.stock-item:hover::before {
    transform: translateX(100%);
}

.stock-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(62, 125, 2, 0.3);
}

/* เพิ่มลูกเล่นสำหรับ Date Badge */
.date-badge {
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* เพิ่มลูกเล่นสำหรับ Result Box */
.result-box, .main-prize {
    animation: resultGlow 2s ease-in-out infinite alternate;
}

@keyframes resultGlow {
    0% { 
        box-shadow: 0 0 10px rgba(254, 32, 30, 0.3);
        transform: scale(1);
    }
    100% { 
        box-shadow: 0 0 20px rgba(254, 32, 30, 0.6);
        transform: scale(1.02);
    }
}

.chat-container {
    background: #ffffff;
    border-radius: 16px;
    border: var(--border-gold);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 18px;
    overflow: hidden;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: linear-gradient(90deg, #1a5f3f 0%, #ffffff 100%);
    color: #1a5f3f;
    padding: 16px 20px;
    border-bottom: 2px solid #1a5f3f;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-title i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.chat-messages, #chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #ffffff;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f3f4f6;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.welcome-message#chat-welcome {
    text-align: center;
    padding: 32px 20px;
    background: #ffffff;
    border-radius: 16px;
    margin: 20px;
    border: 2px solid var(--primary-color);
    animation: fadeIn 0.5s ease;
}

.welcome-message#chat-welcome h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.welcome-message#chat-welcome h2 i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.welcome-message#chat-welcome p {
    font-size: 1rem;
    color: #1f1f1f;
    line-height: 1.6;
    margin-bottom: 0;
}

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

.message {
    display: flex;
    margin-bottom: 24px; /* เพิ่ม margin-bottom จาก 16px เป็น 24px */
    animation: messageAppear 0.3s ease;
    gap: 12px;
}

/* เพิ่ม space ระหว่างข้อความ user กับ AI */
.user-message {
    justify-content: flex-end;
    margin-bottom: 32px; /* เพิ่ม margin-bottom สำหรับข้อความ user */
}

.ai-message {
    margin-bottom: 28px; /* เพิ่ม margin-bottom สำหรับข้อความ AI */
}

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

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1f1f1f;
    position: relative; /* เพิ่ม position relative เพื่อให้สามารถจัดตำแหน่งปุ่มได้ */
}

/* ปรับ padding ด้านขวาให้เหมาะสมกับปุ่มที่อยู่เหนือข้อความ */
.ai-message .message-content {
    padding-right: 16px; /* ลด padding ด้านขวาเพราะปุ่มไม่ได้อยู่ด้านขวาแล้ว */
    /* เพิ่มการจัดการข้อความยาว */
    word-break: break-word; /* ให้ข้อความยาวขึ้นบรรทัดใหม่ได้ */
    overflow-wrap: break-word; /* ให้ข้อความยาวขึ้นบรรทัดใหม่ได้ */
}

/* ปรับ padding ด้านขวาให้เหมาะสมกับปุ่มที่อยู่เหนือข้อความ */
.ai-message .message-content:has(.message-actions) {
    padding-right: 16px; /* ลด padding ด้านขวาเพราะปุ่มไม่ได้อยู่ด้านขวาแล้ว */
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: var(--primary-color);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.ai-message .message-content {
    background: #f3f4f6;
    color: #1f1f1f;
    border-bottom-left-radius: 4px;
    /* เพิ่ม space ด้านล่างเพื่อไม่ให้ชนกับข้อความถัดไป */
    margin-bottom: 8px;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: var(--primary-color);
    color: #ffffff;
}

.ai-message .message-avatar {
    background: #1f1f1f;
    color: #ffffff;
}

.message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 3px; /* ลด gap เพื่อให้ปุ่มชิดกันมากขึ้น */
    /* ลบ margin-top และ padding-top เดิม */
    /* ลบ border-top เดิม */
    /* เพิ่มการแสดงผลที่ชัดเจนขึ้นสำหรับมือถือ */
    position: absolute; /* เปลี่ยนเป็น absolute เพื่อจัดตำแหน่งได้อิสระ */
    top: -35px; /* ปรับตำแหน่งให้เหมาะสมกับปุ่มที่เล็กลง */
    right: 8px; /* อยู่ด้านขวาของ chat bubble */
    z-index: 20; /* เพิ่ม z-index เพื่อให้อยู่ด้านบนสุด */
    background: rgba(255, 255, 255, 0.98); /* เพิ่ม background ให้ชัดเจนมากขึ้น */
    border-radius: 16px; /* ลด border-radius ให้เหมาะสมกับปุ่มที่เล็กลง */
    padding: 2px 5px; /* ลด padding ให้เหมาะสมกับปุ่มที่เล็กลง */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16); /* ลดเงาให้เหมาะสมกับปุ่มที่เล็กลง */
    /* เพิ่มการแสดงผลที่ดีขึ้น */
    backdrop-filter: blur(10px); /* เพิ่ม backdrop filter */
    border: 1px solid rgba(255, 255, 255, 0.3); /* เพิ่ม border ให้ชัดเจนมากขึ้น */
    /* เพิ่มการแสดงผลที่ดีขึ้นสำหรับปุ่มที่อยู่เหนือข้อความ */
    transform: translateY(-1px); /* ลดการยกปุ่มให้เหมาะสมกับขนาดใหม่ */
}

.ai-message .message-actions {
    justify-content: center; /* เปลี่ยนเป็น center เพื่อให้ปุ่มอยู่กึ่งกลาง */
    /* ลบ background, border-radius, padding, margin-top, box-shadow เดิม เพราะย้ายไปที่ .message-actions แล้ว */
}

.action-button {
    background: #817f77; /* เปลี่ยนสีปุ่มเป็น #817f77 */
    color: #ffffff;
    border: none;
    padding: 5px 8px; /* ลดขนาดปุ่มลงอีกนิดหน่อย */
    border-radius: 12px; /* ลด border-radius */
    font-size: 0.75rem; /* ลดขนาดตัวอักษร */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1px; /* ลด margin */
    display: inline-flex;
    align-items: center;
    gap: 2px; /* ลด gap */
    box-shadow: 0 2px 6px rgba(129, 127, 119, 0.3); /* ปรับ shadow ให้เหมาะสมกับสีใหม่ */
    /* ปรับการแสดงผลให้เหมาะสมกับการแสดงผลใหม่ */
    min-height: 24px; /* ลดความสูงขั้นต่ำ */
    min-width: 42px; /* ลดความกว้างขั้นต่ำ */
}

.action-button:active {
    transform: scale(0.95);
    background: #5a5850; /* ปรับสี active ให้เข้มขึ้นเล็กน้อย */
}

/* เพิ่ม hover effect สำหรับปุ่ม */
.action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(129, 127, 119, 0.4); /* ปรับ shadow ให้เหมาะสมกับสีใหม่ */
    background: #6b6961; /* เพิ่มสี hover ที่เข้มขึ้นเล็กน้อย */
}

/* เพิ่ม focus effect สำหรับ accessibility */
.action-button:focus {
    outline: 2px solid #817f77; /* ปรับ outline ให้เหมาะสมกับสีใหม่ */
    outline-offset: 2px;
}

/* เพิ่มการแสดงผลที่ดีขึ้นสำหรับปุ่มที่ active */
.action-button.active {
    background: #5a5850; /* ปรับสี active ให้เข้มขึ้นเล็กน้อย */
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(129, 127, 119, 0.5); /* ปรับ shadow ให้เหมาะสมกับสีใหม่ */
}

.chat-suggestions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 12px;
    background: #ffffff;
    border-top: 2px solid var(--primary-color);
}

.suggestion-btn {
    background: var(--button-gold);
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(254, 32, 30, 0.2);
}

.suggestion-btn span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
}

.suggestion-btn:active {
    transform: scale(0.95);
    background: var(--button-gold-hover);
}

.chat-input {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 0.95rem;
    background: #ffffff;
    color: #1f1f1f;
}

.chat-input button {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(254, 32, 30, 0.2);
}

.chat-input button i {
    font-size: 1.2rem;
    color: #ffffff;
}

/* ปรับแต่งสำหรับหน้าจอเล็ก */
@media (max-width: 375px) {
    .chat-container {
        padding-bottom: 160px;
    }

    .bottom-container {
        bottom: 80px;
    }

    .chat-input {
        padding: 6px;
    }

    .chat-input input {
        height: 36px;
        font-size: 0.95rem;
    }

    .chat-input button {
        width: 36px;
        height: 36px;
    }

    .chat-suggestions {
        padding: 8px;
        gap: 8px;
    }

    .suggestion-btn {
        padding: 8px;
        font-size: 0.9rem;
        min-height: 40px;
        border-radius: 10px;
    }
}

/* ปรับแต่งเมื่อคีย์บอร์ดแสดง */
@media (max-height: 600px) {
    .chat-container {
        padding-bottom: 140px;
    }

    .bottom-container {
        bottom: 70px;
    }

    .chat-suggestions {
        padding: 8px;
    }
}

/* ซ่อน scrollbar แต่ยังเลื่อนได้ */
.chat-messages::-webkit-scrollbar {
    width: 0px;
}

.chat-messages {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

@supports not (backdrop-filter: blur(8px)) {
    .lotto-section,
    .stock-item,
    .chat-container,
    .message-content,
    .chat-suggestions,
    .suggestion-btn,
    .chat-input,
    .welcome-message,
    .result-container,
    .lucky-container {
        background: #ffffff;
    }
}

/* เพิ่ม hover effect */
.lotto-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 166, 81, 0.2);
    transition: all 0.3s ease;
}

/* เพิ่ม animation เมื่อโหลดหน้า */
@keyframes headerAppear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lotto-header {
    animation: headerAppear 0.5s ease-out forwards;
}

/* เพิ่ม active states สำหรับการแตะบนมือถือ */
@media (hover: none) {
    .suggestion-btn:active {
        background: var(--button-gold-hover);
        color: #ffffff;
    }

    .chat-input button:active {
        background: var(--button-gold-hover);
        color: #ffffff;
    }

    .action-button:active {
        background: var(--button-gold-hover);
        color: #ffffff;
    }

    .cosmic-actions button:active {
        background: #ddd06f;
        color: #ffffff;
    }
}

/* ปรับปรุงการแสดงผลบน iPhone SE และหน้าจอเล็ก */
@media (max-width: 375px) {
    .message-content {
        font-size: 1rem;
        padding: 10px 14px;
    }

    .chat-input input {
        font-size: 1rem;
        height: 40px;
    }

    .chat-input button {
        width: 40px;
        height: 40px;
    }

    .suggestion-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .welcome-message h2 {
        font-size: 1.2rem;
    }

    .welcome-message p {
        font-size: 0.9rem;
    }
}

/* ปรับปรุงการแสดงผลเมื่อคีย์บอร์ดแสดง */
@media (max-height: 600px) {
    .chat-messages {
        padding-bottom: 140px;
    }
}

.bottom-container {
    position: fixed;
    bottom: 90px;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 2px solid var(--primary-color);
    z-index: 1000;
}

/* สไตล์สำหรับหน้าหาเลขเด็ด */
.lucky-container {
    background: #ffffff;
    border-radius: 16px;
    border: var(--border-gold);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 18px;
    padding: 20px;
}

.camera-container {
    background: #ffffff;
    border-radius: 16px;
    border: var(--border-gold);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 18px;
    padding: 20px;
    text-align: center;
}

#camera-preview {
    width: 100%;
    max-width: 400px;
    height: 300px;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    margin-bottom: 16px;
}

#photo-canvas {
    display: none;
}

#capture-btn, #retry-btn {
    background: var(--button-gold);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 8px;
    box-shadow: 0 2px 8px rgba(254, 32, 30, 0.2);
}

#capture-btn:hover, #retry-btn:hover {
    background: var(--button-gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(254, 32, 30, 0.3);
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(31, 31, 31, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

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

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

#result-container {
    background: #ffffff;
    border-radius: 16px;
    border: var(--border-gold);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 20px;
    text-align: center;
    margin-top: 16px;
}

.lucky-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 16px 0;
    text-shadow: 0 2px 4px rgba(254, 32, 30, 0.3);
    letter-spacing: 2px;
}

.result-description {
    font-size: 1.1rem;
    color: #1f1f1f;
    margin-bottom: 16px;
    line-height: 1.6;
}

.camera-instructions {
    background: #fef2f2;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    color: var(--primary-color);
    font-weight: 600;
    text-align: center;
}

/* เพิ่มอนิเมชันสำหรับการโหลด */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.analyzing {
    animation: pulse 1.5s infinite;
}

.cosmic-bg {
    background: linear-gradient(rgb(255 255 255), rgb(254, 32, 30)), url(./images/bg-luxury.png) center / cover no-repeat;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#cosmic-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.cosmic-number-float {
    position: absolute;
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(90deg, #ffffff 0%, #f8f8f8 50%, #1a5f3f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.5;
    animation: cosmic-float 6s infinite linear;
    text-shadow: 0 0 10px rgba(254, 32, 30, 0.3);
}

@keyframes cosmic-float {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    60% {
        opacity: 1;
        transform: scale(1.7) translateY(-40px);
    }
    100% {
        opacity: 0;
        transform: scale(2.2) translateY(-100px);
    }
}

.cosmic-effect-flare {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(254, 32, 30, 0.763) 0%, transparent 70%);
    border-radius: 50%;
    animation: cosmic-flare 4s infinite ease-in-out;
}

@keyframes cosmic-flare {
    0% { opacity: 0.7; transform: scale(0.5); }
    80% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(2.2); }
}

.cosmic-instruction {
    background: #ffffff;
    border: 2px solid #1a5f3f;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    color: #1f1f1f;
    font-weight: 600;
    z-index: 2;
    position: relative;
}

#cosmic-number {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(90deg, #ffffff 0%, #f8f8f8 50%, #1a5f3f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(254, 32, 30, 0.5);
    margin: 20px 0;
    z-index: 2;
    position: relative;
}

.cosmic-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    z-index: 2;
    position: relative;
}

.cosmic-actions button {
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
    color: #1a5f3f;
    border: 2px solid #1a5f3f;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(254, 32, 30, 0.1);
    position: relative;
    overflow: hidden;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cosmic-actions button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(254, 32, 30, 0.4), transparent);
    transition: left 0.6s ease;
}

.cosmic-actions button:hover::before {
    left: 100%;
}

.cosmic-actions button:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
    color: #1a5f3f;
    transform: translateY(-6px) scale(1.08);
    border: 2px solid #1a5f3f;
    box-shadow: 0 12px 30px rgba(254, 32, 30, 0.3);
    position: relative;
}

.cosmic-actions button i {
    color: inherit;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.cosmic-actions button:active {
    transform: scale(0.95);
    background: #1a5f3f;
    color: #ffffff;
    transition: transform 0.1s ease;
}

@media (max-width: 600px) {
    .cosmic-instruction {
        font-size: 1.2rem;
    }

    #cosmic-number {
        font-size: 3rem;
    }

    .cosmic-actions button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

.tab[data-tab="cosmic"].active {
    background: linear-gradient(90deg, #ffffff 0%, #1a5f3f 100%);
    color: #1a5f3f;
    box-shadow: 0 2px 8px rgba(197, 46, 11, 0.18);
}

@media (max-width: 600px) {
    .chat-container {
        height: auto;
    }
}

#stats-chart {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%) !important;
    height: clamp(240px, 40vh, 360px);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 8px 25px rgba(197, 46, 11, 0.15);
    border: 2px solid #1a5f3f;
}
#stats-table {
    width: 100%;
    overflow-x: auto;
    margin: 0 auto 12px auto;
    display: block;
}
#stats-table table {
    min-width: 600px;
    width: 100%;
    background: transparent !important;
    color: var(--text-color);
    font-size: 1.05rem;
    margin-bottom: 12px;
    border-radius: 10px;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
#stats-table th, #stats-table td {
    border: 1px solid #1a5f3f;
    padding: 8px 6px;
    min-width: 38px;
    text-align: center;
    word-break: keep-all;
    background: #ffffff;
    color: #1a5f3f;
    font-weight: 600;
}
#stats-table th {
    background: #ffffff;
    color: #1a5f3f;
    font-size: 1.08rem;
    font-weight: 700;
    border: 1px solid #1a5f3f;
}
#stats-table tr:nth-child(2) td {
    font-weight: 600;
    color: #1a5f3f;
    background: #f8fbff;
    border: 1px solid #1a5f3f;
}
@media (max-width: 700px) {
    #stats-table table {
        min-width: 520px;
        font-size: 0.98rem;
    }
    #stats-table th, #stats-table td {
        min-width: 32px;
        padding: 5px 2px;
    }
}
@media (max-width: 500px) {
    #stats-table table {
        min-width: 400px;
        font-size: 0.93rem;
    }
    #stats-table th, #stats-table td {
        min-width: 28px;
        padding: 4px 1px;
    }
}
#stats-chart {
    background: rgba(255, 255, 255, 0.95) !important;
    height: clamp(240px, 40vh, 360px);
    margin-bottom: 8px;
    border-radius: 16px;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 4px 16px rgba(197, 46, 11, 0.12);
    border: 2px solid #1a5f3f;
}
.lotto-section {
    padding: 12px 6px 18px 6px;
}
.lotto-header {
    margin-bottom: 8px;
} 

.dark-theme #stats-table th {
    background: #ffffff;
    color: #8a761e;
    border: 1px solid #8a761e;
}

.dark-theme #stats-table td {
    background: #ffffff;
    color: #8a761e;
    border: 1px solid #8a761e;
}

.dark-theme #stats-table tr:nth-child(2) td {
    background: #f8fbff;
    color: #8a761e;
    border: 1px solid #8a761e;
} 

/* เพิ่มเอฟเฟกต์พิเศษสำหรับ Dark Mode */
.dark-theme .top-banner {
    background: linear-gradient(135deg, #0a3d25 0%, #0f4a2e 100%) !important;
    color: #1a5f3f !important;
    border-bottom: 3px solid #1a5f3f !important;
    box-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.6) !important;
}

.dark-theme .top-banner img {
    box-shadow: 0 6px 24px 0 rgba(254, 32, 30, 0.4) !important;
    border: 0.5px solid #1a5f3f !important;
    filter: brightness(1.1) contrast(1.1) !important;
}

.dark-theme .check-section {
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%) !important;
    border: 2px solid #1a5f3f !important;
    box-shadow: 0 4px 20px rgba(247, 211, 78, 0.2) !important;
}

.dark-theme .check-section .lotto-header {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    color: #0a3d25 !important;
}

.dark-theme #check-number {
    background: #1a5f3f !important;
    color: #ffffff !important;
    border: 2px solid #1a5f3f !important;
}

.dark-theme #check-number:focus {
    border-color: #1a5f3f !important;
    box-shadow: 0 0 0 3px rgba(254, 32, 30, 0.2) !important;
}

.dark-theme .check-btn, .dark-theme .suggestion-btn, .dark-theme #capture-btn {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    color: #0a3d25 !important;
    border: 2px solid #1a5f3f !important;
    box-shadow: 0 4px 16px rgba(247, 211, 78, 0.3) !important;
}

.dark-theme .check-btn:hover, .dark-theme .suggestion-btn:hover, .dark-theme #capture-btn:hover {
    background: linear-gradient(135deg, #0f4a2e 0%, #0a3d25 100%) !important;
    transform: translateY(-6px) scale(1.08) !important;
    box-shadow: 0 12px 30px rgba(254, 32, 30, 0.4) !important;
}

.dark-theme .check-btn i, .dark-theme .suggestion-btn i, .dark-theme #capture-btn i {
    color: #0a3d25 !important;
}

.dark-theme .refresh-btn {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    color: #1a5f3f !important;
    border: 2px solid #1a5f3f !important;
    box-shadow: 0 2px 8px rgba(247, 211, 78, 0.2) !important;
}

.dark-theme .refresh-btn:hover {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    color: #0a3d25 !important;
    transform: translateY(-4px) scale(1.05) !important;
}

.dark-theme .refresh-btn i {
    color: inherit !important;
}

.dark-theme .stock-item {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    border: 2px solid #1a5f3f !important;
    color: #1a5f3f !important;
    box-shadow: 0 2px 8px rgba(247, 211, 78, 0.15) !important;
}

.dark-theme .stock-item:hover {
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%) !important;
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 10px 25px rgba(254, 32, 30, 0.25) !important;
}

.dark-theme .stock-flag-name strong {
    color: #1a5f3f !important;
}

.dark-theme .stock-result {
    color: #ffffff !important;
}

.dark-theme .stock-date {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    color: #1a5f3f !important;
    border: 1.5px solid #1a5f3f !important;
}

.dark-theme .chat-header-mobile {
    background: linear-gradient(135deg, #0a3d25 0%, #0f4a2e 100%) !important;
    color: #1a5f3f !important;
    border-bottom: 2px solid #1a5f3f !important;
}

.dark-theme .welcome-compact {
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%) !important;
    border: 1px solid #1a5f3f !important;
    color: #1a5f3f !important;
}

.dark-theme .welcome-text {
    color: #1a5f3f !important;
}

.dark-theme .chat-messages-mobile {
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%) !important;
    border: 1px solid #1a5f3f !important;
    color: #ffffff !important;
}

.dark-theme .chat-input-mobile {
    background: linear-gradient(135deg, #0a3d25 0%, #0f4a2e 100%) !important;
    border-top: 1px solid #1a5f3f !important;
}

.dark-theme .input-field-mobile {
    background: #1a5f3f !important;
    color: #ffffff !important;
    border: 2px solid #1a5f3f !important;
}

.dark-theme .input-field-mobile:focus {
    border-color: #1a5f3f !important;
    box-shadow: 0 0 0 3px rgba(247, 211, 78, 0.2) !important;
}

.dark-theme .send-btn-mobile {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    color: #0a3d25 !important;
}

.dark-theme .quick-btn {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    border: 1px solid #1a5f3f !important;
    color: #1a5f3f !important;
}

.dark-theme .quick-btn:hover {
    background: #1a5f3f !important;
    color: #0a3d25 !important;
}

.dark-theme .welcome-chat-content {
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%) !important;
    border: 1px solid #1a5f3f !important;
    color: #ffffff !important;
}

.dark-theme .welcome-chat-name {
    color: #1a5f3f !important;
}

.dark-theme .chat-tips {
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%) !important;
    border: 2px solid #1a5f3f !important;
}

.dark-theme .tips-header {
    color: #1a5f3f !important;
}

.dark-theme .tip-item {
    color: #1a5f3f !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-left: 3px solid #1a5f3f !important;
}

.dark-theme .cosmic-bg {
    background: linear-gradient(135deg, #0a3d25 0%, #0f4a2e 100%) !important;
}

.dark-theme .cosmic-instruction {
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%) !important;
    border: 2px solid #1a5f3f !important;
    color: #1a5f3f !important;
}

.dark-theme #cosmic-number {
    background: linear-gradient(90deg, #1a5f3f 0%, #0f4a2e 50%, #1a5f3f 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.dark-theme .cosmic-actions button {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    color: #1a5f3f !important;
    border: 2px solid #1a5f3f !important;
}

.dark-theme .cosmic-actions button:hover {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    color: #0a3d25 !important;
}

.dark-theme .cosmic-actions button i {
    color: inherit !important;
}

.dark-theme #stats-chart {
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%) !important;
    border: 2px solid #1a5f3f !important;
    color: #ffffff !important;
    box-shadow: 0 8px 25px rgba(254, 32, 30, 0.2) !important;
}

.dark-theme #stats-table th, .dark-theme #stats-table td {
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%) !important;
    color: #1a5f3f !important;
    border: 1px solid #1a5f3f !important;
}

.dark-theme #stats-table tr:nth-child(2) td {
    background: linear-gradient(135deg, #0a3d25 0%, #0f4a2e 100%) !important;
    color: #1a5f3f !important;
    border: 1px solid #1a5f3f !important;
}

/* เพิ่มเอฟเฟกต์พิเศษสำหรับ Dark Mode */
.dark-theme .lotto-section::before {
    background: linear-gradient(90deg, transparent, #1a5f3f, transparent) !important;
}

.dark-theme .prize-box::after, .dark-theme .lotto-cell::after {
    background: radial-gradient(circle, rgba(254, 32, 30, 0.3) 0%, transparent 70%) !important;
}

.dark-theme .tab::before {
    background: linear-gradient(90deg, transparent, rgba(254, 32, 30, 0.5), transparent) !important;
}

.dark-theme .tab::after {
    background: linear-gradient(90deg, #1a5f3f, #0f4a2e) !important;
}

.dark-theme .tab.active::before {
    background: linear-gradient(45deg, #1a5f3f, #0f4a2e, #1a5f3f) !important;
}

/* เพิ่มเอฟเฟกต์ glow สำหรับ Dark Mode */
.dark-theme .lotto-header {
    position: relative;
}

.dark-theme .lotto-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(254, 32, 30, 0.1) 50%, transparent 70%);
    border-radius: 20px 20px 0 0;
    animation: darkGlow 3s ease-in-out infinite;
}

@keyframes darkGlow {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

/* ===== ONLINE LOTTERY TAB STYLES ===== */

.online-bg {
    background: linear-gradient(135deg, #fafcff 0%, #ffffff 100%);
    min-height: 100vh;
    padding: 20px 20px 100px 20px;
    position: relative;
    overflow: hidden;
}

.online-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%);
    border-radius: 20px;
    color: white;
    box-shadow: 0 8px 25px rgba(254, 32, 30, 0.3);
}

.online-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #1a5f3f;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.online-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* Game Section */
.game-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.game-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
    border: 2px solid #1a5f3f;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(197, 46, 11, 0.15);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(254, 32, 30, 0.1), transparent);
    transition: left 0.6s ease;
}

.game-card:hover::before {
    left: 100%;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(197, 46, 11, 0.25);
}

.game-card h3 {
    color: #1a5f3f;
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-card h3::before {
    content: '';
    width: 24px;
    height: 24px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gameIconPulse 2s ease-in-out infinite;
}

@keyframes gameIconPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(197, 46, 11, 0.4);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(197, 46, 11, 0);
    }
}

.number-display {
    font-size: 3rem;
    font-weight: 800;
    color: #1a5f3f;
    margin: 20px 0;
    text-shadow: 0 4px 8px rgba(254, 32, 30, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
    border: 3px solid #1a5f3f;
    border-radius: 15px;
    padding: 15px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-btn {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%);
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(254, 32, 30, 0.3);
    position: relative;
    overflow: hidden;
}

.game-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.game-btn:hover::before {
    left: 100%;
}

.game-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(254, 32, 30, 0.4);
}

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

/* Lucky Slot Machine Section - Mobile First */
.lucky-wheel-section {
    background: linear-gradient(135deg, #ffffff 0%, #ff0600 100%);
    border: 3px solid #1a5f3f;
    border-radius: 20px;
    padding: 20px 15px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 
        0 8px 25px rgba(254, 32, 30, 0.15),
        inset 0 2px 10px rgba(254, 32, 30, 0.1);
    position: relative;
    overflow: hidden;
}

.slot-header {
    margin-bottom: 20px;
}

.slot-header h3 {
    color: #ffffff;
    font-size: 1.4rem;
    margin-bottom: 8px;
    font-weight: 700;
    text-shadow: 0 2px 8px #1a5f3f;
    animation: titlePulse 2s infinite;
}

.slot-subtitle {
    color: #f8f8f8;
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 500;
}

.lucky-wheel-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #1a5f3f, #00d4aa, #1a5f3f, #00d4aa);
    border-radius: 25px;
    z-index: -1;
    animation: borderGlow 3s infinite;
}

@keyframes borderGlow {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.lucky-wheel-section h3 {
    color: #ffffff;
    font-size: 1.6rem;
    margin-bottom: 25px;
    font-weight: 700;
    text-shadow: 0 2px 8px #1a5f3f;
    animation: titlePulse 2s infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 0 2px 8px #1a5f3f; }
    50% { text-shadow: 0 4px 16px #1a5f3f, 0 0 20px #1a5f3f; }
}

.slot-machine-container {
    position: relative;
    margin: 0 auto;
    max-width: 360px;
    width: 100%;
}

.slot-machine {
    background: linear-gradient(145deg, #1a5f3f, #ffffff);
    border: 3px solid #1a5f3f;
    border-radius: 20px;
    padding: 20px;
    position: relative;
    margin: 20px 0;
    box-shadow: 
        0 12px 35px rgba(197, 46, 11, 0.2),
        inset 0 2px 8px rgba(197, 46, 11, 0.1);
    transition: all 0.3s ease;
}

.slot-machine:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 16px 45px rgba(197, 46, 11, 0.3),
        inset 0 2px 8px rgba(197, 46, 11, 0.15);
}

/* Decorative corners */
.slot-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #1a5f3f, #0f4a2e);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(254, 32, 30, 0.6);
    animation: cornerPulse 2s infinite alternate;
}

.slot-corner-tl { top: 8px; left: 8px; }
.slot-corner-tr { top: 8px; right: 8px; }
.slot-corner-bl { bottom: 8px; left: 8px; }
.slot-corner-br { bottom: 8px; right: 8px; }

@keyframes cornerPulse {
    from { box-shadow: 0 0 8px rgba(254, 32, 30, 0.4); }
    to { box-shadow: 0 0 15px rgba(254, 32, 30, 0.8); }
}

.slot-display {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #0f4a2e 0%, #0a3d25 100%);
    border: 3px solid #00d4aa;
    border-radius: 12px;
    padding: 12px 8px;
    box-shadow: 
        inset 0 4px 12px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(212, 175, 55, 0.3);
    position: relative;
}

.reel-container {
    position: relative;
}

.reel-separator {
    width: 2px;
    height: 100px;
    background: linear-gradient(to bottom, transparent, #1a5f3f, transparent);
    margin: 0 8px;
    position: relative;
}

.reel-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #1a5f3f;
    border-radius: 50%;
    box-shadow: 0 0 8px #1a5f3f;
}

.slot-reel {
    width: 70px;
    height: 100px;
    background: linear-gradient(135deg, #2a3a2a 0%, #1a2a1a 100%);
    border: 2px solid #1a5f3f;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.6),
        0 0 12px rgba(254, 32, 30, 0.3);
    /* เพิ่มพื้นฐานการหมุน */
    transform: translateY(0);
    transition: transform 0.5s ease;
}

.slot-number {
    height: 33.33px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 900;
    color: #ffffff;
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid #00d4aa;
    position: relative;
}

.slot-number:nth-child(even) {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
}

.slot-number:last-child {
    border-bottom: none;
}

.slot-frame {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 20px;
    pointer-events: none;
}

.slot-light {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px #ffffff;
    animation: lightBlink 1.5s infinite;
}

/* 12 lights for better mobile coverage */
.slot-light-1 { top: 5px; left: 15%; animation-delay: 0s; }
.slot-light-2 { top: 5px; left: 50%; animation-delay: 0.1s; }
.slot-light-3 { top: 5px; right: 15%; animation-delay: 0.2s; }
.slot-light-4 { top: 30%; right: 5px; animation-delay: 0.3s; }
.slot-light-5 { top: 60%; right: 5px; animation-delay: 0.4s; }
.slot-light-6 { bottom: 5px; right: 15%; animation-delay: 0.5s; }
.slot-light-7 { bottom: 5px; left: 50%; animation-delay: 0.6s; }
.slot-light-8 { bottom: 5px; left: 15%; animation-delay: 0.7s; }
.slot-light-9 { top: 60%; left: 5px; animation-delay: 0.8s; }
.slot-light-10 { top: 30%; left: 5px; animation-delay: 0.9s; }
.slot-light-11 { top: 20%; left: 30%; animation-delay: 1.0s; }
.slot-light-12 { top: 20%; right: 30%; animation-delay: 1.1s; }

@keyframes lightBlink {
    0%, 50% { 
        background: #ffffff; 
        box-shadow: 0 0 10px #ffffff; 
    }
    25% { 
        background: #1a5f3f; 
        box-shadow: 0 0 15px #1a5f3f; 
    }
    75% { 
        background: #00d4aa; 
        box-shadow: 0 0 15px #00d4aa; 
    }
}

.slot-result-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 60px;
    border: 2px solid #ffffff;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 20, 0, 0.95) 100%);
    backdrop-filter: blur(3px);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.7),
        0 0 15px rgba(254, 32, 30, 0.4);
}

.result-label {
    font-size: 0.7rem;
    color: #f8f8f8;
    opacity: 0.8;
    margin-bottom: 2px;
    font-weight: 500;
}

.result-display {
    font-size: 2rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 10px #1a5f3f;
    z-index: 6;
    position: relative;
    background: linear-gradient(45deg, #1a5f3f, #00d4aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: resultGlow 1s infinite alternate;
}

@keyframes resultGlow {
    from { 
        filter: drop-shadow(0 0 5px #1a5f3f);
        transform: scale(1);
    }
    to { 
        filter: drop-shadow(0 0 15px #1a5f3f);
        transform: scale(1.05);
    }
}

.result-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    border-radius: 7px;
    animation: highlightSweep 2s infinite;
    z-index: 4;
}

@keyframes highlightSweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.slot-controls {
    margin-top: 20px;
}

.jackpot-display {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%);
    border: 2px solid #1a5f3f;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 15px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.jackpot-top {
    margin-bottom: 0;
    margin-top: 0;
}

.jackpot-label {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    text-shadow: 0 1px 3px #1a5f3f;
}

/* แยก result display ให้ชัดเจน */
.result-display {
    font-size: 1.8rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 12px #1a5f3f;
    z-index: 6;
    position: relative;
    background: linear-gradient(45deg, #1a5f3f, #00d4aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: resultGlow 1s infinite alternate;
    letter-spacing: 1px;
}

.jackpot-counter {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(45deg, #ffffff, #f8f8f8, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    animation: jackpotGlow 2s infinite;
    opacity: 0.9;
}

@keyframes jackpotGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6)); 
        transform: scale(1);
        opacity: 0.9;
    }
    50% { 
        filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8)); 
        transform: scale(1.02);
        opacity: 1;
    }
}

.spin-section {
    margin: 20px 0;
    text-align: center;
}

.spin-btn {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%);
    color: white;
    border: 3px solid #00d4aa;
    padding: 15px 35px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 
        0 6px 20px rgba(254, 32, 30, 0.4),
        inset 0 2px 8px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
    animation: buttonPulse 2s infinite;
    min-width: 120px;
    touch-action: manipulation;
}

.btn-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: btnGlowSweep 3s infinite;
    pointer-events: none;
}

@keyframes btnGlowSweep {
    0% { transform: translateX(-100%) rotate(45deg); }
    50% { transform: translateX(100%) rotate(45deg); }
    100% { transform: translateX(-100%) rotate(45deg); }
}

.spin-btn:hover::before {
    left: 100%;
}

.spin-btn .btn-icon {
    font-size: 1.5rem;
    animation: iconSpin 2s infinite linear;
}

.spin-btn .btn-text {
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes buttonPulse {
    0%, 100% { 
        box-shadow: 
            0 8px 25px rgba(254, 32, 30, 0.4),
            inset 0 2px 10px rgba(255, 255, 255, 0.1);
    }
    50% { 
        box-shadow: 
            0 12px 35px rgba(254, 32, 30, 0.6),
            inset 0 2px 10px rgba(255, 255, 255, 0.2);
        transform: translateY(-2px);
    }
}

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

.spin-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(254, 32, 30, 0.6),
        inset 0 2px 10px rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%);
    border-color: #00d4aa;
}

.spin-btn:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 8px 20px rgba(254, 32, 30, 0.5),
        inset 0 2px 10px rgba(255, 255, 255, 0.1);
}

.spin-btn:disabled {
    background: linear-gradient(135deg, #666666 0%, #444444 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: none;
}

.spin-btn:disabled .btn-icon {
    animation: none;
}

/* Mobile Responsive Design */
@media (max-width: 480px) {
    .lucky-wheel-section {
        padding: 15px 10px;
        border-radius: 16px;
        margin-bottom: 20px;
    }
    
    .slot-header h3 {
        font-size: 1.2rem;
    }
    
    .slot-subtitle {
        font-size: 0.8rem;
    }
    
    .slot-machine-container {
        max-width: 280px;
    }
    
    .slot-machine {
        padding: 12px;
        border-radius: 12px;
    }
    
    .slot-display {
        padding: 10px 6px;
        border-radius: 10px;
    }
    
    .slot-reel {
        width: 60px;
        height: 85px;
        border-radius: 6px;
    }
    
    .slot-number {
        height: 28.33px;
        font-size: 1.4rem;
    }
    
    .reel-separator {
        margin: 0 6px;
        height: 85px;
    }
    
    .slot-result-window {
        width: 140px;
        height: 55px;
        border-radius: 10px;
    }
    
    .result-display {
        font-size: 1.5rem;
    }
    
    .result-label {
        font-size: 0.65rem;
    }
    
    .jackpot-display {
        padding: 10px;
        border-radius: 10px;
    }
    
    .jackpot-label {
        font-size: 0.9rem;
    }
    
    .jackpot-counter {
        font-size: 1.6rem;
    }
    
    .spin-btn {
        padding: 12px 28px;
        font-size: 1.1rem;
        border-radius: 20px;
        min-width: 100px;
    }
    
    .slot-light {
        width: 6px;
        height: 6px;
    }
    
    .slot-corner {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 360px) {
    .slot-machine-container {
        max-width: 260px;
    }
    
    .slot-reel {
        width: 55px;
        height: 80px;
    }
    
    .slot-number {
        height: 26.67px;
        font-size: 1.3rem;
    }
    
    .reel-separator {
        height: 80px;
        margin: 0 5px;
    }
    
    .slot-result-window {
        width: 130px;
        height: 50px;
    }
    
    .result-display {
        font-size: 1.4rem;
    }
}

/* History Section */
.history-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
    border: 2px solid #1a5f3f;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(197, 46, 11, 0.15);
}

.history-section h3 {
    color: #1a5f3f;
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 700;
    text-align: center;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    border: 1px solid #00d4aa;
}

.history-item {
    padding: 10px 15px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%);
    color: #ffffff;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 8px rgba(254, 32, 30, 0.2);
}

.history-item:last-child {
    margin-bottom: 0;
}

.clear-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .online-bg {
        padding: 15px 15px 80px 15px;
    }
    
    .online-header {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .online-header h2 {
        font-size: 1.6rem;
    }
    
    .online-header p {
        font-size: 1rem;
    }
    
    .game-section {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .game-card {
        padding: 20px;
    }
    
    .number-display {
        font-size: 2.5rem;
        padding: 12px;
        min-height: 70px;
    }
    
    .game-btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
    
    .lucky-wheel-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .wheel-container {
        width: 150px;
        height: 150px;
    }
    
    .wheel-segment {
        font-size: 1rem;
    }
    
    .spin-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .history-section {
        padding: 20px;
    }
    
    .history-list {
        max-height: 150px;
    }
}

/* Dark Theme Support */
.dark-theme .online-bg {
    background: linear-gradient(135deg, #0a3d25 0%, #0f4a2e 100%) !important;
}

.dark-theme .game-card,
.dark-theme .lucky-wheel-section,
.dark-theme .history-section {
    background: linear-gradient(135deg, #0f4a2e 0%, #1a5f3f 100%) !important;
    border: 2px solid #1a5f3f !important;
    box-shadow: 0 8px 25px rgba(254, 32, 30, 0.2) !important;
}

.dark-theme .game-card h3,
.dark-theme .lucky-wheel-section h3,
.dark-theme .history-section h3 {
    color: #1a5f3f !important;
}

.dark-theme .number-display {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    color: #1a5f3f !important;
    border: 3px solid #1a5f3f !important;
}

.dark-theme .history-list {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #00d4aa !important;
}

.dark-theme .history-item {
    background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    color: #ffffff !important;
    border-left: 3px solid #00d4aa !important;
}

/* Dark Theme Mobile Optimization */
@media (max-width: 768px) {
    .dark-theme body {
        background: linear-gradient(135deg, #1a5f3f 0%, #0f4a2e 100%) !important;
    }
    
    .dark-theme .lotto-section,
    .dark-theme .check-section,
    .dark-theme .chat-container {
        box-shadow: 0 2px 12px rgba(212, 175, 55, 0.15) !important;
    }
    
    .dark-theme .tab {
        box-shadow: 0 1px 4px rgba(212, 175, 55, 0.2) !important;
    }
    
    .dark-theme .tab.active {
        box-shadow: 0 4px 15px rgba(254, 32, 30, 0.3) !important;
    }
}

/* Chart Container */
.chart-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 12px 40px rgba(197, 46, 11, 0.2);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(222, 156, 42, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 24px;
    pointer-events: none;
    z-index: 1;
}

.chart-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 50px rgba(197, 46, 11, 0.3);
}

/* Stats Cards */
.stats-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    margin: 16px 0;
    box-shadow: 0 8px 25px rgba(197, 46, 11, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(222, 156, 42, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px;
    pointer-events: none;
    z-index: 1;
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(197, 46, 11, 0.2);
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 480px) {
    .lotto-section {
        padding-bottom: 180px !important;
        margin-bottom: 20px !important;
    }
    
    .stats-section {
        padding-bottom: 180px !important;
    }
    
    #stats-content {
        padding-bottom: 180px !important;
    }
    
    .stats-container {
        padding-bottom: 180px !important;
    }
    
    .lucky-container {
        padding-bottom: 180px !important;
    }
    
    .chat-container {
        padding-bottom: 180px !important;
    }
    
    .lotto-section, .result-box, .sub-prizes, .check-section, .chat-container, .camera-container, .lucky-container {
        padding: 12px 0 0 0 !important;
        border-radius: 20px !important;
    }
    
    .lotto-results {
        padding-bottom: 250px;
    }
    
    .result-box, .main-prize {
        font-size: 2rem !important;
        padding: 16px 0 !important;
    }
    
    .prize-box, .lotto-cell {
        font-size: 1.1rem !important;
        min-height: 65px !important;
        padding: 12px 8px 10px 12px !important;
        border-radius: 16px !important;
    }
    
    .lotto-header {
        padding: 16px 18px 12px 18px !important;
        border-radius: 20px 20px 0 0 !important;
    }
    
    .top-banner {
        padding: 18px 0 14px 0;
        border-radius: 0 0 20px 20px;
    }
    
    .top-banner img {
        width: 70px;
        height: 70px;
        padding: 10px;
        border-radius: 16px;
    }
    .banner-title {
        font-size: 1.8rem;
    }
    .banner-subtitle {
        font-size: 0.9rem;
    }
    .theme-toggle-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        top: 18px;
        right: 18px;
    }
    .logo-glow {
        width: 90px;
        height: 90px;
    }
    
    .tab {
        padding: 12px 14px;
        border-radius: 18px;
        min-width: 60px;
    }
    
    .tab-icon {
        font-size: 1.4rem;
        margin-bottom: 5px;
    }
    
    .tab span {
        font-size: 0.8rem;
    }
    
    .bottom-nav {
        padding: 14px 0;
        border-radius: 20px 20px 0 0;
    }
    
    .check-btn, .suggestion-btn, #capture-btn {
        padding: 14px 24px;
        border-radius: 22px;
        min-width: 130px;
        font-size: 0.95rem;
    }
    
    .input-field-mobile {
        padding: 14px 18px;
        border-radius: 22px;
        font-size: 1rem;
    }
    
    .send-btn-mobile {
        padding: 14px 22px;
        border-radius: 22px;
        min-width: 65px;
    }
    
    .quick-btn {
        padding: 10px 14px;
        border-radius: 22px;
        font-size: 0.85rem;
        min-height: 36px;
        max-height: 36px;
    }
    
    .welcome-compact {
        margin: 0 18px 18px 18px;
        padding: 20px;
        border-radius: 20px;
    }
    
    .welcome-text {
        font-size: 1rem;
    }
    
    .chat-messages-mobile {
        margin: 0 18px 18px 18px;
        padding: 20px;
        border-radius: 20px;
        min-height: 300px;
    }
    
    .chat-input-mobile {
        padding: 18px;
        border-radius: 20px 20px 0 0;
    }
    
    /* Chart Container Mobile */
    .chart-container {
        padding: 18px;
        margin: 18px 0;
        border-radius: 20px;
    }
    
    /* Stats Cards Mobile */
    .stats-card {
        padding: 16px;
        margin: 12px 0;
        border-radius: 18px;
    }
    
    /* Slot Machine Mobile */
    .slot-machine-container {
        max-width: 300px;
    }
    
    .slot-machine {
        padding: 16px;
        border-radius: 18px;
        margin: 16px 0;
    }
}

/* เพิ่ม padding ด้านล่างสำหรับ tab สถิติย้อนหลัง */
.stats-section {
    padding-bottom: 150px !important;
}

/* เพิ่ม padding ด้านล่างสำหรับ tab สถิติย้อนหลัง - ใช้ class ที่ถูกต้อง */
#stats-content {
    padding-bottom: 150px !important;
}

.stats-container {
    padding-bottom: 150px !important;
}

/* ===== หน้า เลขเด็ดประจำวัน ===== */
.stats-section {
    padding: 20px;
    padding-bottom: 150px !important;
}

/* Daily Lucky Section */
.daily-lucky-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(197, 46, 11, 0.15);
    border: 2px solid #1a5f3f;
    text-align: center;
}

.lucky-number-display h3 {
    color: #1a5f3f;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.main-lucky-number {
    font-size: 4rem;
    font-weight: bold;
    color: #1a5f3f;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #1a5f3f, #0f4a2e);
    color: white;
    border-radius: 20px;
    display: inline-block;
    min-width: 200px;
}

.lucky-description {
    color: #666;
    font-size: 1rem;
    margin-bottom: 20px;
}

.generate-lucky-btn {
    background: linear-gradient(135deg, #1a5f3f, #0f4a2e);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.generate-lucky-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(197, 46, 11, 0.3);
}

/* Lucky Tips Section */
.lucky-tips-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(197, 46, 11, 0.15);
    border: 2px solid #1a5f3f;
}

.lucky-tips-section h3 {
    color: #1a5f3f;
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 20px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.tip-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid #1a5f3f;
    transition: all 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(197, 46, 11, 0.2);
}

.tip-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.tip-card h4 {
    color: #1a5f3f;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.tip-card p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.tip-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1a5f3f;
    padding: 10px;
    background: rgba(197, 46, 11, 0.1);
    border-radius: 8px;
}

/* Lucky History Section */
.lucky-history-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 16px rgba(197, 46, 11, 0.15);
    border: 2px solid #1a5f3f;
}

.lucky-history-section h3 {
    color: #1a5f3f;
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 20px;
}

.lucky-history-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.stats-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #1a5f3f, #0f4a2e);
    border-radius: 15px;
    color: white;
}

.stats-header h2 {
    font-size: 1.8rem;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.stats-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
}

/* Stats Overview Cards */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(197, 46, 11, 0.15);
    border: 2px solid #1a5f3f;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::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.5s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1a5f3f;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Chart Section */
.chart-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(197, 46, 11, 0.15);
    border: 2px solid #1a5f3f;
}

.chart-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3rem;
    text-align: center;
}

.stats-chart {
    width: 100%;
    height: clamp(220px, 36vh, 340px);
    position: relative;
}

/* Modern Table */
.table-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 16px rgba(197, 46, 11, 0.15);
    border: 2px solid #1a5f3f;
}

.table-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3rem;
    text-align: center;
}

.modern-table {
    overflow-x: auto;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
}

.modern-table table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    overflow: hidden;
}

.modern-table thead {
    background: linear-gradient(135deg, #1a5f3f, #0f4a2e);
}

.modern-table th {
    padding: 15px 12px;
    text-align: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
}

.modern-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.modern-table tbody tr:hover {
    background: rgba(197, 46, 11, 0.1);
}

.modern-table td {
    padding: 12px;
    text-align: center;
    color: #333;
    font-size: 0.9rem;
}

.modern-table td:first-child {
    font-weight: bold;
    color: #1a5f3f;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.hot {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3);
}

.status-badge.medium {
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    color: white;
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
}

.status-badge.cold {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

/* ===== หน้า เกมเสี่ยงโชค ===== */
.lucky-container {
    padding: 20px;
    padding-bottom: 150px !important;
}

/* Slot Machine Section */
.slot-machine-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(197, 46, 11, 0.15);
    border: 2px solid #1a5f3f;
    text-align: center;
}

.slot-header h3 {
    color: #1a5f3f;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.slot-subtitle {
    color: #666;
    margin-bottom: 30px;
}

.slot-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.slot-machine {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 4px solid #1a5f3f;
}

.slot-display {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.slot-reel {
    width: 60px;
    height: 120px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    border: 3px solid #1a5f3f;
    position: relative;
}

.slot-item {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #1a5f3f;
    background: white;
    border-bottom: 1px solid #ddd;
    transition: all 0.1s ease;
}

/* Animation for slot spinning */
@keyframes slotSpin {
    0% { transform: translateY(0); }
    100% { transform: translateY(-400px); }
}

.slot-reel.spinning {
    animation: slotSpin 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.slot-reel.spinning .slot-item {
    animation: slotItemBlur 0.1s infinite;
}

@keyframes slotItemBlur {
    0%, 100% { filter: blur(0px); }
    50% { filter: blur(1px); }
}

/* Continuous slot spinning effect */
.slot-reel.continuous-spin {
    animation: continuousSpin 0.5s linear infinite;
}

@keyframes continuousSpin {
    0% { transform: translateY(0); }
    100% { transform: translateY(-40px); }
}

/* Slot item highlight during spin */
.slot-item.highlight {
    background: linear-gradient(135deg, #1a5f3f, #0f4a2e);
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px rgba(197, 46, 11, 0.6);
}

/* Slot machine lights effect */
.slot-machine::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: slotLight 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes slotLight {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Enhanced slot machine effects */
.slot-machine {
    position: relative;
    overflow: hidden;
}

.slot-machine::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(197, 46, 11, 0.1) 0%, transparent 70%);
    animation: slotGlow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes slotGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Slot reel enhanced effects */
.slot-reel.spinning {
    box-shadow: 0 0 20px rgba(197, 46, 11, 0.5);
}

.slot-reel.spinning .slot-item {
    text-shadow: 0 0 10px rgba(197, 46, 11, 0.8);
}

/* Result display enhancement */
.result-display {
    position: relative;
    overflow: hidden;
}

.result-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: resultShine 0.5s ease-out;
}

@keyframes resultShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.slot-result {
    text-align: center;
    margin-top: 20px;
}

.result-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1a5f3f;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    border: 2px solid #1a5f3f;
    transition: all 0.3s ease;
    animation: resultPulse 0.5s ease-out;
    opacity: 1;
    transform: scale(1);
}

@keyframes resultPulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.result-display.winning {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border-color: #27ae60;
    animation: winningGlow 1s ease-in-out infinite alternate;
}

@keyframes winningGlow {
    0% { box-shadow: 0 0 20px rgba(39, 174, 96, 0.5); }
    100% { box-shadow: 0 0 30px rgba(39, 174, 96, 0.8); }
}

.slot-controls {
    margin-top: 20px;
}

.spin-slot-btn {
    background: linear-gradient(135deg, #1a5f3f, #0f4a2e);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.spin-slot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(197, 46, 11, 0.3);
}

/* Mini Games Section */
.mini-games-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(197, 46, 11, 0.15);
    border: 2px solid #1a5f3f;
}

.mini-games-section h3 {
    color: #1a5f3f;
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 20px;
}

.mini-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.mini-game-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid #1a5f3f;
    transition: all 0.3s ease;
}

.mini-game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(197, 46, 11, 0.2);
}

.mini-game-card h4 {
    color: #1a5f3f;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.game-number {
    font-size: 2rem;
    font-weight: bold;
    color: #1a5f3f;
    margin: 15px 0;
    padding: 15px;
    background: rgba(198 202 193);
    border-radius: 10px;
}

.mini-game-btn {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 2px solid #1a5f3f;
    background: rgba(255, 255, 255, 0.95);
    color: #1a5f3f;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mini-game-btn:hover {
    background: #1a5f3f;
    color: white;
}

/* Game History Section */
.game-history-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 16px rgba(197, 46, 11, 0.15);
    border: 2px solid #1a5f3f;
}

.game-history-section h3 {
    color: #1a5f3f;
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 20px;
}

.game-history-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.lucky-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #1a5f3f, #0f4a2e);
    border-radius: 15px;
    color: white;
}

.lucky-header h2 {
    font-size: 1.8rem;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.lucky-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
}

/* Fortune Wheel Section */
.fortune-wheel-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(197, 46, 11, 0.15);
    border: 2px solid #1a5f3f;
    text-align: center;
}

.wheel-header h3 {
    font-size: 1.5rem;
    margin: 0 0 10px 0;
    color: #333;
}

.wheel-subtitle {
    color: #666;
    margin-bottom: 30px;
}

.wheel-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.wheel-background {
    position: relative;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.wheel-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: wheelGlow 3s ease-in-out infinite alternate;
}

@keyframes wheelGlow {
    0% { opacity: 0.3; }
    100% { opacity: 0.8; }
}

.wheel-stars {
    position: absolute;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    font-size: 1.2rem;
    animation: starTwinkle 2s ease-in-out infinite;
}

.star-1 { top: 10%; left: 20%; animation-delay: 0s; }
.star-2 { top: 20%; right: 15%; animation-delay: 0.5s; }
.star-3 { bottom: 30%; left: 10%; animation-delay: 1s; }
.star-4 { bottom: 20%; right: 25%; animation-delay: 1.5s; }
.star-5 { top: 50%; left: 50%; transform: translate(-50%, -50%); animation-delay: 0.8s; }

@keyframes starTwinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.fortune-wheel {
    position: relative;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #ff6b6b 0deg 36deg,
        #4ecdc4 36deg 72deg,
        #45b7d1 72deg 108deg,
        #96ceb4 108deg 144deg,
        #feca57 144deg 180deg,
        #ff9ff3 180deg 216deg,
        #54a0ff 216deg 252deg,
        #5f27cd 252deg 288deg,
        #00d2d3 288deg 324deg,
        #ff9f43 324deg 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wheel-segments {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.wheel-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: 100% 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.wheel-segment:nth-child(1) { transform: rotate(0deg); }
.wheel-segment:nth-child(2) { transform: rotate(36deg); }
.wheel-segment:nth-child(3) { transform: rotate(72deg); }
.wheel-segment:nth-child(4) { transform: rotate(108deg); }
.wheel-segment:nth-child(5) { transform: rotate(144deg); }
.wheel-segment:nth-child(6) { transform: rotate(180deg); }
.wheel-segment:nth-child(7) { transform: rotate(216deg); }
.wheel-segment:nth-child(8) { transform: rotate(252deg); }
.wheel-segment:nth-child(9) { transform: rotate(288deg); }
.wheel-segment:nth-child(10) { transform: rotate(324deg); }

.wheel-pointer {
    position: absolute;
    top: -8px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 24px solid #1a5f3f;
    z-index: 10;
}

.wheel-result {
    text-align: center;
    margin-top: 20px;
}

.result-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1a5f3f;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.result-message {
    color: #666;
    font-size: 0.9rem;
}

.wheel-controls {
    margin-top: 20px;
}

.spin-wheel-btn {
    padding: 12px 25px;
    border-radius: 25px;
    border: none;
    background: linear-gradient(135deg, #1a5f3f, #0f4a2e);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spin-wheel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(197, 46, 11, 0.3);
}

.btn-aura {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.spin-wheel-btn:hover .btn-aura {
    left: 100%;
}

/* Game Section */
.game-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.game-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(197, 46, 11, 0.15);
    border: 2px solid #1a5f3f;
    transition: all 0.3s ease;
}

.game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.game-card h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1rem;
}

.number-display {
    font-size: 2rem;
    font-weight: bold;
    color: #1a5f3f;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-btn {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 2px solid #1a5f3f;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-btn:hover {
    border-color: #1a5f3f;
    background: #1a5f3f;
    color: white;
}

/* History Section */
.history-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 16px rgba(197, 46, 11, 0.15);
    border: 2px solid #1a5f3f;
}

.history-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3rem;
    text-align: center;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid #1a5f3f;
    color: #333;
    font-size: 0.9rem;
}

.history-item:last-child {
    border-bottom: none;
}

.clear-btn {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 2px solid #1a5f3f;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    border-color: #e74c3c;
    background: #e74c3c;
    color: white;
}

/* ===== แก้ไข Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border-top: var(--glass-border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 60px;
    text-align: center;
}

.tab-icon {
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.tab span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
    line-height: 1;
}

.tab.active {
    background: rgba(197, 46, 11, 0.1);
    border: 1px solid var(--accent-color);
}

.tab.active .tab-icon,
.tab.active span {
    color: var(--accent-color);
}

.tab:hover {
    background: rgba(197, 46, 11, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-section, .lucky-container {
        padding: 15px;
        padding-bottom: 160px !important;
    }
    
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-section {
        grid-template-columns: 1fr;
    }
    
    .wheel-background {
        width: 240px;
        height: 240px;
    }
    
    .fortune-wheel {
        width: 190px;
        height: 190px;
    }
    
    .wheel-segment {
        font-size: 0.9rem;
    }
    
    .result-number {
        font-size: 2rem;
    }
    
    .bottom-nav {
        padding: 6px 0;
    }
    
    .tab {
        padding: 6px 8px;
        min-width: 50px;
    }
    
    .tab-icon {
        font-size: 1rem;
    }
    
    .tab span {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .stats-section, .lucky-container {
        padding: 10px;
        padding-bottom: 180px !important;
    }
    
    .stats-overview {
        grid-template-columns: 1fr;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .mini-games-grid {
        grid-template-columns: 1fr;
    }
    
    .main-lucky-number {
        font-size: 3rem;
        min-width: 150px;
        padding: 15px;
    }
    
    .slot-machine {
        padding: 20px;
    }
    
    .slot-display {
        gap: 15px;
    }
    
    .slot-reel {
        width: 50px;
        height: 100px;
    }
    
    .slot-item {
        height: 33.33px;
        font-size: 1.2rem;
    }
    
    .wheel-background {
        width: 200px;
        height: 200px;
    }
    
    .fortune-wheel {
        width: 150px;
        height: 150px;
    }
    
    .wheel-segment {
        font-size: 0.8rem;
    }
    
    .result-number {
        font-size: 1.8rem;
    }
    
    .bottom-nav {
        padding: 4px 0;
    }
    
    .tab {
        padding: 4px 6px;
        min-width: 45px;
    }
    
    .tab-icon {
        font-size: 0.9rem;
    }
    
    .tab span {
        font-size: 0.6rem;
    }
}

/* ===== Responsive overrides for Stats Chart (mobile-first) ===== */
@media (min-width: 480px) {
    #stats-chart, .stats-chart {
        height: clamp(260px, 38vh, 360px);
    }
}

@media (min-width: 768px) {
    #stats-chart, .stats-chart {
        height: clamp(320px, 42vh, 420px);
    }
}

@media (min-width: 1024px) {
    #stats-chart, .stats-chart {
        height: clamp(360px, 45vh, 480px);
    }
}