/* GRAB4D design system — dark default + light, mobile-first */
:root {
  --green: #2ecb3f; --green-deep: #0e7a1f; --green-ink: #0b6b1c;
  --gold: #f2b632; --gold-ink: #8a6200;
  --bg: #08150c; --bg2: #0b1e11; --card: #0f2a17; --card2: #123321;
  --line: rgba(125, 205, 145, .16); --line2: rgba(125, 205, 145, .28);
  --text: #e9f4ec; --muted: #a7bfae; --soft: #cfe3d5;
  --chip: #132f1c;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 14px; --radius-s: 10px;
  --wrap: 1180px;
}
html[data-theme="light"] {
  --green: #0b6b1c; --green-deep: #0b6b1c; --green-ink: #0b6b1c;
  --gold: #8a6200; --gold-ink: #6d4d00;
  --bg: #f5f7f3; --bg2: #eef2ec; --card: #ffffff; --card2: #f3f7f1;
  --line: rgba(18, 60, 32, .14); --line2: rgba(18, 60, 32, .26);
  --text: #132115; --muted: #4e6354; --soft: #2c4132;
  --chip: #e9efe7;
  --shadow: 0 8px 24px rgba(20, 50, 30, .12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; font-size: 16px;
  background-image: radial-gradient(1100px 500px at 85% -10%, rgba(46, 203, 63, .09), transparent 60%),
                    radial-gradient(900px 420px at -10% 0%, rgba(242, 182, 50, .06), transparent 55%);
  background-attachment: fixed;
}
img, svg { vertical-align: middle; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(1.55rem, 4.2vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.7rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: #201a05; padding: 8px 14px; border-radius: 0 0 8px 0; z-index: 99; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.topstrip { background: var(--green-deep); color: #fff; text-align: center; font-size: .78rem; padding: 5px 12px; letter-spacing: .02em; }
html[data-theme="light"] .topstrip { color: #fff; }
html[data-theme="light"] .skip { color: #fff; }
.site-head { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.head-in { display: flex; align-items: center; gap: 14px; min-height: 62px; }
.brand img { height: 38px; width: auto; display: block; }
.mainnav { display: none; gap: 2px; margin-left: 4px; }
.mainnav a { color: var(--soft); padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: .92rem; }
.mainnav a:hover { background: var(--chip); text-decoration: none; color: var(--text); }
.mainnav a[aria-current="page"] { color: var(--gold); }
.head-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.head-cta { display: none; gap: 8px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--chip); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--line2); }
.nav-toggle { margin-left: auto; }
.nav-toggle[aria-expanded="false"] ~ .head-tools .nav-toggle { display: none; }
.mobilenav { display: grid; gap: 2px; padding: 10px 16px 14px; border-top: 1px solid var(--line); background: var(--bg2); }
.mobilenav[hidden] { display: none; }
.mobilenav a { padding: 12px 10px; border-radius: 10px; color: var(--text); font-weight: 600; }
.mobilenav a:hover { background: var(--chip); text-decoration: none; }
@media (min-width: 960px) {
  .mainnav { display: flex; }
  .head-cta { display: flex; }
  .nav-toggle { display: none; }
  .mobilenav { display: none !important; }
}

/* ---------- buttons & badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 12px; font-weight: 800; font-size: .95rem; border: 1.5px solid transparent; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.07); }
.btn-gold { background: linear-gradient(180deg, #ffd257, var(--gold)); color: #241a02; box-shadow: 0 4px 14px rgba(242, 182, 50, .35); }
.btn-green { background: linear-gradient(180deg, #37d948, var(--green-deep)); color: #fff; box-shadow: 0 4px 14px rgba(24, 160, 50, .3); }
html[data-theme="light"] .btn-green { background: linear-gradient(180deg, #179a2c, var(--green-deep)); }
.btn-ghost { border-color: var(--line2); color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--chip); }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: .88rem; border-radius: 10px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; border: 1px solid var(--line2); color: var(--muted); background: var(--chip); white-space: nowrap; }
.badge-live { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.badge-gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 50%, transparent); }

/* ---------- breadcrumb ---------- */
.crumbs { padding: 12px 0 2px; font-size: .82rem; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.crumbs li a { color: var(--muted); }
.crumbs li > span { color: var(--soft); font-weight: 600; }
.crumbs .sep { color: var(--muted); opacity: .6; }

/* ---------- hero ---------- */
.hero { padding: 26px 0 8px; }
.hero-grid { display: grid; gap: 20px; }
.hero h1 { margin-bottom: .35em; }
.hero h1 .grad { background: linear-gradient(92deg, var(--green), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { color: var(--muted); max-width: 56ch; font-size: 1.02rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.hero-figure { margin: 0; }
.hero-figure img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
@media (min-width: 880px) {
  .hero-grid { grid-template-columns: 1.15fr .85fr; align-items: center; }
  .hero { padding: 40px 0 10px; }
}

/* ---------- sections ---------- */
.section { padding: 26px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-head h2 { margin: 0; }
.sec-head .more { font-size: .88rem; font-weight: 700; white-space: nowrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 14px; }
.card h2, .card h3 { margin-top: 0; }

/* ---------- market cards ---------- */
.mgrid { display: grid; gap: 12px; }
@media (min-width: 640px) { .mgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .mgrid { grid-template-columns: repeat(3, 1fr); } }
.mcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.mcard-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.mcard-name { margin: 0; font-size: 1rem; font-weight: 700; }
.mcard-name a { color: var(--text); }
.mcard-meta { margin: 2px 0 0; font-size: .78rem; color: var(--muted); }
.mcard-head .badge { margin-left: auto; }
.mcard-result { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px; }
@media (max-width: 420px) { .mcard-result .tile { width: 30px; height: 38px; font-size: 1.1rem; } }
.mcard-result .lbl { font-size: .74rem; color: var(--muted); display: grid; }
.mcard-result .lbl time { color: var(--soft); font-weight: 600; font-size: .82rem; }
.mcard-links { display: flex; gap: 6px; flex-wrap: wrap; }
.mcard-links a { flex: 1; text-align: center; padding: 8px 6px; border-radius: 9px; background: var(--chip); border: 1px solid var(--line); font-size: .82rem; font-weight: 700; color: var(--soft); }
.mcard-links a:hover { border-color: var(--line2); color: var(--text); text-decoration: none; }

/* ---------- digit tiles ---------- */
.tiles { display: inline-flex; gap: 4px; }
.tile { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 42px; border-radius: 8px; background: linear-gradient(180deg, var(--card2), var(--chip)); border: 1px solid var(--line2); font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; color: var(--text); }
.tile.t-win { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.tiles-lg .tile { width: 46px; height: 58px; font-size: 1.7rem; border-radius: 10px; }
.tiles-sm .tile { width: 26px; height: 32px; font-size: .95rem; border-radius: 6px; }
.copy-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: auto; border-radius: 10px; border: 1px solid var(--line2); background: var(--chip); color: var(--muted); cursor: pointer; }
.copy-btn:hover { color: var(--text); border-color: var(--green); }
.copy-btn.done { color: var(--green); border-color: var(--green); }
.share-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line2); background: var(--chip); color: var(--soft); font-weight: 700; cursor: pointer; font-size: .88rem; }
.share-btn:hover { color: var(--text); border-color: var(--green); }

/* ---------- countdown ---------- */
.cd { display: inline-grid; }
.cd-val { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--gold); font-size: 1.05rem; }
.cd-note { font-size: .72rem; color: var(--muted); }
.cd-box { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 14px; text-align: center; }
.cd-box .cd-val { font-size: clamp(1.2rem, 4vw, 1.6rem); letter-spacing: .02em; }
.cd-box .cd-note { text-transform: uppercase; letter-spacing: .08em; }
.cd-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--card); -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 520px; }
table.data th, table.data td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { position: sticky; top: 0; background: var(--bg2); color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; z-index: 1; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--chip) 70%, transparent); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num { font-variant-numeric: tabular-nums; }
.row-hi td { background: color-mix(in srgb, var(--gold) 12%, transparent); }
tr.is-hidden, tr.row-off, tr.poff { display: none; }

/* paito */
.paito-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.paito-legend button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line2); background: var(--chip); color: var(--soft); font-weight: 700; font-size: .8rem; cursor: pointer; }
.paito-legend button .sw { width: 14px; height: 14px; border-radius: 4px; }
.paito-legend button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
table.paito td.pd { padding: 5px 7px; }
table.paito { min-width: 460px; }
.pd span { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; border-radius: 7px; font-weight: 800; font-size: .88rem; color: #fff; font-variant-numeric: tabular-nums; }
.pd span.kembar { outline: 2px solid #fff; outline-offset: -2px; }
html[data-theme="light"] .pd span.kembar { outline-color: #101418; }
.d0 { background: #3f4b5a; } .d1 { background: #b91c1c; } .d2 { background: #c2410c; } .d3 { background: #a16207; }
.d4 { background: #15803d; } .d5 { background: #0f766e; } .d6 { background: #1d4ed8; } .d7 { background: #6d28d9; }
.d8 { background: #a21caf; } .d9 { background: #be185d; }

/* ---------- tools row (search/filter) ---------- */
.tools-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.search-in { flex: 1 1 200px; min-height: 44px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); color: var(--text); font-size: .95rem; }
.search-in::placeholder { color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.seg button { min-height: 40px; padding: 8px 14px; border: 0; background: var(--card); color: var(--muted); font-weight: 700; cursor: pointer; font-size: .85rem; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--green-deep); color: #fff; }
.count-note { font-size: .8rem; color: var(--muted); margin-left: auto; }

/* ---------- stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px; }
.stat b { display: block; font-size: 1.3rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.stat span { font-size: .76rem; color: var(--muted); }
.hotcold { display: flex; flex-wrap: wrap; gap: 6px; }
.hotcold .pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: .85rem; font-variant-numeric: tabular-nums; }
.hotcold .pill small { font-weight: 600; color: var(--muted); }
.pill.hot { background: color-mix(in srgb, #dc2626 22%, var(--card)); color: #ff8f8f; border: 1px solid rgba(220, 38, 38, .45); }
.pill.cold { background: color-mix(in srgb, #1d4ed8 20%, var(--card)); color: #9ec2ff; border: 1px solid rgba(29, 78, 216, .45); }
html[data-theme="light"] .pill.hot { color: #b91c1c; }
html[data-theme="light"] .pill.cold { color: #1d4ed8; }
.meter { height: 10px; border-radius: 999px; background: var(--chip); overflow: hidden; border: 1px solid var(--line); }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-deep), var(--green)); }

/* ---------- prediction cards ---------- */
.pred-grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .pred-grid { grid-template-columns: repeat(2, 1fr); } }
.pred-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.pred-card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pred-num { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pred-num .big { font-size: 1.9rem; font-weight: 800; letter-spacing: .06em; color: var(--gold); font-variant-numeric: tabular-nums; }
.pred-num .big.g { color: var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chipv { padding: 5px 12px; border-radius: 8px; background: var(--chip); border: 1px solid var(--line); font-weight: 800; font-variant-numeric: tabular-nums; }
button.chipv { cursor: pointer; color: var(--text); font-family: inherit; font-size: .95rem; }
button.chipv:hover { border-color: var(--green); }
.note-dis { font-size: .8rem; color: var(--muted); border-left: 3px solid var(--gold); padding: 6px 10px; background: var(--bg2); border-radius: 0 8px 8px 0; margin-top: 14px; }

/* ---------- CTA ---------- */
.cta-box { display: grid; gap: 14px; background: linear-gradient(120deg, var(--card), color-mix(in srgb, var(--green-deep) 40%, var(--card))); border: 1px solid var(--line2); border-radius: var(--radius); padding: 22px; margin: 26px 0 6px; align-items: center; }
@media (min-width: 720px) { .cta-box { grid-template-columns: 1fr auto; } }
.cta-title { margin: 0 0 4px; font-size: 1.3rem; }
.cta-sub { margin: 0; color: var(--muted); font-size: .92rem; max-width: 52ch; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.banner-cta { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); display: block; margin: 8px 0; }
.banner-cta img { width: 100%; height: auto; display: block; }

/* ---------- article / prose ---------- */
.prose { max-width: 74ch; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose .table-note { font-size: .8rem; color: var(--muted); }
.art-meta { color: var(--muted); font-size: .84rem; margin-bottom: 1.2em; }
.callout { background: var(--bg2); border: 1px solid var(--line); border-left: 4px solid var(--green); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 1em 0; }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 10px; }
details.faq { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
details.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; display: flex; gap: 10px; align-items: baseline; min-height: 48px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: "+"; color: var(--gold); font-weight: 800; font-size: 1.1rem; }
details.faq[open] summary::before { content: "–"; }
details.faq .faq-a { padding: 0 16px 14px 40px; color: var(--soft); }

/* ---------- footer ---------- */
.site-foot { margin-top: 40px; border-top: 1px solid var(--line); background: var(--bg2); padding: 30px 0 20px; }
.foot-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.foot-h { font-size: .82rem; text-transform: uppercase; letter-spacing: .09em; color: var(--gold); margin-bottom: 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot-grid a { color: var(--muted); font-size: .9rem; }
.foot-grid a:hover { color: var(--text); }
.foot-legal { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 16px; font-size: .8rem; color: var(--muted); }

/* ---------- market page head ---------- */
.mk-head { display: grid; gap: 14px; padding: 18px 0 4px; align-items: center; }
@media (min-width: 760px) { .mk-head { grid-template-columns: 1fr auto; } }
.mk-id { display: flex; align-items: center; gap: 14px; }
.mk-id h1 { margin: 0; font-size: clamp(1.35rem, 4vw, 2rem); }
.mk-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.latest-row { display: grid; gap: 14px; align-items: center; }
@media (min-width: 700px) { .latest-row { grid-template-columns: 1fr auto; } }
.latest-side { display: flex; gap: 12px; align-items: center; justify-content: flex-start; }
.latest-side .copy-btn { margin-left: 0; }

/* ---------- misc ---------- */
.grid-2 { display: grid; gap: 14px; }
@media (min-width: 800px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.pager a, .pager span { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: .88rem; color: var(--soft); }
.pager .cur { background: var(--green-deep); color: #fff; border-color: transparent; }
.top-btn { position: fixed; right: 14px; bottom: 14px; z-index: 40; box-shadow: var(--shadow); }
.lead { color: var(--muted); max-width: 68ch; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mini-list { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); font-size: .9rem; }
.mini-list a { font-weight: 700; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

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