/*
Theme Name: NHL Live Rink
Theme URI: https://example.com
Author: Your Name
Description: A dark, scoreboard-inspired WordPress theme for streaming live NHL games. Pulls the day's schedule from the ESPN NHL API and plays live games through admin-mapped iframe embeds.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: nhllive
*/

/* =========================================================
   DESIGN TOKENS
   Palette: deep rink ice, steel blue boards, NHL red, cyan
   "live" glow — built around an arena jumbotron, not a
   generic dark-mode template.
   ========================================================= */
:root {
  --ink: #0a0d13;
  --ink-2: #0f141d;
  --board: #16202c;
  --board-line: #26333f;
  --steel: #22405c;
  --ice: #eef3f6;
  --frost: #93a1ac;
  --frost-dim: #5c6a75;
  --red: #c8102e;
  --red-glow: #ff2f4f;
  --cyan: #00c2d9;

  --font-display: "Teko", sans-serif;
  --font-body: "Inter", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --radius: 4px;
  --container: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--ice);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  background-image:
    radial-gradient(ellipse 900px 500px at 50% -10%, rgba(0, 194, 217, 0.08), transparent 60%);
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0;
  color: var(--ice);
}

::selection { background: var(--red); color: var(--ice); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* =========================================================
   SITE HEADER
   ========================================================= */
.site-header {
  border-bottom: 1px solid var(--board-line);
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.site-branding {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.site-title {
  font-size: 30px;
  line-height: 1;
  margin: 0;
}

.site-title a { display: flex; align-items: baseline; gap: 8px; }

.site-title .puck {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  display: inline-block;
  box-shadow: 0 0 10px var(--cyan);
}

.site-tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--frost-dim);
}

.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.primary-nav a {
  font-family: var(--font-display);
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--frost);
  transition: color 0.15s ease;
}

.primary-nav a:hover { color: var(--cyan); }

/* =========================================================
   SIGNATURE ELEMENT: JUMBOTRON TICKER
   A scrolling scoreboard strip, like an arena marquee,
   showing every game on today's slate at a glance.
   ========================================================= */
.jumbotron-ticker {
  background: var(--board);
  border-bottom: 1px solid var(--board-line);
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.jumbotron-ticker::before,
.jumbotron-ticker::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 60px;
  z-index: 2;
  pointer-events: none;
}
.jumbotron-ticker::before { left: 0; background: linear-gradient(90deg, var(--board), transparent); }
.jumbotron-ticker::after { right: 0; background: linear-gradient(-90deg, var(--board), transparent); }

.ticker-track {
  display: inline-flex;
  gap: 40px;
  padding: 10px 0;
  animation: ticker-scroll 40s linear infinite;
}

.jumbotron-ticker:hover .ticker-track { animation-play-state: paused; }

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker-item {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--frost);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ticker-item .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red-glow);
  box-shadow: 0 0 6px var(--red-glow);
  animation: pulse 1.4s ease-in-out infinite;
}

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

.ticker-item .score { color: var(--ice); font-weight: 700; }

.next-game-day-notice {
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--board);
  border: 1px solid var(--steel);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--frost);
}

.next-game-day-notice strong {
  color: var(--cyan);
}

/* =========================================================
   PLAYER / HERO ZONE
   ========================================================= */
.player-zone {
  padding: 40px 0 20px;
}

.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--board-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.player-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.player-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--frost-dim);
  text-align: center;
  padding: 20px;
  background:
    repeating-linear-gradient(135deg, var(--board) 0 2px, var(--ink) 2px 40px);
}

.player-empty .icon { font-size: 40px; color: var(--steel); }
.player-empty h3 { color: var(--frost); font-size: 24px; }
.player-empty p { font-family: var(--font-mono); font-size: 12px; margin: 0; max-width: 360px; }

.now-playing-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--board);
  border: 1px solid var(--board-line);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--frost);
}

.now-playing-bar .badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--red-glow);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.now-playing-bar .badge-live .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red-glow);
  box-shadow: 0 0 8px var(--red-glow);
  animation: pulse 1.4s ease-in-out infinite;
}

/* =========================================================
   SCHEDULE GRID
   ========================================================= */
.schedule-section {
  padding: 30px 0 70px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px solid var(--board-line);
  padding-bottom: 12px;
  margin-bottom: 22px;
}

.section-heading h2 { font-size: 34px; }

.section-heading .date-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--frost-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.game-card {
  background: var(--board);
  border: 1px solid var(--board-line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s ease, transform 0.15s ease;
  cursor: default;
}

.game-card.is-playable {
  cursor: pointer;
}

.game-card.is-playable:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.game-card.is-active {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}

.game-card-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--frost-dim);
}

.status-live {
  color: var(--red-glow);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-live .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red-glow);
  box-shadow: 0 0 6px var(--red-glow);
  animation: pulse 1.4s ease-in-out infinite;
}

.matchup {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.team img { width: 40px; height: 40px; object-fit: contain; }

.team-abbr {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.03em;
}

.team-score {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--ice);
}

.matchup-sep {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--frost-dim);
  padding: 0 10px;
}

.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--board-line);
  padding-top: 12px;
}

.watch-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  border: 1px solid var(--steel);
  border-radius: var(--radius);
  padding: 6px 12px;
  background: transparent;
}

.game-card.is-playable:hover .watch-btn {
  border-color: var(--cyan);
}

.watch-btn.disabled {
  color: var(--frost-dim);
  border-color: var(--board-line);
}

.no-games {
  font-family: var(--font-mono);
  color: var(--frost-dim);
  text-align: center;
  padding: 60px 0;
  border: 1px dashed var(--board-line);
  border-radius: var(--radius);
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--board-line);
  background: var(--ink-2);
  padding: 28px 0;
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--frost-dim);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 720px) {
  .site-header .wrap { height: 60px; }
  .site-title { font-size: 24px; }
  .primary-nav ul { gap: 16px; }
  .primary-nav a { font-size: 15px; }
  .section-heading h2 { font-size: 26px; }
  .now-playing-bar { flex-direction: column; align-items: flex-start; gap: 6px; }
  .site-footer .wrap { flex-direction: column; gap: 8px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .live-dot, .status-live .dot, .badge-live .dot { animation: none; }
}
