:root {
  --wc-bg: #050508;
  --wc-surface: #0c0c14;
  --wc-card: rgba(255, 255, 255, 0.03);
  --wc-border: rgba(255, 255, 255, 0.07);
  --wc-gold: #e8c547;
  --wc-gold-dim: #a68b2a;
  --wc-emerald: #22c55e;
  --wc-indigo: #6366f1;
  --wc-text: #f1f5f9;
  --wc-muted: #64748b;
}

* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }
html { scroll-behavior: auto; }
body { background: var(--wc-bg); color: var(--wc-text); overflow-x: hidden; padding-bottom: env(safe-area-inset-bottom, 0); -webkit-overflow-scrolling: touch; }
.safe-top { padding-top: env(safe-area-inset-top, 0); }
.pb-safe { padding-bottom: max(1rem, env(safe-area-inset-bottom, 0)); }

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

/* Ambient */
.ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% -20%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 20%, rgba(34, 197, 94, 0.06), transparent),
    radial-gradient(ellipse 40% 30% at 0% 60%, rgba(232, 197, 71, 0.04), transparent);
}

.ambient-blur {
  position: fixed; top: -30rem; right: -20rem; width: 40rem; height: 40rem;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(34,197,94,0.08));
  filter: blur(100px); transform: rotate(-15deg); pointer-events: none; z-index: 0;
}

/* Glass */
.panel {
  background: var(--wc-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--wc-border);
  border-radius: 20px;
}

.panel-strong {
  background: rgba(8, 8, 16, 0.85);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-bottom: 1px solid var(--wc-border);
}

/* Typography */
.text-gold {
  background: linear-gradient(135deg, #fff8e0 0%, var(--wc-gold) 45%, var(--wc-gold-dim) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.75rem 1.5rem; border-radius: 12px;
  background: var(--wc-emerald); color: #041208; font-weight: 600; font-size: 0.875rem;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s; cursor: pointer; border: none;
  touch-action: manipulation; text-decoration: none;
}
.btn-primary:active { transform: scale(0.98); background: #1fb855; }
@media (hover: hover) {
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 32px rgba(34,197,94,0.25); background: #2dd96a; }
}

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.75rem 1.25rem; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--wc-border); color: var(--wc-text);
  font-weight: 500; font-size: 0.875rem; transition: all 0.2s; cursor: pointer;
  touch-action: manipulation; text-decoration: none;
}
.btn-ghost:active { background: rgba(99,102,241,0.12); }
@media (hover: hover) {
  .btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(99,102,241,0.3); }
}

/* Nav */
.nav-link {
  position: relative; color: var(--wc-muted); font-size: 0.875rem; font-weight: 500;
  padding: 0.625rem 0.25rem; transition: color 0.2s; min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  touch-action: manipulation; text-decoration: none;
}
.nav-link:active { color: var(--wc-text); }
@media (hover: hover) {
  .nav-link:hover, .nav-link.active { color: var(--wc-text); }
}
.nav-link.active { color: var(--wc-text); }
.nav-link.active::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--wc-emerald); border-radius: 2px;
}

/* Match cards */
.fixture-card {
  position: relative; overflow: hidden; cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1), border-color 0.25s, box-shadow 0.25s;
  border-radius: 20px; border: 1px solid var(--wc-border); min-height: 44px;
  touch-action: manipulation;
}
.fixture-card:active { transform: scale(0.99); border-color: rgba(99,102,241,0.35); }
@media (hover: hover) {
  .fixture-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99,102,241,0.35);
    box-shadow: 0 24px 48px rgba(0,0,0,0.45), 0 0 0 1px rgba(99,102,241,0.1);
  }
}
.fixture-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(99,102,241,0.08) 0%, transparent 50%);
  pointer-events: none;
}

/* Live pulse */
.live-dot { animation: live-pulse 2s ease-in-out infinite; }
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

/* Countdown */
.cd-box {
  font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,0.5); border: 1px solid var(--wc-border);
  border-radius: 10px; padding: 0.35rem 0.6rem; font-weight: 700; min-width: 2.4rem; text-align: center;
}

/* Calendar — mobile-first */
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--wc-border); border-radius: 12px; overflow: hidden;
}
@media (min-width: 768px) { .cal-grid { border-radius: 16px; } }

.cal-head {
  background: rgba(255,255,255,0.02); padding: 0.5rem 0;
  text-align: center; font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.06em; color: var(--wc-muted); text-transform: uppercase;
}
@media (min-width: 768px) {
  .cal-head { padding: 0.75rem 0; font-size: 0.7rem; letter-spacing: 0.08em; }
}

.cal-day {
  background: var(--wc-surface);
  min-height: 48px; min-width: 0;
  padding: 0.35rem 0.25rem;
  cursor: pointer; transition: background 0.15s; position: relative;
  border: none; color: inherit; font: inherit; text-align: left;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
@media (min-width: 768px) {
  .cal-day { min-height: 110px; padding: 0.65rem; }
}
.cal-day:active { background: rgba(99,102,241,0.14); }
@media (hover: hover) { .cal-day:hover { background: rgba(99,102,241,0.06); } }

.cal-day.other { opacity: 0.35; }
.cal-day.today .cal-num { background: var(--wc-indigo); color: white; }
.cal-day.selected {
  background: rgba(99,102,241,0.12);
  outline: 2px solid rgba(99,102,241,0.45); outline-offset: -2px; z-index: 1;
}
.cal-day.has-matches .cal-num { font-weight: 700; }

.cal-num {
  width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 0.75rem; font-weight: 600; margin: 0 auto 0.2rem;
}
@media (min-width: 768px) {
  .cal-num { width: 1.75rem; height: 1.75rem; margin: 0 0 0.35rem; font-size: 0.8rem; }
}

/* Mobile: dots only. Desktop: event chips */
.cal-event { display: none; }
.cal-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; margin-top: 0.15rem; }
@media (min-width: 768px) {
  .cal-event {
    display: block; font-size: 0.65rem; line-height: 1.3; padding: 0.2rem 0.35rem; border-radius: 6px;
    background: rgba(34,197,94,0.12); color: #86efac; border-left: 2px solid var(--wc-emerald);
    margin-bottom: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .cal-event.live-ev { background: rgba(239,68,68,0.12); color: #fca5a5; border-left-color: #ef4444; }
  .cal-dots { display: none; }
}

.cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--wc-emerald); flex-shrink: 0; }
.cal-dot.live { background: #ef4444; }
.cal-more { font-size: 0.6rem; color: var(--wc-muted); text-align: center; margin-top: 0.15rem; }
@media (min-width: 768px) { .cal-more { font-size: 0.65rem; } }

.cal-nav-group {
  display: inline-flex; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--wc-border); box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.cal-nav-btn {
  min-height: 44px; min-width: 44px; padding: 0 1rem;
  background: rgba(255,255,255,0.03); color: var(--wc-text);
  border: none; border-right: 1px solid var(--wc-border);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s; touch-action: manipulation;
}
.cal-nav-btn:last-child { border-right: none; }
.cal-nav-btn:active { background: rgba(99,102,241,0.18); }
@media (hover: hover) { .cal-nav-btn:hover { background: rgba(99,102,241,0.1); } }
.cal-nav-mid { min-width: 4.75rem; font-size: 0.8rem; }

.cal-day-list { max-height: none; overflow: visible; }
@media (min-width: 1024px) {
  .cal-day-list {
    max-height: min(50vh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

#day-panel {
  scroll-margin-top: calc(3.75rem + env(safe-area-inset-top, 0px));
}

/* Calendar page — one scroll context on mobile, lighter glass */
.calendar-page main {
  touch-action: pan-y;
}
@media (max-width: 767px) {
  .calendar-page .panel,
  .calendar-page .panel-strong {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 10, 18, 0.97);
  }
  .calendar-page .ambient-blur {
    display: none;
  }
}

.day-event {
  min-height: 44px; position: relative; padding-left: 1.25rem !important;
  touch-action: manipulation;
}
.day-event::before {
  content: ''; position: absolute; left: 0.65rem; top: 0.85rem; bottom: 0.85rem;
  width: 3px; border-radius: 999px; background: var(--wc-emerald);
}
.day-event.live-accent::before { background: #ef4444; }

/* Player */
.player-shell {
  border-radius: 20px; overflow: hidden; background: #000;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.05);
  position: relative; aspect-ratio: 16/9;
}

/* Shimmer */
.shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.02) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 20px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Scroll snap row — vertical stack on mobile */
.fixture-list.snap-row { gap: 0.75rem; padding-bottom: 0.25rem; }
@media (max-width: 639px) {
  .fixture-list.snap-row {
    flex-direction: column;
    overflow-x: visible;
    scroll-snap-type: none;
  }
  .fixture-list.snap-row .fixture-card { width: 100% !important; max-width: 100%; }
}
@media (min-width: 640px) {
  .fixture-list.snap-row { gap: 1rem; padding-bottom: 0.5rem; }
}

.snap-row { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 0.5rem; }
.snap-row::-webkit-scrollbar { display: none; }
.snap-row > * { scroll-snap-align: start; flex-shrink: 0; }

/* Watch page mobile */
@media (max-width: 1023px) {
  .watch-layout { display: flex; flex-direction: column; }
  .player-shell { border-radius: 14px; }
  #streams-panel { position: sticky; bottom: 0; z-index: 20; margin-bottom: env(safe-area-inset-bottom, 0); }
}
.player-overlay .cd-box { font-size: 0.8rem; min-width: 2rem; padding: 0.3rem 0.45rem; }

/* Countdown — slightly larger tap targets on mobile */
@media (max-width: 639px) {
  .cd-box { padding: 0.4rem 0.5rem; font-size: 0.85rem; }
}

/* Stream pills */
.stream-pill {
  min-height: 48px; cursor: pointer; border-radius: 14px; padding: 0.85rem 1rem;
  border: 1px solid var(--wc-border); background: rgba(255,255,255,0.02);
  transition: all 0.2s; text-align: left; width: 100%;
  touch-action: manipulation;
}
.stream-pill:active { border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.08); }
@media (hover: hover) {
  .stream-pill:hover { border-color: rgba(99,102,241,0.4); background: rgba(99,102,241,0.06); }
}
.stream-pill.active { border-color: var(--wc-indigo); background: rgba(99,102,241,0.15); box-shadow: 0 0 24px rgba(99,102,241,0.15); }

.source-select {
  min-height: 40px; min-width: 9.5rem; padding: 0.45rem 2rem 0.45rem 0.75rem;
  border-radius: 10px; border: 1px solid var(--wc-border);
  background: rgba(255,255,255,0.04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center;
  color: #fff; font-size: 0.8rem; appearance: none; cursor: pointer;
}
.source-select:focus-visible { outline: 2px solid var(--wc-indigo); outline-offset: 2px; }

.lang-select {
  min-height: 36px; min-width: 3.5rem; padding: 0.35rem 1.75rem 0.35rem 0.55rem;
  border-radius: 10px; border: 1px solid var(--wc-border);
  background: rgba(255,255,255,0.04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.45rem center;
  color: #fff; font-size: 0.75rem; font-weight: 600; appearance: none; cursor: pointer;
}
.lang-select:focus-visible { outline: 2px solid var(--wc-indigo); outline-offset: 2px; }

/* Haiti slogan — visible only in HT (toggled via JS) */
.ht-slogan {
  display: none;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.55rem 1rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  border: 1px solid rgba(210, 16, 52, 0.35);
  background: linear-gradient(135deg, rgba(0, 40, 104, 0.35) 0%, rgba(210, 16, 52, 0.12) 55%, rgba(255, 255, 255, 0.04) 100%);
  box-shadow: 0 0 24px rgba(210, 16, 52, 0.12);
}
.ht-slogan--visible {
  display: inline-flex;
}
.ht-slogan--compact {
  margin-bottom: 0;
  padding: 0.4rem 0.65rem;
  gap: 0.35rem;
}
.ht-slogan--compact .ht-slogan__text {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}
.ht-slogan__flag {
  font-size: 1.15rem;
  line-height: 1;
}
.ht-slogan--compact .ht-slogan__flag,
.ht-slogan--compact .ht-slogan__fire {
  font-size: 0.95rem;
}
.ht-slogan__text {
  font-family: 'Barlow Condensed', system-ui, sans-serif;
  font-size: clamp(0.85rem, 3.5vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}
.ht-slogan__fire {
  font-size: 1rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(251, 146, 60, 0.5));
}

/* Ad slots — 300x250 native banner */
.ad-slot {
  width: 100%;
  max-width: min(100%, 300px);
  margin-inline: auto;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--wc-border);
  background: rgba(255,255,255,0.02);
  box-sizing: border-box;
}
.ad-slot--wide {
  max-width: 100%;
  width: 100%;
  padding-inline: 0;
  border: 0;
  background: transparent;
}
body.has-social-bar .ad-slot {
  margin-bottom: calc(var(--social-bar-height, 50px) + env(safe-area-inset-bottom, 0px) + 0.75rem);
}
.ad-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  text-align: center;
}
.ad-native-mount {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
  aspect-ratio: 300 / 250;
  min-height: 200px;
  overflow: visible;
  border-radius: 10px;
}
.ad-native-mount iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  border: 0;
  display: block;
}
.ad-native-mount:empty {
  background: rgba(255,255,255,0.03);
}
@media (max-width: 359px) {
  .ad-native-mount { min-height: calc((100vw - 2rem) * 250 / 300); }
}

/* Social bar — Adsterra injects fixed bottom UI on main document */
.adsterra-social-anchor {
  display: block;
  height: 0;
  overflow: visible;
  pointer-events: none;
}
body.has-social-bar {
  padding-bottom: calc(var(--social-bar-height, 80px) + env(safe-area-inset-bottom, 0px));
}
body.has-social-bar .ad-slot {
  margin-bottom: calc(var(--social-bar-height, 80px) + env(safe-area-inset-bottom, 0px) + 0.75rem);
}

/* Focus */
button:focus-visible, a:focus-visible, .fixture-card:focus-visible, .cal-day:focus-visible {
  outline: 2px solid var(--wc-indigo); outline-offset: 2px;
}
