/* =========================================================
   World Cup 2026 Live Stream - Premium Dark Sports Dashboard
   ========================================================= */

:root {
  --bg-deep: #020612;
  --bg-navy: #071225;
  --bg-midnight: #030915;
  --panel: rgba(7, 18, 37, 0.72);
  --panel-solid: rgba(8, 18, 34, 0.96);
  --border: rgba(129, 184, 255, 0.18);
  --border-soft: rgba(255, 255, 255, 0.08);

  --cyan: #00c2ff;
  --blue: #2563ff;
  --red: #ff2f54;
  --green: #39ff88;
  --orange: #f7c948;
  --gold: #f7c948;
  --pink: #ff5f7d;
  --purple: #ff2f54;

  --text-main: #f4f6fb;
  --text-muted: #a6b4cb;
  --text-dim: #6f7f9c;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-glow-cyan: 0 0 34px rgba(0, 194, 255, 0.28);
  --shadow-glow-purple: 0 0 34px rgba(255, 47, 84, 0.24);
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.45);

  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Bahnschrift SemiCondensed", "Bahnschrift", "Arial Narrow", "Franklin Gothic Medium", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse at 18% -10%, rgba(0, 194, 255, 0.28) 0%, transparent 38%),
    radial-gradient(ellipse at 82% 0%, rgba(255, 47, 84, 0.22) 0%, transparent 34%),
    linear-gradient(180deg, #06152d 0%, var(--bg-deep) 45%, #01030a 100%),
    var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 6, 18, 0.35), rgba(2, 6, 18, 0.88)),
    url("assets/wcParticles.jpg") center / cover no-repeat;
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Ambient glows ---------- */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}
.bg-glow-1 {
  width: 500px;
  height: 500px;
  background: var(--red);
  top: -150px;
  left: -150px;
}
.bg-glow-2 {
  width: 500px;
  height: 500px;
  background: var(--cyan);
  bottom: -200px;
  right: -150px;
  opacity: 0.2;
}
.bg-glow-3 {
  width: 420px;
  height: 420px;
  background: var(--green);
  bottom: 20%;
  left: 16%;
  opacity: 0.08;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 14px 30px;
}

/* ---------- Sticky stream-slot urgency bar ---------- */
.slot-bar {
  position: sticky;
  top: 8px;
  z-index: 30;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 47, 84, 0.4);
  background:
    linear-gradient(135deg, rgba(255, 47, 84, 0.22), rgba(8, 18, 34, 0.92));
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35), 0 0 18px rgba(255, 47, 84, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.slot-bar:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 26px rgba(255, 47, 84, 0.32);
}
.slot-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(255, 47, 84, 0.6);
  animation: slot-pulse 1.6s ease-out infinite;
  flex-shrink: 0;
}
.slot-text strong {
  color: var(--red);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
}
.slot-cta {
  font-weight: 800;
  color: var(--cyan);
  white-space: nowrap;
}
@keyframes slot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 47, 84, 0.55); }
  100% { box-shadow: 0 0 0 9px rgba(255, 47, 84, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .slot-dot { animation: none; }
}
@media (max-width: 859px) {
  .slot-bar {
    font-size: 12px;
    padding: 8px 12px;
    gap: 7px;
  }
}
@media (max-width: 380px) {
  .slot-bar .slot-cta { display: none; }
}

/* =========================================================
   NAVBAR
   ========================================================= */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background:
    linear-gradient(135deg, rgba(8, 20, 42, 0.92), rgba(3, 9, 21, 0.76));
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 34px rgba(0, 0, 0, 0.26);
  border-radius: var(--radius-md);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  margin-bottom: 16px;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--red), var(--cyan));
  box-shadow: 0 0 18px rgba(0, 194, 255, 0.35);
}
.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.welcome-text {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  justify-content: flex-end;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  min-height: 40px;
}
.btn:active {
  transform: scale(0.97);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-main);
  border: 1px solid rgba(129, 184, 255, 0.18);
}
.btn-ghost:hover {
  background: rgba(0, 194, 255, 0.12);
  border-color: rgba(0, 194, 255, 0.38);
}
.btn-primary {
  background: linear-gradient(135deg, var(--red) 0%, var(--blue) 52%, var(--cyan) 100%);
  color: #fff;
  box-shadow: 0 6px 24px rgba(0, 194, 255, 0.26), 0 0 18px rgba(255, 47, 84, 0.24);
}
.btn-primary:hover {
  box-shadow: 0 8px 30px rgba(0, 194, 255, 0.36), 0 0 22px rgba(255, 47, 84, 0.3);
  transform: translateY(-1px);
}
.btn-block {
  width: 100%;
  display: block;
  text-align: center;
  padding: 13px 16px;
  font-size: 15px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 7px 12px;
  border-radius: 999px;
}
.badge-live {
  background: rgba(57, 255, 136, 0.13);
  color: var(--green);
  border: 1px solid rgba(57, 255, 136, 0.42);
  box-shadow: 0 0 18px rgba(57, 255, 136, 0.18);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: pulse-dot 1.6s ease-in-out infinite;
}
.dot-cyan {
  background: var(--cyan);
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}
.dot-cyan {
  animation: pulse-dot-cyan 1.6s ease-in-out infinite;
}
@keyframes pulse-dot-cyan {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(34, 211, 238, 0); }
}

/* =========================================================
   MAIN GRID
   ========================================================= */
.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.player-col,
.chat-col {
  min-width: 0;
}

/* =========================================================
   PLAYER CARD
   ========================================================= */
.player-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(129, 184, 255, 0.24);
  box-shadow: var(--shadow-card), 0 0 42px rgba(0, 194, 255, 0.14);
  aspect-ratio: 16 / 11;
  background: #061020;
}

.player-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.68;
}

.player-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 6, 18, 0.6) 0%, rgba(2, 6, 18, 0.28) 36%, rgba(2, 6, 18, 0.9) 100%),
    radial-gradient(ellipse at 50% 35%, rgba(0, 194, 255, 0.18) 0%, rgba(255, 47, 84, 0.08) 38%, rgba(2, 6, 18, 0.68) 100%),
    linear-gradient(90deg, rgba(57, 255, 136, 0.1), transparent 22%, transparent 78%, rgba(247, 201, 72, 0.1));
}

.player-badge {
  position: absolute;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(3, 9, 21, 0.72);
  border: 1px solid rgba(129, 184, 255, 0.26);
  backdrop-filter: blur(8px);
  z-index: 3;
  letter-spacing: 0.2px;
}
.player-badge.top-left {
  left: 12px;
}
.player-badge.top-right {
  right: 12px;
  color: var(--cyan);
  border-color: rgba(0, 194, 255, 0.44);
  box-shadow: 0 0 18px rgba(0, 194, 255, 0.18);
}

/* ---------- Play button ---------- */
.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--red) 0%, var(--blue) 54%, var(--cyan) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 0 0 0 rgba(0, 194, 255, 0.48), 0 0 28px rgba(57, 255, 136, 0.16);
  animation: pulse-play 2s infinite;
  transition: transform 0.2s ease, background 0.2s ease;
  padding-left: 6px;
}
.play-btn:hover {
  background: linear-gradient(135deg, #ff4868 0%, #3470ff 48%, #24d8ff 100%);
  transform: translate(-50%, -50%) scale(1.06);
}
.play-btn:active {
  transform: translate(-50%, -50%) scale(0.96);
}
@keyframes pulse-play {
  0% { box-shadow: 0 0 0 0 rgba(0, 194, 255, 0.46), 0 0 28px rgba(57, 255, 136, 0.16); }
  70% { box-shadow: 0 0 0 24px rgba(0, 194, 255, 0), 0 0 32px rgba(255, 47, 84, 0.18); }
  100% { box-shadow: 0 0 0 0 rgba(0, 194, 255, 0), 0 0 28px rgba(57, 255, 136, 0.16); }
}

/* ---------- Center hero content ---------- */
.player-center-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 0 16px 82px;
  z-index: 2;
  pointer-events: none;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  letter-spacing: 1.5px;
  line-height: 0.95;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #d7e7ff 54%, #f7c948 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.15);
}

.hero-subtitle {
  margin-top: 6px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hero-subtitle .us { color: var(--cyan); }
.hero-subtitle .ca { color: var(--red); }
.hero-subtitle .mx { color: var(--green); }
.hero-subtitle .dot-sep { color: var(--text-dim); margin: 0 2px; }

/* ---------- Stats bar ---------- */
.player-stats {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 8px 6px;
  background: rgba(2, 6, 18, 0.76);
  border-top: 1px solid rgba(129, 184, 255, 0.14);
  backdrop-filter: blur(12px);
  z-index: 3;
}

.stat {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: left;
  min-height: 60px;
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(9, 25, 50, 0.88), rgba(2, 6, 18, 0.84));
  border: 1px solid rgba(129, 184, 255, 0.14);
}
.stat-button {
  appearance: none;
  border: 1px solid rgba(129, 184, 255, 0.18);
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.stat-button:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 194, 255, 0.34);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}
.stat-button.is-active {
  background: linear-gradient(135deg, rgba(57, 255, 136, 0.14), rgba(0, 194, 255, 0.12));
  border-color: rgba(57, 255, 136, 0.34);
  box-shadow: 0 0 20px rgba(57, 255, 136, 0.12);
}
.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--cyan);
  flex-shrink: 0;
}
.stat-dislike .stat-icon {
  color: var(--red);
}
.stat-dislike.is-active {
  border-color: rgba(255, 47, 84, 0.34);
  background: linear-gradient(135deg, rgba(255, 47, 84, 0.14), rgba(2, 6, 18, 0.84));
  box-shadow: 0 0 20px rgba(255, 47, 84, 0.12);
}
.stat-dislike.is-active .stat-icon {
  color: var(--red);
}
.stat-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.stat-button.is-active .stat-icon {
  color: var(--green);
}
.stat-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.stat-text strong {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-body);
  letter-spacing: 0.2px;
}
.stat-text small {
  font-size: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 1px;
}

/* =========================================================
   INFO ROW
   ========================================================= */
.info-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.info-card, .viewers-card, .chat-card {
  background:
    linear-gradient(145deg, rgba(7, 18, 37, 0.86), rgba(2, 6, 18, 0.72));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-card);
}

.info-card {
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(7, 18, 37, 0.92), rgba(2, 6, 18, 0.76)),
    url("assets/wcPitch.jpg") center / cover no-repeat;
}
.info-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 194, 255, 0.12), transparent 54%, rgba(57, 255, 136, 0.08));
  pointer-events: none;
}
.info-card > * {
  position: relative;
}
.info-card h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}
.info-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.viewers-card {
  padding: 16px 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  min-width: 0;
  background:
    linear-gradient(135deg, rgba(6, 15, 30, 0.88), rgba(2, 6, 18, 0.86)),
    url("assets/wcPitch.jpg") center / cover no-repeat;
  border-color: rgba(0, 194, 255, 0.18);
}
.viewers-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 18, 0.74), rgba(2, 6, 18, 0.44) 48%, rgba(2, 6, 18, 0.7));
  pointer-events: none;
}
.viewers-card > * {
  position: relative;
  z-index: 1;
}
.viewers-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.viewers-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #88d6ff;
  text-shadow: 0 0 10px rgba(0, 194, 255, 0.26);
  white-space: nowrap;
}
.viewers-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--cyan);
}
.viewers-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.viewers-count {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: #f7fbff;
  text-shadow: 0 0 18px rgba(0, 194, 255, 0.32), 0 0 6px rgba(0, 0, 0, 0.38);
  white-space: nowrap;
}

/* =========================================================
   CHAT PANEL
   ========================================================= */
.chat-card {
  display: flex;
  flex-direction: column;
  height: 460px;
  overflow: hidden;
  border-color: rgba(129, 184, 255, 0.18);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(129, 184, 255, 0.12);
  flex-shrink: 0;
}
.chat-header h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}
.chat-viewers {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.chat-viewers #chatViewers {
  color: var(--green);
  font-weight: 800;
}
.chat-toggle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(129, 184, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 14px;
}
.chat-toggle:hover {
  border-color: rgba(0, 194, 255, 0.36);
  background: rgba(0, 194, 255, 0.1);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 194, 255, 0.4) transparent;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.chat-msg .msg-text {
  unicode-bidi: plaintext;
}
/* "x joined" system lines */
.chat-system {
  font-size: 11.5px;
  font-style: italic;
  color: var(--text-dim);
  opacity: 0.75;
  text-align: center;
  letter-spacing: 0.2px;
}
.chat-messages::-webkit-scrollbar {
  width: 5px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 194, 255, 0.35);
  border-radius: 10px;
}

.chat-msg {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
  animation: fade-in 0.35s ease;
  word-break: break-word;
}
.chat-msg .username {
  font-weight: 700;
}
.chat-msg .colon {
  color: var(--text-dim);
  margin-right: 2px;
}

/* "X is typing..." indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 7px;
  opacity: 0.85;
  font-style: italic;
  color: var(--text-dim);
}
.chat-typing .username {
  font-style: normal;
}
.typing-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 0.9; }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-lock-notice {
  flex-shrink: 0;
  padding: 10px 14px;
  border-top: 1px solid rgba(129, 184, 255, 0.12);
  background: rgba(247, 201, 72, 0.08);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}
.chat-lock-notice[hidden] {
  display: none;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(129, 184, 255, 0.12);
  flex-shrink: 0;
}
.chat-input-row input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(129, 184, 255, 0.18);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 16px;
  padding: 10px 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s ease;
  min-width: 0;
}
.chat-input-row input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.12);
}
.chat-input-row input::placeholder {
  color: var(--text-dim);
}
.chat-card.collapsed {
  height: auto;
}
.chat-card.collapsed .chat-messages,
.chat-card.collapsed .chat-input-row,
.chat-card.collapsed .chat-lock-notice {
  display: none;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  margin-top: 22px;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
  padding: 0 12px 8px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* =========================================================
   MODALS
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 12%, rgba(0, 194, 255, 0.14), transparent 36%),
    rgba(1, 4, 12, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 0;
  animation: fade-in 0.25s ease;
}
.modal-overlay.active {
  display: flex;
}

.modal-card {
  background:
    linear-gradient(145deg, rgba(13, 30, 58, 0.9), rgba(3, 9, 21, 0.94)),
    url("assets/wcParticles.jpg") center / cover no-repeat;
  border: 1px solid rgba(129, 184, 255, 0.24);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.66), 0 0 34px rgba(0, 194, 255, 0.12);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 12px 28px 18px;
  position: relative;
  animation: slide-up 0.32s cubic-bezier(0.22, 1, 0.36, 1);

  /* Subtle, dark scrollbar (Firefox) */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 212, 255, 0.35) rgba(255, 255, 255, 0.04);
}

/* Subtle, dark scrollbar (Chrome / Edge / Safari) */
.modal-card::-webkit-scrollbar {
  width: 6px;
}
.modal-card::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}
.modal-card::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.35);
  border-radius: 999px;
}
.modal-card::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.55);
}

@keyframes slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(129, 184, 255, 0.24);
  background: rgba(10, 18, 34, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 5;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
  padding-right: 30px;
  color: #ffffff;
  text-shadow: 0 0 22px rgba(0, 194, 255, 0.18);
}
.modal-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.5;
}

/* ---------- Match list ---------- */
.match-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.match-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(0, 194, 255, 0.045));
  border: 1px solid rgba(129, 184, 255, 0.18);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.match-card:hover {
  border-color: rgba(0, 194, 255, 0.44);
  background: rgba(0, 194, 255, 0.08);
}

.match-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.match-teams {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.match-meta {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  opacity: 0.85;
}
.match-time {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}
.match-tag {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 4px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}
.tag-today {
  background: rgba(0, 194, 255, 0.14);
  color: var(--cyan);
  border: 1px solid rgba(0, 194, 255, 0.34);
}
.tag-soon {
  background: rgba(247, 201, 72, 0.16);
  color: var(--gold);
  border: 1px solid rgba(247, 201, 72, 0.34);
}
.tag-live {
  background: rgba(57, 255, 136, 0.15);
  color: var(--green);
  border: 1px solid rgba(57, 255, 136, 0.38);
  box-shadow: 0 0 16px rgba(57, 255, 136, 0.16);
}
.tag-ended {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-watch {
  background: linear-gradient(135deg, var(--red) 0%, var(--blue) 54%, var(--cyan) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 194, 255, 0.28);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn-watch:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(0, 194, 255, 0.38);
}
.btn-watch:active {
  transform: scale(0.97);
}

/* ---------- Loading modal ---------- */
.loading-modal {
  text-align: center;
  padding-top: 30px;
}

.loading-spinner {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 18px;
}
.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(0, 194, 255, 0.18);
  border-top-color: var(--cyan);
  animation: spin 1s linear infinite;
}
.spinner-img {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.85;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 22px 0 18px;
  text-align: left;
}
.loading-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-dim);
  transition: color 0.3s ease;
}
.loading-steps li .step-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  position: relative;
  transition: all 0.3s ease;
}
.loading-steps li.active {
  color: var(--text-main);
}
.loading-steps li.active .step-icon {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 194, 255, 0.5);
  animation: spin 1s linear infinite;
  border-top-color: transparent;
  border-right-color: transparent;
}
.loading-steps li.done {
  color: var(--green);
}
.loading-steps li.done .step-icon {
  border-color: var(--green);
  background: var(--green);
  animation: none;
}
.loading-steps li.done .step-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #07140d;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.loading-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.loading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), var(--blue), var(--cyan), var(--green));
  border-radius: 999px;
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(0, 194, 255, 0.6);
}

/* ---------- Final CTA modal ---------- */
.final-modal,
.username-modal {
  text-align: center;
  padding-top: 28px;
}
.final-modal {
  cursor: pointer;
}

.cta-urgency {
  margin: 4px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: default;
}
.cta-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 47, 84, 0.1);
  border: 1px solid rgba(255, 47, 84, 0.35);
}
.cta-timer-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}
.cta-timer-value {
  font: 800 26px/1 var(--font-display);
  color: var(--red);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.cta-social {
  font-size: 12.5px;
  color: var(--text-muted);
}
.cta-social #ctaUnlockedCount {
  color: var(--green);
  font-weight: 800;
}
@media (prefers-reduced-motion: reduce) {
  .cta-timer-value {
    animation: none;
  }
}

#finalCtaContinueBtn {
  animation: cta-pulse 2s ease-in-out infinite;
}
#finalCtaContinueBtn .cta-arrow {
  display: inline-block;
  animation: cta-arrow 2s ease-in-out infinite;
}
@keyframes cta-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 6px 24px rgba(0, 194, 255, 0.26), 0 0 18px rgba(255, 47, 84, 0.24);
  }
  50% {
    transform: scale(1.035);
    box-shadow: 0 6px 30px rgba(0, 194, 255, 0.5), 0 0 28px rgba(255, 47, 84, 0.4);
  }
}
@keyframes cta-arrow {
  0%, 100% {
    transform: translateX(0);
    opacity: 1;
  }
  50% {
    transform: translateX(5px);
    opacity: 0.55;
  }
}
@media (prefers-reduced-motion: reduce) {
  #finalCtaContinueBtn,
  #finalCtaContinueBtn .cta-arrow {
    animation: none;
  }
}
.final-modal .modal-title,
.username-modal .modal-title {
  padding-right: 0;
}

.username-input {
  width: 100%;
  min-height: 48px;
  margin: 4px 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(129, 184, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font: 600 16px var(--font-body);
  outline: none;
  padding: 0 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.username-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.12);
}
.username-input::placeholder {
  color: var(--text-dim);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 18px);
  z-index: 140;
  max-width: calc(100vw - 28px);
  border-radius: 999px;
  border: 1px solid rgba(129, 184, 255, 0.24);
  background: rgba(3, 9, 21, 0.92);
  color: var(--text-main);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.42), 0 0 24px rgba(0, 194, 255, 0.14);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  opacity: 0;
  padding: 12px 16px;
  pointer-events: none;
  text-align: center;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =========================================================
   DESKTOP / TABLET LAYOUT
   ========================================================= */
@media (min-width: 860px) {
  .container {
    padding: 24px 24px 40px;
  }

  .navbar {
    padding: 16px 24px;
  }
  .logo {
    width: 42px;
    height: 42px;
  }
  .brand {
    font-size: 20px;
  }
  .hero-title {
    font-size: 52px;
    letter-spacing: 3px;
  }
  .hero-subtitle {
    font-size: 16px;
    letter-spacing: 1.6px;
  }
  .navbar-right {
    gap: 12px;
  }
  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .main-grid {
    grid-template-columns: minmax(0, 1.72fr) minmax(0, 0.88fr);
    gap: 20px;
    align-items: start;
  }

  .player-card {
    aspect-ratio: 16 / 10;
  }
  .play-btn {
    width: 88px;
    height: 88px;
  }

  .info-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
  }

  .chat-card {
    height: 620px;
  }

  .modal-overlay {
    align-items: center;
  }
  .modal-card {
    border-radius: var(--radius-lg);
    max-width: 540px;
  }
}

@media (max-width: 859px) {
  .btn-desktop {
    display: none;
  }
  /* Respect notches / rounded corners and home indicator */
  .container {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .toast {
    top: 18px;
    bottom: auto;
    transform: translate(-50%, -18px);
  }
  #finalCtaOverlay {
    align-items: center;
  }
  #finalCtaOverlay .modal-card {
    border-radius: var(--radius-lg);
  }
  .navbar {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 12px;
  }
  .navbar-left {
    flex: 1 1 100%;
    width: 100%;
  }
  .navbar-right {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .navbar-right .btn {
    width: 100%;
    min-width: 0;
    padding: 9px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .badge {
    justify-content: center;
    padding: 7px 10px;
  }
  .player-card {
    aspect-ratio: 16 / 12;
  }
  .player-badge {
    max-width: calc(100% - 92px);
    padding: 6px 9px;
  }
  .player-badge.top-right {
    max-width: 54px;
  }
  .player-center-content {
    padding: 0 14px 72px;
  }
  .hero-title {
    font-size: 30px;
  }
  .info-card h2 {
    font-size: 20px;
  }
  .viewers-count {
    font-size: 26px;
  }
  .chat-card {
    /* Adapt to the real viewport height (accounts for browser chrome) */
    height: clamp(340px, 58dvh, 560px);
  }
  .chat-header {
    padding: 12px 14px;
    gap: 8px;
  }
  /* Comfortable tap targets on touch screens */
  .chat-input-row .btn,
  .chat-send-btn {
    min-height: 44px;
  }
  .stat-button {
    min-height: 44px;
  }
  .chat-header h3,
  .chat-viewers {
    min-width: 0;
  }
  .chat-input-row {
    padding: 10px;
  }
  .chat-input-row .btn {
    padding-inline: 14px;
  }
  .modal-card {
    max-height: 90vh;
    padding: 20px 10px 24px 14px;
  }
  .match-card {
    align-items: stretch;
    flex-direction: column;
  }
  .match-info {
    width: 100%;
  }
  .match-teams {
    white-space: normal;
    overflow: visible;
  }
  .btn-watch {
    width: 100%;
    min-height: 44px;
  }
}

/* Small phones */
@media (max-width: 380px) {
  .container {
    padding: 8px 8px 22px;
  }
  .brand {
    font-size: 15px;
  }
  .welcome-text {
    display: none !important;
  }
  .navbar-right {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .play-btn {
    width: 70px;
    height: 70px;
  }
  .player-center-content {
    padding-bottom: 68px;
  }
  .hero-title {
    font-size: 27px;
    letter-spacing: 1px;
  }
  .hero-subtitle {
    font-size: 11px;
  }
  .player-stats {
    padding: 7px 4px;
  }
  .stat-icon {
    width: 18px;
    height: 18px;
  }
  .stat-text strong {
    font-size: 13px;
  }
  .stat-text small {
    font-size: 7px;
    letter-spacing: 0.2px;
  }
  .modal-title {
    font-size: 22px;
  }
  .toast {
    top: 12px;
  }
}
