/* Hot chip on series cards */
.series-card-chip-hot {
  background: linear-gradient(135deg, #ff5722, #e64a19);
  color: #fff;
  border: none;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 4px rgba(230, 74, 25, 0.35);
  animation: discovery-hot-pulse 2.4s ease-in-out infinite;
}

@keyframes discovery-hot-pulse {
  0%, 100% { box-shadow: 0 1px 4px rgba(230, 74, 25, 0.35); }
  50%      { box-shadow: 0 1px 10px rgba(255, 87, 34, 0.7); }
}

/* Trending rail rank badge overlay */
.discovery-rail .rec-wall-poster {
  position: relative;
}

.discovery-rank {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  background: rgba(20, 20, 28, 0.85);
  color: #ffd54f;
  font-weight: 700;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}

/* Decade heatmap */
.discovery-decades {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--site-border, #d8dde7);
  border-radius: 10px;
  background: var(--site-surface, #fff);
}

.discovery-decades-label {
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--site-muted, #6b7280);
  margin-bottom: 8px;
}

.discovery-decade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 6px;
}

.discovery-decade-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 6px;
  border-radius: 8px;
  text-decoration: none;
  color: #1f2937;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.discovery-decade-cell:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.discovery-decade-cell.is-active {
  outline: 2px solid #1976d2;
  outline-offset: -2px;
}

.discovery-decade-label { font-size: 14px; }
.discovery-decade-count { font-size: 11px; opacity: 0.75; font-weight: 500; }

.discovery-decade-l1 { background: #e3f2fd; }
.discovery-decade-l2 { background: #bbdefb; }
.discovery-decade-l3 { background: #64b5f6; color: #fff; }
.discovery-decade-l4 { background: #1e88e5; color: #fff; }
.discovery-decade-l5 { background: #0d47a1; color: #fff; }

/* Theme-aware overrides where supported */
[data-site-theme='midnight'] .discovery-decade-l1 { background: #1f2937; color: #cbd5e1; }
[data-site-theme='midnight'] .discovery-decade-l2 { background: #334155; color: #e2e8f0; }
[data-site-theme='midnight'] .discovery-decade-l3 { background: #1e40af; color: #fff; }
[data-site-theme='midnight'] .discovery-decade-l4 { background: #1d4ed8; color: #fff; }
[data-site-theme='midnight'] .discovery-decade-l5 { background: #2563eb; color: #fff; }

/* ---- Pocket Binges ---- */
.pocket-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 2px 0;
}

.pocket-size {
  font-weight: 700;
  color: var(--theme-accent);
}

.pocket-detail {
  font-size: 12px;
  color: var(--theme-muted);
}

.pocket-meter {
  display: block;
  width: 100%;
  max-width: 220px;
  height: 5px;
  margin: 4px 0 2px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--theme-surface-deep);
}

.pocket-meter span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--theme-accent);
}

.pocket-count {
  margin: 2px 2px 8px;
}

.pocket-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: Calibri, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--theme-text-soft);
  text-decoration: none;
}

.pocket-toggle-track {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: var(--theme-border-strong);
  transition: background 0.2s;
}

.pocket-toggle-track span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--theme-surface);
  transition: transform 0.2s;
}

.pocket-toggle.is-on .pocket-toggle-track {
  background: var(--theme-accent);
}

.pocket-toggle.is-on .pocket-toggle-track span {
  transform: translateX(14px);
}

/* ---- Genre Mashup ---- */
.mashup-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin: 10px 0;
}

.mashup-pick {
  display: flex;
  flex: 1 1 130px;
  flex-direction: column;
  gap: 4px;
  font-family: Calibri, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--theme-muted);
}

.mashup-pick .browse-sort-select {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
}

.mashup-swap {
  align-self: center;
  margin-top: 16px;
  font-size: 20px;
  font-weight: 700;
  color: var(--theme-accent);
  text-decoration: none;
}

.mashup-go {
  padding: 8px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--theme-accent);
  color: var(--theme-on-accent);
  font-family: Calibri, sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.mashup-go:hover {
  background: var(--theme-accent-hover);
}

.mashup-venn {
  max-width: 380px;
  margin: 6px auto 10px;
}

.mashup-venn svg {
  display: block;
  width: 100%;
  height: auto;
}

.mashup-venn-a,
.mashup-venn-b {
  fill: var(--theme-accent);
  fill-opacity: 0.16;
  stroke: var(--theme-accent);
  stroke-width: 1.5;
}

.mashup-venn-b {
  fill: var(--theme-text-soft);
  fill-opacity: 0.12;
  stroke: var(--theme-text-soft);
}

.mashup-venn-name {
  fill: var(--theme-muted);
  font-family: Calibri, sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.mashup-venn-count {
  fill: var(--theme-text);
  font-family: Calibri, sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.mashup-venn-both {
  fill: var(--theme-accent);
  font-family: Calibri, sans-serif;
  font-size: 26px;
  font-weight: 800;
}

.mashup-pill-count {
  margin-left: 2px;
  font-size: 11px;
  opacity: 0.7;
}

.mashup-more {
  border-style: dashed;
}

/* ---- TV Roulette ---- */
.roulette {
  margin: 10px 0 16px;
}

.roulette-form {
  padding: 12px;
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  background: var(--theme-panel-gradient);
}

.roulette-dials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.roulette-dial {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roulette-dial-label {
  font-family: Calibri, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--theme-muted);
}

.roulette-dial-select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--theme-border-strong);
  border-radius: 8px;
  background: var(--theme-surface);
  color: var(--theme-text);
  font-family: Calibri, sans-serif;
  font-size: 15px;
  font-weight: 600;
}

.roulette-dial-select:focus {
  outline: none;
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 2px var(--theme-focus);
}

.roulette-spin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--theme-accent);
  color: var(--theme-on-accent);
  font-family: Calibri, sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--theme-accent) 30%, transparent);
}

.roulette-spin-btn:hover {
  background: var(--theme-accent-hover);
}

.roulette-spin-btn:disabled {
  cursor: progress;
  opacity: 0.85;
}

.roulette-die {
  display: inline-block;
  font-size: 22px;
}

.roulette-spin-btn.is-spinning .roulette-die {
  animation: roulette-roll 0.5s linear infinite;
}

@keyframes roulette-roll {
  to { transform: rotate(360deg); }
}

.roulette-stage {
  margin-top: 12px;
  min-height: 160px;
}

.roulette-stage.is-loading {
  opacity: 0.5;
}

.roulette-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 160px;
  border: 2px dashed var(--theme-border);
  border-radius: 12px;
  font-family: Calibri, sans-serif;
  color: var(--theme-muted);
}

.roulette-placeholder-icon {
  font-size: 34px;
}

.roulette-reel {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 260px;
  border-radius: 12px;
  background: var(--theme-surface-deep);
  overflow: hidden;
}

.roulette-reel img {
  height: 230px;
  max-width: 70%;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 16px var(--theme-shadow);
  transform: translateY(0);
  transition: transform 0.06s;
}

.roulette-reel.is-flip img {
  transform: translateY(-6px);
}

.roulette-card {
  display: flex;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--theme-border);
  border-left: 4px solid var(--theme-accent);
  border-radius: 12px;
  background: var(--theme-surface);
  box-shadow: 0 2px 10px var(--theme-shadow);
}

.roulette-card.is-revealed {
  animation: roulette-reveal 0.35s ease-out;
}

@keyframes roulette-reveal {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.roulette-card-empty {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.roulette-poster {
  flex: 0 0 150px;
}

.roulette-poster img {
  display: block;
  width: 150px;
  border-radius: 8px;
  background: var(--theme-surface-deep);
}

.roulette-body {
  flex: 1;
  min-width: 0;
  font-family: Calibri, sans-serif;
}

.roulette-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--theme-accent);
}

.roulette-title {
  margin: 2px 0 6px;
  font-size: 22px;
  line-height: 1.2;
}

.roulette-title a {
  color: var(--theme-text);
  text-decoration: none;
}

.roulette-genres,
.roulette-facts,
.roulette-odds {
  margin-top: 4px;
  font-size: 13px;
  color: var(--theme-muted);
}

.roulette-facts {
  font-weight: 700;
  color: var(--theme-text-soft);
}

.roulette-plot {
  margin: 8px 0 4px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--theme-text-soft);
}

.roulette-match {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--theme-accent-soft);
  color: var(--theme-accent);
  font-size: 12px;
  font-weight: 700;
}

.roulette-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.roulette-action {
  padding: 7px 12px;
  border: 1px solid var(--theme-border-strong);
  border-radius: 8px;
  color: var(--theme-text-soft);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.roulette-action:hover {
  border-color: var(--theme-accent);
  color: var(--theme-accent);
}

.roulette-action-primary {
  border-color: var(--theme-accent);
  background: var(--theme-accent);
  color: var(--theme-on-accent);
}

.roulette-action-primary:hover {
  background: var(--theme-accent-hover);
  color: var(--theme-on-accent);
}

@media (max-width: 520px) {
  .roulette-card {
    flex-direction: column;
  }

  .roulette-poster {
    flex-basis: auto;
    align-self: center;
  }

  .roulette-poster img {
    width: 170px;
  }

  .roulette-dials {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .roulette-card.is-revealed,
  .roulette-spin-btn.is-spinning .roulette-die {
    animation: none;
  }
}
