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

:root {
  --bg-deep: #05060d;
  --bg-navy: #0b0e1a;
  --panel: rgba(22, 26, 46, 0.6);
  --panel-solid: #131729;
  --border: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.05);

  --cyan: #22d3ee;
  --purple: #8b5cf6;
  --green: #22c55e;
  --orange: #fbbf24;
  --pink: #f472b6;
  --blue: #60a5fa;

  --text-main: #f4f6fb;
  --text-muted: #8b93ab;
  --text-dim: #5b6280;

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --shadow-glow-cyan: 0 0 30px rgba(34, 211, 238, 0.25);
  --shadow-glow-purple: 0 0 30px rgba(139, 92, 246, 0.25);
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.45);

  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-display: 'Rajdhani', system-ui, -apple-system, 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 top, #131a33 0%, var(--bg-deep) 55%),
    var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 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(--purple);
  top: -150px;
  left: -150px;
}
.bg-glow-2 {
  width: 500px;
  height: 500px;
  background: var(--cyan);
  bottom: -200px;
  right: -150px;
  opacity: 0.18;
}

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

/* =========================================================
   NAVBAR
   ========================================================= */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  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(--purple), var(--cyan));
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
}
.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: luminosity;
  opacity: 0.9;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* ---------- 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;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.97);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple), #a78bfa);
  color: #fff;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.45);
}
.btn-primary:hover {
  box-shadow: 0 6px 26px rgba(139, 92, 246, 0.6);
  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(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.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 CARD
   ========================================================= */
.player-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  aspect-ratio: 16 / 11;
  background: #0a0c18;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5,6,13,0.55) 0%, rgba(5,6,13,0.35) 35%, rgba(5,6,13,0.85) 100%),
    radial-gradient(ellipse at center, rgba(20,15,45,0.1) 0%, rgba(5,6,13,0.6) 100%);
}

.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(10, 12, 24, 0.65);
  border: 1px solid var(--border);
  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(34, 211, 238, 0.3);
}

/* ---------- Play button ---------- */
.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: none;
  background: rgba(139, 92, 246, 0.85);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.6);
  animation: pulse-play 2s infinite;
  transition: transform 0.2s ease, background 0.2s ease;
  padding-left: 6px;
}
.play-btn:hover {
  background: rgba(139, 92, 246, 1);
  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(139, 92, 246, 0.55); }
  70% { box-shadow: 0 0 0 22px rgba(139, 92, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

/* ---------- 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 70px;
  z-index: 2;
  pointer-events: none;
}

.trophy-icon {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 10px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.35);
  opacity: 0.9;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 8vw, 52px);
  letter-spacing: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #b9c2d8 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-display);
  font-weight: 700;
  font-size: clamp(11px, 3vw, 16px);
  letter-spacing: 2px;
  color: var(--text-muted);
}
.hero-subtitle .us { color: var(--blue); }
.hero-subtitle .ca { color: #f87171; }
.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(4, 1fr);
  gap: 4px;
  padding: 10px 8px;
  background: rgba(8, 10, 20, 0.7);
  border-top: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
  z-index: 3;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.stat-icon {
  font-size: 16px;
  line-height: 1;
}
.stat-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat-text strong {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-display);
}
.stat-text small {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 1px;
}

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

.info-card, .viewers-card, .chat-card {
  background: var(--panel);
  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;
}
.info-card h2 {
  font-family: var(--font-display);
  font-size: clamp(18px, 5vw, 24px);
  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;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(34, 211, 238, 0.08));
  border-color: rgba(139, 92, 246, 0.25);
}
.viewers-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}
.viewers-count {
  font-family: var(--font-display);
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 800;
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.4);
}

/* =========================================================
   CHAT PANEL
   ========================================================= */
.chat-card {
  display: flex;
  flex-direction: column;
  height: 460px;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
  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-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.4) transparent;
}
.chat-messages::-webkit-scrollbar {
  width: 5px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 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;
}

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

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.chat-input-row input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  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(--purple);
}
.chat-input-row input::placeholder {
  color: var(--text-dim);
}

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

/* =========================================================
   MODALS
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 12, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  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: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.6);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 18px 28px;
  position: relative;
  animation: slide-up 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@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 var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.modal-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 6vw, 26px);
  font-weight: 800;
  margin-bottom: 6px;
  padding-right: 30px;
}
.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: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  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(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.07);
}

.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-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(34, 211, 238, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.3);
}
.tag-soon {
  background: rgba(251, 191, 36, 0.15);
  color: var(--orange);
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.tag-live {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-watch {
  background: linear-gradient(135deg, var(--purple), #a78bfa);
  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(139, 92, 246, 0.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn-watch:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(139, 92, 246, 0.55);
}
.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(139, 92, 246, 0.2);
  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(34, 211, 238, 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(--purple), var(--cyan));
  border-radius: 999px;
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
}

/* ---------- Fallback locker modal ---------- */
.fallback-modal {
  text-align: center;
  padding-top: 28px;
}
.fallback-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

/* =========================================================
   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;
  }
  .navbar-right {
    gap: 12px;
  }
  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .main-grid {
    grid-template-columns: 1.65fr 1fr;
    gap: 22px;
    align-items: start;
  }

  .player-card {
    aspect-ratio: 16 / 10;
  }

  .info-row {
    grid-template-columns: 1fr 240px;
  }

  .chat-card {
    height: calc(100% );
    min-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;
  }
}

/* Small phones */
@media (max-width: 380px) {
  .container {
    padding: 10px 10px 24px;
  }
  .brand {
    font-size: 15px;
  }
  .play-btn {
    width: 64px;
    height: 64px;
  }
  .trophy-icon {
    width: 44px;
    height: 44px;
  }
  .player-center-content {
    padding-bottom: 56px;
  }
}
