:root {
  color-scheme: dark;
  --bg: #07121d;
  --bg-deep: #040b12;
  --surface: #0d1c29;
  --surface-2: #122534;
  --line: rgba(188, 216, 232, .13);
  --line-strong: rgba(188, 216, 232, .22);
  --text: #f4f7f9;
  --muted: #8fa6b6;
  --accent: #43d6c7;
  --accent-soft: rgba(67, 214, 199, .13);
  --amber: #e9b85f;
  --shadow: 0 16px 40px rgba(0, 0, 0, .24);
  font-family: Inter, "Noto Sans JP", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg-deep); }
html { overflow-x: clip; }
body { margin: 0; min-width: 0; overflow-x: clip; color: var(--text); background:
  radial-gradient(circle at 85% -10%, rgba(40, 115, 128, .18), transparent 28rem),
  linear-gradient(180deg, var(--bg) 0%, #08141f 65%, var(--bg-deep) 100%); min-height: 100vh; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header { height: 68px; padding: 0 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: rgba(5, 14, 22, .84); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 10; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand > span:last-child { display: grid; line-height: 1; gap: 5px; }
.brand b { font-size: 15px; letter-spacing: .02em; }
.brand small { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.brand-mark { width: 34px; aspect-ratio: 1; border: 1px solid rgba(67,214,199,.45); border-radius: 50%; display: grid; place-items: center; position: relative; box-shadow: inset 0 0 18px rgba(67,214,199,.1); }
.brand-mark::before, .brand-mark::after { content:""; position:absolute; background:rgba(143,166,182,.28); }
.brand-mark::before { width:1px; height:24px; }
.brand-mark::after { width:24px; height:1px; }
.brand-mark i { width: 7px; height: 16px; background: linear-gradient(var(--accent) 0 50%, #294456 50%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); z-index:1; }
.version, .back-link { color: var(--muted); font-size: 12px; text-decoration: none; }
.back-link::before { content:"←"; margin-right:7px; color:var(--accent); }

.page-shell { width: min(100% - 28px, 860px); margin: 0 auto; padding: 28px 0 52px; }
.date-switcher { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; margin-bottom:18px; }
.date-option { min-width:0; padding:10px 6px; border:1px solid var(--line); border-radius:10px; background:rgba(13,31,42,.78); color:var(--muted); font-size:11px; font-weight:700; text-align:center; text-decoration:none; white-space:nowrap; }
.date-option:not(.is-disabled):hover { border-color:rgba(67,214,199,.42); color:var(--text); }
.date-option.is-active { border-color:rgba(67,214,199,.55); background:rgba(31,91,98,.42); color:var(--text); box-shadow:0 0 18px rgba(67,214,199,.08); }
.date-option.is-disabled { background:rgba(8,19,28,.38); opacity:.38; cursor:not-allowed; }
.venue-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:20px; }
.eyebrow { color: var(--accent); margin:0 0 7px; font-size:10px; font-weight:800; letter-spacing:.16em; text-transform:uppercase; }
.venue-heading h1, .detail-heading h1 { font-size: clamp(23px, 5vw, 32px); margin:0; letter-spacing:.02em; }
.venue-status { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:11px; white-space:nowrap; }
.venue-back { display:inline-flex; align-items:center; color:var(--accent); font-size:11px; text-decoration:none; margin-bottom:13px; }
.venue-back[hidden] { display:none; }
.venue-back::before { content:"←"; margin-right:7px; }
.live-dot { width:6px; height:6px; border-radius:50%; background:var(--accent); box-shadow:0 0 10px var(--accent); }
.guide-strip { border:1px solid var(--line); background:linear-gradient(100deg, rgba(67,214,199,.08), rgba(13,28,41,.65)); border-radius:14px; padding:13px 15px; display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.guide-strip p { margin:0; color:var(--muted); font-size:12px; line-height:1.6; }
.guide-strip strong { color:var(--text); }
.guide-icon { width:26px; height:26px; flex:0 0 auto; border:1px solid rgba(67,214,199,.35); border-radius:50%; display:grid; place-items:center; color:var(--accent); font-size:8px; font-weight:900; }

.venue-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.venue-card { min-width:0; border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.venue-card > a, .venue-card > div { min-height:92px; padding:13px; display:grid; grid-template-columns:1fr auto; grid-template-rows:auto 1fr auto; gap:3px 8px; text-decoration:none; position:relative; }
.venue-card .venue-code { color:var(--muted); font-size:9px; font-variant-numeric:tabular-nums; }
.venue-card strong { grid-column:1/-1; align-self:center; font-size:16px; }
.venue-card small { color:var(--muted); font-size:9px; }
.venue-card .chevron { grid-column:2; grid-row:3; align-self:center; }
.venue-card.is-hosting { background:linear-gradient(145deg,rgba(21,48,62,.98),rgba(13,31,42,.98)); border-color:rgba(67,214,199,.27); box-shadow:0 7px 24px rgba(0,0,0,.12); }
.venue-card.is-hosting small { color:var(--accent); }
.venue-card.is-hosting:hover { border-color:rgba(67,214,199,.48); }
.venue-card.is-closed { background:rgba(8,19,28,.46); opacity:.46; }
.race-list { display:grid; gap:10px; }
.race-card { --level: var(--muted); background:linear-gradient(145deg, rgba(18,37,52,.96), rgba(11,25,36,.96)); border:1px solid var(--line); border-radius:16px; overflow:hidden; box-shadow:0 7px 24px rgba(0,0,0,.1); transition:transform .18s ease, border-color .18s ease; }
.race-card:hover { transform:translateY(-1px); border-color:var(--line-strong); }
.race-card a { display:block; text-decoration:none; padding:17px 16px 13px; }
.race-card-main { display:grid; grid-template-columns:64px minmax(0, 1fr) auto; align-items:center; gap:13px; }
.race-identity { border-right:1px solid var(--line); display:grid; gap:4px; }
.race-identity strong { font-size:25px; line-height:1; font-variant-numeric:tabular-nums; }
.race-identity small { color:var(--muted); font-size:12px; margin-left:2px; }
.race-identity span { color:var(--muted); font-size:11px; font-variant-numeric:tabular-nums; }
.race-judgement { min-width:0; display:grid; gap:5px; }
.status-line { font-size:16px; font-weight:800; display:flex; align-items:center; gap:8px; }
.status-line i { width:7px; height:7px; border-radius:50%; background:var(--level); box-shadow:0 0 12px color-mix(in srgb, var(--level) 65%, transparent); }
.race-type { color:var(--muted); font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.race-prob { text-align:right; display:grid; gap:3px; }
.race-prob strong { font-size:19px; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.race-prob span { color:var(--muted); font-size:9px; }
.race-card-meta { margin-top:13px; padding-top:11px; border-top:1px solid var(--line); display:grid; grid-template-columns:auto minmax(0,1fr) 10px; align-items:center; gap:10px; }
.fan1-chip { background:rgba(255,255,255,.045); border:1px solid var(--line); border-radius:99px; color:var(--muted); font-size:10px; padding:5px 9px; white-space:nowrap; }
.fan1-chip b { color:var(--text); font-size:12px; margin-left:3px; }
.bet-summary { min-width:0; color:#b7c5ce; font-size:10px; text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chevron { width:7px; height:7px; border-top:1px solid var(--muted); border-right:1px solid var(--muted); transform:rotate(45deg); }
.level-join { --level: var(--accent); }
.level-lean { --level: #79cfc0; }
.level-watch { --level: var(--amber); }
.level-skip { --level: #687d8b; }

.detail-shell { max-width:760px; }
.detail-heading { margin-bottom:18px; }
.detail-race-line { display:flex; justify-content:space-between; align-items:baseline; gap:14px; }
.detail-race-line h1 strong { color:var(--accent); margin-left:8px; }
.start-time { color:var(--muted); font-size:12px; white-space:nowrap; }
.compass-hero { --level:var(--accent); min-height:280px; position:relative; overflow:hidden; display:flex; flex-direction:column; align-items:center; justify-content:center; background:radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--level) 13%, transparent), transparent 46%), linear-gradient(145deg, var(--surface-2), var(--surface)); border:1px solid var(--line); border-radius:22px; box-shadow:var(--shadow); }
.compass-hero::after { content:""; position:absolute; width:270px; height:270px; border:1px solid color-mix(in srgb, var(--level) 14%, transparent); border-radius:50%; }
.compass-orbit { position:absolute; width:214px; height:214px; border:1px solid color-mix(in srgb, var(--level) 28%, transparent); border-radius:50%; display:grid; place-items:center; }
.compass-orbit::before, .compass-orbit::after { content:""; position:absolute; background:color-mix(in srgb, var(--level) 20%, transparent); }
.compass-orbit::before { width:1px; height:100%; }
.compass-orbit::after { height:1px; width:100%; }
.compass-orbit span { position:absolute; top:10px; color:var(--level); font-size:9px; font-weight:900; z-index:1; }
.compass-orbit i { width:10px; height:44px; background:linear-gradient(var(--level) 0 50%, #294456 50%); clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%); z-index:1; }
.hero-label, .compass-hero h2, .probability { position:relative; z-index:2; }
.hero-label { color:var(--muted); font-size:9px; letter-spacing:.2em; font-weight:800; margin:0 0 15px; }
.compass-hero h2 { font-size:clamp(29px,8vw,44px); margin:0; letter-spacing:.05em; text-shadow:0 2px 24px rgba(0,0,0,.45); }
.probability { display:flex; flex-direction:column; align-items:center; margin:12px 0 0; }
.probability strong { font-size:20px; font-variant-numeric:tabular-nums; }
.probability span { color:var(--muted); font-size:9px; margin-top:2px; }
.summary-pair-grid { width:100%; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:12px 0 0; }
.summary-pair-grid article { min-width:0; background:var(--surface); border:1px solid var(--line); border-radius:13px; padding:13px; display:grid; gap:7px; }
.summary-pair-grid span { color:var(--muted); font-size:9px; }
.summary-pair-grid strong { font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.summary-pair-grid + .reference-panel { margin-top:8px; }
.motor-support[data-support="○"] { color:var(--accent); }
.motor-support[data-support="△"] { color:var(--amber); }
.reference-panel, .detail-panel { background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:18px; margin-top:12px; }
.section-title-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.section-title-row h2 { margin:0; font-size:18px; }
.section-title-row > span { color:var(--accent); border:1px solid rgba(67,214,199,.25); border-radius:99px; padding:5px 9px; font-size:10px; }
.bet-list { display:flex; flex-wrap:wrap; gap:7px; margin-top:16px; }
.bet-ticket { color:#d8e3e9; background:#132a3a; border:1px solid var(--line-strong); border-radius:8px; padding:9px 11px; font-size:13px; font-weight:700; font-variant-numeric:tabular-nums; }
.no-bet { font-size:26px; color:var(--muted); }
.reference-note { color:var(--muted); font-size:9px; margin:12px 0 0; }
.detail-panel { padding:0; overflow:hidden; }
.detail-panel summary { min-height:58px; cursor:pointer; display:flex; align-items:center; justify-content:space-between; padding:0 18px; font-size:13px; font-weight:700; list-style:none; }
.detail-panel summary::-webkit-details-marker { display:none; }
.detail-panel summary i { width:8px; height:8px; border-right:1px solid var(--accent); border-bottom:1px solid var(--accent); transform:rotate(45deg); transition:transform .2s ease; }
.detail-panel[open] summary i { transform:rotate(225deg); }
.detail-panel-body { border-top:1px solid var(--line); padding:18px; display:grid; gap:24px; }
.detail-panel-body h2 { font-size:13px; margin:0 0 10px; }
.metric-list { margin:0; display:grid; }
.metric-list > div { display:flex; justify-content:space-between; gap:12px; border-bottom:1px solid var(--line); padding:10px 0; }
.metric-list dt { color:var(--muted); font-size:11px; }
.metric-list dd { margin:0; font-size:12px; font-weight:700; font-variant-numeric:tabular-nums; }
.ranking-columns { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.ranking-columns > div { background:rgba(255,255,255,.025); border:1px solid var(--line); border-radius:12px; padding:12px; }
.ranking-columns h3 { color:var(--muted); font-size:10px; margin:0 0 8px; }
.ranking-columns ol { list-style:none; margin:0; padding:0; display:grid; gap:7px; }
.ranking-columns li { display:grid; grid-template-columns:16px 25px 1fr; align-items:center; gap:7px; font-size:10px; color:var(--muted); }
.ranking-columns li > span { color:var(--accent); font-weight:800; }
.boat { width:24px; height:24px; display:grid; place-items:center; border-radius:50%; font-size:11px; background:#e8edf0; color:#07121d; }
.boat-2 { background:#3b4651; color:white; }.boat-3 { background:#d84d53; color:white; }.boat-4 { background:#4d75c8; color:white; }.boat-5 { background:#e5c751; }.boat-6 { background:#59ad6a; color:white; }
.empty-state, .error-state { border:1px solid var(--line); background:var(--surface); border-radius:16px; padding:28px; text-align:center; color:var(--muted); }
.error-state h1 { color:var(--text); font-size:20px; }.error-state a { color:var(--accent); }
.site-footer { color:#5f7685; font-size:9px; text-align:center; letter-spacing:.1em; padding:8px 16px 30px; }

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4fbff;
  --bg-deep: #edf7fc;
  --surface: #ffffff;
  --surface-2: #f4fbff;
  --line: rgba(55, 104, 132, .17);
  --line-strong: rgba(39, 120, 165, .3);
  --text: #173047;
  --muted: #5d7688;
  --accent: #168cc0;
  --accent-soft: rgba(63, 177, 224, .13);
  --amber: #b87918;
  --shadow: 0 14px 34px rgba(36, 92, 122, .12);
}
:root[data-theme="light"] body {
  background: radial-gradient(circle at 85% -10%, rgba(89, 193, 232, .2), transparent 28rem), linear-gradient(180deg, #f8fdff 0%, var(--bg) 65%, var(--bg-deep) 100%);
}
:root[data-theme="light"] .site-header { background:rgba(248,253,255,.9); }
:root[data-theme="light"] .brand-mark { border-color:rgba(22,140,192,.38); box-shadow:inset 0 0 18px rgba(22,140,192,.08); }
:root[data-theme="light"] .brand-mark::before,
:root[data-theme="light"] .brand-mark::after { background:rgba(65,106,130,.24); }
:root[data-theme="light"] .brand-mark i,
:root[data-theme="light"] .compass-orbit i { background:linear-gradient(var(--accent) 0 50%, #8da8b7 50%); }
:root[data-theme="light"] .date-option { background:rgba(255,255,255,.88); }
:root[data-theme="light"] .date-option.is-active { border-color:rgba(22,140,192,.42); background:#dff4fd; box-shadow:0 0 18px rgba(22,140,192,.08); }
:root[data-theme="light"] .date-option.is-disabled { background:rgba(230,241,247,.66); }
:root[data-theme="light"] .date-switcher.is-archive { grid-template-columns:1fr; }
:root[data-theme="light"] .guide-strip { background:linear-gradient(100deg, rgba(86,190,230,.14), rgba(255,255,255,.86)); }
:root[data-theme="light"] .venue-card.is-hosting { background:linear-gradient(145deg,#fff,#f1faff); border-color:rgba(22,140,192,.25); box-shadow:0 7px 24px rgba(36,92,122,.09); }
:root[data-theme="light"] .venue-card.is-closed { background:rgba(229,240,246,.72); opacity:.66; }
:root[data-theme="light"] .race-card { background:linear-gradient(145deg,#fff,#f3faff); box-shadow:0 7px 24px rgba(36,92,122,.08); }
:root[data-theme="light"] .fan1-chip { background:#eef8fc; }
:root[data-theme="light"] .bet-summary { color:#536f81; }
:root[data-theme="light"] .bet-ticket { color:#23435a; background:#eaf7fc; }
:root[data-theme="light"] .ranking-columns > div { background:#f6fbfe; }
:root[data-theme="light"] .compass-hero h2 { text-shadow:0 2px 20px rgba(64,121,151,.15); }
:root[data-theme="light"] .site-footer { color:#6c8798; }

.date-switcher.is-archive { grid-template-columns:1fr; }

@media (min-width: 720px) {
  .site-header { padding-inline:max(24px, calc((100vw - 980px) / 2)); }
  .race-list { grid-template-columns:1fr 1fr; }
  .venue-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:11px; }
  .venue-card > a, .venue-card > div { min-height:104px; padding:15px; }
  .guide-strip { margin-bottom:16px; }
  .race-card a { min-height:132px; }
}

@media (max-width: 520px) {
  .site-header { height:62px; padding:0 14px; }
  .page-shell { width:min(100% - 20px, 860px); padding-top:22px; }
  .venue-heading { align-items:flex-start; }
  .venue-heading h1 { font-size:22px; }
  .race-card-main { grid-template-columns:57px minmax(0,1fr) auto; gap:10px; }
  .race-card a { padding:15px 13px 12px; }
  .race-identity strong { font-size:23px; }
  .status-line { font-size:14px; }
  .race-prob strong { font-size:17px; }
  .bet-summary { font-size:9px; }
  .detail-race-line { align-items:flex-end; }
  .compass-hero { min-height:252px; border-radius:18px; }
  .compass-orbit { width:188px; height:188px; }
  .compass-hero::after { width:230px; height:230px; }
  .summary-pair-grid { grid-template-columns:1fr; gap:8px; }
  .reference-panel { padding:16px; }
}

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