/* ReSpace TV — public site */
:root {
  --bg: #0c0e0d;
  --panel: #151816;
  --panel-2: #1b201d;
  --border: #262d28;
  --text: #e9ede9;
  --muted: #95a09a;
  --green: #3aa362;
  --lime: #98b858;
  --live: #e2483b;
  --radius: 10px;
  --wrap: 1140px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* author display rules below would otherwise beat the UA [hidden] rule */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
img { max-width: 100%; display: block; }
p { margin: 0 0 .8em; }

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--green);
  color: #fff;
  padding: 10px 16px;
  z-index: 50;
}
.skip:focus { left: 8px; top: 8px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---- header ---- */

.site-head {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #10130f, var(--bg));
}
.head-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: .01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--green);
  color: #06120b;
  font-size: 12px;
}
.brand-tv { color: var(--lime); }
.strap { margin: 0; color: var(--muted); font-size: .87rem; }

/* ---- player ---- */

.player-mount { margin: 0; }

.rtv {
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.rtv:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

.rtv-stage {
  position: relative;
  aspect-ratio: var(--rtv-ar, 16 / 9);
  background: #000;
  overflow: hidden;
}
.rtv[data-kind="vod"] .rtv-stage { aspect-ratio: var(--rtv-ar, 16 / 9); }
.rtv.is-pannable .rtv-stage { cursor: grab; touch-action: pan-y; }
.rtv.is-pannable .rtv-stage:active { cursor: grabbing; }

.rtv-video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

.rtv-badge {
  position: absolute;
  top: 10px; left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(10, 12, 11, .72);
  border: 1px solid rgba(226, 72, 59, .5);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}
.rtv-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--live);
  animation: rtv-pulse 2s ease-in-out infinite;
}
.rtv-viewers { color: var(--muted); font-weight: 600; letter-spacing: .03em; text-transform: none; }
.rtv-viewers::before { content: "· "; }

@keyframes rtv-pulse { 50% { opacity: .35; } }

.rtv-holding {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px clamp(18px, 4vw, 40px);
  background: radial-gradient(120% 120% at 15% 0%, #17201a 0%, #0b0d0c 70%);
}
.rtv-holding-poster {
  width: min(34%, 260px);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.rtv-holding-body { min-width: 0; }
.rtv-chip {
  display: inline-block;
  margin: 0 0 8px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.rtv-holding-title { font-size: clamp(1.15rem, 2.6vw, 1.7rem); margin-bottom: .25em; }
.rtv-holding-next { margin: 0 0 .2em; color: var(--text); font-size: clamp(.85rem, 1.8vw, 1rem); }
.rtv-holding-count { margin: 0 0 .9em; color: var(--lime); font-variant-numeric: tabular-nums; font-weight: 600; }
.rtv-holding-strap { margin: 0; color: var(--muted); font-size: .8rem; max-width: 46ch; }

.rtv-big {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 96px; height: 96px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: 50%;
  background: rgba(58, 163, 98, .92);
  color: #06120b;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.rtv-big:hover { background: var(--green); }
.rtv-big-icon {
  width: 0; height: 0;
  border-left: 20px solid currentColor;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  margin-left: 5px;
}
.rtv-big-label { font-size: .8rem; }

.rtv-sound-hint {
  position: absolute;
  left: 10px; bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(10, 12, 11, .78);
  color: var(--text);
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.rtv-sound-hint:hover { border-color: var(--green); }
.rtv-sound-icon { font-size: .95rem; }

.rtv-spin {
  position: absolute;
  left: 50%; top: 50%;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid rgba(255, 255, 255, .22);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: rtv-spin 1s linear infinite;
}
@keyframes rtv-spin { to { transform: rotate(360deg); } }

.rtv-stats {
  position: absolute;
  right: 8px; top: 8px;
  margin: 0;
  padding: 8px 10px;
  max-width: 60%;
  background: rgba(0, 0, 0, .68);
  color: #b9f2c9;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  border-radius: 6px;
  pointer-events: none;
}

.rtv-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--panel);
  border-top: 1px solid var(--border);
}
.rtv-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: .82rem;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.rtv-btn:hover { border-color: var(--green); color: #fff; }
.rtv-btn[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #06120b; font-weight: 600; }
.rtv-state { margin-left: auto; color: var(--muted); font-size: .8rem; }

body.rtv-theatre .site-head,
body.rtv-theatre .nownext,
body.rtv-theatre main > section:not(.hero),
body.rtv-theatre .site-foot { display: none; }
body.rtv-theatre .hero .wrap { max-width: none; padding: 0; }
body.rtv-theatre .rtv { border: 0; border-radius: 0; }
body.rtv-theatre .rtv-stage { max-height: 100vh; }

/* ---- hero / now-next ---- */

.hero { padding: 22px 0 6px; }

.nownext {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 14px 0 4px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.nownext-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.nownext.is-live .nownext-label { color: var(--live); }
.nownext-title { font-weight: 650; }
.nownext-when { color: var(--muted); font-size: .9rem; }
.nownext-count {
  margin-left: auto;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
  font-size: .9rem;
}

/* ---- sections ---- */

.section { padding: 30px 0; border-top: 1px solid var(--border); margin-top: 26px; }
.section:first-of-type { border-top: 0; }
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.sec-head h2 { margin: 0; }

.btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  font-size: .85rem;
  cursor: pointer;
}
.btn:hover { border-color: var(--green); text-decoration: none; color: #fff; }
.btn-primary { background: var(--green); border-color: var(--green); color: #06120b; font-weight: 600; }
.btn-primary:hover { background: #45b972; color: #06120b; }

.empty { color: var(--muted); font-size: .92rem; margin: 0; }

.schedule { list-style: none; margin: 0; padding: 0; }
.schedule li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 8px;
}
.schedule .when { color: var(--lime); font-size: .85rem; min-width: 15rem; }
.schedule .title { font-weight: 600; }
.schedule .desc { color: var(--muted); font-size: .88rem; flex-basis: 100%; margin: 0; }
.schedule .tag {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--live);
}
.schedule .links { margin-left: auto; display: flex; gap: 12px; font-size: .85rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  color: var(--text);
}
.card:hover { border-color: var(--green); text-decoration: none; }
.card-thumb {
  aspect-ratio: 16 / 9;
  background: #0a0c0b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M12 9l12 7-12 7z' fill='%23223026'/%3E%3C/svg%3E") center/44px no-repeat;
  object-fit: cover;
  width: 100%;
}
.card-body { padding: 11px 13px 13px; }
.card-title { font-weight: 600; margin: 0 0 3px; font-size: .98rem; }
.card-meta { color: var(--muted); font-size: .82rem; margin: 0; }

/* ---- about / footer ---- */

.about p { max-width: 62ch; color: #cfd6d0; }
.about .links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.site-foot {
  border-top: 1px solid var(--border);
  margin-top: 30px;
  padding: 22px 0 34px;
  color: var(--muted);
  font-size: .85rem;
}
.foot-inner { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.foot-inner .spacer { margin-left: auto; }

/* ---- replay page ---- */

.replay { padding: 24px 0 0; }
.replay h1 { margin-bottom: .25em; }
.replay-meta { color: var(--muted); font-size: .9rem; margin: 0 0 14px; }
.replay-desc { max-width: 68ch; color: #cfd6d0; }
.replay-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.copy-note { color: var(--lime); font-size: .85rem; align-self: center; }
.replay-missing { padding: 40px 0; }

/* ---- embed ---- */

body.embed { background: #000; }
body.embed .rtv { border: 0; border-radius: 0; }
body.embed .rtv-holding { padding: 16px 20px; }

@media (max-width: 720px) {
  .rtv-holding { flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; }
  .rtv-holding-poster { display: none; }
  .rtv-holding-strap { display: none; }
  .schedule .when { min-width: 0; flex-basis: 100%; }
  .schedule .links { margin-left: 0; }
  .nownext-count { margin-left: 0; flex-basis: 100%; }
}

@media (max-width: 420px) {
  .rtv-bar { flex-wrap: wrap; }
  .rtv-state { margin-left: 0; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .rtv-dot { animation: none; }
}
