/* =========================================================
   SX Đà Nẵng — Design System
   Palette: Coral (lottery/primary) + Teal (casino/secondary)
   Mobile-first, fluid type, minimal CSS for fast PageSpeed
   ========================================================= */

:root {
  /* Brand colors (from supplied palette) */
  --coral-50:  #fff2ee;
  --coral-100: #ffe1d8;
  --coral-300: #ffab93;
  --coral-500: #ff6f52;
  --coral-600: #f2532f;
  --coral-700: #cc3f20;
  --coral-900: #6b2113;

  --teal-50:  #e6f8f6;
  --teal-100: #bdeee8;
  --teal-300: #4fc9bd;
  --teal-500: #00a99a;
  --teal-600: #00907f;
  --teal-700: #007265;
  --teal-900: #003d36;

  /* Neutrals */
  --ink-900: #12201e;
  --ink-700: #33453f;
  --ink-500: #5c6d67;
  --ink-300: #a9b6b1;
  --ink-100: #e7ede9;

  /* Semantic (fixed dark theme — same on every device, regardless of system light/dark setting) */
  --bg: #0f1715;
  --surface: #16211f;
  --paper-alt: #12201e;
  --text: #f2f6f4;
  --text-muted: #a9b6b1;
  --line: #223330;
  --accent: var(--coral-500);
  --accent-strong: var(--coral-600);
  --accent-2: var(--teal-500);
  --accent-2-strong: var(--teal-300);
  --focus: #4d8dff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);

  /* Type scale (fluid) */
  --fs-h1: clamp(1.9rem, 1.5rem + 2.1vw, 3.1rem);
  --fs-h2: clamp(1.5rem, 1.25rem + 1.3vw, 2.2rem);
  --fs-h3: clamp(1.2rem, 1.05rem + 0.7vw, 1.5rem);
  --fs-lead: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;

  /* Rhythm */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 22px;
  --max-w: 1120px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent-2-strong); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 var(--space-2); color: var(--text); }
h1 { font-size: var(--fs-h1); font-weight: 800; }
h2 { font-size: var(--fs-h2); font-weight: 800; }
h3 { font-size: var(--fs-h3); font-weight: 700; }
p { margin: 0 0 var(--space-2); color: var(--text); }
ul, ol { margin: 0 0 var(--space-2); padding-left: 1.2em; }
li { margin-bottom: 0.4em; }
table { border-collapse: collapse; width: 100%; }
button { font: inherit; }

/* ---------- Layout helpers ---------- */
.wrap {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--space-2);
}
.section { padding-block: var(--space-5); }
.section--tight { padding-block: var(--space-4); }
.section--alt { background: var(--paper-alt); }
.stack { display: flex; flex-direction: column; gap: var(--space-2); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2-strong);
  margin-bottom: var(--space-1);
}
.lead { font-size: var(--fs-lead); color: var(--text-muted); max-width: 62ch; }
.section-head { margin-bottom: var(--space-3); }
.section-head--center { text-align: center; margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link {
  position: absolute; left: 0; top: -3rem; z-index: 100;
  background: var(--teal-700); color: #fff; padding: 0.75em 1.2em;
  border-radius: 0 0 8px 0; transition: top 0.15s ease;
}
.skip-link:focus { top: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-2); padding-block: 0.9rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand__mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--coral-500) 0 50%, var(--teal-500) 50% 100%);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 0.85rem;
}
.nav { display: none; }
.nav ul { display: flex; gap: var(--space-3); list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--text); font-weight: 600; text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--accent-strong); }
.header-cta { display: none; }
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text); border: none; border-radius: var(--radius-sm);
  padding: 0.35em; font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.nav-toggle:hover { color: var(--accent-strong); }
.mobile-menu {
  display: none; border-top: 1px solid var(--line); padding: var(--space-2) 0;
}
.mobile-menu.is-open { display: block; }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.mobile-menu a {
  display: block; padding: 0.7em 0.2em; color: var(--text); text-decoration: none; font-weight: 600;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 860px) {
  .nav { display: block; }
  .header-cta { display: inline-flex; }
  .nav-toggle { display: none; }
  .mobile-menu { display: none !important; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.85em 1.5em; border-radius: 999px; font-weight: 700; text-decoration: none;
  border: 2px solid transparent; cursor: pointer; font-size: 0.98rem; line-height: 1.1;
  transition: transform 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--coral-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--coral-900); color: #fff; box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--teal-700); color: #fff; }
.btn-secondary:hover { background: var(--teal-900); color: #fff; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--text); }
.btn-outline:hover { border-color: var(--accent-2); color: var(--accent-2-strong); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.55em 1.1em; font-size: 0.9rem; }

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--space-5) var(--space-4);
  background:
    radial-gradient(60% 60% at 85% 0%, color-mix(in srgb, var(--teal-500) 14%, transparent), transparent 70%),
    radial-gradient(50% 55% at 5% 10%, color-mix(in srgb, var(--coral-500) 16%, transparent), transparent 70%);
}
.hero__grid { display: grid; gap: var(--space-4); align-items: center; }
.hero h1 { margin-bottom: var(--space-2); }
.hero .lead { margin-bottom: var(--space-3); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: var(--space-3); }
.hero__meta { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; font-size: var(--fs-small); color: var(--text-muted); }
.hero__meta strong { color: var(--text); }

.hero-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-3); box-shadow: var(--shadow-md);
}
.hero-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.badge {
  display: inline-flex; align-items: center; gap: 0.4em; font-size: 0.78rem; font-weight: 700;
  padding: 0.3em 0.7em; border-radius: 999px; background: var(--teal-50); color: var(--teal-700);
}
.badge--live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #17b26a; display: inline-block; box-shadow: 0 0 0 3px rgba(23,178,106,0.2); }
.hero-card__prize {
  text-align: center; padding: var(--space-3) var(--space-2); border-radius: var(--radius);
  background: linear-gradient(135deg, var(--coral-500), var(--coral-600)); color: #fff; margin-bottom: var(--space-2);
}
.hero-card__prize .num { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); font-weight: 800; letter-spacing: 0.04em; }
.hero-card__prize .lbl { font-size: 0.85rem; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.06em; }
.hero-card__prize .val { font-size: 0.95rem; margin-top: 0.25em; font-weight: 600; }
.hero-card__row { display: flex; justify-content: space-between; padding: 0.5em 0; border-bottom: 1px dashed var(--line); font-size: 0.92rem; }
.hero-card__row:last-of-type { border-bottom: none; }
.hero-card__row span:first-child { color: var(--text-muted); }
.hero-card__row span:last-child { font-weight: 700; }

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1.15fr 0.85fr; }
}

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: var(--space-3); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-3); box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: 0.4em; }
.card p:last-child { margin-bottom: 0; }

.icon-tile {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--coral-50); color: var(--coral-600); font-size: 1.3rem; margin-bottom: 0.8em;
}
.card--teal .icon-tile { background: var(--teal-50); color: var(--teal-700); }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.data-table { min-width: 100%; font-size: 0.94rem; }
.data-table caption { text-align: left; padding: 0.9em 1em; font-weight: 700; background: var(--paper-alt); border-bottom: 1px solid var(--line); }
.data-table th, .data-table td { padding: 0.75em 1em; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.data-table thead th { background: var(--ink-900); color: #fff; font-weight: 700; position: sticky; top: 0; }
.data-table tbody tr:nth-child(even) { background: var(--paper-alt); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td.highlight, .data-table th.highlight { color: var(--coral-600); font-weight: 800; }

/* ---------- Stat pills ---------- */
.stat-pill { display: flex; align-items: center; justify-content: space-between; padding: 0.8em 1em; border-radius: var(--radius-sm); background: var(--paper-alt); border: 1px solid var(--line); }
.stat-pill + .stat-pill { margin-top: 0.5em; }
.stat-pill .n { font-weight: 800; font-size: 1.05rem; }

/* ---------- Testimonials ---------- */
.testimonial { position: relative; }
.testimonial .stars { color: var(--coral-500); letter-spacing: 0.1em; margin-bottom: 0.5em; }
.testimonial cite { display: block; margin-top: 0.9em; font-style: normal; font-weight: 700; color: var(--text); }
.testimonial cite span { display: block; font-weight: 500; color: var(--text-muted); font-size: 0.85rem; }

.win-callout {
  display: flex; gap: 0.9em; align-items: flex-start; padding: var(--space-2);
  border-radius: var(--radius); background: var(--coral-50); border: 1px solid var(--coral-100);
}
.win-callout p { color: var(--coral-900); font-weight: 600; }
.win-callout__icon { font-size: 1.4rem; }

/* ---------- FAQ ---------- */
.faq-item {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  margin-bottom: 0.75rem; overflow: hidden;
}
.faq-item summary {
  cursor: pointer; list-style: none; padding: 1em 1.2em; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 1em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.4rem; color: var(--accent-2-strong); flex: none; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item .faq-body { padding: 0 1.2em 1.1em; color: var(--text-muted); }

/* ---------- AI Overview & Table of Contents ---------- */
.ai-overview {
  display: flex; gap: var(--space-2); align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--teal-500);
  border-radius: var(--radius); padding: var(--space-3); box-shadow: var(--shadow-sm);
}
.ai-overview__icon {
  width: 40px; height: 40px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--teal-50); color: var(--teal-700); font-size: 1.15rem;
}
.ai-overview p:last-child { margin-bottom: 0; }

.toc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3); box-shadow: var(--shadow-sm); }
.toc-list { list-style: none; margin: 0.8em 0 0; padding: 0; display: grid; gap: 0.6rem; }
.toc-list a {
  display: flex; align-items: center; gap: 0.7em; padding: 0.65em 0.9em; border-radius: var(--radius-sm);
  background: var(--paper-alt); border: 1px solid var(--line); text-decoration: none; color: var(--text);
  font-weight: 600; font-size: 0.92rem;
}
.toc-list a:hover { border-color: var(--accent-2); color: var(--accent-2-strong); }
.toc-num {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--coral-500); color: #fff; font-size: 0.75rem; font-weight: 800; flex: none;
}
@media (min-width: 640px) { .toc-list { grid-template-columns: repeat(2, 1fr); } }

/* ---------- CTA banner ---------- */
.cta-banner {
  border-radius: var(--radius-lg); padding: var(--space-4); text-align: center;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-900));
  color: #fff;
}
.cta-banner h2, .cta-banner p { color: #fff; }
.cta-banner .lead { color: rgba(255,255,255,0.85); margin-inline: auto; }
.cta-banner__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: var(--space-2); }
.cta-banner .btn-outline { border-color: rgba(255,255,255,0.5); color: #fff; }
.cta-banner .btn-outline:hover { border-color: #fff; background: rgba(255,255,255,0.1); }

.note {
  border-left: 4px solid var(--accent-2); background: var(--teal-50); padding: 1em 1.2em;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 0.94rem; color: var(--ink-900);
}
.note a { color: var(--teal-700); }
.note--warn { border-left-color: var(--accent); background: var(--coral-50); color: var(--coral-900); font-weight: 600; }
.note--warn a { color: var(--coral-900); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { padding-block: 0.9rem; font-size: 0.85rem; color: var(--text-muted); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4em; margin: 0; padding: 0; }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-2-strong); }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 0.4em; color: var(--ink-300); }

/* ---------- Page hero (subpages) ---------- */
.page-hero { padding-block: var(--space-4) var(--space-3); border-bottom: 1px solid var(--line); background: var(--paper-alt); }
.page-hero h1 { margin-bottom: 0.3em; }

.prose { max-width: 74ch; }
.prose h2 { margin-top: var(--space-4); }
.prose h3 { margin-top: var(--space-3); }
.prose ul { margin-bottom: var(--space-2); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-900); color: var(--ink-100); padding-block: var(--space-5) var(--space-3); margin-top: var(--space-5); }
.site-footer a { color: var(--ink-100); text-decoration: none; }
.site-footer a:hover { color: var(--coral-300); }
.footer-grid { display: grid; gap: var(--space-3); grid-template-columns: 1fr; margin-bottom: var(--space-4); }
.footer-brand p { color: var(--ink-300); max-width: 40ch; }
.footer-col h3 { color: #fff; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.9em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6em; font-size: 0.92rem; }
.footer-social { display: flex; gap: 0.6em; margin-top: 1em; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.08);
  display: grid; place-items: center;
}
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: var(--space-2); display: flex; flex-wrap: wrap; gap: 0.8em; justify-content: space-between; font-size: 0.85rem; color: var(--ink-300); }
.footer-bottom ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1em; padding: 0; margin: 0; }

@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.4fr repeat(4, 1fr); }
}

.responsible-strip {
  display: flex; align-items: center; gap: 0.8em; font-size: 0.85rem; color: var(--ink-300);
  background: rgba(255,255,255,0.05); border-radius: var(--radius-sm); padding: 0.9em 1.1em; margin-bottom: var(--space-3);
}
.responsible-strip strong { color: #fff; }
.responsible-strip a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Blog ---------- */
.blog-banner { width: 100%; height: auto; display: block; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); margin-bottom: var(--space-4); }
.blog-card { display: flex; flex-direction: column; gap: 0.6rem; }
.blog-card h3 { margin: 0; font-size: 1.15rem; line-height: 1.35; }
.blog-card h3 a { color: var(--text); text-decoration: none; }
.blog-card h3 a:hover { color: var(--accent-2-strong); }
.blog-card__excerpt { color: var(--text-muted); font-size: 0.92rem; margin: 0; }
.blog-card__meta { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Author box ---------- */
.author-box { display: flex; gap: var(--space-2); align-items: flex-start; flex-wrap: wrap; }
.author-box__avatar {
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--coral-500), var(--teal-500));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.3rem;
  object-fit: cover;
}
.author-box__avatar--lg { width: 88px; height: 88px; }
.author-box__body { flex: 1; min-width: 220px; }

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.section-head--center + .grid { margin-inline: auto; }
