:root {
  --bg-page: #071827;
  --bg-card: rgba(255, 250, 242, 0.96);
  --bg-surface: #fff6eb;
  --bg-raised: #e8f8fb;
  --accent: #19b6d9;
  --accent-dark: #087a9c;
  --accent-dim: rgba(25, 182, 217, 0.12);
  --accent-border: rgba(25, 182, 217, 0.36);
  --green: #0d7f99;
  --green-dark: #07586e;
  --green-dim: rgba(13, 127, 153, 0.1);
  --amber: #e79a5f;
  --amber-dark: #9a463c;
  --amber-dim: rgba(231, 154, 95, 0.16);
  --crimson: #c94b4b;
  --crimson-dark: #7f2634;
  --crimson-dim: rgba(201, 75, 75, 0.16);
  --danger: #d85f43;
  --danger-dim: rgba(216, 95, 67, 0.12);
  --text-primary: #182128;
  --text-secondary: #53616d;
  --text-muted: #7d8791;
  --border: rgba(24, 33, 40, 0.12);
  --border-strong: rgba(24, 33, 40, 0.22);
  --winner-bg: rgba(25, 182, 217, 0.1);
  --winner-border: rgba(25, 182, 217, 0.32);
  --radius-lg: 6px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --shadow-card: 0 12px 28px rgba(3, 14, 24, 0.28);
  --shadow-soft: 0 4px 14px rgba(3, 14, 24, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: var(--text-primary);
  font-family: var(--font);
  background:
    radial-gradient(circle at 18% 8%, rgba(29, 191, 226, 0.26), transparent 26%),
    radial-gradient(circle at 88% 10%, rgba(231, 154, 95, 0.22), transparent 24%),
    radial-gradient(circle at 72% 82%, rgba(201, 75, 75, 0.2), transparent 28%),
    linear-gradient(155deg, #071827 0%, #0a2b42 40%, #123c57 66%, #492438 100%);
  scroll-behavior: smooth;
}

body { position: relative; overflow-x: hidden; }
body::before, body::after { content: ""; position: fixed; z-index: -1; pointer-events: none; }
body::before {
  left: -140px; bottom: -110px; width: 620px; height: 680px;
  background:
    radial-gradient(circle at 35% 70%, rgba(23, 179, 214, 0.38), transparent 48%),
    radial-gradient(circle at 68% 32%, rgba(201, 75, 75, 0.18), transparent 44%),
    linear-gradient(135deg, rgba(10, 52, 82, 0.48), rgba(5, 21, 36, 0));
  clip-path: polygon(0 15%, 86% 0, 100% 100%, 0 86%);
  opacity: .78;
}
body::after {
  right: -130px; top: -90px; width: 600px; height: 660px;
  background:
    radial-gradient(circle at 70% 22%, rgba(231, 154, 95, 0.4), transparent 42%),
    radial-gradient(circle at 44% 68%, rgba(201, 75, 75, 0.28), transparent 44%),
    linear-gradient(225deg, rgba(25, 182, 217, 0.22), rgba(5, 21, 36, 0));
  clip-path: polygon(20% 0, 100% 0, 100% 88%, 0 100%);
  opacity: .74;
}

a { color: inherit; text-decoration: none; }

#loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, rgba(255,250,242,.94), rgba(14,68,96,.76) 48%, rgba(7,24,39,.96) 100%);
  transition: opacity .35s ease;
}
#loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-card {
  width: min(360px, calc(100vw - 40px));
  padding: 28px 28px 24px;
  background: rgba(255,250,242,.94);
  border: 1px solid rgba(25,182,217,.28);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.loading-logo { margin-bottom: 18px; font-size: 18px; font-weight: 900; letter-spacing: .02em; color: var(--text-primary); }
.loading-track { width: 100%; height: 6px; background: rgba(24,33,40,.1); border-radius: 999px; overflow: hidden; }
.loading-bar { height: 100%; width: 0%; background: var(--accent); border-radius: 999px; animation: lb-run 1.45s ease-in-out infinite; }
@keyframes lb-run { 0%{width:0%;opacity:1} 65%{width:88%;opacity:1} 90%{width:100%;opacity:1} 100%{width:100%;opacity:0} }
.loading-label { margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.loading-note { margin: 10px 0 0; color: var(--text-muted); font-size: 12px; font-weight: 600; line-height: 1.6; }

.page-shell { width: min(1180px, calc(100vw - 48px)); margin: 0 auto; padding: 34px 0 72px; }
.hero {
  margin: 0 auto 26px; padding: 34px 22px 30px; text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.96), rgba(230, 249, 252, 0.9) 48%, rgba(255, 226, 190, 0.88) 72%, rgba(255, 218, 210, 0.82));
  border: 1px solid rgba(255,255,255,.42);
  border-bottom: 4px solid var(--crimson);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(2px);
}
.back-link {
  display: inline-flex; align-items: center; min-height: 30px; margin-bottom: 10px; padding: 0 12px;
  color: var(--accent-dark); background: rgba(255,250,242,.88); border: 1px solid rgba(25,182,217,.28); border-radius: 999px;
  font-size: 12px; font-weight: 800; text-decoration: none;
}
.eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 900; color: var(--crimson-dark); letter-spacing: .04em; text-transform: uppercase; }
.hero h1 { margin: 0; color: var(--text-primary); font-size: clamp(42px, 6vw, 72px); font-weight: 950; letter-spacing: -.055em; line-height: 1.02; }
.lead { margin: 16px auto 0; max-width: 720px; color: var(--text-secondary); font-size: 15px; font-weight: 700; line-height: 1.85; }
.meta-line { margin-top: 18px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.meta-line span { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; color: var(--text-secondary); background: rgba(255,250,242,.78); border: 1px solid rgba(24,33,40,.12); border-radius: 999px; font-size: 12px; font-weight: 700; }
.cache-note { margin: 14px auto 0; max-width: 640px; color: var(--text-muted); font-size: 12px; font-weight: 700; line-height: 1.7; }

.score-card { overflow: hidden; margin-top: 22px; background: var(--bg-card); border: 1px solid rgba(255,255,255,.44); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.section-title { padding: 14px 18px; color: #fff; font-size: 16px; font-weight: 950; text-align: center; border-bottom: 1px solid rgba(24,33,40,.12); background: linear-gradient(90deg, var(--green-dark), var(--green), var(--crimson-dark)); }
.section-title.purple, .section-title.orange { background: linear-gradient(90deg, var(--green-dark), var(--green), var(--crimson-dark)); }
.section-body { padding: 18px; }

.day-tabs, .game-tabs, .hub-tabs { display: flex; align-items: center; justify-content: center; gap: 0; flex-wrap: wrap; padding: 0 14px; background: rgba(255,250,242,.72); border-bottom: 1px solid rgba(24,33,40,.16); }
.hub-tabs { margin-top: 22px; border: 1px solid rgba(24,33,40,.14); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.game-tabs { justify-content: flex-start; }
.day-tab, .game-tab, .hub-tab {
  appearance: none; min-height: 52px; padding: 0 18px; border: none; border-bottom: 3px solid transparent; border-radius: 0;
  background: transparent; color: var(--text-secondary); cursor: pointer; font-family: var(--font);
  transition: color .14s ease, border-color .14s ease, background .14s ease;
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px;
}
.day-tab:hover, .game-tab:hover, .hub-tab:hover { color: var(--crimson-dark); background: var(--crimson-dim); }
.day-tab.active, .game-tab.active, .hub-tab.active { color: var(--crimson-dark); border-bottom-color: var(--crimson); background: var(--crimson-dim); }
.tab-main, .hub-tab { font-size: 14px; font-weight: 850; line-height: 1.1; }
.tab-sub { font-size: 11px; font-weight: 600; opacity: .82; line-height: 1.1; }

.day-current { padding: 22px 18px 10px; text-align: center; }
.day-kicker, .game-kicker { margin: 0; color: var(--text-muted); font-size: 12px; font-weight: 800; }
.day-current h2 { margin: 6px 0 0; color: var(--text-primary); font-size: clamp(24px, 3vw, 34px); font-weight: 900; letter-spacing: -.03em; }
.day-section { padding: 0 0 18px; }
.mini-section-title { margin: 18px 18px 10px; color: var(--text-primary); font-size: 18px; font-weight: 900; text-align: center; }

.game-detail-section { margin-top: 8px; padding-top: 0; border-top: 1px solid rgba(24,33,40,.14); background: rgba(255,246,235,.68); }
.game-current { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px 14px; border-bottom: 1px solid rgba(24,33,40,.1); }
.game-current h3 { margin: 5px 0 0; color: var(--text-primary); font-size: clamp(24px, 3vw, 34px); font-weight: 900; letter-spacing: -.03em; }
.game-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 680px; }
.game-meta span { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; color: var(--text-secondary); background: #fffaf2; border: 1px solid rgba(24,33,40,.12); border-radius: 999px; font-size: 12px; font-weight: 800; box-shadow: var(--shadow-soft); }

.table-wrap { width: calc(100% - 28px); margin: 0 auto; overflow-x: auto; padding-bottom: 2px; }
.table-wrap::-webkit-scrollbar { height: 10px; }
.table-wrap::-webkit-scrollbar-track { background: rgba(24,33,40,.06); }
.table-wrap::-webkit-scrollbar-thumb { background: rgba(201,75,75,.38); border-radius: 999px; }
table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0 8px; table-layout: auto; background: transparent; }
#game-detail-table { min-width: 1120px; }
thead th { padding: 10px 12px; color: var(--text-primary); background: #fffaf2; border-top: 1px solid rgba(24,33,40,.1); border-bottom: 1px solid rgba(24,33,40,.16); font-size: 12px; font-weight: 900; white-space: nowrap; }
thead th:first-child { border-left: 1px solid rgba(24,33,40,.1); border-radius: 4px 0 0 4px; }
thead th:last-child { border-right: 1px solid rgba(24,33,40,.1); border-radius: 0 4px 4px 0; }
tbody td { padding: 12px 12px; color: var(--text-primary); background: #fffaf2; border-top: 1px solid rgba(24,33,40,.08); border-bottom: 1px solid rgba(24,33,40,.16); font-size: 14px; line-height: 1.45; vertical-align: middle; }
tbody td:first-child { border-left: 1px solid rgba(24,33,40,.08); border-radius: 4px 0 0 4px; }
tbody td:last-child { border-right: 1px solid rgba(24,33,40,.08); border-radius: 0 4px 4px 0; }
tbody tr { box-shadow: var(--shadow-soft); }
tbody tr:hover td { background: #fff1ed; }
tbody tr.winner-row td { background: var(--winner-bg); border-top-color: var(--winner-border); border-bottom-color: var(--winner-border); }
td.name-cell, th:first-child { font-weight: 900; text-align: left; }
td.number-cell, td.rank-cell { text-align: right; }
th { text-align: right; }
th:first-child { text-align: left; }
td.text-cell { text-align: left; }
td.wide-cell { min-width: 130px; white-space: normal; }
td.first-rank-cell { font-weight: 900; color: var(--crimson-dark); }
td.total-cell { font-weight: 900; }
td.empty-cell { padding: 26px; color: var(--text-muted); text-align: center; font-weight: 800; }

#summary-table { width: auto; min-width: 1500px; table-layout: auto; }
#summary-table th, #summary-table td { padding: 10px 10px; font-size: 12px; text-align: center; white-space: nowrap; }
#summary-table th:nth-child(1), #summary-table td:nth-child(1) { min-width: 120px; text-align: left; font-size: 13px; font-weight: 900; }
#summary-table th:nth-child(2), #summary-table td:nth-child(2) { min-width: 68px; font-weight: 900; }
#summary-table th:nth-child(3), #summary-table td:nth-child(3) { min-width: 62px; font-weight: 900; }
#summary-table .align-left { text-align: left; }
#summary-table .summary-group-header { padding: 8px 8px; color: var(--text-primary); background: #e8f8fb; border-top: 1px solid rgba(24,33,40,.1); border-bottom: 1px solid rgba(24,33,40,.18); font-size: 11px; font-weight: 900; }
#summary-table .summary-header-cell { color: var(--text-primary); background: #fffaf2; font-weight: 900; }
#summary-table .game20-header { color: var(--danger); background: var(--danger-dim); font-style: italic; font-weight: 900; }
#summary-table .summary-boundary-right { border-right: 1px solid rgba(24,33,40,.2) !important; }
#summary-table tbody tr.winner-row td { color: var(--accent-dark); background: var(--winner-bg); }

#game-detail-table th, #game-detail-table td { text-align: center; }
#game-detail-table td.name-cell, #game-detail-table th:first-child { text-align: center; }
#game-detail-table td.hero-cell { white-space: nowrap; }
#game-detail-table td.hero-cell, #game-detail-table th:nth-child(3) { min-width: 110px; }

.season-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.season-card { display: flex; flex-direction: column; min-height: 190px; padding: 18px; background: #fffaf2; border: 1px solid rgba(24,33,40,.1); border-radius: var(--radius-md); box-shadow: var(--shadow-soft); }
.season-card h2 { margin: 0; color: var(--text-primary); font-size: 26px; font-weight: 900; letter-spacing: -.03em; line-height: 1.2; }
.season-card p { margin: 12px 0 16px; color: var(--text-secondary); font-size: 14px; font-weight: 600; line-height: 1.75; }
.season-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; color: var(--text-secondary); background: rgba(255,241,237,.9); border: 1px solid rgba(201,75,75,.22); border-radius: 999px; font-size: 12px; font-weight: 800; }
.season-card .button { margin-top: auto; }
.button { display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-height: 38px; padding: 0 14px; color: #fff; background: linear-gradient(90deg, var(--green-dark), var(--green)); border: 1px solid rgba(24,33,40,.1); border-radius: 4px; box-shadow: var(--shadow-soft); font-size: 13px; font-weight: 900; }
.button.secondary { color: var(--crimson-dark); background: #fffaf2; border-color: rgba(201,75,75,.28); }
.button:hover { filter: brightness(.98); }
.notice-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.notice-list li { position: relative; padding-left: 18px; color: var(--text-secondary); font-size: 14px; font-weight: 600; line-height: 1.75; }
.notice-list li::before { content: ""; position: absolute; top: .76em; left: 0; width: 7px; height: 7px; border-radius: 999px; background: var(--crimson); }
.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rule-item { padding: 18px; background: #fffaf2; border: 1px solid rgba(24,33,40,.1); border-radius: var(--radius-md); box-shadow: var(--shadow-soft); }
.rule-item h3 { margin: 0 0 8px; color: var(--text-primary); font-size: 17px; font-weight: 900; }
.rule-item p { margin: 0; color: var(--text-secondary); font-size: 14px; font-weight: 600; line-height: 1.75; }

.footer-note { margin-top: 28px; color: rgba(255,250,242,.78); font-size: 12px; font-weight: 700; line-height: 1.7; text-align: center; }
.footer-note code { padding: 2px 6px; color: var(--text-secondary); background: rgba(255,250,242,.9); border: 1px solid rgba(24,33,40,.1); border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }

@media (max-width: 900px) {
  .page-shell { width: min(100% - 24px, 1180px); padding: 24px 0 56px; }
  .hero { padding: 26px 14px 22px; }
  .section-title { padding: 13px 14px; font-size: 15px; }
  .day-tab, .game-tab, .hub-tab { min-height: 48px; padding: 0 13px; }
  .hub-tabs { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .hub-tab { flex: 0 0 auto; }
  .mini-section-title { margin-left: 14px; margin-right: 14px; }
  .game-current { display: block; padding-left: 14px; padding-right: 14px; }
  .game-meta { justify-content: flex-start; margin-top: 12px; }
  .table-wrap { width: calc(100% - 16px); }
  .season-grid, .rule-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body::before, body::after { opacity: .42; }
  .hero h1 { font-size: 42px; }
  .lead { font-size: 14px; }
  .meta-line { gap: 6px; }
  .meta-line span { min-height: 28px; padding: 0 10px; font-size: 11px; }
  .day-tabs, .game-tabs { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .day-tab, .game-tab { flex: 0 0 auto; }
  table { min-width: 660px; }
  #summary-table { min-width: 1300px; }
  #game-detail-table { min-width: 1040px; }
  thead th, tbody td { padding: 9px 8px; font-size: 12px; }
}
