:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1e2230;
  --border: #2a2f3c;
  --text: #e8eaf0;
  --text-dim: #9aa1b1;
  --accent: #5b8cff;

  --sixers: #006bb6;
  --phillies: #cb1839;
  --eagles: #004c54;

  --radius: 12px;
  --maxw: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: linear-gradient(180deg, #14171f 0%, #0f1115 100%);
  border-bottom: 1px solid var(--border);
  padding: 22px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--sixers), var(--phillies));
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 1px;
  color: #fff;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}

.tagline {
  margin: 2px 0 0;
  color: var(--text-dim);
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-text {
  color: var(--text-dim);
  font-size: 13px;
}

.freshness {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #7ee2a8;
  background: rgba(126, 226, 168, 0.1);
  border: 1px solid rgba(126, 226, 168, 0.25);
  padding: 6px 12px;
  border-radius: 999px;
}

.freshness-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
  animation: livepulse 2s infinite;
}

@keyframes livepulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn:hover {
  background: #262c3d;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #4a7bf0;
}

/* Tabs */
.tabs {
  border-bottom: 1px solid var(--border);
  background: #12151c;
  position: sticky;
  top: 0;
  z-index: 10;
}

.tabs-inner {
  display: flex;
  gap: 6px;
  padding-top: 10px;
  padding-bottom: 10px;
  overflow-x: auto;
}

.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.tab.active {
  color: #fff;
  background: var(--surface-2);
  border-color: var(--border);
}

/* Main */
main.container {
  padding-top: 26px;
  padding-bottom: 50px;
}

.error-banner {
  background: rgba(203, 24, 57, 0.12);
  border: 1px solid rgba(203, 24, 57, 0.4);
  color: #ff9aa8;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 22px;
  font-size: 14px;
}

/* Team sections */
.team-section {
  margin-bottom: 40px;
  scroll-margin-top: 80px;
}

.team-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.team-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.team-sport {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.team-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-sixers { background: var(--sixers); }
.dot-phillies { background: var(--phillies); }
.dot-eagles { background: var(--eagles); }

.count {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 999px;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #3a4152;
}

.card-media {
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  position: relative;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-media .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.15);
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.card-title a {
  color: var(--text);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--accent);
}

.card-summary {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-dim);
}

.card-source {
  font-weight: 600;
}

.card-time {
  white-space: nowrap;
}

/* Empty / loading states */
.state-msg {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  padding: 40px 10px;
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.skeleton {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 300 / 220;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 34px;
  color: var(--text-dim);
  font-size: 13px;
}

.site-footer p {
  margin: 4px 0;
}

.feed-meta {
  font-size: 12px;
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 560px) {
  .brand h1 { font-size: 20px; }
  .header-actions { width: 100%; justify-content: space-between; }
  .card-grid { grid-template-columns: 1fr; }
}
