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

:root {
  --mets-blue: #002d72;
  --mets-orange: #ff5910;
  --mets-blue-light: #003a8c;
  --mets-blue-dark: #001d4a;
  --bg: #0a0e1a;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --border: #1e2a3a;
  --text: #e8ecf4;
  --text-secondary: #8899b0;
  --text-muted: #4a5a70;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --radius: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Header --- */
.header {
  background: linear-gradient(135deg, var(--mets-blue) 0%, var(--mets-blue-dark) 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.header-brand h1 span {
  color: var(--mets-orange);
}

.header-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* --- Navigation --- */
.nav {
  display: flex;
  gap: 2px;
  background: var(--mets-blue-dark);
  padding: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar { display: none; }

.nav-btn {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.nav-btn.active {
  background: var(--mets-orange);
  color: white;
}

/* --- Main Content --- */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.page { display: none; }
.page.active { display: block; }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: #2a3a50;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* --- Schedule Calendar --- */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-header {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 0;
  text-transform: uppercase;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  position: relative;
  cursor: default;
  min-height: 60px;
  padding: 4px;
}

.cal-day.empty {
  background: transparent;
}

.cal-day.today {
  border: 2px solid var(--mets-orange);
}

.cal-day.has-game {
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
}

.cal-day.has-game:hover {
  border-color: var(--mets-orange);
}

.cal-day .day-num {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.cal-day .game-opp {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}

.cal-day .game-time {
  font-size: 9px;
  color: var(--muted);
  margin-top: 1px;
}

.cal-day .game-result {
  font-size: 10px;
  font-weight: 700;
  margin-top: 2px;
  padding: 1px 4px;
  border-radius: 3px;
}

.cal-day .game-result.win { background: #10b98130; color: var(--green); }
.cal-day .game-result.loss { background: #ef444430; color: var(--red); }

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-nav h3 {
  font-size: 18px;
}

.cal-nav-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

.cal-nav-btn:hover {
  border-color: var(--mets-orange);
}

/* --- Standings Table --- */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.standings-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.standings-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #0e1520;
}

.standings-table tr.mets-row {
  background: rgba(255, 89, 16, 0.08);
  border-left: 3px solid var(--mets-orange);
}

.standings-table tr.mets-row td {
  font-weight: 700;
}

.standings-table .team-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.record-badge.positive { background: #10b98118; color: var(--green); }
.record-badge.negative { background: #ef444418; color: var(--red); }

/* --- Roster Grid --- */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.player-card:hover {
  border-color: var(--mets-orange);
  transform: translateY(-2px);
}

.player-card .player-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--mets-orange);
  opacity: 0.3;
  float: right;
  line-height: 1;
}

.player-card .player-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.player-card .player-pos {
  font-size: 12px;
  color: var(--text-secondary);
}

.player-card.injured {
  border-left: 3px solid var(--red);
}

.player-card.injured .player-status {
  font-size: 11px;
  color: var(--red);
  margin-top: 6px;
}

/* --- Player Detail Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.visible { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 600px;
  max-width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 { font-size: 20px; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}

.modal-body { padding: 20px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.stat-item {
  text-align: center;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--mets-orange);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

/* --- Article Card --- */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.article-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.article-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--mets-orange);
  font-weight: 700;
  margin-bottom: 6px;
}

.article-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.article-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.article-body {
  padding: 20px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.article-body p { margin-bottom: 12px; }
.article-body h1, .article-body h2, .article-body h3 {
  color: var(--text);
  margin: 16px 0 8px;
}

.takes-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
}

.take {
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.6;
}

.take:first-child {
  border-right: 1px solid var(--border);
}

.take-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.take.pro .take-label { color: var(--green); }
.take.con .take-label { color: var(--red); }

/* --- Predictions --- */
.prediction-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.pred-date {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 70px;
}

.pred-matchup {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
}

.pred-result {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.pred-result.win { background: #10b98120; color: var(--green); }
.pred-result.loss { background: #ef444420; color: var(--red); }

.pred-confidence {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
}

.pred-reasoning {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 16px 14px;
  line-height: 1.5;
  margin-top: -4px;
  margin-bottom: 8px;
}

/* --- Fun Facts --- */
.fact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--mets-orange);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.fact-category {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--mets-orange);
  margin-bottom: 6px;
  font-weight: 600;
}

/* --- Injury List --- */
.injury-list {
  margin-top: 16px;
}

.injury-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #0e1520;
  font-size: 13px;
}

.injury-item:last-child { border-bottom: none; }

.injury-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

.injury-name { font-weight: 600; flex: 1; }
.injury-pos { color: var(--text-muted); min-width: 30px; }
.injury-status { color: var(--red); font-size: 12px; }

/* --- Loading --- */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--mets-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Section Header --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
}

/* --- Buttons --- */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.btn:hover { border-color: var(--mets-orange); }
.btn-primary { background: var(--mets-orange); border-color: var(--mets-orange); color: white; }
.btn-primary:hover { background: #e04e0e; }

.btn-group {
  display: flex;
  gap: 4px;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child { border-radius: 6px 0 0 6px; }
.btn-group .btn:last-child { border-radius: 0 6px 6px 0; }
.btn-group .btn.active { background: var(--mets-orange); border-color: var(--mets-orange); color: white; }

/* --- Drama Cards --- */
.drama-card .article-header {
  border-left: 3px solid var(--mets-orange);
}

.drama-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.drama-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #ff591015;
  color: var(--mets-orange);
  border: 1px solid #ff591030;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.drama-sources {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.drama-source-link {
  font-size: 12px;
  color: var(--mets-blue);
  background: #002d7215;
  padding: 3px 10px;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid #002d7230;
}

.drama-source-link:hover {
  background: #002d7225;
  color: var(--text);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .main { padding: 12px; }
  .calendar { gap: 2px; }
  .cal-day { min-height: 45px; font-size: 11px; }
  .cal-day .game-opp { font-size: 8px; }
  .roster-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .takes-container { grid-template-columns: 1fr; }
  .take:first-child { border-right: none; border-bottom: 1px solid var(--border); }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .prediction-card { flex-wrap: wrap; }
}

/* ---- Media Section ---- */

.media-filters {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.media-filter {
  padding: 6px 16px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-secondary); cursor: pointer;
  font-size: 0.85rem; transition: all 0.2s;
}
.media-filter:hover { border-color: var(--mets-orange); color: var(--text); }
.media-filter.active {
  background: var(--mets-orange); color: #fff; border-color: var(--mets-orange);
}

.media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.media-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: all 0.2s;
}
.media-card:hover {
  border-color: var(--mets-orange); transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 89, 16, 0.15);
}
.media-thumb {
  position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden;
}
.media-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.media-duration {
  position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.8);
  color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem;
  font-family: monospace;
}
.media-cat-badge {
  position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 4px;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
}
.media-cat-highlights { background: var(--mets-orange); color: #fff; }
.media-cat-interview { background: var(--yellow); color: #000; }
.media-cat-pressconference { background: var(--mets-blue); color: #fff; }
.media-cat-breakdown { background: var(--green); color: #fff; }

.media-info { padding: 12px; }
.media-info h3 {
  font-size: 0.9rem; color: var(--text); margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.media-meta {
  display: flex; gap: 12px; font-size: 0.75rem; color: var(--text-muted);
}

.media-modal-wide {
  width: 90vw; max-width: 960px;
}
.media-player {
  position: relative; width: 100%; padding-bottom: 56.25%; /* 16:9 */
}
.media-player iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;
}

@media (max-width: 600px) {
  .media-grid { grid-template-columns: 1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
