/* JAMIX PRO LIVE — public page */

.live-body { background: var(--bg); }

.live-main { padding: 7.5rem 0 3rem; }

.live-heading { margin-bottom: 1.6rem; }
.live-kicker {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #ff5468;
}
.live-heading h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: 0.02em;
  color: var(--cream);
  line-height: 1.1;
}
.live-heading h1 span { color: #ff5468; }
.live-heading p { color: var(--muted); margin-top: 0.4rem; }

.live-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 1.4rem;
  align-items: stretch;
}

.live-stage { min-width: 0; }
.live-viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.live-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }

/* Lower third sits over the video but never takes pointer events, so the player,
   sound button and chat stay usable. Kept as its own layer for future compositing. */
.live-lower-third {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.live-offline {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.7rem;
  padding: 2rem;
  text-align: center;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(212, 164, 55, 0.14), transparent 70%),
    linear-gradient(180deg, #121009, #090806);
}
.live-offline-mark {
  font-family: var(--font-display);
  font-size: 2.6rem;
  letter-spacing: 0.08em;
  color: #ff5468;
  border: 2px solid rgba(255, 84, 104, 0.4);
  border-radius: 14px;
  padding: 0.2rem 0.9rem;
}
.live-offline strong {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  letter-spacing: 0.03em;
  color: var(--cream);
}
.live-offline p { max-width: 34ch; color: var(--muted); font-size: 0.9rem; }

/* ---------- private access gate ---------- */

.live-viewport.is-gated { aspect-ratio: auto; min-height: 520px; }

.live-gate {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.5rem;
  padding: 1.6rem;
  text-align: center;
  overflow-y: auto;
  background:
    radial-gradient(640px 340px at 50% -10%, rgba(66, 99, 235, 0.3), transparent 70%),
    linear-gradient(180deg, #0b0f1a, #06070b 72%);
}
.live-gate-mark {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 0.08em;
  color: #dfe4f2;
  border: 2px solid rgba(168, 181, 214, 0.45);
  box-shadow: 0 0 26px rgba(66, 99, 235, 0.28);
  border-radius: 14px;
  padding: 0.16rem 0.8rem;
  margin-bottom: 0.2rem;
}
.live-gate strong {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  letter-spacing: 0.04em;
  color: #eef1f8;
}
.live-gate > p {
  max-width: 38ch;
  color: #9aa3b8;
  font-size: 0.86rem;
  line-height: 1.5;
}
.live-gate-form {
  display: grid;
  width: min(340px, 100%);
  margin-top: 0.5rem;
  text-align: left;
}
.live-gate-form.is-shake { animation: liveGateShake 0.32s ease; }
.live-gate-label {
  margin: 0.65rem 0 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #a8b1c6;
}
.live-gate-label span { font-weight: 500; letter-spacing: 0.04em; text-transform: none; color: #6f7890; }
.live-gate-input {
  width: 100%;
  background: #0a0d14;
  border: 1px solid #2b3347;
  border-radius: 10px;
  color: #eef1f8;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.68rem 0.8rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#liveGateCode {
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.live-gate-input::placeholder { color: #5d6579; letter-spacing: normal; text-transform: none; font-weight: 500; }
.live-gate-input:focus { outline: none; border-color: #4f6ef7; box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.2); }
.live-gate-btn {
  margin-top: 1rem;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  background: linear-gradient(135deg, #4f6ef7, #2b3fa8);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(43, 63, 168, 0.35);
  transition: transform 0.15s, filter 0.2s;
}
.live-gate-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.live-gate-btn:disabled { opacity: 0.6; cursor: default; }
.live-gate-busy {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
  font-size: 0.82rem;
  color: #a8b1c6;
}
.live-gate-busy .live-spinner { width: 22px; height: 22px; border-top-color: #4f6ef7; }
.live-gate-error {
  width: min(340px, 100%);
  margin-top: 0.9rem;
  background: rgba(40, 7, 12, 0.9);
  border: 1px solid #7a2430;
  color: #ffb8c0;
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
}
@keyframes liveGateShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.live-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  background: #e11d2e;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  padding: 0.32rem 0.65rem;
  border-radius: 5px;
  animation: livePulse 1.6s infinite;
}

.live-unmute {
  position: absolute;
  left: 50%;
  bottom: 70px;
  z-index: 4;
  transform: translateX(-50%);
  background: rgba(10, 10, 12, 0.86);
  color: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.live-unmute:hover { border-color: #ff5468; color: #fff; }

/* ---------- YouTube-style player ---------- */

.live-viewport {
  --lt-bottom: 62px;
  outline: none;
}
/* chrome display rules would otherwise beat the hidden attribute */
.live-viewport [hidden] { display: none !important; }
.live-audio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.player-chrome {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.25s ease;
}
.player-chrome::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 118px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45) 45%, rgba(0, 0, 0, 0.8));
  pointer-events: none;
}
.live-viewport.controls-hidden { cursor: none; }
.live-viewport.controls-hidden .player-chrome {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s 0.25s;
}

.player-big {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(2px);
  transition: background 0.15s, transform 0.15s;
}
.player-big:hover { background: rgba(0, 0, 0, 0.72); transform: scale(1.05); }
.player-big svg { width: 40px; height: 40px; pointer-events: none; }

.player-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 8px 2px;
  pointer-events: auto;
}

.player-timeline {
  position: relative;
  height: 3px;
  margin: 0 2px 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
  transition: height 0.12s ease;
}
.player-timeline-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #ff0f0f;
}
.player-timeline::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff0f0f;
  transform: translateY(-50%);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}
.player-bar:hover .player-timeline { height: 5px; }
.player-bar:hover .player-timeline::after { width: 13px; height: 13px; }

.player-controls {
  display: flex;
  align-items: center;
  gap: 1px;
  height: 46px;
}

.player-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: 0.94;
  transition: background 0.15s, transform 0.1s;
}
.player-btn:hover { background: rgba(255, 255, 255, 0.13); opacity: 1; }
.player-btn:active { transform: scale(0.94); }
.player-btn:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.player-btn svg { width: 22px; height: 22px; display: block; pointer-events: none; }

#playerPlay .pb-play { display: none; }
#playerPlay.is-paused .pb-play { display: block; }
#playerPlay.is-paused .pb-pause { display: none; }

#playerMute .vol-off { display: none; }
#playerMute.is-muted .vol-off { display: block; }
#playerMute.is-muted .vol-on { display: none; }

.player-vol { display: flex; align-items: center; gap: 2px; }
.player-volume {
  width: 64px;
  height: 4px;
  margin: 0 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.34);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.player-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.player-volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

.player-time {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}
.player-live { display: inline-flex; align-items: center; gap: 5px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.14em; }
.player-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff0f0f; box-shadow: 0 0 6px #ff0f0f; animation: livePulse 1.6s infinite; }
.player-elapsed { opacity: 0.78; }
.player-spacer { flex: 1; }

.live-fs-icon { width: 20px; height: 20px; display: block; pointer-events: none; }
.live-fs-collapse { display: none; }

.live-viewport:fullscreen .live-fs-expand,
.live-viewport.is-fullscreen .live-fs-expand { display: none; }
.live-viewport:fullscreen .live-fs-collapse,
.live-viewport.is-fullscreen .live-fs-collapse { display: block; }

.live-viewport:fullscreen,
.live-viewport.is-fullscreen {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #000;
  box-shadow: none;
  --lt-bottom: 72px;
}
/* fallback when the browser refuses element fullscreen (older iOS Safari) */
.live-viewport.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
body.live-fs-lock { overflow: hidden; }
.live-viewport.is-fullscreen .live-offline { padding: 1.2rem; }

@media (max-width: 560px) {
  .live-viewport { --lt-bottom: 56px; }
  .player-btn { width: 36px; height: 36px; }
  .player-btn svg { width: 20px; height: 20px; }
  .player-controls { height: 42px; }
  .player-volume { display: none; }
  .player-time { margin-left: 6px; }
  .player-big { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
  .player-big svg { width: 34px; height: 34px; }
  .live-viewport:fullscreen,
  .live-viewport.is-fullscreen { --lt-bottom: 62px; }
}

.live-playback-error {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 56px;
  z-index: 4;
  background: rgba(28, 5, 9, 0.94);
  border: 1px solid #e11d2e;
  color: #ffd9dd;
  font-size: 0.84rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
}

.live-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.live-meta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  letter-spacing: 0.02em;
  color: var(--cream);
}
.live-meta p { color: var(--muted); font-size: 0.86rem; }
.live-stats { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.live-stat {
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
}
.live-stat strong { color: var(--cream); font-variant-numeric: tabular-nums; }

.live-actions { display: flex; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; }

/* ---------- chat ---------- */

.live-chat {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: 640px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.live-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}
.live-chat-head h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--cream);
}
.live-chat-state { font-size: 0.72rem; color: var(--muted); text-align: right; }

.live-chat-log {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  scrollbar-width: thin;
}
.live-msg-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}
.live-msg-top strong { font-size: 0.82rem; color: var(--gold); }
.live-msg-top time { font-size: 0.68rem; color: var(--muted); }
.live-msg p { color: var(--text); font-size: 0.9rem; line-height: 1.45; overflow-wrap: anywhere; }
.live-mod { display: inline-flex; gap: 0.4rem; margin-top: 0.3rem; }
.live-mod button {
  background: transparent;
  border: 1px solid rgba(255, 84, 104, 0.4);
  color: #ff8b96;
  font-family: inherit;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  cursor: pointer;
}
.live-mod button:hover { background: rgba(255, 84, 104, 0.12); }

.live-chat-empty { padding: 0 1rem 0.6rem; color: var(--muted); font-size: 0.82rem; }

.live-chat-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.7rem 1rem 0.4rem;
  border-top: 1px solid var(--line);
}
.live-chat-input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.55rem 0.9rem;
}
.live-chat-input:focus { outline: none; border-color: var(--gold); }
.live-chat-send {
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: #1a1206;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}
.live-chat-send:hover { filter: brightness(1.06); }

.live-chat-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 1rem 0;
}
.live-chat-name-row label { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.live-chat-name {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed var(--line);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 0.2rem 0;
}
.live-chat-name:focus { outline: none; border-color: var(--gold); }
.live-chat-note { padding: 0.5rem 1rem 0.8rem; font-size: 0.72rem; color: var(--muted); }

.live-about { margin-top: 2.4rem; max-width: 70ch; }
.live-about h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--cream);
  margin-bottom: 0.6rem;
}
.live-about p { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.6rem; }
.live-about strong { color: var(--cream); }

.live-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0;
  margin-top: 2rem;
}
.live-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
}
.live-footer a { color: var(--gold); }

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(225, 29, 46, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(225, 29, 46, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 29, 46, 0); }
}

@media (max-width: 900px) {
  .live-layout { grid-template-columns: 1fr; }
  .live-main { padding-top: 6rem; }
  .live-chat { min-height: 340px; max-height: 60vh; }
  .live-viewport.is-gated { min-height: 560px; }
}

/* ---- LiveKit viewer additions ---- */
.live-loading { gap: 0.9rem; }
.live-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: #e11d2e;
  animation: liveSpin 0.9s linear infinite;
}
@keyframes liveSpin { to { transform: rotate(360deg); } }

.live-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.live-screen {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.live-past-list { list-style: none; display: grid; gap: 0.7rem; margin-top: 1rem; }
.live-past-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background: var(--surface);
}
.live-past-item strong { display: block; color: var(--cream); font-size: 0.95rem; }
.live-past-item small { color: var(--muted); font-size: 0.78rem; }

.live-chat-item {
  position: relative;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 0.15rem;
}
.live-chat-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.live-chat-item-head strong { font-size: 0.78rem; color: var(--gold); }
.live-chat-item-head time { font-size: 0.68rem; color: var(--muted); }
.live-chat-item p { margin: 0; font-size: 0.88rem; color: var(--text); word-break: break-word; }
.live-chat-del {
  margin-top: 0.35rem;
  justify-self: start;
  background: transparent;
  border: 1px solid #4a1a22;
  color: #ff8b96;
  font-family: inherit;
  font-size: 0.68rem;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
}
