:root {
  --black: #1a1a1a;
  --white: #ffffff;
  --gray-light: #f5f5f5;
  --gray-mid: #dddddd;
  --gray-text: #666666;
  --green: #2d7a2d;
  --loss-red: #b30000;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: var(--black);
  background: var(--white);
}

/* ---- Header ---- */

header {
  background: var(--primary);
  color: var(--white);
  border-bottom: 4px solid var(--primary-dark);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.source-logos {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.source-logos a {
  display: flex;
  background: var(--white);
  padding: 4px;
  border-radius: 4px;
}

.source-logos img {
  width: 24px;
  height: 24px;
  border-radius: 2px;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.subtitle {
  font-size: 0.875rem;
  opacity: 0.85;
  font-weight: 400;
}

/* ---- Tab Bar ---- */

.tab-bar {
  background: var(--white);
  border-bottom: 2px solid var(--gray-mid);
  position: sticky;
  top: 0;
  z-index: 10;
}

.tab-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 0;
}

.tab {
  padding: 0.75rem 1.25rem;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-text);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: var(--primary);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---- Main ---- */

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* ---- Sport Sections ---- */

.sport-section {
  margin-bottom: 2.5rem;
}

.sport-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.35rem;
  margin-bottom: 1rem;
}

.sport-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
}

.sport-feeds {
  min-width: 0;
}

.sport-schedule {
  align-self: start;
}

.sport-schedule > h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-text);
  margin-bottom: 0.5rem;
}

/* ---- View Toggle ---- */

.view-toggle-bar {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--gray-mid);
}

.view-toggle {
  padding: 0.4rem 0.75rem;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-text);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.view-toggle:hover {
  color: var(--primary);
}

.view-toggle.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---- Chronological Feed ---- */

.chrono-items li {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chrono-source {
  font-size: 0.65rem;
  color: var(--gray-text);
  background: var(--gray-light);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- General Sections ---- */

.general-section {
  margin-bottom: 2.5rem;
}

.general-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.35rem;
  margin-bottom: 1rem;
}

/* ---- Podcast Grid ---- */

#podcasts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2rem;
}

#podcasts h2 {
  grid-column: 1 / -1;
}

/* ---- Feed Sources ---- */

.feed-source {
  margin-bottom: 1.25rem;
}

.feed-source h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 0.3rem;
}

.source-link {
  color: var(--gray-text);
  text-decoration: none;
  font-size: 0.75rem;
  margin-left: 0.25rem;
}

.source-link:hover {
  color: var(--primary);
}

.feed-empty {
  font-size: 0.8rem;
  color: var(--gray-text);
  font-style: italic;
}

.feed-items {
  list-style: none;
}

.feed-items li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--gray-light);
  font-size: 0.875rem;
}

.feed-items li:last-child {
  border-bottom: none;
}

.feed-items a {
  color: var(--black);
  text-decoration: none;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-items a:hover {
  color: var(--primary);
}

.feed-items time {
  color: var(--gray-text);
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Podcasts ---- */

#podcasts {
  columns: 2;
  column-gap: 1.5rem;
}

#podcasts > h2 {
  column-span: all;
}

.podcast-source {
  break-inside: avoid;
}

.podcast-items li {
  flex-wrap: wrap;
}

.podcast-items li::before {
  content: "\1F3A7 ";
  font-size: 0.75rem;
  flex-shrink: 0;
}

.podcast-summary {
  width: 100%;
  font-size: 0.75rem;
  color: var(--gray-text);
  line-height: 1.4;
  margin-top: 0.1rem;
  padding-left: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.podcast-duration {
  font-size: 0.65rem;
  color: var(--gray-text);
  background: var(--gray-light);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Videos ---- */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.video-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--black);
  border-radius: 4px;
  overflow: hidden;
}

.video-card:hover .video-title {
  color: var(--primary);
}

.video-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: var(--gray-light);
}

.video-title {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.3;
  margin-top: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card time {
  font-size: 0.7rem;
  color: var(--gray-text);
  margin-top: 0.15rem;
}

/* ---- Schedule ---- */

.schedule-record {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-mid);
}

.schedule-group {
  margin-bottom: 0.75rem;
}

.schedule-group h4 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-text);
  margin-bottom: 0.25rem;
}

.schedule-list {
  list-style: none;
}

.schedule-list li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--gray-light);
}

.schedule-list li:last-child {
  border-bottom: none;
}

.game-date {
  color: var(--gray-text);
  font-size: 0.75rem;
  white-space: nowrap;
  min-width: 3rem;
  flex-shrink: 0;
}

.game-opponent {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-result {
  font-weight: 600;
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.result-win {
  color: var(--green);
}

.result-loss {
  color: var(--loss-red);
}

.result-draw {
  color: var(--gray-text);
}

.game-time {
  color: var(--gray-text);
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.schedule-error {
  font-size: 0.8rem;
  color: var(--gray-text);
  font-style: italic;
}

.schedule-error a {
  color: var(--primary);
}

.schedule-empty {
  font-size: 0.8rem;
  color: var(--gray-text);
  font-style: italic;
}

/* ---- Standings Table ---- */

.standings-wrapper {
  margin-bottom: 1rem;
}

.standings-wrapper h4 {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
  line-height: 1.4;
}

.standings-table th {
  font-weight: 600;
  text-align: center;
  padding: 0.25rem 0.2rem;
  border-bottom: 2px solid var(--gray-mid);
  color: var(--gray-text);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.standings-table th:nth-child(2),
.standings-table td.standings-team {
  text-align: left;
}

.standings-table td {
  text-align: center;
  padding: 0.25rem 0.2rem;
  border-bottom: 1px solid var(--gray-light);
}

.standings-table td:first-child {
  font-weight: 600;
  color: var(--gray-text);
  width: 1.5em;
}

.standings-team {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.standings-row-highlight {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  font-weight: 600;
}

.standings-row-highlight .standings-team {
  color: var(--primary);
}

/* ---- Footer ---- */

footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--gray-mid);
  font-size: 0.75rem;
  color: var(--gray-text);
}

.disclaimer {
  margin-top: 0.25rem;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
  main {
    padding: 1rem;
  }

  .header-inner {
    padding: 1rem;
  }

  .tab-bar-inner {
    padding: 0 1rem;
  }

  .tab {
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
  }

  #podcasts {
    columns: 1;
  }

  .sport-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  footer {
    padding: 1rem;
  }
}
