:root {
  --bg: #000;
  --surface: rgba(255,255,255,.05);
  --border: rgba(255,255,255,.09);
  --text: #fff;
  --text-dim: rgba(255,255,255,.65);
  --text-faint: rgba(255,255,255,.35);
  --accent: #4f8ef7;
  --live: #ef3b47;
  --radius: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* ===== Upcoming ticker ===== */
.upcoming {
  width: 100%;
  background: #08080c;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 50;
  height: 40px;
  flex-shrink: 0;
}
.upcoming-label {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(0,0,0,.92);
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  z-index: 2;
  white-space: nowrap;
}
.upcoming-track {
  display: flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  animation: tickerScroll 45s linear infinite;
  padding-left: 110px;
  will-change: transform;
}
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.upcoming-item {
  display: inline-flex;
  align-items: center;
  margin-right: 20px;
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-shrink: 0;
}
.upcoming-item .vs {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-faint);
  margin: 0 6px;
  letter-spacing: 1px;
}
.upcoming-item .sep {
  color: rgba(255,255,255,.12);
  margin-right: 14px;
}

/* ===== Main layout ===== */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 0 24px 24px;
  gap: 0;
  z-index: 1;
}

.title {
  width: 100%;
  max-width: 960px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 20px 0 12px;
}

/* ===== Viewers badge ===== */
.viewers {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  pointer-events: none;
  white-space: nowrap;
}
.viewers .count { font-variant-numeric: tabular-nums; }
.viewers.hidden { opacity: 0; }

/* ===== Video ===== */
.video-wrap {
  width: 100%;
  max-width: 960px;
  overflow: hidden;
  border-radius: var(--radius);
  position: relative;
  background: #0a0a0f;
  aspect-ratio: 16 / 9;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.video-wrap .poster {
  position: absolute;
  inset: 0;
  z-index: 5;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: opacity .4s ease;
  pointer-events: none;
}
.video-wrap .poster.hidden { opacity: 0; }

video {
  width: 135%;
  height: 135%;
  object-fit: contain;
  object-position: center;
  position: absolute;
  top: -12%;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  display: block;
}

/* ===== Control bar (Live) — gaya YouTube: hanya garis merah, tanpa timer ===== */
.live-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.55) 100%);
  transition: opacity .3s ease;
}
.live-bar.hidden { opacity: 0; pointer-events: none; }
.live-bar .ctrl {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 8px 4px;
}
.live-bar .track {
  height: 3px;
  background: var(--live);
  border-radius: 2px;
  margin: 0 8px;
}
.live-bar .ctrl button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.9);
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: opacity .15s;
  padding: 0;
}
.live-bar .ctrl button:hover { opacity: .7; }
.live-bar .ctrl button .ico {
  width: 16px; height: 16px;
  display: block;
}
.live-bar .live-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,.85);
  padding-left: 2px;
}
.live-bar .live-tag .dot {
  width: 5px;
  height: 5px;
  background: var(--live);
  border-radius: 50%;
  margin: 0;
}

/* ===== Play overlay button ===== */
.play-toggle {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  cursor: pointer;
  transition: opacity .3s ease;
}
.play-toggle .pt-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
  transition: transform .15s;
}
.play-toggle:hover .pt-btn { transform: scale(1.06); }
.play-toggle .pt-ico {
  width: 0;
  height: 0;
  border-left: 22px solid #fff;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  margin-left: 6px;
}
.play-toggle.hidden { opacity: 0; pointer-events: none; }

/* Pause overlay */
.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.pause-overlay.show { opacity: 1; pointer-events: auto; }
.pause-overlay .pause-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
}

/* Loading skeleton */
.skeleton {
  position: absolute;
  inset: 0;
  background: #0a0a0f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  transition: opacity .4s ease;
}
.skeleton.hidden { opacity: 0; pointer-events: none; }
.skeleton .shimmer {
  width: 70%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg,
    rgba(255,255,255,.05) 0%,
    rgba(255,255,255,.12) 50%,
    rgba(255,255,255,.05) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton .label {
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Buffering overlay */
.buffering-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: rgba(0,0,0,.72);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.buffering-overlay.show { display: flex; }
.buffering-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,.12);
  border-top-color: rgba(255,255,255,.55);
  border-radius: 50%;
  animation: bufSpin .8s linear infinite;
}
@keyframes bufSpin { to { transform: rotate(360deg); } }
.buffering-overlay .buf-label {
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
}

/* ===== Chat ===== */
.chat-panel {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  gap: 8px;
  flex-shrink: 0;
  flex-grow: 0;
}

/* ===== Ad slot 320x50 ===== */
.ad-slot {
  width: 320px;
  max-width: 100%;
  height: 50px;
  margin: 10px auto 0;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.ad-slot .ad-label {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 0.5rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.ad-slot iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.chat {
  height: 200px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  scroll-behavior: smooth;
  flex-shrink: 0;
}
.chat::-webkit-scrollbar { width: 3px; }
.chat::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }

.chat-msg {
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 2px 0;
  animation: chatIn .25s ease;
}
@keyframes chatIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-msg .u { font-weight: 600; margin-right: 6px; }
.chat-msg .m { color: rgba(255,255,255,.85); }
.chat-msg.sys { color: var(--text-faint); font-style: italic; font-size: 0.72rem; }
.chat-msg.sys .u { font-style: normal; color: var(--accent); }

.chat-input {
  display: flex;
  gap: 8px;
  align-items: center;
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.chat-input input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
  touch-action: manipulation;
}
.chat-input input:focus { border-color: rgba(79,142,247,.45); }
.chat-input input::placeholder { color: var(--text-faint); }
.chat-input button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.chat-input button:hover { opacity: .85; }

/* ===== Sign Up modal ===== */
.vip-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
}
.vip-overlay.show { pointer-events: auto; visibility: visible; }

.vip-modal {
  background: rgba(14,14,20,.94);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 32px 28px 24px;
  width: 300px;
  max-width: 88vw;
  text-align: center;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .3s ease, transform .3s ease;
  position: relative;
}
.vip-overlay.show .vip-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.vip-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  color: rgba(255,255,255,.3);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
}
.vip-close:hover { background: rgba(255,255,255,.05); color: rgba(255,255,255,.7); }

.vip-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 14px;
}
.vip-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255,196,0,.1);
  border: 1px solid rgba(255,196,0,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
}

.vip-modal h2 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 10px;
  color: rgba(255,255,255,.92);
}
.vip-sub {
  font-size: 0.76rem;
  color: rgba(255,255,255,.4);
  line-height: 1.6;
  margin-bottom: 20px;
}
.vip-sub strong { color: rgba(255,255,255,.65); font-weight: 500; }

.vip-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.65rem;
  color: rgba(255,255,255,.3);
}
.vip-avatars {
  display: flex;
  flex-shrink: 0;
}
.vip-avatars span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(14,14,20,.94);
  margin-right: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  opacity: .75;
}
.vip-avatars span:nth-child(1) { background: #5a6e8a; z-index: 4; }
.vip-avatars span:nth-child(2) { background: #6a5a8a; z-index: 3; }
.vip-avatars span:nth-child(3) { background: #5a8a6a; z-index: 2; }
.vip-avatars span:nth-child(4) { background: #8a5a6a; z-index: 1; }
.vip-social strong { color: rgba(255,255,255,.55); font-weight: 500; }

.vip-cta {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.1);
  border-bottom: 2px solid var(--accent);
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  width: 100%;
  transition: background .2s, border-color .2s, transform .1s;
}
.vip-cta:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.16);
  border-bottom-color: var(--accent);
}
.vip-cta:active { transform: scale(.98); background: rgba(255,255,255,.05); }

.vip-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 0.6rem;
  color: rgba(255,255,255,.22);
}
.vip-trust span { white-space: nowrap; }
.vip-trust .sep { color: rgba(255,255,255,.1); }

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .upcoming { height: 34px; }
  .upcoming-label { padding: 0 10px; font-size: 0.58rem; }
  .upcoming-track { padding-left: 100px; animation-duration: 25s; }
  .upcoming-item { font-size: 0.68rem; margin-right: 14px; }
  .upcoming-item .sep { color: rgba(255,255,255,.35); font-size: 0.85rem; margin-right: 10px; }

  main { padding: 0; width: 100%; justify-content: flex-start; padding-bottom: 20px; }

  .title { font-size: 0.6rem; letter-spacing: 3px; padding: 10px 0 6px; width: 100%; }

  .viewers { top: 8px; left: 8px; padding: 3px 10px; font-size: 0.65rem; gap: 5px; }

  .video-wrap {
    width: 100%;
    max-width: 100%;
    border-radius: 5px;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
  }

  .ad-slot { width: 100%; max-width: 100%; height: 50px; }

  .chat-panel { width: 100%; max-width: 100%; }
  .chat { height: 160px; padding: 8px 10px; }
  .chat-msg { font-size: 0.72rem; }
  .chat-input { width: 100%; }
  .chat-input input, .chat-input button { font-size: 0.72rem; padding: 7px 10px; }
  .chat-input input { font-size: 16px; }

  .vip-modal { width: 100%; max-width: 100%; padding: 24px 16px 18px; }
  .vip-avatars { display: none; }

  .live-bar { gap: 3px; }
  .live-bar .ctrl { padding: 0 6px 3px; }
  .live-bar .ctrl button { width: 20px; height: 20px; font-size: 0.65rem; }
  .live-bar .ctrl button .ico { width: 11px; height: 11px; }
  .live-bar .live-tag { font-size: 0.5rem; gap: 2px; }
  .live-bar .track { margin: 0 6px; }
}

@media (min-width: 481px) and (max-width: 768px) {
  .title { font-size: 0.65rem; letter-spacing: 4px; padding: 16px 0 10px; }
  .chat { height: 180px; }
  .viewers { top: 10px; left: 10px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .title { font-size: 0.7rem; padding: 18px 0 10px; }
  .chat { height: 200px; }
}

@media (hover: none) {
  .vip-close {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .vip-cta { padding: 14px 28px; }
  .chat-input button { padding: 9px 16px; }
}
