:root {
    /* โทนสีแดง-ดำ */
    --bg-gradient: linear-gradient(135deg, #8B0000 0%, #300000 50%, #000000 100%);
    --header-gradient: linear-gradient(to right, #000000, #8B0000, #000000);
    --bg-card: rgba(20, 0, 0, 0.75);
    --bg-card-hover: rgba(5, 0, 0, 0.95);
    --border-color: #5a0000;
    --accent-yellow: #FFD700;
    --text-white: #ffffff;
    --text-gray: #dddddd;
    --box-border: #444;
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Kanit', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-white);
    line-height: 1.6;
    padding-bottom: 70px;
}

a { text-decoration: none; color: inherit; font-family: 'Kanit', sans-serif; }

.text-yellow { color: var(--accent-yellow); text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }

h1, h2, h3, h4, h5, h6 { font-family: 'Kanit', sans-serif; }
h1 { font-size: 36px; color: var(--text-white); text-shadow: 2px 2px 4px rgba(0,0,0,0.8); margin-top: 0; }
h2 { font-size: 30px; color: var(--text-white); text-shadow: 2px 2px 4px rgba(0,0,0,0.8); }
h3, h4 { color: var(--text-white); text-shadow: 2px 2px 4px rgba(0,0,0,0.8); }

/* Header Navigation */
header {
    background: var(--header-gradient);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 2px solid var(--accent-yellow);
    box-shadow: 0 2px 10px rgba(0,0,0,0.9);
}

.nav-container {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

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

.nav-links { display: flex; gap: 25px; list-style: none; margin: 0; padding: 0; }
.nav-links li a { font-weight: 500; font-size: 16px; transition: color 0.3s; font-family: 'Kanit', sans-serif; }
.nav-links li a:hover { color: var(--accent-yellow); }

.auth-buttons { display: flex; gap: 10px; }
.btn { padding: 8px 20px; border-radius: 5px; font-weight: 600; font-size: 15px; cursor: pointer; transition: 0.3s; text-align: center; font-family: 'Kanit', sans-serif; }
.btn-outline { border: 1px solid var(--accent-yellow); color: var(--accent-yellow); background: rgba(0,0,0,0.5); }
.btn-outline:hover { background: var(--accent-yellow); color: #000; }
.btn-primary { background: var(--accent-yellow); color: #000; border: none; }
.btn-primary:hover { background: var(--text-white); color: #000; }

/* Section CTA Interlude Buttons */
.section-cta-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0 50px 0;
    flex-wrap: wrap;
}
.section-cta-bar .btn {
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}
.btn-secondary-action {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--accent-yellow);
    color: var(--accent-yellow);
}
.btn-secondary-action:hover {
    background: var(--accent-yellow);
    color: #000;
}

/* Main Container */
.container { max-width: 1140px; margin: 100px auto 40px auto; padding: 0 20px; font-family: 'Kanit', sans-serif; }

/* Hero Section */
.hero-section {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 30px; 
    padding: 40px;
    text-align: left;
    margin-bottom: 50px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}
.hero-section p { color: var(--text-gray); font-size: 17px; margin-bottom: 30px; }
.hero-buttons { display: flex; gap: 15px; justify-content: flex-start; }
.hero-buttons .btn { padding: 12px 30px; font-size: 16px; border-radius: 15px; }

.lottery-categories { display: flex; gap: 15px; margin-top: 35px; flex-wrap: wrap; }
.lottery-pill {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    padding: 8px 25px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.05);
    transition: 0.3s;
    font-family: 'Kanit', sans-serif;
}
.lottery-pill:hover, .lottery-pill.active { border-color: var(--accent-yellow); color: var(--accent-yellow); background: rgba(255, 215, 0, 0.1); }

/* Banner ระหว่าง Section */
.section-banner-box {
    width: 100%;
    aspect-ratio: 1600 / 687;
    background: rgba(20, 0, 0, 0.75);
    border: 2px dashed var(--accent-yellow);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    font-size: 16px;
    text-align: center;
    margin-bottom: 40px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}
.section-banner-box img { width: 100%; height: 100%; object-fit: cover; }

/* Layout Basics */
.section-box { margin-bottom: 60px; scroll-margin-top: 100px; }
.section-title { font-size: 32px; margin-bottom: 25px; border-left: 5px solid var(--accent-yellow); padding-left: 15px; line-height: 1.3; font-family: 'Kanit', sans-serif; }

/* Calculator UI */
.calc-container {
    background: rgba(20, 0, 0, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 40px;
    margin-bottom: 50px;
    scroll-margin-top: 90px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}
.calc-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--box-border); padding-bottom: 15px; margin-bottom: 25px; }
.calc-badge { border: 1px solid var(--accent-yellow); color: var(--accent-yellow); border-radius: 20px; padding: 5px 15px; font-size: 14px; }
.calc-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; }

.type-toggle { display: flex; background: rgba(0,0,0,0.6); border-radius: 15px; overflow: hidden; border: 1px solid var(--box-border); }
.type-btn {
    flex: 1; text-align: center; padding: 15px; cursor: pointer; transition: 0.3s;
    color: var(--text-gray); border-right: 1px solid var(--box-border);
    font-family: 'Kanit', sans-serif;
}
.type-btn:last-child { border-right: none; }
.type-btn.active { background: var(--accent-yellow); color: #000; font-weight: bold; }
.type-btn.active span { color: #333; }

input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; margin: 15px 0; }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 8px; cursor: pointer; background: rgba(255,215,0,0.3); border-radius: 5px; }
input[type=range]::-webkit-slider-thumb { border: 2px solid #000; height: 20px; width: 20px; border-radius: 50%; background: var(--accent-yellow); cursor: pointer; -webkit-appearance: none; margin-top: -6px; }

.quick-bets { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.quick-bet-btn {
    background: transparent; border: 1px solid var(--box-border); color: var(--text-gray);
    border-radius: 20px; padding: 5px 15px; cursor: pointer; transition: 0.3s; font-family: 'Kanit', sans-serif;
}
.quick-bet-btn.active, .quick-bet-btn:hover { border-color: var(--accent-yellow); color: var(--accent-yellow); background: rgba(255,215,0,0.1); }

.result-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--box-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}
.result-number { font-size: 52px; margin: 10px 0; color: var(--accent-yellow); font-weight: bold; text-shadow: 2px 2px 5px rgba(0,0,0,0.8); }
.calc-footer { border-top: 1px solid var(--box-border); margin-top: 25px; padding-top: 20px; font-size: 14px; color: var(--text-gray); display: flex; justify-content: space-between; align-items: flex-end; }

/* Grids & Cards */
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.grid-6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.card { 
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    border-radius: 30px; 
    padding: 35px; 
    transition: 0.3s; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); 
    font-family: 'Kanit', sans-serif;
}
.card:hover { transform: translateY(-5px); border-color: var(--accent-yellow); background: var(--bg-card-hover); }
.card h3 { color: var(--accent-yellow); margin-top: 0; font-size: 22px; margin-bottom: 10px; text-shadow: none; font-family: 'Kanit', sans-serif; }

ul.custom-list { list-style: none; padding: 0; margin: 0; font-family: 'Kanit', sans-serif; }
ul.custom-list li { padding: 15px 0; border-bottom: 1px solid #444; color: var(--text-gray); font-size: 16px; }
ul.custom-list li:last-child { border-bottom: none; }
ul.custom-list li strong { color: var(--accent-yellow); display: block; margin-bottom: 5px; font-size: 18px; }

/* --- TOP 10 --- */
.top10-list { 
    display: flex; 
    flex-direction: column; 
    gap: 25px; 
    margin-top: 20px; 
}
.top10-item { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 25px;
    align-items: center;
    background: var(--bg-card); border: 1px solid var(--border-color); 
    border-radius: 30px; padding: 30px; transition: 0.3s;
}
.top10-item:hover { border-color: var(--accent-yellow); transform: translateY(-3px); background: var(--bg-card-hover); }

.top10-img-box {
    width: 100%; 
    aspect-ratio: 2048 / 640; 
    background: rgba(0,0,0,0.5); border: 1px dashed var(--accent-yellow);
    border-radius: 15px; display: flex; align-items: center; justify-content: center; 
    color: var(--text-gray); font-size: 13px; text-align: center; overflow: hidden;
}
.top10-img-box img { width: 100%; height: 100%; object-fit: cover; }

.top10-right-content {
    display: flex; flex-direction: column; justify-content: space-between; height: 100%; position: relative;
}
.top10-header-flex { display: flex; align-items: center; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.top10-title-area { display: flex; align-items: center; gap: 12px; }
.rank-badge { 
    background: var(--accent-yellow); color: #000; font-size: 20px; font-weight: bold; 
    border-radius: 50%; width: 38px; height: 38px; display: flex; 
    align-items: center; justify-content: center; flex-shrink: 0;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    font-family: 'Kanit', sans-serif;
}
.top10-content h3 { margin: 0; font-size: 24px; color: var(--accent-yellow); text-shadow: none; line-height: 1.2; font-family: 'Kanit', sans-serif; }
.top10-right-content > p { margin: 0 0 20px 0; color: var(--text-gray); font-size: 14px; line-height: 1.6; }
.top10-action { display: flex; justify-content: flex-start; }

/* Promo (2 คอลัมน์) */
.promo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 20px; }
.promo-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 30px; padding: 25px; display: flex; flex-direction: column; transition: 0.3s;
}
.promo-card:hover { border-color: var(--accent-yellow); transform: translateY(-5px); background: var(--bg-card-hover); }
.promo-img-box {
    width: 100%; aspect-ratio: 990 / 320; background: rgba(0, 0, 0, 0.5);
    border: 1px dashed var(--accent-yellow); border-radius: 15px; display: flex;
    align-items: center; justify-content: center; color: var(--text-gray); font-size: 13px;
    margin-bottom: 20px; text-align: center; overflow: hidden;
}
.promo-img-box img { width: 100%; height: 100%; object-fit: cover; }
.promo-content h3 { color: var(--accent-yellow); font-size: 22px; margin-top: 0; margin-bottom: 10px; text-shadow: none; font-family: 'Kanit', sans-serif; }
.promo-content p { color: var(--text-gray); font-size: 16px; margin: 0; line-height: 1.6; }

/* เว็บน้องใหม่ (2 คอลัมน์) */
.newweb-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 20px; }

/* รูปแบบการซื้อหวย */
.lottery-grid-container { display: flex; flex-direction: column; gap: 20px; }
.lottery-row-1 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.lottery-row-2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* วิธีเลือกเว็บและข้อควรระวัง */
.warning-modern-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; margin-top: 30px; }
.warning-box { background: rgba(0, 0, 0, 0.4); border-radius: 20px; padding: 30px; border: 1px solid var(--box-border); }
.warning-box.danger { border-left: 5px solid #ff4d4d; }
.warning-box.safe { border-left: 5px solid #2ecc71; }
.warning-box h4 { font-size: 20px; margin-top: 0; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; font-family: 'Kanit', sans-serif; }
.warning-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 15px; }
.warning-list li {
    display: flex; align-items: flex-start; gap: 12px; font-size: 15px; color: var(--text-gray);
    background: rgba(255, 255, 255, 0.03); padding: 12px 15px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.05);
}

/* CTA Banner ส่งท้าย */
.cta-banner-section {
    background: linear-gradient(135deg, #8B0000 0%, #300000 50%, #000000 100%);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 40px 50px;
    margin-top: 60px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    text-align: center;
}
.cta-content h2 { font-size: 32px; color: #ffffff; margin-top: 0; margin-bottom: 15px; text-shadow: 2px 2px 4px rgba(0,0,0,0.8); font-family: 'Kanit', sans-serif; }
.cta-content p { color: var(--text-gray); font-size: 16px; line-height: 1.6; margin-bottom: 25px; max-width: 800px; margin-left: auto; margin-right: auto; }
.cta-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 30px; }
.cta-badge { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 20px; padding: 6px 16px; font-size: 14px; color: #ffffff; }
.cta-buttons { display: flex; justify-content: center; gap: 15px; margin-bottom: 25px; align-items: center; }
.btn-cta-primary { background: var(--accent-yellow); color: #000000; font-weight: bold; padding: 12px 40px; border-radius: 12px; font-size: 16px; box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3); transition: 0.3s; font-family: 'Kanit', sans-serif; }
.btn-cta-primary:hover { background: #ffffff; transform: translateY(-2px); }
.cta-footer-text { font-size: 13px; color: #aaaaaa; line-height: 1.5; }
.cta-footer-text a { color: var(--accent-yellow); text-decoration: underline; }

/* Tables */
.table-responsive { overflow-x: auto; margin-top: 20px; border-radius: 15px; }
table { width: 100%; border-collapse: collapse; background: rgba(0,0,0,0.6); text-align: center; font-size: 15px; font-family: 'Kanit', sans-serif; }
th { background: rgba(139, 0, 0, 0.8); color: var(--accent-yellow); padding: 15px; border: 1px solid #444; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); font-size: 16px; font-family: 'Kanit', sans-serif; }
td { padding: 12px; border: 1px solid #444; color: var(--text-gray); }
tr:hover { background: rgba(255, 215, 0, 0.1); }

/* FAQ Accordion */
.faq-item {
    background: rgba(30, 0, 0, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: 0.3s;
}
.faq-item:hover { border-color: var(--accent-yellow); }
.faq-summary {
    padding: 20px; font-weight: 600; cursor: pointer; list-style: none;
    display: flex; justify-content: space-between; align-items: center; color: var(--text-white); font-size: 18px;
    font-family: 'Kanit', sans-serif;
}
.faq-summary::after { content: '+'; color: var(--accent-yellow); font-size: 24px; font-weight: bold; }
details[open] .faq-summary::after { content: '-'; }
details[open] .faq-summary { border-bottom: 1px solid #444; color: var(--accent-yellow); }
.faq-content { padding: 20px; font-size: 16px; color: #ccc; background: rgba(0, 0, 0, 0.5); line-height: 1.7; }

/* Desktop Footer (Full-width) */
.desktop-footer-wrapper {
    background: #050000;
    border-top: 2px solid var(--accent-yellow);
    margin-top: 60px;
    width: 100%;
}
.desktop-footer {
    max-width: 1140px;
    margin: 0 auto;
    padding: 50px 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    color: var(--text-gray);
    font-size: 15px;
    font-family: 'Kanit', sans-serif;
}
.desktop-footer h3 { color: var(--text-white); margin-bottom: 20px; font-size: 20px; font-family: 'Kanit', sans-serif; }
.desktop-footer ul { list-style: none; padding: 0; }
.desktop-footer ul li { margin-bottom: 10px; }

.footer-logo img {
    height: 45px;
    width: auto;
    display: block;
    margin-bottom: 15px;
}

.footer-bottom-bar {
    background: #000000;
    padding: 15px;
    text-align: center;
    color: #555;
    font-size: 13px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.mobile-bottom-nav { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background: #0a0000; border-top: 2px solid var(--accent-yellow); z-index: 1000; justify-content: space-around; padding: 10px 0; box-shadow: 0 -5px 15px rgba(0,0,0,0.8); font-family: 'Kanit', sans-serif; }
.mobile-item { text-align: center; font-size: 11px; flex: 1; color: var(--text-gray); }
.mobile-item.active { color: var(--accent-yellow); }
.mobile-item .icon { display: block; font-size: 20px; margin-bottom: 3px; }

.newweb-card:hover {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.8) 0%, rgba(60, 0, 0, 0.9) 100%) !important;
    border-color: var(--accent-yellow) !important;
}

/* Responsive */
@media (max-width: 1200px) {
    .container, .nav-container, .desktop-footer { max-width: 100%; padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 992px) {
    .grid-6 { grid-template-columns: repeat(2, 1fr); }
    .split-grid { grid-template-columns: 1fr; }
    .promo-grid { grid-template-columns: 1fr; }
    .newweb-grid { grid-template-columns: 1fr; } 
    .top10-item { grid-template-columns: 1fr; } 
    .top10-header-flex { flex-direction: column; align-items: flex-start; gap: 10px; }
    .lottery-row-1, .lottery-row-2 { grid-template-columns: 1fr; }
    .warning-modern-grid { grid-template-columns: 1fr; }
    .cta-banner-section { padding: 30px 20px; }
    .desktop-footer { grid-template-columns: repeat(2, 1fr); }
    .calc-grid { grid-template-columns: 1fr; } 
}
@media (max-width: 768px) {
    .nav-links, .auth-buttons { display: none; }
    .mobile-bottom-nav { display: flex; }
    .grid-6 { grid-template-columns: 1fr; }
    .promo-grid { grid-template-columns: 1fr; }
    .hero-section { text-align: center; padding: 25px;} 
    .hero-section h1 { font-size: 28px; }
    .hero-section p { text-align: center; }
    .hero-buttons, .lottery-categories { justify-content: center; }
    .cta-buttons { flex-direction: column; width: 100%; }
    .btn-cta-primary { width: 100%; text-align: center; }
    .desktop-footer { grid-template-columns: 1fr; padding-bottom: 100px; text-align: center; }
    .calc-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .calc-footer { flex-direction: column; align-items: flex-start; gap: 15px; }
    .card { padding: 20px; }
    .section-title { font-size: 26px; }
}