/* Playout V2 — one stylesheet for every club. Club colours come from --accent and --bar (set in _head.php). */

:root {
  --accent: #db0007;
  --bar: #151925;
  --bg-image: none;
  --panel: rgba(12, 14, 22, 0.72);
  --panel-solid: #141722;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f4f7;
  --muted: rgba(243, 244, 247, 0.62);
  --live: #ef3b3b;
  --ok: #2fbf71;
  --warn: #f5a524;
  --danger: #ef4444;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bar);
  position: relative;
}
/* The photo sits on its own fixed layer: iOS ignores background-attachment: fixed and would
   stretch the image over the whole page instead. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg-image) center / cover no-repeat;
  pointer-events: none;
}
@media (orientation: portrait) { body::after { background-position: var(--bg-focus, 50%) center; } }
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.35) 40%, rgba(0, 0, 0, 0.7));
  pointer-events: none;
}
body.is-admin::before { background: rgba(6, 8, 14, 0.86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
body.theatre::before { background: rgba(0, 0, 0, 0.94); }

a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent); text-underline-offset: 3px; }
a:hover { color: #fff; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
h1, h2, .brand-text strong, .feed-name, .stat-value, .feed-art-fallback { font-family: var(--font-heading, var(--font)); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 0.95rem; }
p { margin: 0; }
img { max-width: 100%; display: block; }
svg { width: 1em; height: 1em; fill: currentColor; flex-shrink: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.block { display: block; }
.right { margin-left: auto; text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 0.82rem; word-break: break-all; }
.mt { margin-top: 1.25rem; }
.text-warn { color: var(--warn); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; font-weight: 800; color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem clamp(1rem, 3vw, 2rem);
  padding-top: max(0.6rem, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bar) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; min-width: 0; margin-right: auto; }
.brand img { height: 38px; width: auto; max-width: 110px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--muted); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topnav { display: flex; gap: 0.25rem; flex-shrink: 0; }
.usermenu { flex-shrink: 0; }
.topnav a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.85rem; border-radius: 999px;
  text-decoration: none; font-weight: 700; font-size: 0.9rem; color: var(--muted);
}
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.topnav a.active { color: #fff; background: rgba(255, 255, 255, 0.1); }

.usermenu { position: relative; }
.usermenu summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem; border-radius: 999px;
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: rgba(255, 255, 255, 0.06); }
.usermenu-name { font-weight: 700; font-size: 0.9rem; }
.usermenu .chev { color: var(--muted); }
.usermenu-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 230px; padding: 0.4rem;
  background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.usermenu-head { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); margin-bottom: 0.3rem; }
.usermenu-head small { display: block; color: var(--muted); }
.usermenu-panel a, .usermenu-panel button {
  display: block; width: 100%; text-align: left;
  padding: 0.55rem 0.7rem; border-radius: 7px;
  background: none; border: 0; color: var(--text); font: inherit; text-decoration: none; cursor: pointer;
}
.usermenu-panel a:hover, .usermenu-panel button:hover { background: rgba(255, 255, 255, 0.07); }
.danger-link { color: #ff8a8a !important; }

.avatar {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 0.78rem;
}

.subnav {
  display: flex; gap: 0.25rem; overflow-x: auto;
  padding: 0.5rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  scrollbar-width: none;
}
.subnav a {
  padding: 0.45rem 0.9rem; border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 700; font-size: 0.9rem; color: var(--muted); white-space: nowrap;
}
.subnav a:hover { color: #fff; }
.subnav a.active { color: #fff; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- Layout ---------- */

.main {
  flex: 1;
  width: 100%;
  padding: clamp(1rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.page { width: 100%; max-width: 1200px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head .muted { margin-top: 0.25rem; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 0.85rem; margin-bottom: 0.4rem; }
.back:hover { color: #fff; }
.actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.panel { padding: clamp(1rem, 2.5vw, 1.5rem); }
.panel > h2 { margin-bottom: 0.9rem; }
.panel.narrow { max-width: 480px; margin: auto; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1.25rem; align-items: start; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */

.footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem clamp(1rem, 3vw, 2rem);
  padding-bottom: max(0.7rem, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bar) 92%, transparent);
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}
.footer-logo { height: 34px; width: auto; max-width: 90px; object-fit: contain; }
.footer-text { text-align: center; color: var(--muted); }
.footer-right { justify-self: end; color: var(--muted); }
form.inline { display: inline; }
button.link {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: #fff; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px;
}
@media (max-width: 700px) {
  .footer { grid-template-columns: 1fr; text-align: center; }
  .footer-logo, .footer-right { display: none; }
}

/* ---------- Buttons & forms ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 40px; padding: 0.5rem 1rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06); color: var(--text);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-danger:hover { background: #f05d5d; }
.btn-ghost { background: none; border-color: transparent; }
.btn-ghost-danger { background: none; border-color: rgba(239, 68, 68, 0.4); color: #ff8a8a; }
.btn-ghost-danger:hover { background: rgba(239, 68, 68, 0.15); }
.btn-sm { min-height: 32px; padding: 0.3rem 0.7rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; font-size: 0.75rem;
}
.icon-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); color: #fff; }
.icon-btn:disabled { opacity: 0.25; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn[aria-pressed="true"] { color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 0.35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span:first-child, .field legend { font-weight: 700; font-size: 0.88rem; padding: 0; }
.field legend { margin-bottom: 0.35rem; }
.hint { color: var(--muted); font-size: 0.8rem; }
.error { color: #ff8a8a; font-size: 0.82rem; font-weight: 700; }
.has-error input, .has-error select { border-color: var(--danger); }

input[type=text], input[type=password], input[type=search], input[type=date], input[type=email], select, textarea {
  width: 100%; min-height: 42px; padding: 0.55rem 0.8rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35); color: var(--text);
  font: inherit;
  transition: border-color 0.15s, background 0.15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: rgba(0, 0, 0, 0.5); }
input::placeholder, textarea::placeholder { color: rgba(255, 255, 255, 0.38); }
select option { background: var(--panel-solid); }
input[type=file] { font: inherit; color: var(--muted); }
input[type=file]::file-selector-button {
  margin-right: 0.75rem; padding: 0.45rem 0.9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.08); color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
}

.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 4.2rem; }
.reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  padding: 0.25rem 0.55rem; border: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.08);
  color: var(--muted); font: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer;
}
.reveal:hover { color: #fff; }
.inline-actions { display: flex; align-items: center; gap: 0.4rem; }
/* A button wrapped in its own form should sit exactly like the link buttons beside it. */
.actions > form, .inline-actions > form, .feed-row-actions > form { display: flex; }

.prefix-input { display: flex; align-items: stretch; }
.prefix-input > span {
  display: flex; align-items: center; padding: 0 0.6rem; font-size: 0.85rem; color: var(--muted);
  border: 1px solid var(--line-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: rgba(255, 255, 255, 0.04);
}
.prefix-input input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.check { display: flex; align-items: center; gap: 0.55rem; cursor: pointer; font-size: 0.92rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex-shrink: 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.5rem; margin-top: 0.6rem; padding: 0.75rem; border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.25); }

.segmented { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.5rem; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block; height: 100%; padding: 0.6rem 0.8rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.25);
  font-weight: 700; transition: border-color 0.15s, background 0.15s;
}
.segmented small { display: block; font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.segmented input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.segmented input:disabled + span { opacity: 0.4; cursor: not-allowed; }

.form-actions { display: flex; gap: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }

.alert { padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem; margin-bottom: 1rem; text-align: left; }
.alert-error { background: rgba(239, 68, 68, 0.16); border: 1px solid rgba(239, 68, 68, 0.4); }
.alert-success { background: rgba(47, 191, 113, 0.16); border: 1px solid rgba(47, 191, 113, 0.4); }
.alert-info { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line-strong); }

/* ---------- Chips, badges, dots ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.12rem 0.55rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line);
  font-size: 0.78rem; font-weight: 700; white-space: nowrap; vertical-align: middle;
}
.chip-accent { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.chip-danger { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.4); color: #ffb0b0; }
.chip-live { background: rgba(239, 59, 59, 0.14); border-color: rgba(239, 59, 59, 0.4); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-right: 0.45rem; vertical-align: middle; }
.chip .dot { margin-right: 0; }
.dot-live { background: var(--live); box-shadow: 0 0 0 0 rgba(239, 59, 59, 0.6); animation: pulse 1.8s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 59, 59, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(239, 59, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 59, 59, 0); }
}

.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.55rem; border-radius: 6px;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  background: rgba(0, 0, 0, 0.6); color: #fff;
}
.badge.is-live, .badge-live { background: var(--live); }
.badge.is-live::before, .badge-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.4s infinite; }
.badge.is-offline { background: rgba(60, 64, 76, 0.9); color: rgba(255, 255, 255, 0.75); }
@keyframes blink { 50% { opacity: 0.3; } }

.type { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 5px; font-size: 0.72rem; font-weight: 800; white-space: nowrap; background: rgba(255, 255, 255, 0.08); }
.type-auth { background: rgba(80, 140, 255, 0.18); color: #a9c6ff; }
.type-watch { background: rgba(239, 59, 59, 0.16); color: #ffb3b3; }
.type-user { background: rgba(47, 191, 113, 0.16); color: #9fe6bf; }
.type-feed { background: rgba(245, 165, 36, 0.16); color: #ffd58a; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; z-index: 50; left: 50%; bottom: 5rem; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.8rem;
  max-width: min(560px, calc(100vw - 2rem));
  padding: 0.75rem 0.6rem 0.75rem 1rem; border-radius: var(--radius-sm);
  background: var(--panel-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  font-weight: 700; animation: toast-in 0.25s ease-out; transition: opacity 0.5s, transform 0.5s;
}
.toast-success { border-left: 4px solid var(--ok); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--accent); }
.toast button { background: none; border: 0; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 0.3rem; }
.toast-hide { opacity: 0; transform: translate(-50%, 10px); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- Login ---------- */

body.is-login { justify-content: center; }
body.is-login::before { background: rgba(0, 0, 0, 0.5); }
.login-video { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.login-wrap { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 1.5rem 1rem; }
.login-card {
  width: 100%; max-width: 420px; padding: clamp(1.5rem, 5vw, 2.5rem);
  display: flex; flex-direction: column; gap: 1rem; text-align: center;
  background: rgba(10, 12, 20, 0.6);
}
.login-logo { max-height: 110px; max-width: 70%; width: auto; margin: 0 auto 0.25rem; object-fit: contain; }
.login-card h1 { font-size: 1.35rem; }
.login-card .muted { margin-top: -0.6rem; }
.login-card .field { text-align: left; }
.login-card .check { justify-content: flex-start; color: var(--muted); }
.login-card .btn-primary { min-height: 46px; font-size: 1rem; margin-top: 0.25rem; }
.turnstile { display: flex; justify-content: center; min-height: 65px; }
.powered { font-size: 0.8rem; color: var(--muted); display: flex; justify-content: center; }
.powered-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--muted); text-decoration: none; font-size: 0.8rem; line-height: 1; white-space: nowrap;
  transition: color 0.15s;
}
/* The logo's cloud hangs below the wordmark, so nudge it up to sit the wordmark on the text baseline. */
.powered-link img { height: 13px; width: auto; position: relative; top: -1px; opacity: 0.6; transition: opacity 0.15s; }
.powered-link:hover { color: #fff; }
.powered-link:hover img { opacity: 1; }

/* ---------- Feed picker ---------- */

.picker { width: 100%; max-width: 1100px; margin: auto 0; padding: clamp(1.25rem, 3vw, 2rem); }
.picker-head { margin-bottom: 1.5rem; }
.picker-head h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.feed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: clamp(0.9rem, 2vw, 1.4rem); }
.feed-grid:has(> :nth-child(2):last-child) { max-width: 760px; margin: 0 auto; }
.feed-grid:has(> :only-child) { max-width: 380px; margin: 0 auto; }
@media (max-width: 560px) {
  .feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feed-grid:has(> :only-child) { grid-template-columns: 1fr; }
  .feed-name { font-size: 0.95rem; }
  .feed-art-fallback { font-size: 1.1rem; }
}

.feed-card { display: flex; flex-direction: column; gap: 0.6rem; text-decoration: none; }
.feed-art {
  position: relative; display: block; aspect-ratio: 1; overflow: hidden;
  border-radius: var(--radius); background: #000; border: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}
.feed-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease, filter 0.3s; }
.feed-art-fallback {
  display: grid; place-items: center; width: 100%; height: 100%; padding: 1rem; text-align: center;
  font-size: 1.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 60%, #000), var(--bar) 75%);
}
.feed-art-fallback.small { font-size: 0.75rem; padding: 0.3rem; }
.feed-art .badge { position: absolute; top: 10px; left: 10px; }
.feed-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.35); opacity: 0; transition: opacity 0.2s;
}
.feed-play svg {
  width: 64px; height: 64px; padding: 16px; border-radius: 50%;
  background: var(--accent); color: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.feed-name { font-weight: 800; font-size: 1.05rem; text-align: center; }
a.feed-card:hover .feed-art, a.feed-card:focus-visible .feed-art {
  transform: translateY(-4px); border-color: var(--accent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), 0 0 0 2px var(--accent);
}
a.feed-card:hover .feed-art img { transform: scale(1.04); }
a.feed-card:hover .feed-play, a.feed-card:focus-visible .feed-play { opacity: 1; }
a.feed-card:focus-visible { outline: none; }
.feed-card.is-offline .feed-art img { filter: grayscale(0.6) brightness(0.75); }
.feed-card.static { max-width: 260px; margin: 0 auto; }

.empty { text-align: center; padding: 2.5rem 1rem; }
.empty h2 { margin-bottom: 0.4rem; }

/* ---------- Watch ---------- */

.main-watch { justify-content: center; }
.watch { width: 100%; max-width: 1280px; display: flex; flex-direction: column; gap: 0.9rem; transition: max-width 0.3s; }
body.theatre .watch { max-width: none; }
body.theatre .topbar, body.theatre .footer { opacity: 0.25; transition: opacity 0.3s; }
body.theatre .topbar:hover, body.theatre .footer:hover { opacity: 1; }

.feed-tabs {
  display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none;
  padding: 0.3rem; border-radius: 999px; align-self: center; max-width: 100%;
  background: rgba(0, 0, 0, 0.55); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.feed-tabs a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 1rem; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 0.9rem;
  color: var(--muted); white-space: nowrap;
}
.feed-tabs a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.feed-tabs a.active { background: var(--accent); color: #fff; }
.feed-tabs-back { border-right: 1px solid var(--line); border-radius: 999px 0 0 999px !important; }
@media (max-width: 560px) { .feed-tabs-back span { display: none; } }

.player-shell { border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); border: 1px solid rgba(0, 0, 0, 0.8); }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; }
body.theatre .player { max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); width: 100%; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; }
.player video { object-fit: contain; background: #000; }

.player-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  background: rgba(0, 0, 0, 0.6); text-align: center; padding: 1rem; font-weight: 700;
  pointer-events: none;
}
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.2); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
.player-overlay.no-spin .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.unmute {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.8rem; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-weight: 800; font-size: 0.85rem;
  animation: nudge 2.4s ease-in-out 1s 3;
}
.unmute svg { width: 16px; height: 16px; }
.unmute:hover { filter: brightness(1.1); }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: scale(1.06); } }
.player-bar-left { display: inline-flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; min-width: 0; }
.player-casting { font-weight: 800; color: var(--accent); }
.icon-btn.is-active { color: var(--accent); }

.player-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.75rem 1rem; background: rgba(0, 0, 0, 0.72); font-size: 0.92rem;
}
.player-bar a { color: #fff; }
.player-bar-right { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--muted); }
@media (max-width: 560px) { .player-bar { justify-content: center; text-align: center; } }
.shortcut-hint { margin-top: 0.7rem; text-align: center; font-size: 0.8rem; color: var(--muted); }
.shortcut-hint kbd {
  display: inline-block; min-width: 1.5em; padding: 0.05rem 0.35rem; margin: 0 0.1rem;
  border: 1px solid var(--line-strong); border-radius: 5px; background: rgba(255, 255, 255, 0.06);
  font: inherit; font-size: 0.75rem; font-weight: 700; color: var(--text);
}
/* Phones and tablets have no keyboard. */
@media (hover: none), (pointer: coarse) { .shortcut-hint { display: none; } }
body.theatre .shortcut-hint { display: none; }

/* ---------- Admin ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, calc(50% - 0.5rem)), 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 0.3rem; }
.stat-label { color: var(--muted); font-size: 0.82rem; font-weight: 700; display: flex; align-items: center; }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list a { text-decoration: none; }
.list a:hover { text-decoration: underline; }
.panel h3 { margin-bottom: 0.4rem; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline .type { margin-top: 0.15rem; min-width: 64px; text-align: center; }
.timeline.compact li { padding: 0.45rem 0; font-size: 0.85rem; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.toolbar .search { flex: 1 1 240px; }
.toolbar select, .toolbar input[type=date] { width: auto; flex: 0 1 auto; }
.chips { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.chip-btn {
  padding: 0.35rem 0.8rem; border-radius: 999px; border: 1px solid var(--line-strong);
  background: none; color: var(--muted); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer;
}
.chip-btn:hover { color: #fff; }
.chip-btn.active { background: #fff; color: #111; border-color: #fff; }

.table-wrap { overflow-x: auto; margin: 0 calc(-1 * clamp(1rem, 2.5vw, 1.5rem)); padding: 0 clamp(1rem, 2.5vw, 1.5rem); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
  text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 800; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.table td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.sort-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0; border: 0; background: none; cursor: pointer;
  color: inherit; font: inherit; font-size: inherit; font-weight: inherit; letter-spacing: inherit; text-transform: inherit;
}
.sort-btn:hover { color: #fff; }
.sort-btn::after { content: '↕'; opacity: 0.35; font-size: 0.9em; }
th[aria-sort] .sort-btn { color: #fff; }
th[aria-sort="ascending"] .sort-btn::after { content: '↑'; opacity: 1; color: var(--accent); }
th[aria-sort="descending"] .sort-btn::after { content: '↓'; opacity: 1; color: var(--accent); }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table td.right form { display: inline; }
.table td.right { text-align: right; white-space: nowrap; }
.table td.nowrap, .table .nowrap { white-space: nowrap; }
.table .chip + .chip { margin-left: 0.25rem; }
tr.is-muted td { opacity: 0.55; }
.show-sm { display: none !important; }
@media (max-width: 700px) {
  .table .hide-sm { display: none; }
  .show-sm { display: block !important; }
}
/* On phones the activity log becomes one card per event: time and type, who, then what. */
@media (max-width: 700px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody { display: block; }
  .table-stack tr {
    display: grid; grid-template-columns: 1fr auto; column-gap: 0.75rem; row-gap: 0.15rem;
    padding: 0.75rem 0; border-bottom: 1px solid var(--line);
  }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { display: block; padding: 0 !important; border: 0; }
  .table-stack td:nth-child(1) { grid-column: 1; grid-row: 1; color: var(--muted); font-size: 0.8rem; }
  .table-stack td:nth-child(3) { grid-column: 2; grid-row: 1; justify-self: end; }
  .table-stack td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; font-weight: 700; }
  .table-stack td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; }
  .table-stack .hide-sm { display: none !important; }
  .table-wrap:has(.table-stack) { overflow-x: visible; }
}
.empty-row { padding: 1.25rem 0; text-align: center; }
.user-cell { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.user-cell:hover strong { text-decoration: underline; }

.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }

.feed-admin-list { display: flex; flex-direction: column; gap: 0.75rem; }
.feed-row { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem 0.75rem 0.5rem; }
.feed-row.is-muted .feed-row-art, .feed-row.is-muted h2 { opacity: 0.5; }
.feed-row-order { display: flex; flex-direction: column; }
.feed-row-art { width: 76px; height: 76px; flex-shrink: 0; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.feed-row-art img { width: 100%; height: 100%; object-fit: cover; }
.feed-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.feed-row-info h2 a { text-decoration: none; }
.feed-row-info h2 a:hover { text-decoration: underline; }
.feed-row-info p { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.feed-row-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.feed-row-info .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) {
  .feed-row { flex-wrap: wrap; gap: 0.75rem; padding: 0.75rem; }
  .feed-row-order { flex-direction: row; order: 3; margin-left: auto; }
  .feed-row-art { width: 56px; height: 56px; }
  .feed-row-actions { order: 2; justify-content: flex-start; }
  .feed-row-info { flex-basis: calc(100% - 56px - 0.75rem); }
}

.danger-zone { border-color: rgba(239, 68, 68, 0.3); }
.danger-zone h2 { color: #ff9b9b; margin-bottom: 0.4rem; }
.danger-zone p { margin-bottom: 0.9rem; }

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  h1 { font-size: 1.45rem; }
  .brand-text small { display: none; }
  .usermenu-name { display: none; }
  .topnav a { padding: 0.45rem 0.6rem; }
  .stat-value { font-size: 1.6rem; }
}
/* On phones the crest is enough; the club name would collide with Watch / Manage. */
@media (max-width: 520px) {
  .topbar:has(.topnav) .brand-text { display: none; }
}
@media (max-width: 420px) {
  .topnav a svg { display: none; }
  .brand-text { display: none; }
}

/* ---------- Platform (clubs) ---------- */

.club-swatch { display: grid; place-items: center; padding: 10px; }
.club-swatch img { width: 100%; height: 100%; object-fit: contain; }
.color-input { display: flex; gap: 0.5rem; align-items: center; }
.color-input input[type=color] { width: 46px; height: 42px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.35); cursor: pointer; flex-shrink: 0; }
.color-input input[type=text] { flex: 1; }
.asset-row { display: flex; gap: 0.9rem; align-items: center; }
.asset-thumb { display: grid; place-items: center; width: 84px; height: 56px; flex-shrink: 0; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line-strong); }
.asset-thumb img { width: 100%; height: 100%; object-fit: contain; }
.mt-sm { margin-top: 0.6rem; }
.limit-row { display: grid; grid-template-columns: minmax(120px, 0.6fr) 1fr; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 0.9rem; }
.steps { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.92rem; }
.stack-sm { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }

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

/* ---------- Link a TV ---------- */
.link-card { gap: 1.1rem; }
.link-card .muted { margin-top: -0.5rem; }
.link-form { display: flex; flex-direction: column; gap: 0.9rem; }
.link-steps { list-style: none; margin: 0 0 0.15rem; padding: 0; display: flex; justify-content: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.link-steps li { display: flex; align-items: center; gap: 0.4rem; }
.link-steps li + li::before { content: ''; width: 18px; height: 1px; background: var(--line-strong); margin-right: 0.05rem; }
.link-step-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); font-size: 0.72rem; }
.link-steps .current { color: var(--text); }
.link-steps .current .link-step-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.link-steps .done .link-step-dot { background: rgba(255, 255, 255, 0.14); border-color: transparent; color: var(--text); }
.code-input { font-family: var(--mono); font-size: 1.7rem; font-weight: 700; letter-spacing: 0.18em; text-align: center; text-transform: uppercase; min-height: 62px; }
.code-input::placeholder { letter-spacing: 0.18em; opacity: 0.35; }
.code-boxes { display: flex; justify-content: center; align-items: center; gap: 0.28rem; }
.code-box { width: 2.05rem; height: 2.6rem; display: grid; place-items: center; border-radius: 8px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line-strong); font-family: var(--mono); font-weight: 700; font-size: 1.2rem; }
.code-dash { color: var(--muted); padding: 0 0.1rem; }
.link-pair { display: flex; align-items: flex-start; justify-content: center; gap: 0.6rem; padding: 0.4rem 0 0.2rem; }
.link-pair-side { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; width: 7.5rem; }
.link-pair-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line-strong); }
.link-pair-icon.avatar { border-radius: 50%; font-size: 1.3rem; background: var(--accent); border: 0; color: #fff; }
.link-pair-label { font-weight: 700; font-size: 0.92rem; line-height: 1.25; overflow-wrap: anywhere; }
.link-pair-line { flex: none; width: 2.5rem; height: 2px; margin-top: 31px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--muted) 0 5px, transparent 5px 9px); }
.link-note { margin-top: -0.2rem !important; }
.link-done { width: 76px; height: 76px; margin: 0.2rem auto 0; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; box-shadow: 0 8px 30px rgba(47, 191, 113, 0.35); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.link-pair-icon svg { width: 30px; height: 30px; fill: none; }
.link-done svg { width: 40px; height: 40px; fill: none; }

/* App privacy page */
.privacy { text-align: left; }
.privacy h1 { text-align: center; }
.privacy > .muted:first-of-type { text-align: center; margin-top: -.25rem; }
.privacy h2 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; }
.privacy p, .privacy li { font-size: .95rem; line-height: 1.55; }
.privacy ul { padding-left: 1.2rem; margin: .4rem 0; }
.privacy li + li { margin-top: .35rem; }
.privacy a { color: inherit; }
