:root {
  --bg: #0b0b0c;
  --bg2: #141416;
  --bg3: #1d1d21;
  --line: #2a2a30;
  --text: #f3efe6;
  --muted: #9a958a;
  --gold: #c9a45c;
  --gold2: #e3c27f;
  --gold-dim: rgba(201, 164, 92, .18);
  --red: #e5484d;
  --green: #3fb950;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ================= player ================= */
.tp { position: relative; width: 100%; background: #000; border-radius: var(--radius); overflow: hidden; user-select: none; -webkit-user-select: none; }
.tp-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.tp video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.tp-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 22%, transparent 68%, rgba(0,0,0,.75)); transition: opacity .25s; }
.tp.idle .tp-shade, .tp.idle .tp-top, .tp.idle .tp-bar { opacity: 0; }
.tp.idle .tp-stage { cursor: none; }

.tp-top { position: absolute; top: 0; inset-inline: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; transition: opacity .25s; }
.tp-brand { font-weight: 800; letter-spacing: .08em; font-size: 15px; color: var(--gold2); display: flex; align-items: center; gap: 6px; white-space: nowrap; text-shadow: 0 1px 3px #000; }
.tp-brand small { font-weight: 500; letter-spacing: 0; color: #fff; opacity: .85; font-size: 12px; }
.tp-cams { display: flex; gap: 6px; margin-inline-start: auto; }
.tp-cam { border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.45); backdrop-filter: blur(6px); padding: 4px 10px; border-radius: 999px; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.tp-cam.on { border-color: var(--gold); color: var(--gold2); background: rgba(0,0,0,.65); }
.tp-cam i { width: 7px; height: 7px; border-radius: 50%; background: #666; display: inline-block; }
.tp-cam i.live { background: var(--red); box-shadow: 0 0 6px var(--red); }

.tp-status { position: absolute; top: 46px; inset-inline-start: 12px; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.tp-pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 6px; background: rgba(0,0,0,.6); letter-spacing: .03em; }
.tp-pill.live { background: var(--red); color: #fff; }
.tp-pill.rec { background: rgba(0,0,0,.65); color: var(--gold2); border: 1px solid var(--gold-dim); font-variant-numeric: tabular-nums; }

.tp-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.tp-msg { background: rgba(0,0,0,.72); border: 1px solid var(--line); padding: 14px 18px; border-radius: 12px; text-align: center; max-width: 80%; font-size: 14px; line-height: 1.5; pointer-events: auto; }
.tp-msg b { color: var(--gold2); display: block; font-size: 15px; margin-bottom: 2px; }
.tp-msg button { margin-top: 10px; }
.tp-spin { width: 42px; height: 42px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--gold); border-radius: 50%; animation: tpspin 0.9s linear infinite; }
@keyframes tpspin { to { transform: rotate(360deg); } }
.tp-bigplay { width: 68px; height: 68px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; pointer-events: auto; }
.tp-bigplay svg { width: 30px; height: 30px; fill: #fff; margin-inline-start: 4px; }
.tp-unmute { position: absolute; bottom: 58px; inset-inline-end: 12px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.6); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.tp-unmute svg { width: 16px; height: 16px; fill: currentColor; }

.tp-bar { position: absolute; bottom: 0; inset-inline: 0; display: flex; align-items: center; gap: 4px; padding: 8px 10px; transition: opacity .25s; direction: ltr; }
.tp-btn { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 8px; display: grid; place-items: center; flex: none; }
.tp-btn:hover { background: rgba(255,255,255,.12); }
.tp-btn svg { width: 22px; height: 22px; fill: #fff; }
.tp-btn.txt { width: auto; padding: 0 8px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tp-modes { display: flex; gap: 4px; margin: 0 auto; background: rgba(0,0,0,.55); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.14); padding: 3px; border-radius: 999px; direction: rtl; }
.tp-mode { border: 0; background: transparent; padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tp-mode i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); display: inline-block; }
.tp-mode.on { background: var(--gold); color: #111; }
.tp-mode.on i { background: #111; }
.tp-mode:disabled { opacity: .4; cursor: default; }
.tp-bar .grow { flex: 1; }
.hide { display: none !important; }

/* panel under the video */
.tp-panel { background: var(--bg2); border-top: 1px solid var(--line); padding: 12px 14px 14px; }
.tp-panel h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--gold2); }
.tp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-row + .tp-row { margin-top: 10px; }
.tp-row .sp { flex: 1; }
.chip { border: 1px solid var(--line); background: var(--bg3); padding: 5px 11px; border-radius: 999px; font-size: 12.5px; white-space: nowrap; }
.chip:hover { border-color: #444; }
.chip.on { border-color: var(--gold); color: var(--gold2); background: var(--gold-dim); }
.chip:disabled { opacity: .35; cursor: default; }
.btn { border: 1px solid var(--line); background: var(--bg3); padding: 8px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.btn:hover { border-color: #4a4a52; }
.btn.gold { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #15120a; border-color: var(--gold); }
.btn.gold:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .45; cursor: default; filter: none; }
.btn svg { width: 17px; height: 17px; fill: currentColor; }
.muted { color: var(--muted); font-size: 12.5px; }

/* timeline */
.tl { direction: ltr; margin-top: 10px; }
.tl-track { position: relative; height: 54px; background: #0f0f11; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; touch-action: none; }
.tl-span { position: absolute; top: 8px; bottom: 20px; background: linear-gradient(180deg, #8d7440, #6e5a31); border-radius: 2px; }
.tl-sel { position: absolute; top: 0; bottom: 0; background: rgba(227, 194, 127, .22); border-inline: 2px solid var(--gold2); pointer-events: none; }
.tl-tick { position: absolute; bottom: 0; height: 18px; border-left: 1px solid #333; font-size: 10.5px; color: var(--muted); padding-left: 3px; line-height: 18px; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.tl-tick.major { color: #cfc8b8; border-left-color: #555; }
.tl-day { position: absolute; top: 0; bottom: 0; border-left: 1px dashed #5a4c2c; pointer-events: none; }
.tl-day span { position: absolute; top: 1px; left: 3px; font-size: 10px; color: var(--gold); white-space: nowrap; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); pointer-events: none; }
.tl-head { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(255,255,255,.7); pointer-events: none; }
.tl-head::before { content: ''; position: absolute; top: -1px; left: -5px; border: 6px solid transparent; border-top-color: #fff; }
.tl-hover { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.5); pointer-events: none; }
.tl-tip { position: fixed; z-index: 50; pointer-events: none; background: #000; border: 1px solid var(--gold); border-radius: 8px; padding: 4px; transform: translate(-50%, -100%); box-shadow: 0 6px 24px rgba(0,0,0,.6); }
.tl-tip img { display: block; width: 176px; aspect-ratio: 16/9; object-fit: cover; background: #111; border-radius: 5px; }
.tl-tip div { text-align: center; font-size: 12px; padding-top: 3px; font-variant-numeric: tabular-nums; color: var(--gold2); }
.tl-nav { display: flex; gap: 6px; align-items: center; }
.tl-label { font-size: 13px; font-variant-numeric: tabular-nums; color: #ddd; }

/* export */
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.ex-card { background: var(--bg3); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.ex-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: #0a0a0a; display: block; }
.ex-card .lbl { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; margin-bottom: 6px; }
.ex-card .lbl b { color: var(--gold2); font-variant-numeric: tabular-nums; font-size: 14px; }
.ex-nudge { display: flex; gap: 4px; margin-top: 6px; direction: ltr; justify-content: center; }
.ex-nudge .chip { padding: 3px 8px; font-size: 11.5px; }
.ex-free { display: flex; align-items: center; gap: 6px; }
.ex-free input { width: 62px; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; text-align: center; }
.field { background: var(--bg3); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.field:focus, .ex-free input:focus { outline: none; border-color: var(--gold); }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #111; border: 1px solid var(--gold); color: var(--text); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,.6); }

/* fullscreen */
.tp:fullscreen { border-radius: 0; display: flex; flex-direction: column; background: #000; }
.tp:fullscreen .tp-stage { flex: 1; aspect-ratio: auto; }
.tp:-webkit-full-screen { border-radius: 0; display: flex; flex-direction: column; width: 100%; height: 100%; }
.tp:-webkit-full-screen .tp-stage { flex: 1; aspect-ratio: auto; }

@media (max-width: 560px) {
  .tp-brand small { display: none; }
  .tp-mode { padding: 5px 9px; font-size: 12px; }
  .tp-btn { width: 32px; height: 32px; }
  .tp-btn svg { width: 20px; height: 20px; }
  .tp-bar .opt { display: none; }
  .tp-status { top: 42px; }
  .ex-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .tp-panel { padding: 10px; }
}

/* ================= branding ================= */
.tp-logo, .tp-sponsor { position: absolute; z-index: 4; display: block; line-height: 0; filter: drop-shadow(0 2px 6px rgba(0,0,0,.55)); }
.tp-logo img, .tp-sponsor img { width: 100%; height: auto; display: block; }
.tp-logo[data-pos="top-right"] { top: 10px; right: 12px; }
.tp-logo[data-pos="top-left"] { top: 10px; left: 12px; }
.tp-logo[data-pos="top-center"] { top: 10px; left: 50%; transform: translateX(-50%); }
.tp-sponsor { opacity: .92; transition: opacity .4s; }
.tp-sponsor[data-pos="bottom-right"] { bottom: 58px; right: 12px; }
.tp-sponsor[data-pos="bottom-left"] { bottom: 58px; left: 12px; }
.tp-sponsor[data-pos="top-left"] { top: 52px; left: 12px; }
.tp-sponsor[data-pos="top-right"] { top: 52px; right: 12px; }
/* keep cam chips clear of a top logo */
.tp:has(.tp-logo[data-pos="top-left"]:not(.hide)) .tp-cams { margin-inline-start: 0; margin-inline-end: auto; }
.tp:has(.tp-logo:not(.hide)) .tp-status { top: 46px; inset-inline-start: auto; inset-inline-end: 12px; }
.tp:has(.tp-logo[data-pos="top-left"]:not(.hide)) .tp-status { inset-inline-end: auto; inset-inline-start: 12px; }

/* ================= pre-roll ad ================= */
.tp-ad { position: absolute; inset: 0; z-index: 20; background: #000; display: grid; place-items: center; }
.tp-ad video, .tp-ad img { width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.tp.ad-on .tp-top, .tp.ad-on .tp-bar, .tp.ad-on .tp-unmute, .tp.ad-on .tp-sponsor, .tp.ad-on .tp-status { visibility: hidden; }
.ad-tag { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.25); font-size: 12px; padding: 3px 9px; border-radius: 6px; }
.ad-cta { position: absolute; bottom: 22px; right: 16px; background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #15120a; font-weight: 700; padding: 9px 16px; border-radius: 10px; text-decoration: none; font-size: 14px; }
.ad-skip { position: absolute; bottom: 22px; left: 16px; background: rgba(0,0,0,.75); border: 1px solid rgba(255,255,255,.4); padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; min-width: 110px; }
.ad-skip:disabled { opacity: .75; cursor: default; }
.ad-snd { position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.ad-snd svg { width: 16px; height: 16px; fill: currentColor; }
.ad-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.15); direction: ltr; }
.ad-prog i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .25s linear; }
@media (max-width: 560px) { .ad-cta, .ad-skip { bottom: 14px; padding: 7px 12px; font-size: 13px; min-width: 0; } }

/* forecast on the HD-offline screen */
.fc { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.fc-next { font-size: 13.5px; }
.tp-msg .fc-next b { color: var(--gold2); display: inline; font-size: inherit; margin: 0; }
.fc-strip { display: flex; gap: 6px; justify-content: center; align-items: flex-end; height: 64px; margin-top: 10px; direction: rtl; }
.fc-d { width: 26px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.fc-d i { display: block; width: 100%; background: #3a3a42; border-radius: 4px 4px 1px 1px; }
.fc-d.good i { background: linear-gradient(180deg, var(--gold2), var(--gold)); }
.fc-d span { font-size: 10.5px; color: var(--muted); line-height: 1; }
.fc-d.good span { color: var(--gold2); }
.fc-btn { margin-top: 10px; text-decoration: none; }
@media (max-width: 560px) { .fc-strip { height: 44px; } .fc-d { width: 20px; } .tp-msg { max-width: 92%; padding: 10px 12px; font-size: 13px; } }
