/* =========================================================
   PELUANG88 Malaysia — Shared Stylesheet
   Palette (from brand image): Cream, Gold, Orange, Red
   Mobile-first, accessible, fast, minimal.
   ========================================================= */

/* Self-hosted display font — Poppins (friendly, rounded, readable) */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/poppins-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/poppins-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/poppins-700-latin.woff2") format("woff2"); }

:root {
  /* Brand palette (attached image) */
  --cream: #f5f2df;
  --cream-soft: #faf8ee;
  --gold: #fbc531;
  --gold-deep: #f5a623;
  --orange: #ff8c00;
  --red: #c62828;
  --red-deep: #a51f1f;

  /* Neutrals */
  --ink: #1c1a12;
  --ink-soft: #4a463a;
  --line: rgba(28, 26, 18, 0.12);
  --white: #ffffff;

  /* Semantic */
  --bg: var(--cream);
  --bg-alt: var(--cream-soft);
  --text: var(--ink);
  --muted: var(--ink-soft);
  --primary: var(--gold);
  --accent: var(--orange);
  --danger: var(--red);

  /* Sizing */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 26px;
  --shadow: 0 6px 24px rgba(28, 26, 18, 0.10);
  --shadow-lg: 0 14px 40px rgba(28, 26, 18, 0.16);
  --container: 1120px;
  --header-h: 72px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Poppins", var(--font);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-deep); }
a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 2px; }
/* Links on dark backgrounds get a light colour for sufficient contrast */
.section--dark a { color: #ffd76a; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.01em;
}
h3, h4 { font-weight: 600; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); margin-top: 1.6em; }
h3 { font-size: clamp(1.15rem, 2.4vw, 1.4rem); margin-top: 1.4em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25rem; }
li { margin: .35em 0; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 18px; }
.section { padding: 44px 0; }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--ink); color: var(--cream); }
.section--dark h2, .section--dark h3 { color: var(--white); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 242, 223, 0.85);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; gap: 12px;
  height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; font-size: 1.2rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
/* Fluid logo: scales with the viewport, never overflows its container. */
.brand-logo {
  height: clamp(26px, 6vw, 32px); width: auto; flex: none; display: block;
  max-width: min(220px, 60vw); object-fit: contain;
}
/* The header is light cream and the wordmark's "88" is near-white, so sit it on a
   dark rounded chip to keep the whole logo clearly visible on any screen. */
.site-header .brand { min-width: 0; }
.site-header .brand-logo {
  height: clamp(32px, 7vw, 42px);
  padding: clamp(6px, 1.2vw, 8px) clamp(11px, 2.6vw, 16px);
  border-radius: 12px; background: var(--ink); box-shadow: var(--shadow);
  max-width: 70vw;
}
/* The footer is already dark, so the wordmark reads on its own with no chip. */
.nav-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
}
.nav-links a {
  display: block; padding: 8px 12px; border-radius: 999px; color: var(--ink); font-weight: 600; font-size: .96rem;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { background: rgba(255,140,0,.14); text-decoration: none; }
.nav-cta { margin-left: 6px; }
.nav-toggle {
  margin-left: auto; display: inline-flex; flex-direction: column; gap: 5px;
  background: none; border: 0; padding: 10px; cursor: pointer;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font-weight: 800; font-size: 1rem;
  border: 2px solid transparent; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  text-align: center; line-height: 1.1;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.btn--primary { background: var(--gold); color: var(--ink); }
.btn--primary:hover { background: var(--gold-deep); }
.btn--accent { background: var(--orange); color: var(--ink); }
.btn--danger { background: var(--red); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--cream); }
.btn--lg { padding: 16px 30px; font-size: 1.1rem; }
.btn--block { display: flex; width: 100%; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1100px 460px at 80% -10%, rgba(255,140,0,.35), transparent 60%),
    radial-gradient(900px 420px at 0% 0%, rgba(251,197,49,.45), transparent 55%),
    linear-gradient(180deg, var(--cream-soft), var(--cream));
  padding: 40px 0 48px;
}
.hero-grid { display: grid; gap: 26px; align-items: center; }
.hero .eyebrow {
  display: inline-block; background: var(--red); color: #fff; font-weight: 800;
  font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 14px;
}
.hero h1 { margin-bottom: .35em; }
.hero .lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 60ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 8px; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 18px 0 0; }
.hero-illustration {
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
  background: linear-gradient(160deg, #fff7e0, #ffe0b8);
  aspect-ratio: 4 / 3; display: grid; place-items: center; color: var(--ink);
}
.hero-illustration svg { width: 100%; height: 100%; display: block; }

/* Trust indicators */
.trust {
  display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; padding: 0; list-style: none;
  font-weight: 700; font-size: .92rem; color: var(--ink-soft);
}
.trust li { display: flex; align-items: center; gap: 8px; }
.trust .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex: none; }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr; }

/* Blog: on mobile put the article cards above the long intro; intro first on desktop */
.blog-flow { display: flex; flex-direction: column; }
.blog-flow > #articles { order: -1; }
@media (min-width: 900px) {
  .blog-flow > #articles { order: 0; }
}
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card h3 { margin-top: 0; }
.card .icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.4rem; margin-bottom: 12px;
  background: linear-gradient(160deg, var(--gold), var(--orange) 55%, var(--red)); color: #fff;
}
.card--game .icon { background: linear-gradient(160deg, var(--gold), var(--orange) 55%, var(--red)); }

/* ---------- Boxes (summary / tip / warning / definition / quick answer) ---------- */
.box { border-radius: var(--radius); padding: 18px 20px; margin: 22px 0; border-left: 6px solid; }
.box h3, .box h4 { margin-top: 0; }
.box--summary { background: #fff8e1; border-color: var(--gold-deep); }
.box--tip { background: #eefaf0; border-color: #2e9e56; }
.box--warning { background: #fdeeee; border-color: var(--red); }
.box--definition { background: var(--cream-soft); border-color: var(--orange); }
.box--answer { background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--red); box-shadow: var(--shadow); }
.box .label { display:inline-block; font-size:.72rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--red); margin-bottom:6px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 20px 0; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: var(--white); min-width: 460px; }
caption { text-align: left; font-weight: 700; padding: 10px 14px; color: var(--muted); }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
thead th { background: var(--ink); color: var(--cream); font-size: .92rem; }
tbody tr:nth-child(even) { background: rgba(251,197,49,.08); }

/* ---------- Table of contents ---------- */
.toc {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; box-shadow: var(--shadow); margin: 24px 0;
}
.toc h2 { margin: 0 0 10px; font-size: 1.1rem; }
.toc ol { margin: 0; columns: 2; column-gap: 26px; }
.toc a { color: var(--ink); font-weight: 600; }

/* ---------- Pros / cons ---------- */
.proscons { display: grid; gap: 16px; grid-template-columns: 1fr; }
.proscons .card { padding: 20px; }
.pros li::marker { content: "✔  "; color: #2e9e56; }
.cons li::marker { content: "✕  "; color: var(--red); }

/* ---------- FAQ accordion ---------- */
.faq details {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin: 10px 0; padding: 4px 8px; box-shadow: var(--shadow);
}
.faq summary {
  cursor: pointer; font-weight: 700; padding: 14px 8px; list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--red); line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details > *:not(summary) { padding: 0 8px 14px; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { position: relative; padding-left: 52px; margin: 16px 0; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold); color: var(--ink); font-weight: 800; display: grid; place-items: center;
}

/* ---------- Rating ---------- */
.rating-badge {
  display: inline-flex; align-items: center; gap: 12px; background: var(--ink); color: var(--cream);
  border-radius: var(--radius); padding: 16px 22px; box-shadow: var(--shadow);
}
.rating-badge .score { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; color: var(--gold); line-height: 1; }
.stars { color: var(--gold); letter-spacing: 2px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: .9rem; color: var(--muted); padding: 14px 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--muted); }

/* ---------- Blog list ---------- */
.post-card { display: flex; flex-direction: column; }
.post-card .card-thumb { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 5px; margin-bottom: 14px; display: block; background: var(--cream); }
.post-card .tag { font-size: .78rem; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: .05em; }
.post-card h3 { margin: 6px 0 8px; }
.post-card .meta { font-size: .85rem; color: var(--muted); margin-top: auto; }

/* ---------- Article ---------- */
.article { max-width: 760px; margin-inline: auto; }
/* Keep single-column hero + feature image aligned with the 760px reading column
   (two-column heroes use .hero-grid and are excluded) */
.hero > .container:not(.hero-grid) { max-width: 760px; }
.article img { border-radius: 5px; margin: 18px 0; }

/* Blog feature image */
.post-feature { margin: 4px auto 8px; max-width: 724px; }
.post-feature img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 5px; box-shadow: var(--shadow-lg); display: block; }
.article-meta { color: var(--muted); font-size: .92rem; margin-bottom: 18px; }
.byline { display: flex; align-items: center; gap: 12px; margin: 24px 0; padding: 16px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.byline .avatar { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(160deg,var(--gold),var(--red)); flex: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d9d4c2; padding: 44px 0 24px; margin-top: 20px; }
.site-footer a { color: #efe9d6; }
.footer-grid { display: grid; gap: 26px; grid-template-columns: 1fr; }
.footer-grid h3 { color: #fff; font-size: 1rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 7px 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 28px; padding-top: 18px; font-size: .85rem; color: #b7b09a; }
.footer-disclaimer { font-size: .82rem; color: #b7b09a; margin-top: 8px; }
.age-badge { display:inline-grid; place-items:center; width:44px; height:44px; border:2px solid var(--gold); color:var(--gold); border-radius:50%; font-weight:900; }

/* ---------- Utilities ---------- */
.badge { display:inline-block; background:var(--gold); color:var(--ink); font-weight:800; font-size:.78rem; padding:4px 10px; border-radius:999px; }
.badge--red { background: var(--red); color: #fff; }
.text-muted { color: var(--muted); }
.lead { font-size: 1.1rem; }
.divider { height:1px; background:var(--line); border:0; margin:32px 0; }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); border:0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-links {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--cream-soft); border-bottom: 1px solid var(--line); padding: 10px 16px 18px; gap: 4px;
    transform: translateY(-120%); transition: transform .25s ease; margin-left: 0; box-shadow: var(--shadow-lg);
  }
  .nav-links[data-open="true"] { transform: translateY(0); }
  .nav-links a { padding: 12px 10px; }
  .nav-links .nav-cta { margin: 6px 0 0; }
  .nav-links .nav-cta .btn { width: 100%; }
}
@media (min-width: 861px) {
  .nav-toggle { display: none; }
}
@media (max-width: 560px) {
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .cta-actions { flex-direction: column; align-items: stretch; max-width: 320px; margin-left: auto; margin-right: auto; }
  .cta-actions .btn { width: 100%; }
}
@media (min-width: 700px) {
  .hero-cta .btn { min-width: 210px; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .proscons { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.15fr .85fr; }
  .section { padding: 60px 0; }
}

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