@font-face {
  font-family: "Hongyun Rounded";
  src: url("/fonts/gensen-rounded/gensen-rounded2tw-r-v2100.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Hongyun Rounded";
  src: url("/fonts/gensen-rounded/gensen-rounded2tw-m-v2100.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Hongyun Rounded";
  src: url("/fonts/gensen-rounded/gensen-rounded2tw-b-v2100.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg: #fff9f5;
  --surface: #ffffff;
  --surface-2: #fff4eb;
  --surface-3: #fff9d9;
  --ink: #3d1713;
  --muted: #7b5148;
  --line: #f1c4b3;
  --brand: #ed271f;
  --brand-2: #ff5c22;
  --gold: #f7b916;
  --gold-deep: #c98200;
  --deep: #a31312;
  --success: #13875e;
  --page-wash: rgba(255, 255, 255, .1);
  --shadow: 0 14px 38px rgba(164, 31, 22, .13);
  --radius: 20px;
  font-family: "Hongyun Rounded", "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #1d0d0c;
  --surface: #2b1513;
  --surface-2: #3a1b18;
  --surface-3: #40241a;
  --ink: #fff7e9;
  --muted: #e6bcb0;
  --line: #714039;
  --brand: #ff5549;
  --brand-2: #ff7a35;
  --gold: #ffd053;
  --gold-deep: #ffbf20;
  --deep: #7f1815;
  --success: #66d7a8;
  --page-wash: rgba(30, 8, 7, .78);
  --shadow: 0 16px 42px rgba(0, 0, 0, .32);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 300px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--bg);
  background-image: linear-gradient(var(--page-wash), var(--page-wash)), url("/assets/hongyun-lottery-bg-r5.jpg");
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
button, select, input, textarea { font: inherit; }
button, a { touch-action: manipulation; }
a { color: inherit; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 75%, white); outline-offset: 3px; }
.skip-link { position: fixed; left: 12px; top: 12px; z-index: 99; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; transform: translateY(-200%); background: var(--deep); color: #fff; border-radius: 10px; }
.skip-link:focus-visible { width: auto; height: auto; padding: 10px 14px; overflow: visible; clip-path: none; opacity: 1; pointer-events: auto; transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header {
  min-height: 66px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 8px max(18px, calc((100vw - 1180px) / 2));
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 7px 24px rgba(150, 29, 20, .1);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 9px; min-width: max-content; color: inherit; text-decoration: none; }
.brand > span:last-child { display: grid; line-height: 1; }
.brand strong { color: var(--brand); font-size: 23px; font-weight: 800; letter-spacing: .02em; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.brand-mark { position: relative; display: block; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(145deg, #ff4f37, #d91318 62%, #9c0711); box-shadow: inset 0 0 0 3px #fff, 0 4px 12px rgba(218, 23, 25, .28); }
.brand-mark::after { content: ""; position: absolute; left: 7px; top: 23px; width: 30px; height: 4px; border-radius: 99px; background: var(--gold); transform: rotate(-25deg); }
.brand-mark i { position: absolute; z-index: 1; border-radius: 50%; background: #fff; border: 2px solid var(--gold); }
.brand-mark i:nth-child(1) { width: 9px; height: 9px; left: 7px; bottom: 7px; }
.brand-mark i:nth-child(2) { width: 12px; height: 12px; left: 19px; top: 12px; background: var(--gold); border-color: #fff1a6; }
.brand-mark i:nth-child(3) { width: 8px; height: 8px; right: 6px; top: 9px; }

.quick-nav { justify-self: center; display: flex; align-items: center; gap: 5px; }
.quick-nav a { min-width: 70px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 10px; color: var(--muted); border-radius: 12px; text-decoration: none; font-size: 12px; font-weight: 600; }
.quick-nav a:hover, .quick-nav a:focus-visible, .quick-nav a[aria-current="page"] { color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
.quick-nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--brand); background: var(--surface); box-shadow: 0 5px 15px rgba(154, 34, 25, .1); cursor: pointer; }

/* Compact legacy header markup on content pages. */

main { width: min(100%, 1224px); margin: 0 auto; padding: 14px 22px 58px; }
.live-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.17fr) minmax(390px, .83fr);
  min-height: 230px;
  overflow: hidden;
  border: 2px solid var(--brand);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.live-lead { position: relative; padding: 20px 28px; overflow: hidden; color: #fff; background: linear-gradient(128deg, #a80a12 0%, #e92520 48%, #ff5b24 100%); }
.live-lead::after { content: ""; position: absolute; right: -55px; bottom: -80px; width: 250px; height: 250px; border: 22px solid rgba(255, 205, 60, .18); border-radius: 50%; }
.live-topline { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eyebrow { margin: 0 0 6px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.live-lead .eyebrow { display: flex; align-items: center; margin: 0; color: #ffe9ac; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(255, 220, 97, .15); }
.status-dot.ready { background: #7df0bd; }
.status-dot.waiting { background: #ffe174; }
.status-dot.conflict { background: #fff; }
.countdown-chip { flex: 0 0 auto; padding: 7px 11px; border: 1px solid rgba(255,255,255,.32); border-radius: 99px; color: #fff5d7; background: rgba(116, 0, 7, .2); font-size: 11px; }
.countdown-chip strong { margin-left: 5px; color: #fff; font-variant-numeric: tabular-nums; }
.issue-line { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 12px; margin-top: 10px; }
.issue-line span { color: #ffe0b5; font-size: 13px; }
.issue-line strong { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.draw-line { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; margin: 13px 0 10px; }
.draw-line b { color: #ffe49b; font-size: 18px; font-weight: 600; }
.ball, .sum { display: grid; place-items: center; flex: 0 0 auto; width: 58px; height: 58px; border-radius: 50%; font-size: 28px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ball { color: #b11416; background: linear-gradient(145deg, #fff, #fff4dd 70%); border: 4px solid var(--gold); box-shadow: inset 0 -7px 12px rgba(225, 134, 0, .14), 0 7px 16px rgba(83, 0, 4, .25); }
.sum { color: #9e1014; background: linear-gradient(145deg, #ffe26d, #f6ad09); border: 4px solid #fff0ae; box-shadow: 0 7px 16px rgba(83, 0, 4, .25); }
.draw-meta { position: relative; z-index: 1; display: flex; align-items: center; }
.draw-meta > span { display: inline-flex; padding: 5px 10px; border-radius: 99px; color: #fff; background: rgba(111,0,7,.24); font-size: 12px; }

.recent-panel { padding: 0 22px 8px; background: color-mix(in srgb, var(--surface) 96%, transparent); }
.section-kicker { height: 47px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -22px; padding: 0 22px; color: #8c1715; border-bottom: 1px solid #f0d6c8; background: linear-gradient(90deg, #fff7e3, #fff); font-size: 14px; font-weight: 800; }
.section-kicker small { color: var(--gold-deep); font-size: 10px; }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li { min-height: 56px; display: grid; grid-template-columns: minmax(112px,1fr) auto auto; align-items: center; gap: 13px; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent); font-size: 11px; }
.recent-list li:last-child { border-bottom: 0; }
.recent-list span { font-variant-numeric: tabular-nums; }
.recent-list span em { color: var(--muted); font-size: 9px; }
.recent-list strong { color: var(--brand); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recent-list > li > em { min-width: 38px; padding: 4px 7px; border-radius: 99px; color: #8d4f00; background: #fff0b3; font-size: 9px; font-style: normal; text-align: center; }
.skeleton { height: 43px; opacity: .5; background: linear-gradient(90deg, transparent, rgba(237,39,31,.13), transparent); background-size: 200% 100%; animation: pulse 1.4s infinite; }
@keyframes pulse { to { background-position: -200% 0; } }

.sequence-workbench { margin-top: 15px; padding: 19px 20px 16px; border: 1px solid color-mix(in srgb, var(--brand) 38%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 95%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.workbench-head, .results-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.workbench-head h1, .results-head h2, .content-page h1, .subpage-card h1 { margin: 0; color: var(--deep); font-size: clamp(22px, 3vw, 30px); font-weight: 800; line-height: 1.15; }
:root[data-theme="dark"] .workbench-head h1, :root[data-theme="dark"] .content-page h1, :root[data-theme="dark"] .subpage-card h1 { color: var(--ink); }
.range-badge { display: flex; align-items: baseline; gap: 6px; padding: 8px 11px; border: 1px solid #efb51a; border-radius: 12px; color: #8b1e14; background: #fff3b9; white-space: nowrap; }
.range-badge strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.range-badge span { font-size: 10px; }
.sequence-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 13px 0 9px; }
.examples, .slot-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.text-button, .small-button, .secondary-button { min-height: 38px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); cursor: pointer; }
.text-button { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.small-button { font-size: 11px; }
.small-button:disabled, .secondary-button:disabled { opacity: .45; cursor: not-allowed; }
.sequence-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(142px, 1fr)); gap: 8px; align-items: stretch; }
.sequence-slot { --slot-tone: var(--brand); position: relative; min-width: 0; padding: 11px 10px 10px; border: 1px solid color-mix(in srgb, var(--slot-tone) 52%, var(--line)); border-top: 4px solid var(--slot-tone); border-radius: 14px; background: linear-gradient(155deg, var(--surface), color-mix(in srgb, var(--slot-tone) 7%, var(--surface))); }
.sequence-slot:nth-child(2), .sequence-slot:nth-child(6) { --slot-tone: var(--brand-2); }
.sequence-slot:nth-child(3) { --slot-tone: var(--gold-deep); }
.sequence-slot:nth-child(4) { --slot-tone: #b3165b; }
.sequence-slot:nth-child(5) { --slot-tone: #168d73; }
.sequence-slot:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 50%; z-index: 2; width: 14px; display: grid; place-items: center; transform: translateY(-50%); color: var(--brand); background: var(--surface); font-weight: 800; }
.slot-number { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .08em; }
.slot-number::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--slot-tone); }
.sequence-slot label { display: grid; gap: 4px; margin-top: 6px; color: var(--muted); font-size: 9px; }
.sequence-slot select, .sequence-slot input { width: 100%; min-width: 0; min-height: 36px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); }
.sum-range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4px; }
.search-options { display: flex; align-items: center; gap: 11px; margin-top: 13px; }
.check-row { display: flex; align-items: center; gap: 7px; }
.check-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.check-row span { font-size: 11px; white-space: nowrap; }
.overlap-help { color: var(--brand); font-size: 10px; text-underline-offset: 3px; }
.primary-actions { margin-left: auto; display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.primary-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 17px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(115deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 20px rgba(228, 40, 29, .23); text-decoration: none; font-weight: 800; cursor: pointer; }
.primary-button:disabled { opacity: .46; cursor: not-allowed; }
.action-status { min-height: 17px; margin: 8px 0 0; color: var(--muted); font-size: 11px; }

.matches-section { margin-top: 15px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 95%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.results-head { align-items: center; margin: -18px -18px 0; padding: 14px 18px; border-radius: var(--radius) var(--radius) 0 0; color: #fff; background: linear-gradient(105deg, #a60c13, var(--brand)); }
.results-head .eyebrow { color: #ffd88b; }
.results-head h2 { color: #fff; font-size: 22px; }
.results-head > p { margin: 0; color: #ffe1c5; font-size: 11px; }
.match-list { display: grid; gap: 11px; margin-top: 12px; }
.empty-state { min-height: 90px; display: grid; place-items: center; align-content: center; gap: 3px; padding: 15px; border: 1px dashed color-mix(in srgb, var(--brand) 42%, var(--line)); border-radius: 15px; background: var(--surface); text-align: center; }
.empty-state span { color: var(--brand); font-size: 25px; }
.empty-state h3 { margin: 0; font-size: 14px; }
.empty-state p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.match-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.match-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; color: #fff; background: linear-gradient(95deg, var(--deep), var(--brand)); }
.match-title h3 { margin: 0; font-size: 13px; }
.match-title span { color: #ffe4b0; font-size: 10px; }
.match-track { display: flex; align-items: stretch; gap: 7px; padding: 11px; overflow-x: auto; }
.draw-tile { flex: 0 0 112px; padding: 9px; border: 1px solid color-mix(in srgb, var(--gold) 56%, var(--line)); border-radius: 11px; background: color-mix(in srgb, #fff0b2 56%, var(--surface)); }
.draw-tile.context { opacity: .7; border-color: var(--line); background: transparent; }
.draw-tile.gap-before { position: relative; margin-left: 15px; }
.draw-tile.gap-before::before { content: "断"; position: absolute; left: -19px; top: 50%; transform: translateY(-50%); color: var(--brand); font-size: 9px; }
.draw-tile small { display: block; color: var(--muted); font-size: 9px; }
.draw-tile strong { display: block; margin: 5px 0; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.draw-tile em { color: var(--brand); font-size: 9px; font-style: normal; }
.load-more { display: block; margin: 14px auto 0; padding: 9px 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); cursor: pointer; }
.load-more[hidden] { display: none; }

footer { width: min(100%, 1180px); margin: 0 auto; display: flex; justify-content: space-between; gap: 18px; padding: 18px 22px; border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent); color: var(--muted); font-size: 10px; }
footer p { margin: 0; }
footer nav { display: flex; gap: 13px; }
footer a { color: var(--brand); text-decoration: none; }

.subpage-main { max-width: 980px; padding-top: 22px; }
.subpage-card, .content-page { padding: 24px; border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.return-link { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 16px; color: var(--brand); text-decoration: none; font-size: 12px; font-weight: 800; }
.subpage-intro, .content-lead { color: var(--muted); font-size: 13px; line-height: 1.75; }
.scratch-card { position: relative; min-height: 360px; margin-top: 18px; overflow: hidden; display: grid; place-items: center; border: 2px solid var(--gold); border-radius: 22px; background: url('/assets/hongyun28-scratch-bg.png') center/cover, var(--surface-2); }
.scratch-result { z-index: 1; padding: 20px; border-radius: 20px; background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: var(--shadow); text-align: center; }
.scratch-result .draw-line { justify-content: center; }
.scratch-result p { color: var(--muted); }
.scratch-canvas { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; touch-action: none; cursor: crosshair; transition: opacity .2s ease; }
.scratch-card:focus, .scratch-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.scratch-controls { display: flex; justify-content: center; align-items: center; gap: 9px; margin-top: 13px; flex-wrap: wrap; }
.scratch-note { color: var(--muted); font-size: 11px; }

.chat-page { max-width: 1120px; }
.chat-shell { min-height: 620px; display: grid; grid-template-rows: auto minmax(360px,1fr) auto auto; margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.chat-topbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 15px; color: #fff; background: linear-gradient(105deg, var(--deep), var(--brand)); }
.chat-topbar .return-link { margin: 0; padding: 7px 10px; border-radius: 9px; color: #fff; background: rgba(255,255,255,.13); }
.chat-topbar h1 { margin: 0; font-size: 19px; font-weight: 800; }
.connection-pill { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.connection-pill > span { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.connection-pill[data-state="connected"] > span { background: #7cddb3; }
.connection-pill[data-state="offline"] > span { background: #ffb098; }
.connection-pill button { padding: 5px 8px; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; color: inherit; background: transparent; cursor: pointer; }
.chat-body { min-height: 0; display: grid; grid-template-columns: 220px 1fr; }
.chat-profile { display: grid; align-content: start; justify-items: center; gap: 12px; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--surface-2); }
.profile-avatar, .chat-avatar { display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--surface); }
.profile-avatar { width: 82px; height: 82px; border: 4px solid var(--gold); box-shadow: var(--shadow); }
.profile-avatar img, .chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-profile label { width: 100%; display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.chat-profile input, .chat-compose textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); }
.chat-profile small { color: var(--muted); text-align: center; line-height: 1.5; }
.chat-messages { min-height: 0; max-height: 560px; display: grid; align-content: start; gap: 12px; padding: 18px; overflow-y: auto; background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.chat-empty { margin: auto; color: var(--muted); text-align: center; }
.chat-message { max-width: 720px; display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: start; gap: 10px; }
.chat-avatar { width: 42px; height: 42px; border: 2px solid var(--gold); }
.chat-message > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px 14px 14px; background: var(--surface); }
.chat-message header { display: flex; align-items: center; gap: 9px; }
.chat-message header b { color: var(--deep); font-size: 12px; }
:root[data-theme="dark"] .chat-message header b { color: var(--gold); }
.chat-message header b[data-admin="true"]::after { content: "管理员"; margin-left: 6px; padding: 2px 5px; border-radius: 6px; color: #fff; background: var(--brand); font-size: 8px; }
.chat-message time { color: var(--muted); font-size: 9px; }
.chat-message p { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.chat-compose { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 13px; border-top: 1px solid var(--line); background: var(--surface-2); }
.chat-compose textarea { min-height: 54px; resize: vertical; }
.chat-error { min-height: 20px; margin: 0; padding: 0 13px 8px; color: var(--brand); background: var(--surface-2); font-size: 12px; }

.content-page { max-width: 900px; margin: 0 auto; }
.content-page .content-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; margin-top: 22px; }
.content-page article { padding: 17px; border: 1px solid var(--line); border-top: 5px solid var(--brand); border-radius: 15px; background: var(--surface); }
.content-page article:nth-child(4n+2) { border-top-color: var(--brand-2); }
.content-page article:nth-child(4n+3) { border-top-color: var(--gold); }
.content-page article:nth-child(4n) { border-top-color: #b3165b; }
.content-page h2 { margin: 0 0 8px; color: var(--deep); font-size: 17px; }
:root[data-theme="dark"] .content-page h2 { color: var(--ink); }
.content-page p, .content-page li { color: var(--muted); font-size: 13px; line-height: 1.75; }
.content-page ul, .content-page ol { padding-left: 20px; }
.content-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.content-links a { padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--brand); background: var(--surface); text-decoration: none; font-size: 11px; font-weight: 800; }
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.error-page strong { color: var(--brand); font-size: 80px; font-weight: 800; line-height: 1; }
.error-page h1 { margin: 8px 0; }
.error-page p { color: var(--muted); }

@media (min-width: 901px) {
  .ball, .sum { width: 72px; height: 72px; font-size: 35px; }
  .draw-line b { font-size: 21px; }
}

@media (max-width: 900px) {
  .site-header { grid-template-columns: auto auto; gap: 6px 12px; padding: 7px 14px 8px; }
  .quick-nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; justify-content: center; }
  .icon-button { justify-self: end; }
  .live-strip { grid-template-columns: 1fr; }
  .recent-panel { padding-bottom: 4px; }
  .sequence-slots { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 620px) {
  body { background-attachment: scroll; background-size: auto 844px; }
  .site-header { position: static; }
  .brand-mark { width: 38px; height: 38px; }
  .brand strong { font-size: 20px; }
  .brand small { max-width: 150px; margin-top: 4px; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .quick-nav { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 3px; }
  .quick-nav a { min-width: 0; min-height: 44px; flex-direction: column; gap: 1px; padding: 4px 2px; font-size: 9px; }
  .quick-nav svg { width: 17px; height: 17px; }
  main { padding: 9px 10px 48px; }
  .live-strip { border-radius: 19px; }
  .live-lead { padding: 16px 18px 15px; }
  .issue-line { margin-top: 8px; }
  .draw-line { gap: 6px; margin: 11px 0 9px; }
  .ball, .sum { width: 49px; height: 49px; border-width: 3px; font-size: 24px; }
  .draw-line b { font-size: 15px; }
  .recent-panel { padding: 0 16px 3px; }
  .section-kicker { height: 39px; margin: 0 -16px; padding: 0 16px; }
  .recent-list li { min-height: 47px; grid-template-columns: minmax(96px,1fr) auto auto; gap: 7px; padding: 5px 0; }
  .recent-list strong { font-size: 13px; }
  .sequence-workbench, .matches-section, .subpage-card, .content-page { padding: 15px; }
  .sequence-workbench { margin-top: 11px; }
  .workbench-head h1 { font-size: 23px; }
  .sequence-toolbar { align-items: flex-start; }
  .sequence-slots { grid-template-columns: 1fr; }
  .sequence-slot:not(:last-child)::after { content: "↓"; right: 50%; top: auto; bottom: -13px; transform: translateX(50%); }
  .search-options { align-items: flex-start; flex-wrap: wrap; }
  .primary-actions { width: 100%; margin-left: 0; display: grid; grid-template-columns: 1fr 1fr; }
  .primary-button { grid-column: 1 / -1; }
  .primary-actions button { width: 100%; }
  .matches-section .results-head { margin: -15px -15px 0; padding: 13px 15px; }
  .results-head { display: grid; gap: 5px; }
  footer { display: grid; padding: 17px 12px; }
  .scratch-card { min-height: 300px; }
  .chat-body { grid-template-columns: 1fr; }
  .chat-profile { grid-template-columns: 58px 1fr; align-items: center; justify-items: stretch; gap: 9px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .profile-avatar { grid-row: 1 / 3; width: 58px; height: 58px; }
  .chat-profile small { text-align: left; }
  .chat-messages { min-height: 340px; max-height: 54vh; }
  .chat-page { padding: 0; }
  .chat-shell { min-height: 100vh; margin-top: 0; border: 0; border-radius: 0; }
  .chat-topbar { grid-template-columns: 1fr auto; padding: 10px; }
  .chat-topbar h1 { grid-column: 1 / -1; grid-row: 1; font-size: 18px; }
  .chat-topbar .return-link { grid-row: 2; }
  .connection-pill { grid-row: 2; }
  .chat-compose { padding: 10px; }
  .content-page .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 340px) {
  .site-header { padding-inline: 9px; }
  .brand small { display: none; }
  .quick-nav a { font-size: 8px; }
  main { padding-inline: 8px; }
  .live-lead { padding-inline: 13px; }
  .ball, .sum { width: 43px; height: 43px; font-size: 21px; }
  .draw-line { gap: 4px; }
  .recent-panel { padding-inline: 12px; }
  .section-kicker { margin-inline: -12px; padding-inline: 12px; }
  .recent-list li { grid-template-columns: minmax(84px,1fr) auto auto; gap: 4px; }
  .recent-list strong { font-size: 12px; }
  .recent-list > li > em { min-width: 31px; padding-inline: 4px; }
  .sequence-workbench { padding: 12px; }
  .primary-actions { grid-template-columns: 1fr; }
  .primary-button { grid-column: auto; }
  .match-track { padding: 9px; }
  .draw-tile { flex-basis: 103px; }
}

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