/* ViciousPandaTTV - Official Hub. Self-contained: no CDNs, no third-party scripts. */
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #111827;
  --card: #1f2937;
  --btn: #374151;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --faint: #6b7280;
  --indigo: #4f46e5;
  --indigo-dark: #4338ca;
  --indigo-mid: #6366f1;
  --indigo-light: #818cf8;
  --glow: 0 25px 50px -12px rgba(99, 102, 241, .2);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg, iframe { display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
:focus-visible { outline: 2px solid var(--indigo-light); outline-offset: 2px; }

/* Layout container (same breakpoints as the original) */
.container { width: 100%; margin: 0 auto; padding: 0 24px; }
@media (min-width: 640px)  { .container { max-width: 640px; } }
@media (min-width: 768px)  { .container { max-width: 768px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; } }
@media (min-width: 1280px) { .container { max-width: 1280px; } }
@media (min-width: 1536px) { .container { max-width: 1536px; } }

/* Header / nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(17, 24, 39, .8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, .1), 0 4px 6px -4px rgba(99, 102, 241, .1);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; padding-bottom: 16px; }
.brand { font-size: 24px; line-height: 32px; font-weight: 700; color: #fff; transition: color .15s; }
.brand:hover { color: var(--indigo-light); }
.nav-links { display: none; align-items: center; gap: 8px; }
.nav-link {
  padding: 8px 16px; border-radius: 6px;
  font-size: 14px; line-height: 20px; font-weight: 500;
  transition: background-color .15s;
}
.nav-links .nav-link:hover { background: var(--indigo-mid); }
.nav-link.active, .nav-links .nav-link.active:hover { background: var(--indigo); color: #fff; }
.menu-btn { padding: 8px; border-radius: 6px; background: transparent; }
.menu-btn:hover { background: var(--btn); }
.menu-btn svg { width: 24px; height: 24px; }
.mobile-menu { padding: 8px 16px 16px; }
.mobile-menu .nav-link { display: block; margin-top: 8px; font-size: 16px; line-height: 24px; }
.mobile-menu .nav-link:hover { background: var(--btn); }
.mobile-menu .nav-link.active { background: var(--indigo); }
@media (min-width: 768px) {
  .nav-links { display: flex; }
  .menu-btn, .mobile-menu { display: none; }
}

/* Pages */
.main { flex: 1; padding-top: 32px; padding-bottom: 32px; }
.page-section { display: none; }
.page-section.active { display: block; }
.section-title {
  margin-bottom: 32px; text-align: center; color: #fff;
  font-size: 36px; line-height: 40px; font-weight: 700;
}
.section-title.tight { margin-bottom: 16px; }
.section-title.wide { margin-bottom: 48px; }
.center { text-align: center; }
.muted { color: var(--muted); }

/* Home */
#home.active {
  min-height: 70vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.home h1 {
  color: #fff; font-weight: 900; text-transform: uppercase; letter-spacing: .05em;
  font-size: 48px; line-height: 1;
}
.home p { margin-top: 16px; max-width: 42rem; font-size: 18px; line-height: 28px; color: var(--muted); }
@media (min-width: 768px) { .home h1 { font-size: 72px; } }

.btn {
  display: inline-block; margin-top: 32px; padding: 12px 32px; border-radius: 8px;
  background: var(--indigo); color: #fff; font-weight: 700;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
  transition: transform .15s, background-color .15s;
}
.btn:hover { background: var(--indigo-dark); transform: scale(1.05); }

/* Twitch embeds */
.stream-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
.embed { border-radius: 8px; overflow: hidden; box-shadow: var(--glow); background: #0e0e10; }
.embed .ratio { position: relative; padding-top: 56.25%; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-chat { position: relative; height: 60vh; }
@media (min-width: 1024px) {
  .stream-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .embed-player { grid-column: span 2 / span 2; }
  .embed-chat { height: auto; min-height: 100%; }
}

/* Shorts */
.shorts-wrap { display: flex; flex-direction: column; align-items: center; }
#shorts-slot { width: min(100%, 360px); }
.shorts-player {
  position: relative; width: 100%; aspect-ratio: 9 / 16;
  border-radius: 12px; overflow: hidden; background: #000; box-shadow: var(--glow);
}
.shorts-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.shorts-note { margin-top: 16px; text-align: center; font-size: 14px; color: var(--muted); }
.btn-ghost { background: var(--btn); margin-top: 20px; }
.btn-ghost:hover { background: var(--indigo); }

/* Schedule */
.schedule-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 768px)  { .schedule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .schedule-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.schedule-card {
  background: var(--card); border-radius: 8px; padding: 24px; text-align: center;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
  transition: transform .3s;
}
.schedule-card:hover { transform: translateY(-8px); }
.schedule-card h3 { font-size: 24px; line-height: 32px; font-weight: 700; color: var(--indigo-light); }
.schedule-card .time { margin-top: 8px; font-size: 18px; line-height: 28px; font-weight: 600; }
.schedule-card .game { margin-top: 16px; color: var(--muted); }
.schedule-empty {
  grid-column: 1 / -1; justify-self: center; width: min(100%, 520px);
  padding: 32px 24px; border-radius: 8px; background: var(--card); text-align: center;
}
.schedule-empty h3 { font-size: 20px; line-height: 28px; font-weight: 700; color: #fff; }
.schedule-empty p { margin-top: 8px; color: var(--muted); }
.schedule-empty a { color: var(--indigo-light); font-weight: 600; }
.schedule-empty a:hover { text-decoration: underline; }

/* Anime list */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 16px; }
.anime-filter-btn {
  padding: 8px 16px; border-radius: 6px; background: var(--btn); font-weight: 600;
  transition: background-color .15s;
}
.anime-filter-btn:hover { background: var(--indigo); }
.anime-filter-btn.active { background: var(--indigo); color: #fff; }
.anime-filter-btn .count { margin-left: 2px; font-weight: 500; opacity: .7; }
.anime-meta { margin-bottom: 28px; text-align: center; font-size: 14px; color: var(--muted); }
.anime-meta a { color: var(--indigo-light); font-weight: 600; }
.anime-meta a:hover { text-decoration: underline; }
.anime-score {
  position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 999px;
  background: rgba(17, 24, 39, .85); color: #fbbf24; font-size: 13px; font-weight: 700;
}
.anime-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (min-width: 640px)  { .anime-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px)  { .anime-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .anime-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.anime-card {
  position: relative;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
  transition: transform .3s ease, box-shadow .3s ease;
}
.anime-card:hover { transform: translateY(-8px); box-shadow: 0 10px 20px rgba(79, 70, 229, .4); }
.anime-card img { width: 100%; height: 256px; object-fit: cover; background: var(--btn); }
.anime-body { display: flex; flex: 1; flex-direction: column; justify-content: space-between; padding: 12px; }
.anime-title { color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anime-progress { margin-top: 8px; text-align: center; }
.anime-progress .label { font-size: 14px; line-height: 20px; color: var(--muted); }
.anime-progress .value { font-size: 18px; line-height: 28px; font-weight: 600; color: #fff; }
.anime-grid .empty { grid-column: 1 / -1; text-align: center; color: var(--muted); }

/* Recommended */
.rec-list { display: flex; flex-direction: column; gap: 64px; }
.rec-item.is-live { order: -1; }                 /* live channels float to the top */
.rec-title {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin-bottom: 16px; font-size: 30px; line-height: 36px; font-weight: 700;
  color: var(--indigo-light); overflow-wrap: anywhere;
}
.live-badge {
  display: none; padding: 2px 8px; border-radius: 4px;
  background: #ef4444; color: #fff; font-size: 13px; line-height: 20px; font-weight: 800; letter-spacing: .06em;
}
.rec-item.is-live .live-badge { display: inline-block; }
.live-meta { font-size: 15px; line-height: 20px; font-weight: 500; color: var(--muted); }
.live-summary { margin-bottom: 40px; text-align: center; font-size: 14px; color: var(--muted); }
.live-summary.has-live::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%;
  background: #ef4444; vertical-align: middle; box-shadow: 0 0 0 3px rgba(239, 68, 68, .25);
}
.rec-title a:hover { text-decoration: underline; }

/* Footer */
.site-footer { margin-top: 64px; background: var(--bg); }
.footer-inner { padding-top: 16px; padding-bottom: 16px; text-align: center; color: var(--faint); }
.socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 8px; font-size: 14px; }
.socials a:hover { color: var(--indigo-light); }

/* 404 */
.lost { text-align: center; padding: 48px 0; }
.lost img { width: 160px; height: 160px; margin: 0 auto 24px; }
.lost h1 { font-size: 72px; line-height: 1; font-weight: 900; color: #fff; }
.lost p { margin-top: 16px; font-size: 18px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
