/* ==========================================================
   4D Analyser: cinematic theme
   Near-black stage, spotlight glow, film grain, gold accent.
   ========================================================== */
:root {
  color-scheme: dark;
  --bg: #07080b;
  --bg-2: #0c0e13;
  --panel: rgba(20, 22, 29, 0.72);
  --panel-solid: #14161d;
  --panel-2: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #ecebe6;
  --muted: #8d8f99;
  --dim: #5b5e69;
  --gold: #d9b26a;
  --gold-hi: #f3d59a;
  --gold-soft: rgba(217, 178, 106, 0.12);
  --gold-line: rgba(217, 178, 106, 0.35);
  --teal: #5fb8ac;  --teal-soft: rgba(95, 184, 172, 0.12);
  --ice: #9fb4dc;   --ice-soft: rgba(159, 180, 220, 0.12);
  --red: #e0735f;   --red-soft: rgba(224, 115, 95, 0.12);
  --heat: 217, 178, 106;
  --radius: 14px;
  --display: "Bebas Neue", "Oswald", Impact, sans-serif;
  --ui: "Manrope", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --nav-h: 0px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 14px/1.55 var(--ui); letter-spacing: .005em;
  background:
    radial-gradient(1200px 520px at 50% -140px, rgba(217, 178, 106, 0.16), transparent 70%),
    radial-gradient(900px 600px at 100% 30%, rgba(95, 120, 184, 0.07), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 40%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--nav-h);
}
/* film grain */
body::before {
  content: ""; position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%,100% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-1%); } 80% { transform: translate(3%,3%); } }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } * { transition: none !important; animation: none !important; } }

h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .06em; margin: 0; }
h1 { font-size: 26px; line-height: 1; }
h2 { font-size: 20px; color: var(--text); margin-bottom: 14px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
h2::before { content: ""; width: 18px; height: 2px; background: var(--gold); align-self: center; flex: none; }
.muted, .hint { color: var(--muted); } .hint { font-size: 12.5px; margin: 10px 0; }
b { font-weight: 700; }
::selection { background: var(--gold); color: #000; }

/* ---------- header ---------- */
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px max(24px, env(safe-area-inset-left)); max-width: 1360px; margin: 0 auto;
}
.brand { display: flex; gap: 14px; align-items: center; min-width: 0; }
.logo {
  width: 46px; height: 46px; flex: none; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--display); font-size: 24px; letter-spacing: .04em; color: #0b0b0d;
  background: linear-gradient(145deg, var(--gold-hi), var(--gold) 55%, #9c7a3c);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset, 0 8px 30px rgba(217,178,106,.25);
}
.sub { margin: 4px 0 0; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub .short { display: none; }
.top-actions { display: flex; gap: 14px; align-items: center; }
.next { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- tabs ---------- */
.tabs {
  position: sticky; top: 0; z-index: 30; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  padding: 0 max(20px, calc((100vw - 1360px) / 2 + 20px));
  background: rgba(7, 8, 11, 0.78); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative; border: 0; background: none; color: var(--muted); cursor: pointer; white-space: nowrap;
  padding: 15px 14px; font: 600 12px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; transition: color .2s var(--ease);
}
.tabs button::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--gold); transform: scaleX(0); transition: transform .3s var(--ease); }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--gold-hi); }
.tabs button.active::after { transform: scaleX(1); }
.tabs button.hl { color: var(--gold); }

/* ---------- layout ---------- */
main { max-width: 1360px; margin: 0 auto; padding: 24px max(20px, env(safe-area-inset-left)); }
.tab { display: none; } .tab.active { display: block; animation: fadeUp .45s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card {
  position: relative; min-width: 0; margin-bottom: 20px; padding: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 60px -30px rgba(0,0,0,.9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid2 > .card { margin-bottom: 0; }

/* ---------- hero (dashboard) ---------- */
.hero {
  position: relative; overflow: hidden; margin-bottom: 20px; border-radius: 18px; padding: 34px 32px 30px;
  border: 1px solid var(--gold-line);
  background:
    radial-gradient(700px 300px at 50% 0%, rgba(217,178,106,.22), transparent 70%),
    linear-gradient(180deg, #12110e, #0a0a0c);
  box-shadow: 0 40px 100px -40px rgba(217,178,106,.25);
}
.hero::before, .hero::after { content: ""; position: absolute; left: 0; right: 0; height: 10px; background: #000; opacity: .6; }
.hero::before { top: 0; } .hero::after { bottom: 0; }
.hero .eyebrow { font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); text-align: center; }
.hero .title { font-family: var(--display); font-size: 22px; letter-spacing: .12em; text-align: center; margin: 6px 0 22px; color: var(--muted); }
.hero .podium { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 16px; align-items: end; max-width: 820px; margin: 0 auto; }
.hero .p { text-align: center; padding: 14px 8px 12px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.hero .p .l { font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.hero .p .num { font-family: var(--display); font-size: 58px; line-height: 1.05; letter-spacing: .08em; color: var(--text); border: 0; }
.hero .p.first { border-color: var(--gold-line); background: linear-gradient(180deg, rgba(217,178,106,.14), rgba(217,178,106,.02)); }
.hero .p.first .num { font-size: 84px; color: var(--gold-hi); text-shadow: 0 0 40px rgba(217,178,106,.45); }
.hero .p.first .l { color: var(--gold); }
.hero .countdown { display: flex; justify-content: center; gap: 22px; margin-top: 22px; flex-wrap: wrap; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hero .countdown b { color: var(--text); font-family: var(--display); font-size: 18px; letter-spacing: .1em; font-weight: 400; margin-left: 6px; }

/* ---------- controls ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-bottom: 14px; }
.toolbar.card { margin-bottom: 20px; }
label { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; letter-spacing: .06em; }
select, input {
  font: 500 13.5px var(--ui); color: var(--text); background: rgba(255,255,255,.04);
  border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 10px; outline: none; transition: border-color .2s, box-shadow .2s;
}
select:focus, input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
select option { background: var(--panel-solid); }
input[type="date"] { color-scheme: dark; }
input.small { width: 68px; } input.wide { width: 240px; } input.mono { width: 100px; font-family: var(--mono); letter-spacing: .25em; }
.custom { display: none; gap: 6px; align-items: center; } .custom.show { display: inline-flex; }
.btn {
  font: 700 12px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
  padding: 11px 18px; border-radius: 999px; color: var(--text); background: rgba(255,255,255,.04); border: 1px solid var(--line-strong);
  transition: all .2s var(--ease);
}
.btn:hover { border-color: var(--gold-line); color: var(--gold-hi); }
.btn.primary { color: #111; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border-color: transparent; box-shadow: 0 8px 24px -8px rgba(217,178,106,.6); }
.btn.primary:hover { color: #000; filter: brightness(1.06); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: wait; transform: none; }
.prizes { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.prizes label { position: relative; cursor: pointer; }
.prizes input { position: absolute; opacity: 0; pointer-events: none; }
.prizes label span, .prizes label { font-size: 11.5px; }
.prizes label { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--dim); letter-spacing: .08em; text-transform: uppercase; font-weight: 700; transition: all .2s; }
.prizes label:has(input:checked) { color: var(--gold-hi); border-color: var(--gold-line); background: var(--gold-soft); }
.chip { font: 600 12px var(--ui); letter-spacing: .04em; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: all .2s; }
.chip:hover { border-color: var(--gold-line); color: var(--gold-hi); }
.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.sep { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .15em; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 20px; top: 0; width: 28px; height: 2px; background: var(--gold); }
.kpi .v { font-family: var(--display); font-size: 38px; line-height: 1.1; letter-spacing: .04em; }
.kpi .l { color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; background: var(--panel-solid); position: sticky; top: 0; z-index: 1; }
tr:hover td { background: rgba(255,255,255,.02); }
td.c, th.c { text-align: center; } td.r, th.r { text-align: right; }
.scroll-x { overflow-x: auto; } .scroll-y { max-height: 600px; overflow-y: auto; }
.tablewrap { max-height: 640px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.tablewrap tr:last-child td { border-bottom: 0; }
.heat { text-align: center; font-family: var(--mono); font-size: 12.5px; }

/* ---------- numbers & chips ---------- */
.num { display: inline-block; font-family: var(--mono); font-weight: 700; letter-spacing: .08em; font-size: 15px; }
.n-link { cursor: pointer; border-bottom: 1px dashed var(--dim); transition: color .15s, border-color .15s; }
.n-link:hover { color: var(--gold-hi); border-color: var(--gold); }
.hit { display: inline-flex; gap: 6px; align-items: center; padding: 3px 8px 3px 4px; margin: 2px 4px 2px 0; border-radius: 7px; background: rgba(255,255,255,.035); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pz { font-size: 9.5px; font-weight: 800; padding: 2px 6px; border-radius: 5px; letter-spacing: .1em; text-transform: uppercase; }
.pz-1st, .pz-2nd, .pz-3rd { background: var(--gold-soft); color: var(--gold-hi); }
.pz-starter { background: var(--ice-soft); color: var(--ice); }
.pz-consolation { background: var(--teal-soft); color: var(--teal); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; font: 700 10px/16px var(--ui); border-radius: 999px; background: var(--gold-soft); color: var(--gold); vertical-align: super; }
.badge.zero { background: rgba(255,255,255,.04); color: var(--dim); }
.count { font-family: var(--display); font-size: 20px; letter-spacing: .05em; color: var(--gold-hi); font-weight: 400; }

/* ---------- draw results ---------- */
.results .top3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.results .prize-box { text-align: center; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--gold-line); background: linear-gradient(180deg, rgba(217,178,106,.12), rgba(217,178,106,.02)); }
.results .prize-box .l { font-size: 10px; font-weight: 800; letter-spacing: .25em; color: var(--gold); text-transform: uppercase; }
.results .prize-box .num { font-family: var(--display); font-weight: 400; font-size: 36px; letter-spacing: .08em; border: 0; line-height: 1.1; }
.results h3 { font-size: 10.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; font-weight: 700; }
.results .grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.results .grid5 div { text-align: center; padding: 8px 4px; border-radius: 9px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }

/* ---------- monthly ---------- */
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.month { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: rgba(255,255,255,.02); }
.month > div { margin: 4px 0; }
.month h3 { margin: 0 0 8px; display: flex; justify-content: space-between; align-items: baseline; font: 400 22px var(--display); letter-spacing: .08em; }
.month h3 .muted { font: 600 11px var(--ui); letter-spacing: .12em; text-transform: uppercase; }
.month .lbl { font-size: 10px; color: var(--gold); font-weight: 800; margin: 12px 0 6px; letter-spacing: .2em; text-transform: uppercase; }
.empty { color: var(--dim); font-style: italic; padding: 6px 0; font-size: 13px; }

/* ---------- predictions ---------- */
.notice { border: 1px solid var(--gold-line); border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 10px; padding: 14px 18px; margin-bottom: 20px; font-size: 13px; color: #d8d3c6; }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.pick { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: rgba(255,255,255,.025); cursor: pointer; transition: border-color .2s, transform .2s var(--ease); }
.pick:hover { border-color: var(--gold-line); transform: translateY(-2px); }
.pick:nth-child(-n+3) { border-color: var(--gold-line); background: linear-gradient(180deg, rgba(217,178,106,.1), rgba(217,178,106,.01)); }
.pick .row { display: flex; justify-content: space-between; align-items: baseline; }
.pick .rank { color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.pick .num { font-family: var(--display); font-weight: 400; font-size: 34px; letter-spacing: .1em; border: 0; }
.pick:nth-child(-n+3) .num { color: var(--gold-hi); }
.pick .meta { font-size: 11px; }
.pick .why { display: none; font-size: 11px; color: var(--gold); margin-top: 4px; }
.bars { margin-top: 8px; display: grid; gap: 4px; }
.bar { display: grid; grid-template-columns: 58px 1fr 38px; gap: 6px; align-items: center; font-size: 10.5px; color: var(--muted); }
.bar .track { height: 4px; background: rgba(255,255,255,.06); border-radius: 2px; position: relative; overflow: hidden; }
.bar .fill { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.bar .fill.pos { left: 50%; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); } .bar .fill.neg { right: 50%; background: var(--red); }
.bt-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .num { padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.03); }

.chartbox { position: relative; height: 290px; }

/* ---------- footer, toast, loading ---------- */
footer { text-align: center; color: var(--dim); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; padding: 32px 16px 48px; }
#toast { position: fixed; left: 50%; bottom: calc(24px + var(--nav-h)); transform: translate(-50%, 10px); background: var(--panel-solid); color: var(--text); border: 1px solid var(--gold-line); padding: 12px 18px; border-radius: 999px; opacity: 0; transition: all .25s var(--ease); pointer-events: none; z-index: 60; max-width: 90vw; font-size: 13px; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { color: var(--muted); padding: 14px 0; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.loading::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px; vertical-align: -2px; border: 2px solid var(--gold-soft); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- bottom nav + sheet (phones) ---------- */
.bottom-nav, .sheet { display: none; }
.sheet[hidden] { display: none !important; }

/* ======================= TABLET ======================= */
@media (max-width: 1000px) {
  .grid2 { grid-template-columns: 1fr; }
  .hero .p .num { font-size: 46px; } .hero .p.first .num { font-size: 66px; }
}

/* ======================= PHONE ======================= */
@media (max-width: 720px) {
  :root { --nav-h: calc(64px + env(safe-area-inset-bottom)); }
  body { font-size: 14px; }
  select, input { font-size: 16px; }              /* stops iOS zoom on focus */

  .top { padding: 12px 16px; gap: 10px; }
  .logo { width: 38px; height: 38px; font-size: 20px; border-radius: 10px; }
  h1 { font-size: 22px; }
  .sub { font-size: 10.5px; letter-spacing: .06em; }
  .sub .long { display: none; } .sub .short { display: inline; }
  .next { display: none; }

  .tabs { display: none; }
  main { padding: 16px 12px; }
  .card { padding: 16px 14px; margin-bottom: 14px; border-radius: 12px; }
  .grid2 { gap: 14px; margin-bottom: 14px; }
  h2 { font-size: 18px; margin-bottom: 12px; }

  /* hero */
  .hero { padding: 26px 12px 20px; border-radius: 14px; margin-bottom: 14px; }
  .hero .title { font-size: 16px; margin-bottom: 16px; }
  .hero .podium { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero .p.first { grid-column: 1 / -1; order: -1; }
  .hero .p .num { font-size: 40px; }
  .hero .p.first .num { font-size: 64px; }
  .hero .countdown { gap: 6px 16px; font-size: 10.5px; }

  /* KPIs */
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .kpi { padding: 14px; } .kpi .v { font-size: 30px; } .kpi .l { font-size: 10px; letter-spacing: .1em; }
  .kpi.hide-m { display: none; }

  /* toolbars become stacked form rows */
  .toolbar { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .toolbar.card { margin-bottom: 14px; }
  .toolbar > label { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: center; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
  .toolbar > label > select, .toolbar > label > input { width: 100%; min-width: 0; }
  .toolbar > label.inline { display: flex; flex-wrap: wrap; }
  .toolbar > label.inline input { width: 68px; }
  .custom.show { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; }
  .custom input { width: 100%; min-width: 0; }
  .prizes { display: flex; }
  .toolbar > .btn { width: 100%; padding: 14px; }
  .toolbar > .btn.primary { order: 99; }
  .toolbar > .sep { text-align: center; }
  #tab-draw .toolbar, #tab-toto_results .toolbar { grid-template-columns: auto 1fr auto; }
  #tab-draw .toolbar > label, #tab-toto_results .toolbar > label { grid-template-columns: auto 1fr; }
  #tab-draw .toolbar > .btn, #tab-toto_results .toolbar > .btn { width: auto; padding: 12px 14px; }
  .presets { display: grid; grid-template-columns: 1fr; }
  .presets .chip { padding: 11px 14px; text-align: left; }

  /* tables: no nested scroll areas, sticky first column */
  .tablewrap { max-height: none; overflow-x: auto; overflow-y: visible; }
  .scroll-y { max-height: none; }
  th, td { padding: 9px 8px; }
  th { position: static; }
  .tablewrap td:first-child, .tablewrap th:first-child { position: sticky; left: 0; background: var(--panel-solid); z-index: 1; }
  .hit { font-size: 11px; }

  .results .prize-box .num { font-size: 28px; }
  .results .grid5 { grid-template-columns: repeat(3, 1fr); }
  .results .grid5 .num { font-size: 14px; }

  .months { grid-template-columns: 1fr; }

  .picks { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pick { padding: 10px 12px; }
  .pick .num { font-size: 30px; }
  .pick .bars { display: none; }
  .pick .why { display: block; }
  .pick.open { grid-column: 1 / -1; }
  .pick.open .bars { display: grid; }
  .pick.open .why { display: none; }
  .bt-summary { grid-template-columns: 1fr; }
  .chartbox { height: 240px; }

  /* bottom navigation */
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: var(--nav-h); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(9, 10, 13, 0.86); backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-top: 1px solid var(--line);
  }
  .bottom-nav button {
    border: 0; background: none; color: var(--dim); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font: 700 9.5px var(--ui); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; position: relative;
  }
  .bottom-nav .i { font-size: 19px; line-height: 1; letter-spacing: 0; }
  .bottom-nav button.active { color: var(--gold-hi); }
  .bottom-nav button.active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; background: var(--gold); border-radius: 0 0 2px 2px; box-shadow: 0 0 12px var(--gold); }

  .sheet { display: flex; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); align-items: flex-end; animation: fade .2s; }
  .sheet-panel { width: 100%; background: var(--panel-solid); border-top: 1px solid var(--gold-line); border-radius: 20px 20px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .3s var(--ease); }
  .sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-family: var(--display); font-size: 20px; letter-spacing: .08em; }
  .sheet-head b { font-weight: 400; }
  .sheet-head .btn { padding: 9px 14px; }
  .sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .sheet-grid button { text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text); font: 600 13px var(--ui); cursor: pointer; }
  .sheet-grid button.active { border-color: var(--gold-line); color: var(--gold-hi); background: var(--gold-soft); }
  footer { padding-bottom: 24px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
.brand > div { min-width: 0; }
.top-actions { flex: none; }
@media (max-width: 720px) { .picks { grid-auto-flow: dense; } }
.auto { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--gold-line); background: var(--gold-soft); color: var(--gold-hi); font: 700 11px var(--ui); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.auto i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (max-width: 720px) { .auto { padding: 8px; } .auto span { display: none; } }

/* ---------- responsible gambling ---------- */
footer.disclaimer { max-width: 900px; margin: 0 auto; text-transform: none; letter-spacing: 0; font-size: 12.5px; line-height: 1.65; color: var(--muted); display: grid; gap: 10px; }
footer.disclaimer .help { color: var(--text); padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(255,255,255,.03); }
footer.disclaimer a { color: var(--gold-hi); }
footer.disclaimer .small { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.notice a { color: var(--gold-hi); }
.gate { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.gate[hidden] { display: none; }
.gate-panel { width: min(560px, 100%); max-height: 90vh; overflow-y: auto; padding: 26px 24px; border-radius: 16px; border: 1px solid var(--gold-line); background: linear-gradient(180deg, #16140f, #0c0c0f); box-shadow: 0 30px 80px rgba(0,0,0,.7); }
.gate-eyebrow { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.gate h2::before { display: none; }
.gate ul { margin: 0 0 20px; padding-left: 18px; display: grid; gap: 10px; font-size: 14.5px; line-height: 1.55; color: #d9d6cc; }
.gate a { color: var(--gold-hi); }
.gate .btn { width: 100%; padding: 15px; font-size: 13px; }

.gate-legal { font-size: 12.5px; color: var(--muted); margin: -6px 0 14px; }

/* ---------- legal pages ---------- */
a.brand { color: inherit; text-decoration: none; }
a.btn { text-decoration: none; display: inline-block; }
body.legal-page { padding-bottom: 0; }
.legal { max-width: 820px; margin: 0 auto; padding: 24px 20px 20px; }
.legal .eyebrow { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin: 12px 0 4px; }
.legal-title { font-size: 56px; letter-spacing: .05em; line-height: 1; margin: 0 0 8px; }
.legal .meta { color: var(--muted); font-size: 12.5px; margin: 0 0 22px; }
.legal .toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 26px; }
.legal .toc a { font-size: 12px; color: var(--muted); text-decoration: none; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-strong); }
.legal .toc a:hover { color: var(--gold-hi); border-color: var(--gold-line); }
.legal section { padding: 18px 0; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.legal section.callout { border: 1px solid var(--gold-line); border-radius: var(--radius); background: var(--gold-soft); padding: 18px 20px; margin-bottom: 8px; }
.legal h2 { font-size: 22px; margin-bottom: 10px; }
.legal p, .legal li { font-size: 15px; line-height: 1.75; color: #d6d3ca; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }
.legal a { color: var(--gold-hi); }
.legal .contact { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.03); }
.legal-table { margin: 6px 0 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: block; overflow-x: auto; }
.legal-table th { position: static; }
.legal-table td { font-size: 13.5px; color: #d6d3ca; vertical-align: top; }
.legal .mono { font-family: var(--mono); }
.legal-foot { color: var(--muted); margin-top: 18px; }
[data-fill] { color: var(--gold-hi); }
@media (max-width: 720px) {
  .legal { padding: 12px 16px 8px; }
  .legal-title { font-size: 42px; }
  .legal p, .legal li { font-size: 15.5px; }
  .legal-page .top .btn { padding: 10px 12px; font-size: 11px; }
}
.legal .mono { white-space: nowrap; }

/* ---------- language switch ---------- */
.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.03); flex: none; }
.lang-switch button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 7px 14px; border-radius: 999px; font: 700 12px/1 var(--ui), "Noto Sans SC", sans-serif; letter-spacing: .08em; transition: all .2s var(--ease); }
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active { color: #111; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); }
.gate-lang { float: right; margin: -6px -6px 0 0; }
.gate-lang button { padding: 6px 11px; font-size: 11px; }

/* small helpers that replaced inline styles */
.h-note { font: 600 11px var(--ui); letter-spacing: .12em; text-transform: uppercase; }
.lookup-card { background: rgba(255,255,255,.025); }
.lk-num { font-size: 26px; }
.kpi .v.small-v { font-size: 22px; }
.kpi .v .vs { font: 500 13px var(--ui); letter-spacing: 0; }

/* ---------- Chinese typography ---------- */
:root { --cjk: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }
body { font-family: var(--ui), var(--cjk); }
html[data-lang="zh"] body { font-size: 15px; letter-spacing: 0; }
html[data-lang="zh"] h1, html[data-lang="zh"] h2, html[data-lang="zh"] .month h3, html[data-lang="zh"] .sheet-head,
html[data-lang="zh"] .hero .title, html[data-lang="zh"] .legal-title {
  font-family: var(--cjk); font-weight: 700; letter-spacing: .04em;
}
html[data-lang="zh"] h1 { font-size: 22px; }
html[data-lang="zh"] h2 { font-size: 18px; }
html[data-lang="zh"] .hero .title { font-size: 18px; font-weight: 500; }
html[data-lang="zh"] .tabs button, html[data-lang="zh"] .btn, html[data-lang="zh"] .kpi .l, html[data-lang="zh"] th,
html[data-lang="zh"] .hero .eyebrow, html[data-lang="zh"] .hero .p .l, html[data-lang="zh"] .hero .countdown,
html[data-lang="zh"] .results h3, html[data-lang="zh"] .results .prize-box .l, html[data-lang="zh"] .month .lbl,
html[data-lang="zh"] .prizes label, html[data-lang="zh"] .bottom-nav button, html[data-lang="zh"] footer .small,
html[data-lang="zh"] .gate-eyebrow, html[data-lang="zh"] .h-note, html[data-lang="zh"] .pz, html[data-lang="zh"] label {
  letter-spacing: .04em; font-family: var(--ui), var(--cjk);
}
html[data-lang="zh"] .tabs button { font-size: 13.5px; }
html[data-lang="zh"] .kpi .l { font-size: 12.5px; }
html[data-lang="zh"] th { font-size: 12.5px; }
html[data-lang="zh"] .pz { font-size: 10.5px; }
html[data-lang="zh"] .bottom-nav button { font-size: 11px; }
html[data-lang="zh"] .legal p, html[data-lang="zh"] .legal li { font-size: 15.5px; line-height: 1.85; }
@media (max-width: 720px) {
  .lang-switch button { padding: 8px 12px; }
  .top .lang-switch { margin-left: auto; }
}

/* bilingual blocks on the legal pages */
html:not([data-lang="zh"]) .only-zh, html[data-lang="zh"] .only-en { display: none !important; }
html[data-lang="zh"] .hero .eyebrow, html[data-lang="zh"] .hero .countdown { font-size: 13px; }
html[data-lang="zh"] .hero .p .l, html[data-lang="zh"] .results .prize-box .l { font-size: 13px; letter-spacing: .15em; }
html[data-lang="zh"] .results h3, html[data-lang="zh"] .month .lbl { font-size: 12.5px; letter-spacing: .1em; }
html[data-lang="zh"] .h-note { font-size: 12px; }
.legal-actions { display: flex; gap: 10px; align-items: center; }
@media (max-width: 720px) { .legal-page .top { flex-wrap: wrap; } .legal-actions { width: 100%; justify-content: space-between; } }

/* ---------- lucky numbers ---------- */
.kpis.profile .kpi .l:first-child { margin-bottom: 4px; }
.kpis.profile .sub-l { margin-top: 2px; color: var(--gold); }
.zemoji { font-size: .9em; }
.digit-pool { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dchip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--gold-line); background: var(--gold-soft); }
.dchip b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #111; font: 400 20px var(--display); }
.dchip small { color: var(--gold-hi); font-size: 11.5px; }
.mean { display: inline-flex; align-items: center; gap: 5px; margin: 2px 6px 2px 0; padding: 2px 8px 2px 3px; border-radius: 6px; background: rgba(255,255,255,.035); border: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; }
.mean b { min-width: 20px; text-align: center; border-radius: 4px; background: var(--gold-soft); color: var(--gold-hi); font-family: var(--mono); }
.mean.bad b { background: var(--red-soft); color: var(--red); }
.meanings { display: flex; flex-wrap: wrap; gap: 6px; }
.meanings .mean { font-size: 13px; padding: 5px 10px 5px 5px; }
td.means { min-width: 220px; }

/* ---------- grouped navigation ---------- */
.subtabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px max(20px, calc((100vw - 1360px) / 2 + 20px)); border-bottom: 1px solid var(--line); background: rgba(7,8,11,.55); }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs[hidden] { display: none; }
.subtabs button { flex: none; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 999px; font: 600 12.5px var(--ui), var(--cjk); cursor: pointer; white-space: nowrap; transition: all .2s; }
.subtabs button:hover { color: var(--text); border-color: var(--gold-line); }
.subtabs button.active { color: #111; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border-color: transparent; }
.sheet-group { margin-bottom: 14px; }
.sheet-glabel { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px 2px; font-weight: 700; }
#moreSheet .sheet-panel { max-height: 82vh; overflow-y: auto; }
@media (max-width: 720px) { .subtabs { position: sticky; top: 0; z-index: 30; padding: 10px 12px; background: rgba(7,8,11,.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); } }

/* ---------- research widgets ---------- */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-strong); }
.seg button { border: 0; background: none; color: var(--muted); padding: 8px 14px; border-radius: 999px; cursor: pointer; font: 700 12px var(--ui), var(--cjk); }
.seg button.active { color: #111; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); }
.group-chips, .quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip.active { color: #111; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border-color: transparent; }
.chip.active .muted { color: #3a2e14; }
.card.inner { background: rgba(255,255,255,.02); box-shadow: none; }
.hint.pad { margin: 0 4px 14px; }
.notice.calm { border-color: var(--line-strong); border-left-color: var(--teal); background: var(--teal-soft); }
.tag { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 12px; line-height: 1.5; }
.tag.ok { background: var(--teal-soft); color: var(--teal); }
.tag.warn { background: var(--gold-soft); color: var(--gold-hi); }
.tag.bad { background: var(--red-soft); color: var(--red); }
.watch-btn { margin-left: auto; }
.watch-grid, .dream-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.watch, .dream { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel); }
.watch.hit-now { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-line), 0 10px 40px -10px rgba(217,178,106,.5); }
.watch .row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.num.big, .num.big .num { font-family: var(--display); font-weight: 400; font-size: 36px; letter-spacing: .08em; border-bottom: 0; }
.flag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 6px; background: var(--teal-soft); color: var(--teal); margin-bottom: 8px; }
.flag.gold { background: var(--gold-soft); color: var(--gold-hi); }
.flag.dim { background: rgba(255,255,255,.05); color: var(--muted); }
.stats-row { display: flex; gap: 16px; margin: 4px 0; } .stats-row b { font-family: var(--display); font-size: 20px; color: var(--gold-hi); font-weight: 400; }
.muted.small { font-size: 12px; }
.dream .dz { font-size: 18px; font-weight: 700; margin: 2px 0; }

/* ---------- header tools & settings ---------- */
.top-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.04); color: var(--text); font: 700 14px var(--ui), var(--cjk); cursor: pointer; }
.icon-btn:hover { border-color: var(--gold-line); color: var(--gold-hi); }
.icon-btn.active { color: #111; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border-color: transparent; }
.sheet.settings { display: flex; position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.6); align-items: center; justify-content: center; padding: 16px; }
.sheet.settings[hidden] { display: none !important; }
.sheet.settings .sheet-panel { width: min(520px, 100%); background: var(--panel-solid); border: 1px solid var(--gold-line); border-radius: 18px; padding: 20px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); color: var(--text); font-size: 15px; letter-spacing: 0; }
.set-row small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; font-weight: 400; }
.switch { appearance: none; -webkit-appearance: none; width: 52px; height: 30px; border-radius: 999px; background: rgba(255,255,255,.12); position: relative; cursor: pointer; flex: none; border: 0; padding: 0; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch:checked { background: var(--gold); } .switch:checked::after { transform: translateX(22px); }
.offline-banner { background: var(--gold-soft); color: var(--gold-hi); text-align: center; padding: 8px 16px; font-size: 13px; border-bottom: 1px solid var(--gold-line); }
.offline-banner[hidden] { display: none; }
@media (max-width: 720px) { .top .brand h1 { font-size: 18px; } .top-tools { gap: 6px; } .icon-btn { min-width: 36px; height: 36px; padding: 0 8px; } }

/* ---------- read aloud / share ---------- */
.draw-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn.act { padding: 12px 18px; font-size: 13px; }
.btn.wa { background: #1f7a4a; border-color: #25d366; color: #fff; }
.btn.wa:hover { color: #fff; filter: brightness(1.1); }

/* ---------- simple mode ---------- */
.simple-bar { display: none; }
html[data-simple="1"] .tabs, html[data-simple="1"] .subtabs { display: none !important; }
html[data-simple="1"] .simple-bar { display: flex; align-items: center; gap: 12px; max-width: 1360px; margin: 0 auto; padding: 10px 20px 0; }
html[data-simple="1"] .simple-bar b { font-size: 18px; }
html[data-simple="1"][data-tab="simple"] .simple-bar { display: none; }
html[data-simple="1"] .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(72px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(9,10,13,.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--line); }
html[data-simple="1"] body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
html[data-simple="1"] .bottom-nav button { border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 700 13px var(--ui), var(--cjk); cursor: pointer; position: relative; }
html[data-simple="1"] .bottom-nav .i { font-size: 24px; }
html[data-simple="1"] .bottom-nav button.active { color: var(--gold-hi); }
.big-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.big-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 140px; border-radius: 18px; border: 1px solid var(--gold-line); background: linear-gradient(180deg, rgba(217,178,106,.16), rgba(217,178,106,.03)); color: var(--text); font: 800 22px var(--ui), var(--cjk); cursor: pointer; transition: transform .15s var(--ease); }
.big-btn:active { transform: scale(.98); }
.big-btn .bi { font-size: 40px; color: var(--gold-hi); }
.simple-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.simple-links .chip { font-size: 15px; padding: 12px 18px; }

/* ---------- easy-read mode ---------- */
html[data-easy="1"] { --muted: #c9c8c2; --dim: #a3a4ab; --line: rgba(255,255,255,.18); --line-strong: rgba(255,255,255,.3); --text: #ffffff; }
html[data-easy="1"] body { zoom: 1.22; }
html[data-easy="1"] body::before { display: none; }
html[data-easy="1"] .hint, html[data-easy="1"] .muted { color: var(--muted); }
html[data-easy="1"] th, html[data-easy="1"] .kpi .l, html[data-easy="1"] label { font-size: 13.5px; letter-spacing: .03em; }
html[data-easy="1"] td { font-size: 15px; }
html[data-easy="1"] .num { font-size: 18px; }
html[data-easy="1"] .n-link { border-bottom-width: 2px; }
@media (max-width: 720px) { html[data-easy="1"] body { zoom: 1.12; } }

/* ---------- checker ---------- */
.ck-rows { display: grid; gap: 10px; margin: 6px 0 14px; }
.ck-row { display: grid; grid-template-columns: 120px 1fr 120px 40px; gap: 10px; align-items: center; }
.ck-row input.mono { width: 100%; font-size: 20px; text-align: center; letter-spacing: .3em; }
.ck-row .amt input { width: 80px; }
.ck-total { font-size: 20px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-strong); margin: 6px 0 12px; }
.ck-total.won { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-hi); }
tr.won td { background: rgba(217,178,106,.08); }
@media (max-width: 720px) { .ck-row { grid-template-columns: 1fr 1fr; } .ck-row .amt { grid-column: 1; } .ck-row .icon-btn { justify-self: end; } }

/* ---------- scorecard ---------- */
.sc-cards .kpi .v.small-v { margin-top: 6px; }
.sc-draw { border-top: 1px solid var(--line); padding: 14px 0; }
.sc-head { margin-bottom: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
details summary { cursor: pointer; color: var(--gold); font-size: 12.5px; }
.picks-mini { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; }

/* ---------- TOTO ---------- */
.ball { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; font: 400 26px var(--display); letter-spacing: .02em; color: #111;
  background: radial-gradient(circle at 35% 30%, #fff4d6, var(--gold-hi) 35%, var(--gold) 70%, #8a6a2f); box-shadow: 0 6px 18px -6px rgba(217,178,106,.6); }
.ball.add { background: radial-gradient(circle at 35% 30%, #e6f5f2, #8fd3c9 35%, var(--teal) 70%, #2d6f67); }
.ball.sm { width: 30px; height: 30px; font-size: 16px; box-shadow: none; margin: 1px; }
.ball.miss { background: rgba(255,255,255,.08); color: var(--muted); box-shadow: none; }
.ball.hit { outline: 3px solid #fff; }
.balls { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.balls.small .ball { width: 40px; height: 40px; font-size: 20px; }
.balls .plus { font: 400 30px var(--display); color: var(--muted); }
.toto-hero .balls .ball { width: 64px; height: 64px; font-size: 32px; }
.ball-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.bcell { border-radius: 10px; padding: 8px 6px; text-align: center; border: 1px solid var(--line); }
.bcell b { display: block; font: 400 24px var(--display); }
.bcell span { display: block; font-family: var(--mono); font-size: 13px; color: var(--gold-hi); }
.bcell small { display: block; font-size: 10.5px; color: var(--muted); }
.ball-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; margin: 8px 0 14px; }
.pick-ball { width: 48px; height: 48px; font-size: 22px; border: 0; cursor: pointer; background: rgba(255,255,255,.07); color: var(--text); box-shadow: none; }
.pick-ball.on { background: radial-gradient(circle at 35% 30%, #fff4d6, var(--gold-hi) 35%, var(--gold) 70%, #8a6a2f); color: #111; }
.picker-actions { grid-column: 1 / -1; }
label.check { cursor: pointer; }
@media (max-width: 720px) { .ball { width: 42px; height: 42px; font-size: 22px; } .toto-hero .balls .ball { width: 44px; height: 44px; font-size: 24px; } .ball-grid { grid-template-columns: repeat(7, 1fr); } .bcell small { display: none; } .ball-picker { grid-template-columns: repeat(7, 1fr); } .pick-ball { width: 100%; height: auto; aspect-ratio: 1; font-size: 18px; } }

.top .brand h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) { .top { gap: 8px; } .top .brand { gap: 8px; } .top .brand h1 { font-size: 16px; } .top .lang-switch button { padding: 7px 9px; } }
.set-inline { display: inline-flex; gap: 8px; align-items: center; }
.chartbox.tall { height: 340px; }
@media (max-width: 720px) { .chartbox.tall { height: 260px; } }

/* ---------- TOTO research ---------- */
.nowrap { white-space: nowrap; }
.plus-sm { color: var(--muted); margin: 0 3px; font-weight: 700; }
.balls-left { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 6px 0; }
.count.sm { font-size: 15px; margin-right: 6px; }
.since-bar { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.07); vertical-align: middle; margin-right: 6px; overflow: hidden; }
.since-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); }
.rank-box { margin-top: 14px; }
.rank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 10px; }
.rank-item { display: grid; grid-template-columns: 34px 34px 1fr; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; }
.rank-item .bars { display: grid; gap: 2px; margin: 0; }
.grid2.flat { margin-bottom: 0; } .grid2.flat .balls { justify-content: flex-start; }
ul.plain { margin: 0 0 12px; padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.toolbar.center { justify-content: center; margin-top: 12px; }
.pick-quick { border: 0; cursor: pointer; }
@media (max-width: 720px) { .since-bar { width: 36px; } td.nowrap { font-size: 12.5px; } }

/* lookup lists */
.list-title { font: 700 14px var(--ui), var(--cjk); margin: 20px 0 8px; letter-spacing: .02em; }
.list-table { max-height: none; }
.list-table td, .list-table th { padding: 9px 12px; }
.list-table .pz { font-size: 11px; padding: 3px 8px; text-transform: none; letter-spacing: .02em; }
.list-table.collapsed tr.more-row { display: none; }

/* ---------- hot & cold ---------- */
.hc-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hc-cols.four { grid-template-columns: repeat(4, 1fr); }
.hc-col { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: rgba(255,255,255,.02); }
.hc-col h3 { margin: 0 0 4px; font: 700 16px var(--ui), var(--cjk); }
.hc-col.hc-hot { border-color: rgba(224,115,95,.45); background: linear-gradient(180deg, rgba(224,115,95,.1), transparent); }
.hc-col.hc-due { border-color: rgba(159,180,220,.45); background: linear-gradient(180deg, rgba(159,180,220,.1), transparent); }
.hc-col.hc-mix, .hc-col.hc-balanced { border-color: var(--gold-line); background: linear-gradient(180deg, var(--gold-soft), transparent); }
.hc-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.hc-num .num { font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: .08em; }
.balls.left { justify-content: flex-start; }
.hc-table td.hc-cell { font-family: var(--mono); font-size: 13px; }
.hc-table td.hc-cell span { color: var(--muted); font-size: 11.5px; }
.hc-table td.hot { background: rgba(224,115,95,.18); color: #ffb4a5; }
.hc-table td.cold { background: rgba(159,180,220,.16); color: #cfdbf3; }
.bcell.hc-hotcell { border-color: rgba(224,115,95,.8) !important; box-shadow: inset 0 0 0 1px rgba(224,115,95,.6); }
.bcell.hc-coldcell { border-color: rgba(159,180,220,.8) !important; box-shadow: inset 0 0 0 1px rgba(159,180,220,.6); }
@media (max-width: 1000px) { .hc-cols.four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .hc-cols, .hc-cols.four { grid-template-columns: 1fr; } }

/* plain-language explanations */
.explain { display: grid; gap: 8px; margin: 4px 0 16px; }
.explain > div { display: flex; align-items: center; gap: 12px; font-size: 14.5px; line-height: 1.5; }
.ex-tag { flex: none; min-width: 58px; text-align: center; padding: 5px 8px; border-radius: 8px; background: var(--gold-soft); color: var(--gold-hi); border: 1px solid var(--gold-line); font-weight: 700; }
td.pat-desc, .pat-desc { font-size: 12.5px; font-family: var(--ui), var(--cjk); letter-spacing: 0; text-transform: none; font-weight: 500; }
