:root {
  color-scheme: light;
  --red: #4f46e5;
  --red-strong: #3730a3;
  --red-soft: #eef2ff;
  --green: #0891b2;
  --green-strong: #0e7490;
  --green-soft: #ecfeff;
  --orange: #d97706;
  --bg: #e9eeff;
  --surface: #fbfcff;
  --surface-2: #eef2ff;
  --surface-indigo: #e0e7ff;
  --surface-cyan: #cffafe;
  --surface-amber: #fef3c7;
  --row-alt: #f0f4ff;
  --chart-bg: #f7f9ff;
  --ink: #171a33;
  --muted: #626b87;
  --line: #c7d2ef;
  --shadow: rgba(48, 46, 108, .14);
  --header: #ffffff;
  --table-head: #252b55;
  --radius: 8px;
  --font-apple: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  --font-sans: var(--font-apple);
  --font-number: var(--font-apple);
  --font-weight-site: 300;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --red: #818cf8;
  --red-strong: #a5b4fc;
  --red-soft: #242a4f;
  --green: #22d3ee;
  --green-strong: #67e8f9;
  --green-soft: #12313a;
  --orange: #fbbf24;
  --bg: #08091c;
  --surface: #111733;
  --surface-2: #171d3e;
  --surface-indigo: #232858;
  --surface-cyan: #123746;
  --surface-amber: #3b3118;
  --row-alt: #151c3d;
  --chart-bg: #0e1430;
  --ink: #eef2ff;
  --muted: #b6c2e2;
  --line: #30385c;
  --shadow: rgba(0, 0, 0, .3);
  --header: #0d112a;
  --table-head: #252b55;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 8% 4%, rgba(79,70,229,.13), transparent 32rem), radial-gradient(circle at 96% 22%, rgba(6,182,212,.12), transparent 30rem), var(--bg); color: var(--ink); font: var(--font-weight-site) 14px/1.57 var(--font-sans); padding-bottom: 0; }
body[data-page]:not([data-page="chat"]) { padding-bottom: 82px; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
h1, h2, h3, h4, h5, h6, strong, b, th { font-weight: var(--font-weight-site); }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.cta-icon { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.return-action { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: inline-flex; align-items: center; gap: 7px; font-weight: 300; }
img { max-width: 100%; display: block; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.shell { width: min(1000px, calc(100% - 32px)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap; border: 0; }

.site-header { position: relative; z-index: 30; height: 72px; border-top: 4px solid var(--red); border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--header), var(--surface-indigo) 62%, var(--surface-cyan)); }
.header-inner { position: relative; width: min(1120px, calc(100% - 32px)); height: 72px; margin: auto; display: flex; align-items: center; gap: 12px; }
.brand { flex: 0 0 auto; color: var(--ink); }
.brand img { width: 142px; height: 36px; object-fit: contain; }
.primary-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; white-space: nowrap; }
.primary-nav a { position: relative; padding: 24px 6px 22px; color: var(--muted); font-size: 12px; font-weight: 300; }
.primary-nav a::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: 13px; height: 2px; transform: scaleX(0); transform-origin: left; background: var(--red); transition: transform .16s ease; }
.primary-nav a:hover, .primary-nav a.active { color: var(--ink); }
.primary-nav a:hover::after, .primary-nav a.active::after { transform: scaleX(1); }
.primary-nav a.bingo-active::after { background: var(--green); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle, .nav-toggle { min-height: 44px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; font-weight: 300; }
.theme-toggle { min-width: 70px; padding: 0 9px; cursor: pointer; }
.theme-toggle svg, .nav-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.nav-toggle { display: none; padding: 0 12px; margin-left: auto; cursor: pointer; }

.hero { background: var(--surface); }
.hero-inner { height: 236px; display: grid; grid-template-rows: 40px 196px; padding: 0; }
.hero-topline { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px; border-inline: 1px solid var(--line); }
.hero-copy { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.hero-copy p { margin: 0; color: var(--red); font-size: 12px; font-weight: 300; }
.hero-copy h1 { margin: 0; font-size: 22px; line-height: 1; letter-spacing: -.02em; white-space: nowrap; }
.market-switch { height: 32px; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; }
.market-switch a { min-width: 88px; padding: 4px 10px; border-radius: 2px; color: var(--muted); font-size: 12px; line-height: 20px; text-align: center; font-weight: 300; }
.market-switch a.selected { background: var(--red); color: #fff; }
.draw-core { height: 196px; display: grid; grid-template-rows: 60px 52px 36px 48px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 3px var(--shadow); overflow: hidden; }
.draw-core > header { min-width: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 16px; border-bottom: 1px solid var(--line); }
.draw-core > header span { font-size: 14px; font-weight: 300; }
.draw-core > header small { display: inline; margin-left: 8px; color: var(--muted); font-size: 11px; }
.countdown-radar { --countdown-progress: 0%; position: relative; flex: 0 0 52px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 50%, var(--surface) 0 56%, transparent 57%), conic-gradient(from -90deg, var(--green) 0 var(--countdown-progress), color-mix(in srgb, var(--line) 72%, transparent) var(--countdown-progress) 100%); box-shadow: 0 0 0 1px var(--line), 0 0 18px color-mix(in srgb, var(--green) 20%, transparent); }
.countdown-radar::before, .countdown-radar::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.countdown-radar::before { inset: 5px; border: 1px dashed color-mix(in srgb, var(--green) 48%, transparent); animation: radar-spin 8s linear infinite; }
.countdown-radar::after { width: 4px; height: 4px; top: 1px; left: calc(50% - 2px); background: var(--green); box-shadow: 0 0 8px var(--green); }
.radar-ring { position: absolute; inset: -3px; border: 1px solid color-mix(in srgb, var(--red) 32%, transparent); border-radius: 50%; }
.radar-readout { position: relative; z-index: 1; display: grid !important; justify-items: center; line-height: 1; }
.radar-readout small { color: var(--muted); font-size: 7px; letter-spacing: .12em; }
.radar-readout strong { margin-top: 3px; color: var(--red); font-family: var(--font-number); font-size: 11px; font-variant-numeric: tabular-nums; }
.countdown-radar[data-phase="drawing"] { animation: radar-pulse 1.1s ease-in-out infinite; background: radial-gradient(circle at 50% 50%, var(--surface) 0 56%, transparent 57%), conic-gradient(from -90deg, var(--orange), var(--red), var(--orange)); }
.countdown-radar[data-phase="drawing"] .radar-readout strong { color: var(--orange); font-size: 9px; }
@keyframes radar-spin { to { transform: rotate(360deg); } }
@keyframes radar-pulse { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 20%, transparent), 0 0 22px color-mix(in srgb, var(--orange) 34%, transparent); } }
.number-line { min-height: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; font-family: var(--font-number); }
.number-line > b { color: var(--muted); font-size: 17px; }
.ball { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--red); color: #fff; font-size: 22px; font-weight: 300; }
.ball.sum { width: 44px; height: 44px; background: var(--green); }
.result-tags { display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 6px; padding: 0 12px 4px; }
.result-tags span { min-width: 48px; height: 22px; padding: 0 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 3px; text-align: center; font-size: 12px; line-height: 20px; font-weight: 300; }
.draw-actions { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-top: 1px solid var(--line); background: var(--surface-2); }
.draw-actions > span { margin-right: auto; color: var(--green-strong); font-weight: 300; }
.draw-actions button, .draw-actions a { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 300; cursor: pointer; }
.draw-actions a { color: #fffaf4; background: var(--red); border-color: var(--red); }
.draw-actions svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.draw-scratch-icon { flex: 0 0 auto; }

.recent-strip { border-block: 1px solid var(--line); background: var(--surface); }
.recent-strip > .shell { height: 112px; display: grid; grid-template-columns: 126px 1fr; align-items: stretch; }
.strip-title { padding: 16px 12px 14px 10px; border-inline: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; }
.strip-title strong { font-size: 17px; }
.strip-title a { color: var(--red); font-size: 11px; font-weight: 300; }
.recent-rail { display: grid; grid-template-columns: repeat(8, minmax(110px, 1fr)); overflow-x: auto; scrollbar-width: thin; }
.rail-item { min-width: 108px; padding: 14px 11px; border-right: 1px solid var(--line); transition: background .16s ease; }
.rail-item:hover { background: var(--surface-2); }
.rail-item span, .rail-item small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; }
.rail-item strong { display: block; margin: 6px 0 4px; color: var(--red); font-family: var(--font-number); white-space: nowrap; }
.loading-line { padding: 20px; color: var(--muted); }

.portal-grid { padding-block: 16px 22px; }
.home-history { padding-block: 0 32px; }
.section-title { max-width: 100%; margin-bottom: 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title h2 { margin: 0; font-size: 21px; line-height: 1.2; letter-spacing: -.02em; }
.section-title p { margin: 0; color: var(--muted); font-size: 12px; }
.portal-grid > .section-title, .portal-layout { width: min(520px, 100%); margin-inline: auto; }
.portal-layout { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--surface); }
.portal-layout-five .portal-block:last-child { grid-column: 1 / -1; }
.portal-block { min-height: 78px; padding: 8px 10px; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 7px; border-bottom: 1px solid var(--line); transition: transform .16s ease, background .16s ease; }
.portal-block:hover { background: var(--surface-2); }
.portal-block:active { transform: translateY(1px); }
.portal-block svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.portal-block span { color: var(--muted); font-size: 10px; font-weight: 300; }
.portal-block h3 { margin: 0; font-size: 16px; line-height: 1.25; }
.portal-block p { margin: 2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.25; }
.portal-block > strong { font-family: var(--font-number); font-size: 12px; white-space: nowrap; }
.dragon-block { border-right: 1px solid var(--line); color: var(--red); }
.dragon-block h3, .dragon-block p, .dragon-block span { color: var(--ink); }
.today-block { color: var(--orange); }
.today-block h3, .today-block p, .today-block span { color: var(--ink); }
.probability-block { color: var(--red); border-right: 1px solid var(--line); border-bottom: 0; }
.probability-block h3, .probability-block p, .probability-block span { color: var(--ink); }
.bingo-block { color: var(--green); border-bottom: 0; }
.bingo-block h3, .bingo-block p, .bingo-block span { color: var(--ink); }

.summary-line { min-height: 78px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-bottom: 0; background: var(--surface); border-radius: 4px 4px 0 0; overflow: hidden; }
.summary-line > div { padding: 12px 16px; border-right: 1px solid var(--line); }
.summary-line > div:last-child { border-right: 0; }
.summary-line span { display: block; color: var(--muted); font-size: 13px; }
.summary-line strong { display: block; margin-top: 3px; color: var(--red); font-family: var(--font-number); font-size: 19px; }
.table-wrap { width: 100%; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 0 0 4px 4px; }
table { width: 100%; border-collapse: collapse; min-width: 800px; }
th { height: 34px; padding: 0 12px; background: var(--table-head); color: #fff; text-align: left; font-size: 12px; white-space: nowrap; }
td { height: 35px; padding: 0 12px; border-bottom: 1px solid var(--line); font-family: var(--font-number); font-size: 13px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: var(--row-alt); }
tbody tr:hover { background: var(--surface-cyan); }
.equation-cell { display: flex; align-items: center; gap: 5px; }
.mini-ball { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 300; }
.mini-ball.primary { background: var(--red); }
.mini-ball.secondary { background: var(--green); }
.empty-cell { padding: 40px; text-align: center; color: var(--muted); }

.site-footer { background: var(--surface); color: var(--ink); border-top: 1px solid var(--line); }
.site-footer > .shell { min-height: 76px; display: grid; grid-template-columns: 150px 1fr auto; gap: 18px; align-items: center; }
.site-footer img { width: 138px; }
.site-footer p { color: var(--muted); font-size: 12px; }
.site-footer nav { display: flex; gap: 16px; font-size: 12px; font-weight: 300; }

.result-bar { background: linear-gradient(105deg, var(--red-strong), #312e81 58%, var(--green-strong)); color: #fffaf4; box-shadow: 0 10px 32px rgba(49,46,129,.16); }
.result-bar > .shell { min-height: 74px; display: grid; grid-template-columns: 1fr 1.6fr 1fr auto; align-items: center; }
.result-bar > .shell > div { padding: 13px 20px; border-right: 1px solid rgba(255,255,255,.2); }
.result-bar span { display: block; opacity: .72; font-size: 11px; }
.result-bar strong { font-family: var(--font-number); font-size: 17px; }
.result-bar button { margin-left: 18px; min-width: 80px; height: 44px; border: 1px solid rgba(255,255,255,.38); border-radius: 10px; background: rgba(255,255,255,.1); color: #fffaf4; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 300; cursor: pointer; }
.subpage { padding-block: 58px 88px; }
.page-intro { max-width: 780px; margin-bottom: 44px; }
.page-intro > p { margin: 0 0 7px; color: var(--red); font-weight: 300; }
.page-intro h1 { margin: 0 0 12px; font-size: clamp(42px, 6vw, 72px); line-height: 1; letter-spacing: -.06em; }
.page-intro > span { display: block; color: var(--muted); max-width: 65ch; }
.current-chip { margin-top: 24px; display: inline-flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.current-chip span, .current-chip small { color: var(--muted); }
.current-chip strong { color: var(--red); font-family: var(--font-number); }
.history-table { border-radius: var(--radius); }
.pagination { width: fit-content; margin: 22px auto 0; display: grid; grid-template-columns: 110px 90px 110px; align-items: center; gap: 10px; }
.pagination button, .pagination strong { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 300; }
.pagination button { cursor: pointer; }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }

.streak-board { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.streak-row { min-height: 94px; padding: 18px 26px; display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 22px; border-bottom: 1px solid var(--line); }
.streak-row:last-child { border-bottom: 0; }
.streak-row.leading { min-height: 132px; background: linear-gradient(90deg, var(--red-soft), var(--surface)); }
.streak-row span { color: var(--muted); font-weight: 300; }
.streak-row strong { font-size: 28px; }
.streak-row b { color: var(--red); font-family: var(--font-number); font-size: 24px; }
.compact-title { margin-top: 54px; margin-bottom: 22px; }
.compact-title h2 { font-size: 32px; }

.today-hero { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.today-hero > div { min-height: 138px; padding: 26px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; }
.today-hero > div:first-child { background: var(--red); color: #fffaf4; }
.today-hero > div:last-child { border-right: 0; }
.today-hero span { font-size: 13px; font-weight: 300; }
.today-hero strong { font-family: var(--font-number); font-size: 34px; }
.today-breakdown { display: grid; grid-template-columns: 1.4fr .6fr; gap: 22px; margin-top: 22px; }
.today-breakdown > section { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.today-breakdown h2 { margin: 0 0 16px; }
.stat-ledger { display: grid; grid-template-columns: repeat(5, 1fr); }
.stat-ledger > div { padding: 14px; border-left: 1px solid var(--line); }
.stat-ledger > div:first-child { border-left: 0; }
.stat-ledger span { display: block; color: var(--muted); }
.stat-ledger strong { display: block; margin-top: 6px; color: var(--red); font-family: var(--font-number); font-size: 24px; }
.today-breakdown > section:last-child .stat-ledger { grid-template-columns: repeat(3, 1fr); }

.probability-explain { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 30px; padding: 26px 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.probability-explain > div { color: var(--red); border-right: 1px solid var(--line); }
.probability-explain strong { display: block; font-family: var(--font-number); font-size: 42px; }
.probability-explain span { color: var(--muted); font-size: 13px; }
.probability-explain p { margin: 0; color: var(--muted); }
.probability-grid { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.probability-cell { min-height: 118px; padding: 17px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.probability-cell:nth-child(7n) { border-right: 0; }
.probability-cell:nth-last-child(-n+7) { border-bottom: 0; }
.probability-cell strong { color: var(--red); font-family: var(--font-number); font-size: 26px; }
.probability-cell span { font-family: var(--font-number); font-weight: 300; }
.probability-cell small { color: var(--muted); }
.rule-notes, .bingo-rules { margin-top: 36px; padding-top: 30px; border-top: 1px solid var(--line); }
.rule-notes h2, .bingo-rules h2 { font-size: 30px; }
.rule-notes > div, .bingo-rules > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.rule-notes p, .bingo-rules p { margin: 0; padding: 20px; background: var(--surface); border-radius: var(--radius); }

.market-banner { background: var(--surface); border-bottom: 1px solid var(--line); }
.market-banner > .shell { height: 64px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.market-banner a { padding: 9px 18px; border: 1px solid var(--line); border-radius: 10px; font-weight: 300; }
.market-banner a.selected { color: #fffaf4; background: var(--green); border-color: var(--green); }
.bingo-intro > p { color: var(--green); }
.bingo-result { max-width: 760px; margin: auto; border: 2px solid rgba(0,140,69,.38); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: 0 24px 70px rgba(0,80,40,.14); }
.bingo-result > header { min-height: 78px; padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.bingo-result > header span, .bingo-result > header small { display: block; color: var(--muted); }
.bingo-result > header strong { font-family: var(--font-number); color: var(--green); font-size: 24px; }
.bingo-number-line .ball { background: var(--green); box-shadow: inset 0 -7px 0 rgba(8,145,178,.22); }
.bingo-number-line .ball.sum { background: var(--red); }
.bingo-tags span { background: var(--green-soft); border-color: rgba(6,182,212,.28); color: var(--green-strong); }
.bingo-history { margin-top: 54px; }
.bingo-history .table-wrap { border-radius: var(--radius); }
.bingo-history th { background: var(--green-strong); }

.scratch-page { position: relative; min-height: calc(100dvh - 66px); overflow: hidden; isolation: isolate; }
.scratch-media { position: absolute; inset: 0; z-index: -2; }
.scratch-media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) sepia(.22) hue-rotate(184deg) saturate(1.5); }
.scratch-page::after { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(255,253,250,.28); }
:root[data-theme="dark"] .scratch-page::after { background: rgba(12,23,18,.68); }
:root[data-theme="dark"] .scratch-media img { filter: grayscale(1) sepia(.28) hue-rotate(184deg) saturate(1.35) brightness(.55); }
.scratch-shell { padding-block: 46px 80px; }
.scratch-intro { margin-inline: auto; text-align: center; }
.scratch-card { position: relative; width: min(780px, 100%); min-height: 350px; margin: auto; border: 2px solid rgba(200,16,46,.28); border-radius: var(--radius); background: rgba(255,253,250,.94); overflow: hidden; box-shadow: 0 28px 80px var(--shadow); }
:root[data-theme="dark"] .scratch-card { background: rgba(23,32,28,.95); }
.scratch-result { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.scratch-result > p { margin: 6px; color: var(--muted); }
.scratch-result > strong { color: var(--green-strong); }
.scratch-card canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; transition: opacity .2s ease; touch-action: none; }
.scratch-card canvas.is-transparent { opacity: 0; }
.scratch-card.is-locked { border-color: var(--line); }
.scratch-actions { width: min(780px, 100%); margin: 18px auto 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.scratch-actions button, .scratch-actions a { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 300; cursor: pointer; }
.scratch-actions button:first-child { background: var(--red); border-color: var(--red); color: #fffaf4; }
.scratch-actions button:disabled { opacity: .55; cursor: not-allowed; }

.chat-float { position: fixed; z-index: 40; right: 24px; bottom: 22px; min-width: 112px; min-height: 48px; padding: 0 14px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; background: var(--green); border: 2px solid rgba(255,255,255,.65); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,80,40,.2); font-weight: 300; }
.chat-float:hover { transform: translateY(-2px); }
.chat-float:active { transform: translateY(1px); }
.chat-float svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.chat-shell { min-height: 620px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.chat-room { min-height: 620px; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; min-width: 0; }
.chat-room-toolbar { min-height: 74px; padding: 12px 18px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-back-button { min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 11px; background: var(--green-strong); color: #fffaf4; font-weight: 300; text-decoration: none; }
.chat-self { min-width: 0; display: flex; align-items: center; gap: 10px; }.chat-self-avatar { width: 46px; height: 46px; display: grid; flex: 0 0 46px; place-items: center; border-radius: 50%; background: var(--green); color: #fffaf4; }.chat-self-avatar svg,.chat-avatar svg { width: 58%; height: 58%; fill: currentColor; }.chat-self-copy { min-width: 0; display: grid; }.chat-self-copy small { color: var(--muted); font-size: 11px; }.chat-self-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.chat-live-state { display: grid; justify-items: end; gap: 3px; }.chat-live-state strong { color: var(--green-strong); }.chat-live-state span { color: var(--muted); font-size: 12px; }
.chat-announcement { padding: 12px 18px; background: var(--green-soft); color: var(--green-strong); font-weight: 300; }
.chat-messages { min-height: 380px; max-height: 520px; overflow-y: auto; padding: 22px; }
.chat-message { display: grid; grid-template-columns: 42px 1fr; gap: 12px; margin-bottom: 18px; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--green); color: #fffaf4; font-weight: 300; }
.chat-self-avatar,.chat-avatar{overflow:hidden}.chat-self-avatar img,.chat-avatar img{width:100%;height:100%;display:block;object-fit:cover}.chat-self-avatar[data-avatar-kind="assigned-portrait"],.chat-avatar[data-avatar-kind="assigned-portrait"]{background:#e8eef8;color:inherit}
.chat-message header { display: flex; gap: 10px; align-items: baseline; }
.chat-message time { color: var(--muted); font-size: 12px; }
.chat-message p { margin: 4px 0 0; overflow-wrap: anywhere; }
.chat-error { min-height: 28px; margin: 0; padding: 4px 22px; color: var(--red); font-weight: 300; }
.chat-form { padding: 18px 22px; display: grid; grid-template-columns: 120px 1fr auto; gap: 8px 12px; align-items: end; border-top: 1px solid var(--line); }
.chat-form label { font-size: 12px; font-weight: 300; }
.chat-form label[for="chat-message"] { grid-column: 2; grid-row: 1; }
.chat-form input, .chat-form textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.chat-form input { grid-column: 1; }
.chat-form textarea { grid-column: 2; resize: vertical; }
.chat-form button { min-height: 46px; padding: 0 20px; border: 0; border-radius: 10px; background: var(--green); color: #fffaf4; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 300; cursor: pointer; }
.privacy-note { color: var(--muted); }

.section-title-stack { align-items: flex-end; }
.history-controls, .window-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.history-controls button, .window-picker button { min-height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 300; cursor: pointer; }
.history-controls button.selected, .window-picker button.selected { background: var(--red); border-color: var(--red); color: #fff; }
.history-controls svg, .window-picker svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.coverage-note { min-height: 24px; margin: 8px 0 12px; color: var(--muted); font-size: 12px; }
.coverage-lock { min-height: 180px; margin: 0; display: grid; place-items: center; color: var(--muted); text-align: center; }
.async-table { min-height: 420px; max-height: min(70vh, 720px); overflow: auto; contain: layout paint; }
.table-wrap thead th { position: sticky; top: 0; z-index: 4; box-shadow: inset 0 -1px rgba(255,255,255,.14); }
.workbench-shell { padding-block: 38px 84px; }
.workbench-head { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; margin-bottom: 22px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg, var(--surface-indigo), var(--surface-cyan)); box-shadow: 0 14px 34px rgba(55,48,163,.1); }
.workbench-head p { margin: 0 0 7px; color: var(--red); font-weight: 300; }
.workbench-head h1 { margin: 0 0 8px; font-size: clamp(38px, 5vw, 64px); line-height: 1; letter-spacing: -.05em; }
.workbench-head span { color: var(--muted); }
.chart-frame { min-height: 318px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, var(--surface), var(--surface-cyan)); box-shadow: 0 18px 42px rgba(55,48,163,.12); overflow: hidden; }
.chart-title-row { min-height: 52px; margin-bottom: 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.chart-title-row h2 { margin: 0 0 4px; font-size: 20px; }
.chart-title-row p { margin: 0; color: var(--muted); font-size: 12px; }
.trend-chart-key { display: flex; align-items: center; gap: 6px; }
.trend-chart-key span { min-width: 48px; padding: 5px 8px; border-radius: 999px; color: #fff; font-family: var(--font-number); font-size: 10px; font-weight: 300; text-align: center; }
.trend-chart-key .is-low { background: var(--green); }
.trend-chart-key .is-mid { background: var(--red); }
.trend-chart-key .is-high { background: var(--orange); }
.trend-chart-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--chart-bg); scrollbar-color: var(--red) var(--surface-indigo); scrollbar-width: thin; }
.trend-chart-scroll:focus-visible { outline-offset: 2px; }
.trend-chart { min-width: 100%; max-width: none; height: 236px; display: block; }
.trend-guide { stroke: var(--line); stroke-width: 1; }
.trend-polyline { fill: none; stroke: var(--red-strong); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.trend-dot { stroke: var(--chart-bg); stroke-width: 2; }
.trend-value-node--low { fill: var(--green); }
.trend-value-node--mid { fill: var(--red); }
.trend-value-node--high { fill: var(--orange); }
.trend-value-label { fill: #fff; font-family: var(--font-number); font-size: 8px; font-weight: 300; pointer-events: none; }
.trend-table { margin-top: 20px; border-radius: var(--radius); box-shadow: 0 16px 36px rgba(55,48,163,.1); }
.trend-table table { min-width: 720px; }
.is-locked .trend-chart { opacity: .28; }
.omission-section { margin-top: 28px; }
.omission-section h2 { margin: 0 0 14px; font-size: 25px; }
.omission-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.omission-cell { min-height: 104px; padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.omission-cell:nth-child(7n) { border-right: 0; }
.omission-cell:nth-last-child(-n+7) { border-bottom: 0; }
.omission-cell strong { color: var(--red); font-family: var(--font-number); font-size: 23px; }
.omission-cell span, .omission-cell small { color: var(--muted); }
.digit-omission-list { display: grid; gap: 16px; }
.digit-omission-group { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.digit-omission-group h3 { margin: 0 0 12px; }
.digit-omission-grid { display: grid; grid-template-columns: repeat(10, 1fr); }
.digit-omission-grid .omission-cell { min-height: 94px; border: 0; border-left: 1px solid var(--line); }
.digit-omission-grid .omission-cell:first-child { border-left: 0; }
.radar-context { margin: 0 0 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.radar-context strong { font-family: var(--font-number); color: var(--red); }
.radar-context span { color: var(--muted); }

@media (max-width: 1040px) {
  .header-inner { gap: 10px; }
  .primary-nav a { padding-inline: 6px; font-size: 13px; }
  .brand img { width: 132px; }
  .theme-toggle { min-width: 44px; }
  .theme-toggle span { display: none; }
  .portal-block { grid-template-columns: 26px 1fr auto; }
  .probability-grid { grid-template-columns: repeat(4, 1fr); }
  .probability-cell:nth-child(7n) { border-right: 1px solid var(--line); }
  .probability-cell:nth-child(4n) { border-right: 0; }
  .probability-cell:nth-last-child(-n+7) { border-bottom: 1px solid var(--line); }
  .probability-cell:nth-last-child(-n+4) { border-bottom: 0; }
}

@media (max-width: 768px) {
  .site-header, .header-inner { height: 66px; }
  .header-inner { width: calc(100% - 24px); }
  .brand img { width: 126px; height: 32px; }
  .nav-toggle { display: inline-flex; }
  .primary-nav { display: none; position: absolute; top: 65px; left: -12px; right: -12px; margin: 0; padding: 8px 12px 12px; background: var(--header); border: 1px solid var(--line); box-shadow: 0 8px 18px var(--shadow); flex-direction: column; align-items: stretch; }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { min-height: 44px; padding: 11px 10px; }
  .primary-nav a::after { display: none; }
  .header-actions { margin-left: 0; }
  .theme-toggle { min-width: 36px; }
  .hero-inner { height: 236px; grid-template-rows: 40px 196px; }
  .hero-topline { padding-inline: 8px; }
  .hero-copy h1 { font-size: 19px; }
  .hero-copy p { display: none; }
  .market-switch { height: 30px; }
  .market-switch a { min-width: 82px; padding-inline: 7px; line-height: 18px; }
  .draw-core > header { padding-inline: 12px; }
  .draw-core > header small { display: none; }
  .number-line { gap: 7px; }
  .ball { width: 36px; height: 36px; font-size: 20px; }
  .ball.sum { width: 40px; height: 40px; }
  .draw-actions { padding-inline: 8px; }
  .recent-strip > .shell { height: 116px; grid-template-columns: 104px 1fr; }
  .strip-title { padding: 14px 10px; }
  .portal-grid { padding-block: 14px 20px; }
  .home-history { padding-bottom: 28px; }
  .portal-block { min-height: 72px; }
  .summary-line { grid-template-columns: 1fr 1fr; }
  .summary-line > div:nth-child(2) { border-right: 0; }
  .summary-line > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .site-footer > .shell { min-height: 98px; grid-template-columns: 132px 1fr; padding-block: 12px; gap: 8px 12px; }
  .site-footer p { margin: 0; }
  .site-footer nav { grid-column: 1 / -1; flex-wrap: wrap; }
  .result-bar > .shell { width: 100%; grid-template-columns: 1fr 1fr 1fr; }
  .result-bar > .shell > div { padding: 10px 12px; }
  .result-bar > .shell > div:nth-child(2) { display: none; }
  .result-bar button { margin: 0 10px; min-width: 64px; }
  .subpage { padding-block: 40px 76px; }
  .page-intro h1 { font-size: 45px; }
  .today-hero { grid-template-columns: 1fr 1fr; }
  .today-hero > div:nth-child(2) { border-right: 0; }
  .today-hero > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .today-breakdown { grid-template-columns: 1fr; }
  .stat-ledger { overflow-x: auto; }
  .probability-explain { grid-template-columns: 1fr; }
  .probability-explain > div { border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
  .probability-grid { grid-template-columns: repeat(4, 1fr); }
  .probability-cell { min-height: 106px; padding: 13px; }
  .rule-notes > div, .bingo-rules > div { grid-template-columns: 1fr; }
  .scratch-page { min-height: calc(100dvh - 66px); }
  .scratch-shell { padding-block: 36px 72px; }
  .scratch-card { min-height: 320px; }
  .scratch-actions { grid-template-columns: 1fr; }
  .chat-float { right: 14px; bottom: 14px; min-width: 52px; width: 52px; height: 52px; padding: 0; }
  .chat-float span { display: none; }
  .chat-room-toolbar { grid-template-columns: 1fr auto; }.chat-self { grid-column: 1 / -1; grid-row: 2; }.chat-live-state { justify-items: end; }
  .chat-form { grid-template-columns: 1fr; }
  .chat-form label, .chat-form label[for="chat-message"], .chat-form input, .chat-form textarea { grid-column: 1; grid-row: auto; }
  .workbench-head { grid-template-columns: 1fr; align-items: start; }
  .chart-title-row { flex-direction: column; }
  .window-picker { width: 100%; }
  .window-picker button { flex: 1 1 92px; }
  .omission-grid { grid-template-columns: repeat(4, 1fr); }
  .omission-cell:nth-child(7n), .omission-cell:nth-last-child(-n+7) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .omission-cell:nth-child(4n) { border-right: 0; }
  .omission-cell:nth-last-child(-n+4) { border-bottom: 0; }
  .digit-omission-grid { grid-template-columns: repeat(5, 1fr); }
  .digit-omission-grid .omission-cell { border-left: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .digit-omission-grid .omission-cell:nth-child(5n) { border-right: 0; }
  .digit-omission-grid .omission-cell:nth-last-child(-n+5) { border-bottom: 0; }
  .radar-context { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
  .shell { width: 100%; }
  .site-header, .header-inner { height: 60px; }
  .primary-nav { top: 59px; }
  .hero-inner { height: 236px; grid-template-rows: 40px 196px; }
  .scratch-page { min-height: calc(100dvh - 60px); }
  .hero-copy h1 { font-size: 17px; }
  .market-switch a { min-width: 76px; padding-inline: 5px; }
  .countdown-radar { flex-basis: 48px; width: 48px; height: 48px; }
  .number-line { gap: 5px; }
  .number-line > b { font-size: 15px; }
  .result-tags { gap: 4px; padding-inline: 7px; }
  .result-tags span { min-width: 0; flex: 1; padding-inline: 3px; font-size: 11px; }
  .draw-actions > span { font-size: 11px; }
  .draw-actions button, .draw-actions a { padding-inline: 8px; }
  .recent-strip > .shell { grid-template-columns: 92px 1fr; }
  .strip-title { padding-inline: 9px; }
  .strip-title strong { font-size: 15px; }
  .portal-grid > .section-title, .home-history > .section-title { padding-inline: 12px; }
  .portal-layout { border-inline: 0; border-radius: 0; }
  .portal-block { grid-template-columns: 24px 1fr; padding: 7px 10px; }
  .portal-block > strong { grid-column: 2; font-size: 10px; }
  .portal-block p { display: none; }
  .portal-block h3 { font-size: 15px; }
  .section-title h2 { font-size: 20px; }
  .section-title p { text-align: right; }
  .summary-line { border-inline: 0; border-radius: 0; }
  .summary-line > div { padding: 10px 12px; }
  .home-history .table-wrap { border-inline: 0; border-radius: 0; }
  .result-bar strong { font-size: 14px; }
  .result-bar span { font-size: 10px; }
  .probability-grid { grid-template-columns: repeat(2, 1fr); }
  .probability-cell:nth-child(4n) { border-right: 1px solid var(--line); }
  .probability-cell:nth-child(2n) { border-right: 0; }
  .probability-cell:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }
  .probability-cell:nth-last-child(-n+2) { border-bottom: 0; }
  .streak-row { grid-template-columns: 1fr auto; }
  .streak-row b { grid-column: 1 / -1; }
  .today-hero strong { font-size: 28px; }
  .scratch-result .number-line { padding-inline: 4px; }
  .section-title-stack { align-items: flex-start; flex-direction: column; padding-inline: 12px; }
  .history-controls { width: 100%; }
  .history-controls button { flex: 1; }
  .workbench-shell { padding-block: 28px 70px; }
  .workbench-head { padding-inline: 12px; }
  .workbench-head h1 { font-size: 40px; }
  .chart-frame, .omission-section, .digit-omission-group { border-inline: 0; border-radius: 0; }
  .trend-chart-key { padding-inline: 0; }
  .omission-grid { grid-template-columns: repeat(2, 1fr); border-inline: 0; border-radius: 0; }
  .omission-cell:nth-child(4n) { border-right: 1px solid var(--line); }
  .omission-cell:nth-child(2n) { border-right: 0; }
  .omission-cell:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }
  .omission-cell:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
