/* ===========================================================
   XSMN – Xổ số miền Nam | Premium News Portal Design System
   Mobile-first, glassmorphism, dark/light, high CWV
   =========================================================== */

:root {
  --brand: #8a66b3;
  --brand-dark: #6f4f96;
  --brand-2: #e7a6b2;
  --accent: #a07bc0;
  --gold: #e7a6b2;
  --ink: #3b2f42;
  --ink-soft: #6a5d70;
  --muted: #9c8fa4;
  --line: #efd7db;
  --bg: #fbeeee;
  --card: #ffffff;
  --card-2: #fce4e6;
  --glass: rgba(251, 238, 238, 0.75);
  --shadow: 0 6px 24px rgba(110, 79, 150, 0.10);
  --shadow-lg: 0 18px 48px rgba(110, 79, 150, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --maxw: 1180px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ok: #7fa389;
  --warn: #d5896b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 17px;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.4rem, 3.2vw, 2rem); margin: 2em 0 .6em; }
h3 { font-size: clamp(1.12rem, 2.2vw, 1.35rem); margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Skip link */
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: 10px 16px; z-index: 999; border-radius: 0 0 10px 0; }
.skip:focus { left: 0; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--glass);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.15rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-weight: 900; font-size: .95rem;
  box-shadow: 0 4px 12px rgba(214,40,40,.35);
}
.brand small { display: block; font-size: .62rem; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.nav { display: none; margin-left: auto; align-items: center; gap: 2px; }
.nav a { color: var(--ink-soft); font-weight: 600; font-size: .92rem; padding: 8px 12px; border-radius: 10px; }
.nav a:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); text-decoration: none; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav + .header-tools { margin-left: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; display: grid; place-items: center;
  font-size: 1.1rem; transition: transform .15s;
}
.icon-btn:hover { transform: translateY(-1px); }
.menu-toggle { display: grid; }
/* Header call-to-action — compact, always visible incl. mobile */
.header-cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px; border-radius: 11px; font-weight: 700; font-size: .88rem;
  line-height: 1.1; white-space: nowrap; flex-shrink: 0; border: 1px solid transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; box-shadow: 0 6px 16px rgba(138,102,179,.32);
  transition: transform .15s, box-shadow .15s;
}
.header-cta:hover { transform: translateY(-1px); text-decoration: none; }
/* Keep the brand from squeezing the tools; logo/CTA never shrink. */
.brand { min-width: 0; flex-shrink: 1; }
.brand .logo { flex-shrink: 0; }
/* Mobile: tighten spacing, drop the subtitle, slim the CTA so nothing crowds. */
@media (max-width: 700px) {
  .header-inner { gap: 10px; height: 60px; }
  .header-tools { gap: 7px; }
  .brand { font-size: 1.02rem; }
  .brand small { display: none; }
  .header-cta { padding: 8px 12px; font-size: .8rem; }
}
@media (max-width: 380px) {
  .header-cta { padding: 7px 10px; font-size: .74rem; }
}
@media (min-width: 980px) {
  .nav { display: flex; }
  .menu-toggle { display: none; }
}
.mobile-nav { display: none; border-top: 1px solid var(--line); background: var(--card); }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 13px 20px; color: var(--ink-soft); font-weight: 600; border-bottom: 1px solid var(--line); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 12px 22px; border-radius: 12px; font-weight: 700; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; box-shadow: 0 8px 20px rgba(214,40,40,.32); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.btn-gold { background: linear-gradient(135deg, var(--brand-2), #d98f9f); color: #5a2e3a; box-shadow: 0 8px 20px rgba(231,166,178,.4); }

/* Hero */
.hero { padding: 46px 0 30px; position: relative; }
.hero-grid { display: grid; gap: 30px; align-items: center; }
@media (min-width: 900px){ .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); padding: 6px 14px; border-radius: 999px; margin-bottom: 14px; }
.hero p.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 60ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.trust { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 22px; }
.trust div { font-size: .82rem; color: var(--muted); }
.trust b { display: block; font-size: 1.4rem; color: var(--ink); font-weight: 900; }

/* Cards / glass panel */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 22px;
}
.glass {
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}

/* Live result widget */
.result-widget { padding: 20px; }
.result-widget .rw-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.badge-live { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 800; color: #fff; background: var(--brand); padding: 4px 11px; border-radius: 999px; }
.badge-live .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.rw-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rw-table th, .rw-table td { padding: 7px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.rw-table th { text-align: left; color: var(--muted); font-weight: 700; width: 96px; }
.rw-special { color: var(--brand); font-weight: 900; font-size: 1.15rem; }
.countdown { display: flex; gap: 8px; justify-content: center; margin-top: 6px; }
.countdown span { background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; }
.countdown small { display: block; font-size: .6rem; color: var(--muted); font-weight: 600; }

/* Section headers */
.section { padding: 34px 0; }
.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.section-title h2 { margin: 0; }
.kicker { color: var(--brand); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }

/* Grids */
.grid { display: grid; gap: 18px; }
.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(2,1fr);} }
@media (min-width: 940px){ .grid-3 { grid-template-columns: repeat(3,1fr);} .grid-4 { grid-template-columns: repeat(4,1fr);} }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card h3 { margin-top: 0; }
.card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: color-mix(in srgb, var(--brand) 12%, transparent); margin-bottom: 12px; }

/* Province chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: .9rem; color: var(--ink-soft); box-shadow: var(--shadow); }
.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

/* Tables */
.table-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--card); min-width: 480px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.data thead th { background: var(--card-2); font-weight: 800; color: var(--ink); position: sticky; top: 0; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--brand) 5%, transparent); }

/* Callout boxes */
.box { border-radius: var(--radius); padding: 18px 20px; margin: 20px 0; border: 1px solid var(--line); background: var(--card); }
.box-def { border-left: 5px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
.box-tip { border-left: 5px solid var(--ok); background: color-mix(in srgb, var(--ok) 7%, var(--card)); }
.box-warn { border-left: 5px solid var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--card)); }
.box-summary { border-left: 5px solid var(--brand-2); background: color-mix(in srgb, var(--brand-2) 8%, var(--card)); }
.box b.box-label { display: block; text-transform: uppercase; font-size: .72rem; letter-spacing: .07em; margin-bottom: 6px; }
.box-def b.box-label { color: var(--accent); }
.box-tip b.box-label { color: var(--ok); }
.box-warn b.box-label { color: var(--warn); }
.box-summary b.box-label { color: var(--brand-2); }

/* Key takeaways list */
ul.takeaways { list-style: none; padding: 0; margin: 16px 0; }
ul.takeaways li { padding: 8px 0 8px 30px; position: relative; }
ul.takeaways li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 900; }

/* TOC */
.toc { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 24px 0; }
.toc h2 { margin: 0 0 10px; font-size: 1.05rem; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 30px; }
.toc a { color: var(--ink-soft); font-weight: 600; }
@media (max-width: 640px){ .toc ol { columns: 1; } }

/* Article layout */
.article { max-width: 820px; margin: 0 auto; }
.article-meta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; color: var(--muted); font-size: .88rem; margin: 10px 0 20px; }
.article-body { font-size: 1.05rem; }
.article-body h2 { border-bottom: 2px solid var(--line); padding-bottom: 8px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg,var(--accent),var(--brand)); display: inline-grid; place-items: center; color: #fff; font-weight: 800; }
.tag { display: inline-block; font-size: .74rem; font-weight: 700; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); padding: 4px 10px; border-radius: 999px; }

/* Breadcrumb */
.crumb { font-size: .82rem; color: var(--muted); margin: 18px 0; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--brand); }

/* Blog cards */
.post-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.post-card .thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; color: #fff; font-size: 2.4rem; font-weight: 900; }
.post-card .pc-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.post-card h3 { font-size: 1.08rem; margin: 8px 0; }
.post-card p { color: var(--muted); font-size: .9rem; flex: 1; }
.post-card .pc-meta { font-size: .78rem; color: var(--muted); margin-top: 10px; }

/* FAQ */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; padding: 4px 18px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-weight: 900; font-size: 1.3rem; }
.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq details p { padding: 12px 0; margin: 0; color: var(--ink-soft); }

/* Rating stars */
.rating { display: flex; align-items: center; gap: 10px; }
.stars { color: var(--gold); font-size: 1.3rem; letter-spacing: 2px; }

/* Footer */
.site-footer { background: var(--card); border-top: 1px solid var(--line); margin-top: 50px; padding: 46px 0 26px; }
.footer-grid { display: grid; gap: 30px; grid-template-columns: 1fr; }
@media (min-width: 720px){ .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-grid h4 { font-size: .95rem; margin: 0 0 14px; }
.footer-grid a { display: block; color: var(--muted); font-size: .9rem; padding: 5px 0; }
.footer-grid a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: .82rem; color: var(--muted); }
.disclaimer-strip { background: color-mix(in srgb, var(--warn) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--line)); border-radius: var(--radius); padding: 14px 18px; font-size: .84rem; color: var(--ink-soft); margin-top: 24px; }
.age-badge { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--warn); color: var(--warn); font-weight: 900; font-size: .8rem; margin-right: 8px; }

/* utility */
.mt-0{margin-top:0}.mb-0{margin-bottom:0}.center{text-align:center}
.lead-block { max-width: 760px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.divider { height: 1px; background: var(--line); border: 0; margin: 34px 0; }
.cta-band { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; border-radius: var(--radius-lg); padding: 34px; text-align: center; margin: 30px 0; }
.cta-band h2 { color: #fff; margin-top: 0; }
.cta-band p { color: rgba(255,255,255,.9); }
.cta-band .btn-ghost { background: #fff; color: var(--brand); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ===== Vietlott live results ===== */
.vl-live { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; color: var(--brand); }
.vl-live .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(127,163,137,.6); animation: vlPulse 1.8s infinite; }
@keyframes vlPulse { 0% { box-shadow: 0 0 0 0 rgba(127,163,137,.55); } 70% { box-shadow: 0 0 0 8px rgba(127,163,137,0); } 100% { box-shadow: 0 0 0 0 rgba(127,163,137,0); } }
.vl-grid { display: grid; gap: 18px; grid-template-columns: 1fr; margin-top: 22px; }
@media (min-width: 720px) { .vl-grid { grid-template-columns: 1fr 1fr; } }
.vl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; }
.vl-card h3 { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vl-tag { font-size: .72rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); padding: 4px 10px; border-radius: 999px; }
.vl-meta { color: var(--muted); font-size: .85rem; margin: 6px 0 14px; }
.vl-balls { display: flex; flex-wrap: wrap; gap: 10px; }
.vl-ball {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; font-size: 1.05rem; color: #fff;
  background: radial-gradient(circle at 32% 28%, #b79adf, var(--brand));
  box-shadow: 0 4px 10px rgba(138,102,179,.35); font-variant-numeric: tabular-nums;
}
.vl-ball.bonus { background: radial-gradient(circle at 32% 28%, #f2c3cd, var(--brand-2)); color: #5a2e3a; }
.vl-ball.skeleton { background: var(--card-2); box-shadow: none; animation: vlShimmer 1.2s infinite; }
@keyframes vlShimmer { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.vl-updated { margin-top: 14px; font-size: .78rem; color: var(--muted); }
.vl-warn { color: var(--warn); font-size: .8rem; margin-top: 8px; }
