/* streamball.top v2 — watch page (loads after base.css) */

.watch { padding-block: 18px 28px; }

.stream-container {
  --player-w: min(100%, 1060px, calc((100dvh - 320px) * 16 / 9));
  display: flex; flex-direction: column; align-items: center;
}
@media (max-width: 900px) and (orientation: landscape) {
  .stream-container { --player-w: min(100%, calc((100dvh - 90px) * 16 / 9)); }
}
@media (max-width: 760px) and (orientation: portrait) {
  .stream-container { --player-w: 100%; }
}

.stream-meta {
  width: var(--player-w);
  display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap;
  margin: 0 0 14px;
}
.stream-title {
  margin: 0; min-width: 0; flex: 1 1 260px;
  font: 700 clamp(1.25rem, 3.6vw, 2rem)/1.1 var(--font-display);
  letter-spacing: -.045em; text-wrap: balance;
}
@keyframes blink { 50% { opacity: .25; } }

.iframe-container {
  width: var(--player-w); aspect-ratio: 16 / 9; position: relative; overflow: hidden;
  background: #000; border-radius: 20px; border: 1px solid var(--line-strong);
}
iframe { display: block; width: 100%; height: 100%; border: none; }

.iframe-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.6); z-index: 40; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255,255,255,.15); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: spin 3s linear infinite !important; } }

/* ── Sources ──────────────────────────────────── */
.sources-panel { width: var(--player-w); margin-top: 26px; }
.sources-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 700 1.1rem/1 var(--font-display); letter-spacing: -.03em; }
.sources-count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--accent); font: 600 .8125rem var(--font-body); }
.sources-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.source-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 10px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s, background-color .15s, color .15s;
}
@media (hover: hover) { .source-row:hover { border-color: var(--accent); } }
.source-row.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.source-row.active .source-meta { color: rgba(3,19,10,.7); }
.source-row.active .source-badge { background: var(--accent-ink); color: var(--accent); border-color: var(--accent-ink); }
.source-name { font-weight: 700; font-size: .9375rem; white-space: nowrap; }
.source-meta { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; color: var(--muted); }
.source-badge { margin-left: auto; flex-shrink: 0; padding: 3px 10px; border-radius: 999px; font: 700 .6875rem var(--font-body); background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.source-badge.is-sd { background: transparent; color: var(--muted); border-color: var(--line-strong); }

@media (max-width: 480px) { .stream-meta { flex-direction: column; align-items: flex-start; } .stream-title { flex: none; } }

/* ── Phones: compact watch layout ─────────────── */
@media (max-width: 559px) {
  .watch { padding-block: 10px 20px; }
  .stream-meta { margin: 0 0 8px; gap: 6px 10px; }
  .stream-title { font-size: 1.05rem; letter-spacing: -.03em; line-height: 1.12; }
  .iframe-container { border-radius: 14px; }
  .sources-panel { margin-top: 14px; }
  .sources-title { font-size: .95rem; margin: 0 0 8px; gap: 8px; }
  .sources-count { min-width: 22px; height: 22px; padding: 0 7px; font-size: .75rem; }
  .sources-list { gap: 8px; }
  .source-row { min-height: 44px; padding: 7px 14px; gap: 8px; }
  .source-name { font-size: .8375rem; }
  .source-meta { font-size: .75rem; }
}
