/* ============================================
   Lotto99 - เว็บหวยออนไลน์
   Design: Royal Purple + Champagne Gold + Coral
   Fonts: Prompt (headings) + Sarabun (body)
   ============================================ */

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

:root {
  --primary: #6D28D9;
  --primary-dark: #4C1D95;
  --primary-light: #8B5CF6;
  --primary-tint: #EDE9FE;
  --gold: #D97706;
  --gold-light: #F59E0B;
  --gold-tint: #FEF3C7;
  --coral: #F87171;
  --coral-dark: #EF4444;
  --cream: #FFFBEB;
  --white: #FFFFFF;
  --ink: #1E1B4B;
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6B7280;
  --gray-300: #D1D5DB;
  --gray-100: #F3F4F6;
  --success: #10B981;
  --shadow-sm: 0 2px 6px rgba(76,29,149,0.06);
  --shadow-md: 0 6px 20px rgba(76,29,149,0.10);
  --shadow-lg: 0 14px 40px rgba(76,29,149,0.14);
  --radius: 20px;
  --radius-sm: 12px;
  --grad-primary: linear-gradient(135deg, #6D28D9 0%, #F87171 100%);
  --grad-gold: linear-gradient(180deg, #FCD34D 0%, #D97706 100%);
  --container: 1200px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Sarabun', 'Segoe UI', Tahoma, sans-serif;
  color: var(--gray-900);
  background: var(--cream);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Skip link (a11y) */
.skip-link {
  position: absolute; top: -100px; left: 8px; z-index: 999;
  background: var(--primary); color: var(--white);
  padding: 8px 16px; border-radius: 6px; text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 8px; }

/* Typography */
h1, h2, h3, h4, h5 {
  font-family: 'Prompt', 'Sarabun', sans-serif;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.2rem;
}
h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  color: var(--primary-dark);
  margin: 2.5rem 0 1rem;
  position: relative;
  padding-bottom: 0.6rem;
}
h2::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 56px; height: 4px;
  background: var(--grad-gold);
  border-radius: 2px;
}
h3 {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 700;
  color: var(--primary);
  margin: 1.6rem 0 0.7rem;
}
h4 { font-size: 1.1rem; font-weight: 700; color: var(--gray-700); margin: 1rem 0 0.5rem; }
p { margin: 0 0 1rem; }
a { color: var(--primary); text-decoration: underline; text-decoration-color: rgba(109,40,217,0.35); text-underline-offset: 3px; transition: color 0.15s; }
a:hover { color: var(--coral-dark); text-decoration-color: var(--coral-dark); }
strong { color: var(--primary-dark); font-weight: 700; }

/* Layout container */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ============ HEADER ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,251,235,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--primary-tint);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; max-width: var(--container); margin: 0 auto;
}
.brand { display: flex; align-items: center; }
.brand img { height: 44px; width: auto; display: block; }
.nav-desktop { display: flex; gap: 6px; }
.nav-desktop a {
  padding: 8px 14px; border-radius: 8px;
  color: var(--gray-700); text-decoration: none; font-weight: 600; font-size: 15px;
  transition: all 0.18s;
}
.nav-desktop a:hover { background: var(--primary-tint); color: var(--primary-dark); }
.nav-desktop a.cta {
  background: var(--grad-primary); color: var(--white);
  padding: 9px 20px; border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.nav-desktop a.cta:hover { background: var(--gold); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.hamburger {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; border-radius: 6px;
}
.hamburger span {
  display: block; width: 26px; height: 3px; background: var(--primary-dark);
  margin: 5px 0; border-radius: 2px; transition: transform 0.2s;
}
.nav-mobile {
  display: none; background: var(--cream);
  border-top: 1px solid var(--primary-tint);
  padding: 12px 20px 20px;
}
.nav-mobile a {
  display: block; padding: 12px 14px; border-radius: 8px;
  color: var(--gray-900); text-decoration: none; font-weight: 600;
  margin-bottom: 4px; min-height: 44px;
}
.nav-mobile a:hover, .nav-mobile a:focus { background: var(--primary-tint); color: var(--primary-dark); }
.nav-mobile a.cta { background: var(--grad-primary); color: var(--white); text-align: center; margin-top: 8px; }
.nav-mobile.open { display: block; }

/* ============ HERO ============ */
.hero {
  position: relative;
  background: linear-gradient(135deg, #4C1D95 0%, #6D28D9 50%, #7C3AED 100%);
  color: var(--cream);
  padding: 60px 0 100px;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 30%, rgba(245,158,11,0.15) 0%, transparent 40%),
                    radial-gradient(circle at 80% 70%, rgba(248,113,113,0.15) 0%, transparent 40%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 60px;
  background: var(--cream);
  clip-path: polygon(0 100%, 100% 100%, 100% 30%, 0 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center;
  max-width: var(--container); margin: 0 auto; padding: 0 20px;
}
.hero h1 {
  color: var(--cream);
  background: linear-gradient(90deg, #FEFCE8 0%, #FCD34D 60%, #F87171 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(2rem, 4.8vw, 3.2rem);
  margin-bottom: 1rem;
}
.hero-tagline {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: rgba(255,251,235,0.92);
  margin-bottom: 1.6rem;
  max-width: 540px;
}
.hero-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-cta-row .btn { min-height: 48px; }
.hero-illus { width: 100%; height: auto; display: block; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.25)); }
.hero .updated {
  margin-top: 1.4rem; font-size: 0.9rem; color: rgba(255,251,235,0.75);
}
.hero .updated time { font-weight: 600; color: var(--gold-light); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 26px; border-radius: 12px; font-weight: 700;
  text-decoration: none; font-family: 'Prompt', sans-serif; font-size: 15px;
  border: none; cursor: pointer; transition: all 0.2s;
  min-height: 44px;
}
.btn-primary {
  background: var(--grad-gold); color: var(--ink);
  box-shadow: 0 4px 14px rgba(217,119,6,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(217,119,6,0.45); color: var(--ink); }
.btn-ghost {
  background: rgba(255,251,235,0.15); color: var(--cream);
  border: 2px solid rgba(255,251,235,0.4);
}
.btn-ghost:hover { background: rgba(255,251,235,0.3); color: var(--cream); }
.btn-outline {
  background: var(--white); color: var(--primary-dark);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }

/* ============ SECTIONS ============ */
main section { padding: 50px 0; }
main section.tinted { background: linear-gradient(180deg, var(--primary-tint) 0%, var(--cream) 100%); }
main section.gold-tinted { background: linear-gradient(180deg, var(--gold-tint) 0%, var(--cream) 100%); }

.section-intro { max-width: 780px; margin-bottom: 2rem; }
.section-intro p { color: var(--gray-700); font-size: 1.05rem; }

/* ============ TABLE OF CONTENTS ============ */
.toc {
  background: var(--white); border-radius: var(--radius);
  padding: 24px 28px; margin: 30px 0;
  border-top: 6px solid var(--gold-light);
  box-shadow: var(--shadow-md);
}
.toc h2 { margin-top: 0; }
.toc ol { padding-left: 1.4rem; column-count: 2; column-gap: 40px; }
.toc ol li { padding: 4px 0; break-inside: avoid; }
.toc ol li a { color: var(--gray-700); text-decoration: none; font-weight: 500; }
.toc ol li a:hover { color: var(--primary); text-decoration: underline; }
@media (max-width: 640px) { .toc ol { column-count: 1; } }

/* ============ CASINO CARDS (TOP 5) ============ */
.casino-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 30px 0;
}
.casino-card {
  background: var(--white); border-radius: var(--radius);
  padding: 28px 24px 24px; position: relative;
  box-shadow: var(--shadow-md);
  border-top: 6px solid var(--gold-light);
  transition: transform 0.2s, box-shadow 0.2s;
}
.casino-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.casino-rank {
  position: absolute; top: -20px; left: 24px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--grad-primary); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Prompt', sans-serif; font-weight: 800; font-size: 1.2rem;
  box-shadow: 0 6px 16px rgba(109,40,217,0.4);
  border: 3px solid var(--white);
}
.casino-name {
  font-family: 'Prompt', sans-serif; font-size: 1.35rem; font-weight: 700;
  color: var(--primary-dark); margin: 12px 0 4px;
}
.casino-rating {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--gold-tint); color: var(--gold);
  padding: 4px 10px; border-radius: 20px;
  font-size: 0.9rem; font-weight: 700;
  margin-bottom: 12px;
}
.casino-bonus {
  background: linear-gradient(90deg, var(--gold-tint) 0%, transparent 100%);
  border-left: 4px solid var(--gold-light);
  padding: 10px 14px; margin: 14px 0;
  border-radius: 0 8px 8px 0;
}
.casino-bonus strong { display: block; color: var(--gold); font-size: 1.1rem; }
.casino-bonus span { color: var(--gray-700); font-size: 0.9rem; }
.casino-meta { list-style: none; padding: 0; margin: 10px 0 18px; font-size: 0.92rem; }
.casino-meta li { padding: 4px 0; color: var(--gray-700); }
.casino-meta li::before { content: '✓ '; color: var(--success); font-weight: 700; margin-right: 6px; }
.casino-card .btn { width: 100%; margin-top: 10px; }

/* ============ COMPARISON TABLE ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-md); margin: 24px 0; }
table {
  width: 100%; border-collapse: collapse; background: var(--white);
  min-width: 720px;
}
thead th {
  background: var(--grad-primary); color: var(--cream);
  font-family: 'Prompt', sans-serif; font-weight: 700; font-size: 0.95rem;
  padding: 14px 12px; text-align: left; border-bottom: 3px solid var(--gold-light);
}
tbody td { padding: 14px 12px; border-bottom: 1px solid var(--primary-tint); }
tbody tr:nth-child(even) { background: var(--cream); }
tbody tr:hover { background: var(--gold-tint); }
tbody td strong { color: var(--primary-dark); }

/* ============ PROS/CONS ============ */
.proscons {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0;
}
.proscons > div {
  background: var(--white); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.pros { border-top: 6px solid var(--success); }
.cons { border-top: 6px solid var(--coral-dark); }
.pros h3 { color: var(--success); }
.cons h3 { color: var(--coral-dark); }
.proscons ul { list-style: none; padding: 0; }
.proscons ul li { padding: 8px 0; padding-left: 28px; position: relative; }
.pros ul li::before {
  content: '+'; position: absolute; left: 0; top: 8px;
  width: 20px; height: 20px; background: var(--success); color: var(--white);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.cons ul li::before {
  content: '−'; position: absolute; left: 0; top: 8px;
  width: 20px; height: 20px; background: var(--coral-dark); color: var(--white);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
@media (max-width: 640px) { .proscons { grid-template-columns: 1fr; } }

/* ============ STEPS ============ */
.steps { counter-reset: step; margin: 24px 0; }
.step {
  background: var(--white); border-radius: var(--radius-sm);
  padding: 18px 24px 18px 76px; margin-bottom: 14px;
  position: relative;
  border-left: 4px solid var(--gold-light);
  box-shadow: var(--shadow-sm);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 20px; top: 18px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--grad-primary); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Prompt', sans-serif; font-weight: 800; font-size: 1.15rem;
}
.step h4 { margin: 0 0 4px; color: var(--primary-dark); }
.step p { margin: 0; color: var(--gray-700); font-size: 0.98rem; }

/* ============ INFO CARDS ============ */
.info-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 24px 0;
}
.info-card {
  background: var(--white); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--primary-light);
}
.info-card h3 { margin-top: 0; color: var(--primary-dark); font-size: 1.15rem; }
.info-card p { color: var(--gray-700); font-size: 0.95rem; margin-bottom: 0; }
.info-card .icon-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--gold-tint); color: var(--gold);
  font-size: 1.4rem; font-weight: 800; margin-bottom: 10px;
}

/* ============ FAQ ACCORDION ============ */
.faq { margin: 24px 0; }
.faq-item {
  background: var(--white); border-radius: var(--radius-sm);
  margin-bottom: 12px; box-shadow: var(--shadow-sm); overflow: hidden;
  border-left: 4px solid var(--gold-light);
}
.faq-q {
  width: 100%; text-align: right; direction: ltr;
  background: none; border: none; cursor: pointer;
  padding: 16px 22px; font-family: 'Prompt', sans-serif;
  font-weight: 600; color: var(--primary-dark); font-size: 1.05rem;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px;
}
.faq-q .toggle {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--gold-tint); color: var(--gold);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; transition: transform 0.25s, background 0.25s;
  flex-shrink: 0;
}
.faq-item[open] .faq-q .toggle { transform: rotate(45deg); background: var(--primary); color: var(--cream); }
.faq-a { padding: 0 22px 20px; color: var(--gray-700); }
.faq-a p { margin: 0; }

/* ============ AUTHOR BOX ============ */
.author-box {
  display: flex; gap: 18px; align-items: flex-start;
  background: linear-gradient(90deg, var(--primary-tint) 0%, var(--gold-tint) 100%);
  border-radius: var(--radius); padding: 22px;
  margin: 40px 0 20px;
  border-left: 6px solid var(--primary);
}
.author-box img { width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0; border: 3px solid var(--white); box-shadow: var(--shadow-sm); }
.author-box .name {
  font-family: 'Prompt', sans-serif; font-weight: 700; color: var(--primary-dark);
  font-size: 1.1rem; margin: 0 0 2px;
}
.author-box .role { color: var(--gold); font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.author-box .bio { color: var(--gray-700); font-size: 0.92rem; margin: 0; }

/* ============ BREADCRUMBS ============ */
.breadcrumbs {
  background: var(--primary-tint); padding: 14px 0;
  font-size: 0.92rem;
}
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumbs ol li { color: var(--gray-500); }
.breadcrumbs ol li a { color: var(--primary); text-decoration: none; font-weight: 600; }
.breadcrumbs ol li a:hover { text-decoration: underline; }
.breadcrumbs ol li + li::before { content: '›'; color: var(--gray-500); margin-left: 8px; margin-right: 8px; }

/* ============ CALLOUTS ============ */
.callout {
  background: linear-gradient(90deg, var(--gold-tint) 0%, var(--cream) 100%);
  border-left: 6px solid var(--gold-light);
  padding: 18px 22px; border-radius: 0 12px 12px 0;
  margin: 20px 0;
}
.callout strong { color: var(--gold); }
.callout.warning { background: linear-gradient(90deg, #FEE2E2 0%, var(--cream) 100%); border-left-color: var(--coral-dark); }
.callout.warning strong { color: var(--coral-dark); }
.callout.info { background: linear-gradient(90deg, var(--primary-tint) 0%, var(--cream) 100%); border-left-color: var(--primary); }
.callout.info strong { color: var(--primary-dark); }

/* ============ ILLUSTRATIONS ============ */
.section-illus {
  display: block; max-width: 100%; height: auto;
  border-radius: var(--radius); margin: 30px 0;
  box-shadow: var(--shadow-md);
}

/* ============ FOOTER ============ */
.site-footer {
  background: linear-gradient(180deg, var(--ink) 0%, #0F0C29 100%);
  color: rgba(255,251,235,0.85);
  padding: 50px 0 20px;
  margin-top: 60px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
  padding-bottom: 30px; border-bottom: 1px solid rgba(255,251,235,0.15);
}
.footer-brand-block img { height: 48px; margin-bottom: 12px; filter: brightness(0) invert(1); }
.footer-brand-block p { color: rgba(255,251,235,0.7); font-size: 0.92rem; }
.footer-col h4 { color: var(--gold-light); font-family: 'Prompt', sans-serif; font-size: 1rem; margin-bottom: 12px; font-weight: 700; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { padding: 4px 0; }
.footer-col ul li a { color: rgba(255,251,235,0.75); text-decoration: none; font-size: 0.94rem; transition: color 0.15s; }
.footer-col ul li a:hover { color: var(--gold-light); }
.footer-bottom {
  padding-top: 20px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-size: 0.85rem; color: rgba(255,251,235,0.6);
}
.footer-bottom .age-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--coral-dark); color: var(--cream);
  padding: 4px 10px; border-radius: 20px; font-weight: 700;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* ============ COOKIE BANNER ============ */
.cookie-banner {
  position: fixed; bottom: 20px; left: 20px; right: 20px; z-index: 1000;
  background: var(--ink); color: var(--cream);
  padding: 16px 22px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 900px; margin: 0 auto;
}
.cookie-banner.show { display: flex; }
.cookie-banner p { margin: 0; font-size: 0.92rem; }
.cookie-banner a { color: var(--gold-light); }
.cookie-banner button {
  background: var(--grad-gold); color: var(--ink);
  border: none; padding: 10px 22px; border-radius: 10px;
  font-weight: 700; cursor: pointer; font-family: 'Prompt', sans-serif;
  min-height: 44px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .hero { padding: 40px 0 80px; }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .hero-illus { max-width: 480px; margin: 0 auto; }
  .hero-cta-row { justify-content: center; }
}
@media (max-width: 720px) {
  .nav-desktop { display: none; }
  .hamburger { display: block; }
  main section { padding: 36px 0; }
  h2 { margin-top: 2rem; }
  .toc { padding: 20px; }
  .author-box { flex-direction: column; text-align: center; }
  .author-box img { margin: 0 auto; }
  .author-box { border-left: none; border-top: 6px solid var(--primary); }
  .cookie-banner { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem; }
  .casino-card { padding: 26px 20px 20px; }
  .btn { padding: 12px 20px; font-size: 14px; }
}

/* Focus states for a11y */
button:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold-light); outline-offset: 2px; border-radius: 6px;
}
