.player-panel { container-type: inline-size; }
.generated-card-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(8px, 14px) minmax(0, 1fr);
  gap: clamp(18px, 3cqw, 48px);
  padding: clamp(36px, 6cqw, 104px) clamp(42px, 8cqw, 150px) clamp(62px, 10cqw, 150px);
  background:
    repeating-linear-gradient(90deg, transparent 0 70px, rgb(255 255 255 / 4%) 70px 72px),
    linear-gradient(125deg, #071d2b 0%, #0d3554 68%, #1769aa 100%);
  color: #ffffff;
  pointer-events: none;
}

.generated-card-layer[hidden] { display: none; }
.generated-card-accent { border-radius: 999px; background: #f2b544; }
.generated-card-copy { align-self: center; min-width: 0; }
.generated-card-copy > span {
  display: block;
  margin-bottom: clamp(12px, 2cqw, 28px);
  color: #f2cc7b;
  font-size: clamp(.72rem, 1.7cqw, 1.55rem);
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.generated-card-primary { display: flex; align-items: center; gap: clamp(20px, 4cqw, 68px); }
.generated-card-primary > strong {
  flex: 0 0 auto;
  font-size: clamp(4rem, 13cqw, 11rem);
  line-height: .8;
  letter-spacing: -.07em;
}
.generated-card-primary h3 {
  max-width: 15ch;
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1.8rem, 5cqw, 5rem);
  line-height: 1.02;
}
.generated-card-primary p {
  margin: clamp(8px, 1.3cqw, 22px) 0 0;
  color: #d9ebf5;
  font-size: clamp(.9rem, 2cqw, 2rem);
}
.generated-card-alert {
  display: inline-block;
  max-width: 80%;
  margin: clamp(18px, 3cqw, 38px) 0 0;
  padding: .55em .8em;
  border-left: 5px solid #f2b544;
  background: rgb(7 29 43 / 72%);
  font-size: clamp(.85rem, 1.8cqw, 1.7rem);
  font-weight: 700;
}
.generated-card-alert[hidden],
.generated-card-forecast[hidden] { display: none; }
.generated-card-forecast {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(6px, 1.3cqw, 20px);
  margin-top: clamp(20px, 3cqw, 46px);
}
.generated-card-forecast > div {
  min-width: 0;
  padding: clamp(8px, 1.4cqw, 22px);
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 8px;
  background: rgb(7 29 43 / 58%);
}
.generated-card-layer[data-template="weather-outlook"] .generated-card-forecast {
  gap: clamp(5px, 1cqw, 14px);
  margin-top: clamp(10px, 1.5cqw, 20px);
}
.generated-card-layer[data-template="weather-outlook"] .generated-card-forecast > div {
  padding: clamp(6px, 1cqw, 12px);
}
.generated-card-forecast strong,
.generated-card-forecast span,
.generated-card-forecast small { display: block; }
.generated-card-forecast strong { color: #f2cc7b; font-size: clamp(.7rem, 1.3cqw, 1.2rem); text-transform: uppercase; }
.generated-card-forecast span { margin-top: .45em; font-size: clamp(.65rem, 1.2cqw, 1.1rem); }
.generated-card-forecast small { margin-top: .45em; color: #d9ebf5; font-size: clamp(.58rem, 1cqw, .95rem); }
.generated-card-brand {
  position: absolute;
  right: clamp(42px, 8cqw, 150px);
  bottom: clamp(62px, 9cqw, 118px);
  display: flex;
  gap: 12px;
  align-items: baseline;
  color: #d9ebf5;
  font-size: clamp(.65rem, 1.2cqw, 1.1rem);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.generated-card-brand strong { color: #ffffff; font-size: 1.3em; }

.channel-crawl {
  position: absolute;
  right: clamp(8px, 1.5%, 28px);
  bottom: clamp(12px, 2%, 22px);
  left: clamp(8px, 1.5%, 28px);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5cqw, 24px);
  overflow: hidden;
  min-height: clamp(26px, 6%, 58px);
  padding: clamp(5px, .8cqw, 12px) clamp(10px, 2.4cqw, 44px);
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 3px;
  background: linear-gradient(90deg, rgb(3 10 18 / 86%), rgb(3 10 18 / 76%));
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: clamp(.68rem, 1.25cqw, 1.5rem);
  font-weight: 700;
  text-shadow: 0 2px 8px rgb(0 0 0 / 78%);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.channel-crawl[hidden] { display: none; }

.channel-crawl-brand,
.channel-crawl-clock { flex: 0 0 auto; }
.channel-crawl-brand { color: #f2b544; font-weight: 900; }
.channel-crawl-clock { color: #ffffff; font-weight: 900; }
.channel-crawl-mask { position: relative; min-width: 0; height: 1.2em; flex: 1 1 auto; overflow: hidden; }
.channel-crawl-mask span {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-block;
  min-width: 100%;
  animation: coytv-crawl 32s linear infinite;
  line-height: 1.2;
  white-space: nowrap;
}
.player-panel.controls-active .channel-crawl {
  opacity: 0;
  transform: translateY(10px);
}
@keyframes coytv-crawl {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .channel-crawl-mask span { position: static; animation: none; }
  .channel-crawl { transition: none; }
}
@container (max-width: 44rem) {
  .generated-card-layer {
    grid-template-columns: 6px minmax(0, 1fr);
    gap: 10px;
    padding: 14px 18px 52px;
  }
  .generated-card-copy > span {
    margin-bottom: 5px;
    font-size: .48rem;
    letter-spacing: .14em;
  }
  .generated-card-primary { align-items: flex-start; }
  .generated-card-primary { gap: 10px; }
  .generated-card-primary > strong { font-size: clamp(2.3rem, 11cqw, 3rem); }
  .generated-card-primary h3 {
    max-width: 24ch;
    font-size: clamp(1.05rem, 4.5cqw, 1.3rem);
    line-height: .98;
  }
  .generated-card-primary p {
    margin-top: 4px;
    font-size: .62rem;
    line-height: 1.15;
  }
  .generated-card-alert {
    max-width: 100%;
    margin-top: 6px;
    padding: .35em .55em;
    font-size: .55rem;
  }
  .generated-card-forecast {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 7px;
  }
  .generated-card-forecast > div { padding: 4px; border-radius: 4px; }
  .generated-card-forecast strong { font-size: .43rem; }
  .generated-card-forecast span { margin-top: 2px; font-size: .43rem; line-height: 1.05; }
  .generated-card-forecast small { margin-top: 2px; font-size: .38rem; line-height: 1.05; }
  .generated-card-forecast > div:nth-child(n + 4) { display: none; }
  .generated-card-brand {
    right: 18px;
    bottom: 46px;
    gap: 5px;
    font-size: .44rem;
  }
  .channel-crawl {
    right: 8px;
    bottom: 8px;
    left: 8px;
    gap: 8px;
    min-height: 25px;
    padding: 5px 9px;
    font-size: .62rem;
  }
  .channel-crawl-clock { display: none; }
}

/* Only the local OBS source animates full-frame generated cards. */
.local-production .generated-card-accent { animation: local-card-breathe 12s ease-in-out infinite alternate; }
@keyframes local-card-breathe { from { opacity: .5; transform: translateX(-12px); } to { opacity: 1; transform: translateX(12px); } }
