/*
 * FootClaw — Components
 * Cards, buttons, badges, pills
 */

/* ====== Card ====== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02) 0%,
    transparent 30%
  );
  backdrop-filter: blur(8px);
  padding: var(--space-6);
  transition: all var(--duration-default) var(--easing-default);
}

.card:hover {
  border-color: var(--border-strong);
  background-color: var(--bg-hover);
  transform: translateY(-2px);
}

/* ====== Hero Panel ====== */
.hero-panel {
  position: relative;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card), var(--glow-brand);
  overflow: hidden;
  padding: var(--space-16) var(--space-8);
}

.hero-panel::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 200%;
  background: radial-gradient(circle, var(--brand-primary-soft) 0%, transparent 60%);
  pointer-events: none;
}

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  border: 1px solid transparent;
  transition: all var(--duration-fast) var(--easing-default);
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  box-shadow: 0 0 16px rgba(220, 38, 38, 0.3);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-default);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

/* ====== Team logo / player avatar (SofaScore CDN via /img/sofa/) ====== */
.fc-team-logo {
  display: inline-block;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  padding: 1px;
}
.fc-player-avatar {
  display: inline-block;
  object-fit: cover;
  vertical-align: middle;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
}

/* ====== LIVE badge ====== */
.badge-live {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: var(--danger);
  color: white;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  letter-spacing: 0.04em;
}

.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
  animation: pulse 1.5s infinite;
}

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

/* ====== Tag / Chip ====== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag-brand {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
}

/* ====== Tier pills (rank/percentile) ====== */
.tier {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  color: black;
}

.tier-S { background: var(--tier-s); }
.tier-A { background: var(--tier-a); }
.tier-B { background: var(--tier-b); }
.tier-C { background: var(--tier-c); }
.tier-D { background: var(--tier-d); color: white; }

/* ====== Stat block ====== */
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--font-black);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text-primary);
}

.stat-value-sm {
  font-size: var(--text-2xl);
}

/* ====== Wordmark (logo placeholder) ====== */
.wordmark {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--font-black);
  letter-spacing: -0.04em;
  color: var(--brand-primary);
  text-transform: lowercase;
}

.wordmark::before {
  content: '◣';
  display: inline-block;
  margin-right: 4px;
  color: var(--brand-primary);
  transform: scaleX(-1);
}

/* ====== Odds badge injected on match rows ====== */
.odds-badge {
  display: inline-flex;
  gap: 4px;
  margin-left: var(--space-3);
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--font-semibold);
  flex-shrink: 0;
}

.odds-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-base);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.odds-cell.odds-h { color: var(--success); border-color: rgba(16,185,129,0.25); background: rgba(16,185,129,0.05); }
.odds-cell.odds-d { color: var(--warning); border-color: rgba(245,158,11,0.25); background: rgba(245,158,11,0.05); }
.odds-cell.odds-a { color: var(--brand-primary); border-color: rgba(220,38,38,0.25); background: rgba(220,38,38,0.05); }

@media (max-width: 768px) {
  .odds-badge { display: none; }  /* save space on mobile */
}

/* ====== Floating Favourites button ====== */
.fc-fav-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  transition: all 200ms ease;
}

.fc-fav-btn:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 24px rgba(220,38,38,0.3);
}

.fc-fav-btn.active {
  background: rgba(220,38,38,0.10);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.fc-fav-icon {
  font-size: 16px;
  line-height: 1;
}

@media (max-width: 640px) {
  .fc-fav-btn { padding: 10px 14px; bottom: 16px; right: 16px; }
  .fc-fav-text { display: none; }
}

/* ====== Related links widget (internal linking + SEO) ====== */
.fc-related {
  margin: var(--space-8) 0;
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-default);
}
.fc-related-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-4);
}
.fc-related-head h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0;
}
.fc-related-all { font-size: 13px; font-weight: 700; color: var(--brand-primary); }
.fc-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.fc-related-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 150ms;
}
.fc-related-card:hover {
  border-color: var(--brand-primary);
  background: var(--bg-hover);
  transform: translateY(-1px);
}
.fc-related-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fc-related-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.fc-related-body strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.fc-related-body span {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* ====== Loading skeletons ====== */
.fc-skel {
  background: linear-gradient(
    90deg,
    var(--bg-hover) 0%,
    rgba(255, 255, 255, 0.06) 50%,
    var(--bg-hover) 100%
  );
  background-size: 200% 100%;
  animation: fc-skel-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
  display: inline-block;
}

@keyframes fc-skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.fc-skel-line {
  height: 14px;
  width: 100%;
  margin: 8px 0;
}
.fc-skel-h1 { height: 32px; width: 70%; margin: 12px 0; }
.fc-skel-h2 { height: 22px; width: 50%; margin: 10px 0; }
.fc-skel-card {
  display: block;
  height: 120px;
  width: 100%;
  margin: 12px 0;
  border-radius: var(--radius-lg);
}
.fc-skel-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.fc-loading-shell {
  padding: var(--space-8) var(--space-4);
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
}

.fc-loading-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(90deg, var(--brand-primary-soft), transparent);
  border: 1px solid rgba(220, 38, 38, 0.30);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.fc-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--brand-primary-soft);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: fc-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes fc-spin {
  to { transform: rotate(360deg); }
}

/* ====== Live scoreboard strip (above ticker) ====== */
.live-strip {
  position: sticky;
  top: 72px;
  z-index: 41;
  display: flex;
  align-items: stretch;
  height: 36px;
  background: rgba(8, 8, 10, 0.97);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(220, 38, 38, 0.20);
  overflow: hidden;
}

.live-strip[hidden] { display: none; }

.live-strip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.40), rgba(220, 38, 38, 0.15));
  border-right: 1px solid rgba(220, 38, 38, 0.40);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.10em;
  color: white;
  flex-shrink: 0;
}
.live-strip-label .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
  animation: pulse 1.5s infinite;
}

.live-strip-track {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.live-strip-track::-webkit-scrollbar { display: none; }

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background-color 100ms;
}
.live-chip:hover { background: rgba(220, 38, 38, 0.08); color: var(--text-primary); }

.live-chip-min {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 2px;
}
.live-chip-score {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
  padding: 0 4px;
}
.live-chip-name { color: var(--text-secondary); }
.live-chip img { opacity: 0.9; }

@media (max-width: 768px) {
  .live-strip { display: none !important; }
}

/* B86.11: live-strip merged into ticker — no offset needed. */

/* ====== Live ticker — sticky thin strip under header ====== */
.ticker-bar {
  position: sticky;
  top: 72px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0;
  height: 38px;
  /* B86.11 (2026-05-26): one red atmosphere zone per screen (redesign fix B).
     Was: red-gradient edges + red border-bottom doubled the brand-red
     surfaces under the header. Now: neutral dark base, brand red lives
     only in the LIVE dot inside chip items + hero bloom on home. */
  background: rgba(12, 12, 14, 0.97);
  border-bottom: 1px solid var(--border-default);
  border-top: 1px solid var(--border-strong);
  overflow: hidden;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.ticker-pause {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--bg-surface);
  border: none;
  border-right: 1px solid var(--border-default);
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-fast);
}

.ticker-pause:hover { color: var(--brand-primary); }
.ticker-pause[aria-pressed="true"] svg path,
.ticker-pause[aria-pressed="true"] svg rect { display: none; }
.ticker-pause[aria-pressed="true"]::after {
  content: '▶';
  font-size: 10px;
}

.ticker-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-width: 0;
}

.ticker-viewport::before,
.ticker-viewport::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  z-index: 2;
  pointer-events: none;
}
.ticker-viewport::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-base), transparent);
}
.ticker-viewport::after {
  right: 0;
  background: linear-gradient(-90deg, var(--bg-base), transparent);
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  will-change: transform;
}

.ticker-item.ticker-fact {
  color: var(--info);
  font-weight: var(--font-medium);
}

.ticker-loading {
  padding: 0 var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 var(--space-5);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  border-right: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.ticker-item:hover { color: var(--text-primary); }

.ticker-item.ticker-live {
  color: var(--danger);
  font-weight: var(--font-bold);
}

.ticker-item.ticker-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.5s infinite;
  margin-right: 4px;
}

.ticker-item.ticker-brand {
  color: var(--brand-primary);
  font-weight: var(--font-semibold);
}

.ticker-item.ticker-muted { color: var(--text-tertiary); }

@media (max-width: 768px) {
  .ticker-bar { top: 64px; }
}

/* ====== Cookie banner — compact bottom-strip ====== */
.cookie-banner {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  box-shadow: var(--shadow-modal);
  padding: 8px 16px 8px 20px;
  max-width: calc(100vw - 24px);
}

.cookie-banner-content {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.cookie-banner-icon { font-size: 18px; }

.cookie-banner-text {
  font-size: var(--text-xs);
  line-height: 1.4;
  margin: 0;
  color: var(--text-secondary);
  white-space: nowrap;
}

.cookie-banner-text strong {
  color: var(--text-primary);
  font-weight: var(--font-bold);
}

.cookie-banner-text a {
  color: var(--brand-primary);
  text-decoration: underline;
  margin-left: 4px;
}

.cookie-banner-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: var(--font-semibold);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--duration-fast);
}

.cookie-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.cookie-btn-ghost:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.cookie-btn-primary {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}

.cookie-btn-primary:hover { background: var(--brand-primary-hover); }

/* Push body content above the banner when banner is shown */
body.has-cookie-banner { padding-bottom: 76px; }

@media (max-width: 768px) {
  .cookie-banner {
    bottom: 8px;
    border-radius: var(--radius-lg);
    padding: 12px 14px;
  }
  .cookie-banner-content {
    flex-wrap: wrap;
    gap: var(--space-3);
  }
  .cookie-banner-text { white-space: normal; flex: 1; }
  .cookie-banner-actions { width: 100%; justify-content: flex-end; }
}
