:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #1368e8;
  --brand-dark: #0b4bb3;
  --brand-soft: #eaf2ff;
  --navy: #0b1220;
  --success: #138a5b;
  --success-soft: #e8f8f0;
  --warning: #a15c00;
  --warning-soft: #fff4dc;
  --danger: #b42318;
  --danger-soft: #feeceb;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
  --max-width: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }

.app-shell {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 0 28px 56px;
}

.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.05em;
}

.brand strong { display: block; font-size: 17px; letter-spacing: -0.02em; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

.header-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
}
.header-meta.is-ready .status-dot { background: var(--success); }

.hero {
  padding: 56px 0 42px;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.eyebrow, .section-kicker {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  font-weight: 900;
}

.hero-copy {
  max-width: 650px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.mobile-break { display: none; }

.controls {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}

.period-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 5px;
}

.period-tab {
  min-height: 46px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: .18s ease;
}
.period-tab:hover { color: var(--text); }
.period-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}
.period-tab .count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--line);
  font-size: 11px;
}
.period-tab.is-active .count { background: var(--brand-soft); color: var(--brand-dark); }

.target-filter-wrap {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-heading-row .section-kicker { margin-bottom: 8px; color: var(--muted); }
.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.target-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: thin;
}

.target-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: #334155;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: .18s ease;
}
.target-chip:hover { border-color: #b8c6da; }
.target-chip.is-active {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}
.target-chip.is-national { border-style: dashed; }
.target-chip.is-national.is-active { border-style: solid; }

.schedule-section { padding: 42px 0 0; }
.schedule-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.schedule-heading h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}
.schedule-summary { margin: 0; color: var(--muted); font-size: 13px; }

.date-group + .date-group { margin-top: 32px; }
.date-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
}
.date-heading strong { font-size: 18px; }
.date-heading span { color: var(--muted); font-size: 12px; }

.match-list { display: grid; gap: 12px; }

.match-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.035);
}

.match-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.competition-name {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}
.target-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.target-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 800;
}
.target-badge.national { background: #eef2ff; color: #4f46a5; }

.match-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.match-status.live { background: var(--danger-soft); color: var(--danger); }
.match-status.postponed, .match-status.tbd { background: var(--warning-soft); color: var(--warning); }
.match-status.cancelled { background: var(--danger-soft); color: var(--danger); }

.match-main {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 22px;
  align-items: center;
  padding: 19px 0 15px;
}
.time-block {
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}
.match-time { font-size: 27px; letter-spacing: -0.03em; }
.time-note { margin-top: 2px; color: var(--muted); font-size: 10px; }
.match-date-mobile { display: none; }

.teams-block { display: grid; grid-template-columns: minmax(0,1fr) 34px minmax(0,1fr); align-items: center; gap: 10px; }
.team-row { min-width: 0; }
.team-row.away-team { text-align: right; }
.team-label { display: block; margin-bottom: 5px; color: #94a3b8; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.team-name { display: block; font-size: 18px; line-height: 1.4; word-break: break-word; }
.team-score { display: block; margin-top: 3px; font-size: 17px; font-weight: 900; }
.versus { text-align: center; color: #94a3b8; font-size: 10px; font-weight: 900; }

.match-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.detail-item::before { content: "•"; margin-right: 6px; color: #cbd5e1; }
.detail-item:first-child::before { content: ""; margin: 0; }

.broadcast-area {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: start;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.broadcast-label { margin: 8px 0 0; color: var(--muted); font-size: 10px; font-weight: 800; }
.broadcast-links { display: flex; flex-wrap: wrap; gap: 8px; }
.broadcast-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  text-decoration: none;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  transition: .18s ease;
}
.broadcast-link:hover { border-color: var(--brand); color: var(--brand-dark); transform: translateY(-1px); }
.broadcast-link small {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 9px;
}
.broadcast-link small.paid { background: var(--surface-soft); color: var(--muted); }
.broadcast-pending {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
}

.match-footer { display: flex; justify-content: flex-end; margin-top: 12px; }
.source-link { color: var(--muted); font-size: 10px; text-decoration: none; }
.source-link:hover { color: var(--brand); text-decoration: underline; }

.loading-state, .error-state, .empty-state {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
}
.loading-state p, .error-state p, .empty-state p { margin: 8px 0 0; font-size: 13px; }
.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 999px;
  color: #94a3b8;
}
.primary-button {
  margin-top: 16px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  margin-top: 54px;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.site-footer strong { color: var(--text); }
.site-footer p { margin: 5px 0 0; max-width: 640px; }
.footer-updated { flex: 0 0 auto; text-align: right; }

[hidden] { display: none !important; }

@media (max-width: 760px) {
  .app-shell { padding: 0 16px 42px; }
  .site-header { min-height: 74px; }
  .brand small { display: none; }
  .header-meta { font-size: 10px; }
  .hero { padding: 38px 0 30px; }
  .hero h1 { font-size: clamp(40px, 13vw, 58px); }
  .hero-copy { margin-top: 16px; font-size: 14px; }
  .mobile-break { display: block; }
  .controls { margin: 0 -2px; padding: 14px; border-radius: 18px; }
  .period-tabs { grid-template-columns: repeat(2, 1fr); }
  .target-filter-wrap { margin-top: 14px; padding-top: 14px; }
  .schedule-section { padding-top: 32px; }
  .schedule-heading { align-items: flex-start; margin-bottom: 14px; }
  .schedule-heading h2 { font-size: 24px; }
  .schedule-summary { margin-top: 6px; font-size: 11px; }
  .date-heading { margin-bottom: 9px; }
  .match-card { padding: 15px; border-radius: 18px; }
  .match-main { grid-template-columns: 1fr; gap: 10px; padding: 15px 0 12px; }
  .time-block {
    min-height: 0;
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: baseline;
    gap: 7px;
    border-right: 0;
  }
  .match-date-mobile { display: inline; color: var(--muted); font-size: 11px; font-weight: 700; }
  .match-time { font-size: 24px; }
  .time-note { margin: 0; }
  .teams-block { grid-template-columns: minmax(0,1fr) 24px minmax(0,1fr); gap: 6px; }
  .team-name { font-size: 15px; }
  .broadcast-area { grid-template-columns: 1fr; gap: 5px; }
  .broadcast-label { margin: 0; }
  .broadcast-link { min-height: 36px; }
  .match-footer { justify-content: flex-start; }
  .site-footer { flex-direction: column; gap: 8px; }
  .footer-updated { text-align: left; }
}

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