/* ============================================================
   RVSL Live Studio — LIVE page (broadcast surface)
   Dark video-stage UI, mobile-first, TikTok/Shopee-live feel.
   Depends on css/tokens.css (dark tokens + primitives).
   ============================================================ */

.live-body {
  background:
    radial-gradient(1200px 600px at 70% -10%, #1a1330, var(--d-bg));
  color: var(--d-ink);
  min-height: 100%;
  overflow-x: hidden;
}
html, body { height: 100%; }

/* ---------- Layout shell ----------
   Mobile: full-bleed vertical stage with chat overlaid.
   Desktop: stage + side chat panel. */
.live-wrap {
  position: relative;
  width: 100%;
  height: 100dvh;
  height: 100vh; /* fallback */
  overflow: hidden;
}

.stage {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
}

.scene { position: absolute; inset: 0; z-index: 0; }
.scene.has-video video { width: 100%; height: 100%; object-fit: cover; }

/* Scrims — keep text readable over any video */
.scrim { position: absolute; left: 0; right: 0; z-index: 1; pointer-events: none; }
.scrim--top {
  top: 0; height: 128px;
  background: linear-gradient(rgba(0,0,0,.62), rgba(0,0,0,0));
}
.scrim--bottom {
  bottom: 0; height: 46%;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.28) 46%, rgba(0,0,0,.82));
}

/* ---------- Top bar ---------- */
.top-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
}
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--danger); color: #fff;
  font-weight: 800; font-size: var(--fs-xs); letter-spacing: .6px;
  padding: 5px 9px; border-radius: 7px;
  box-shadow: 0 2px 10px rgba(225,29,72,.45);
}
.live-badge i {
  width: 7px; height: 7px; border-radius: 50%; background: #fff;
  animation: blink 1.2s steps(1,end) infinite;
}
@keyframes blink { 50% { opacity: .15; } }

.viewers {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.5); color: #fff;
  font-size: var(--fs-xs); font-weight: 700;
  padding: 5px 10px; border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.12);
}
.viewers::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #ff4d6d; box-shadow: 0 0 0 0 rgba(255,77,109,.7);
  animation: pingdot 1.8s ease-out infinite;
}
@keyframes pingdot {
  0% { box-shadow: 0 0 0 0 rgba(255,77,109,.6); }
  70%,100% { box-shadow: 0 0 0 7px rgba(255,77,109,0); }
}

.ai-badge {
  margin-left: auto;
  background: rgba(0,0,0,.42); color: #d7ffe9;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .3px;
  padding: 5px 9px; border-radius: 7px;
  border: 1px solid rgba(120,255,190,.28);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

/* Follow — CSS-only toggle */
.follow-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 64px; height: 30px; padding: 0 12px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 999px; font-size: var(--fs-xs); font-weight: 800;
  cursor: pointer; user-select: none;
  transition: background .18s var(--ease), transform .12s var(--ease);
}
.follow-btn span::before { content: "＋ Ikuti"; }
.follow-btn:active { transform: scale(.95); }
#followChk:checked + .follow-btn {
  background: rgba(255,255,255,.14); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}
#followChk:checked + .follow-btn span::before { content: "✓ Diikuti"; }
#followChk:focus-visible + .follow-btn { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Brand strip ---------- */
.brand-strip {
  position: absolute; top: calc(52px + env(safe-area-inset-top)); left: 12px; z-index: 6;
  display: flex; align-items: center; gap: 9px;
  background: rgba(0,0,0,.4); padding: 6px 12px 6px 6px; border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.1);
  max-width: 66%;
}
.brand-ava {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 14px;
  background: linear-gradient(135deg, var(--accent), #8a1039);
}
.brand-text { min-width: 0; line-height: 1.15; }
.brand-strip .bn {
  font-weight: 800; font-size: var(--fs-sm);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-strip .bt { font-size: var(--fs-xs); color: #ffe3ec; opacity: .85; }

/* ---------- Right action rail ---------- */
.action-rail {
  position: absolute; right: 10px; z-index: 6;
  bottom: calc(120px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.rail-btn {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; color: #fff;
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.14);
  transition: transform .12s var(--ease), background .15s var(--ease);
}
.rail-btn:active { transform: scale(.9); }
.rail-btn.off { color: #ff8098; }
.like-btn .like-heart { color: #ff4d6d; display: inline-block; }
.like-btn:active .like-heart { animation: likepop .4s var(--ease); }
@keyframes likepop {
  0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); }
}

/* ---------- Floating hearts ---------- */
.hearts {
  position: absolute; right: 12px; z-index: 5; pointer-events: none;
  bottom: calc(150px + env(safe-area-inset-bottom));
  width: 60px; height: 42vh;
}
.heart {
  position: absolute; bottom: 0; left: 20px;
  color: #ff4d6d; font-size: 18px; opacity: 0;
  animation: floatHeart 4.2s ease-in infinite;
}
.heart:nth-child(1) { animation-delay: 0s;   left: 14px; }
.heart:nth-child(2) { animation-delay: .9s;  left: 30px; font-size: 14px; }
.heart:nth-child(3) { animation-delay: 1.8s; left: 8px;  font-size: 22px; }
.heart:nth-child(4) { animation-delay: 2.6s; left: 26px; }
.heart:nth-child(5) { animation-delay: 3.4s; left: 18px; font-size: 16px; }
@keyframes floatHeart {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  15% { opacity: .95; }
  70% { opacity: .8; }
  100% { transform: translateY(-42vh) translateX(-14px) scale(1.1) rotate(12deg); opacity: 0; }
}

/* ---------- Scene label (debug/angle tag) ---------- */
.scene-label {
  position: absolute; top: calc(58px + env(safe-area-inset-top)); right: 12px; z-index: 5;
  font-size: var(--fs-xs); color: var(--d-muted); background: rgba(0,0,0,.4);
  padding: 3px 8px; border-radius: 6px; letter-spacing: .2px;
}
.scene-label:empty { display: none; }

/* ---------- Product pin ---------- */
.product-pin {
  position: absolute; left: 12px; z-index: 7;
  bottom: calc(190px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
  background: #fff; color: #14151c;
  border-radius: 16px; padding: 8px 8px 8px 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  max-width: min(84%, 320px);
  animation: pinPop .38s var(--ease);
}
@keyframes pinPop {
  from { transform: translateY(14px) scale(.94); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.pin-thumb {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 18px;
  background: linear-gradient(135deg, var(--accent), #8a1039);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}
.pin-info { min-width: 0; line-height: 1.2; }
.pin-name {
  font-weight: 800; font-size: var(--fs-sm); color: #14151c;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px;
}
.pin-priceline { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.pin-price { color: var(--accent); font-weight: 900; font-size: 17px; }
.pin-old { color: #9aa; text-decoration: line-through; font-size: var(--fs-xs); }
.pin-disc {
  background: var(--accent-soft); color: var(--accent);
  font-weight: 800; font-size: 10px; padding: 1px 6px; border-radius: 6px;
}
.pin-buy {
  margin-left: auto; align-self: stretch;
  display: inline-flex; align-items: center; gap: 5px;
  background: #ffcd00; color: #1a1400; font-weight: 900;
  padding: 0 14px; border-radius: 12px; font-size: var(--fs-sm);
  box-shadow: 0 4px 14px rgba(255,205,0,.4);
  transition: transform .12s var(--ease), filter .12s var(--ease);
}
.pin-buy::before { content: "🛒"; font-size: 14px; }
.pin-buy:active { transform: translateY(1px) scale(.97); }
.pin-buy:hover { filter: brightness(1.03); }

/* ---------- AI host caption (lower-third subtitle) ---------- */
.caption-wrap {
  position: absolute; left: 12px; right: 12px; z-index: 7;
  bottom: calc(76px + env(safe-area-inset-bottom));
  display: flex; align-items: flex-end; gap: 8px;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.caption-wrap:has(.caption:empty) { opacity: 0; transform: translateY(6px); pointer-events: none; }
.cap-avatar {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, #6d5efc, var(--accent));
  box-shadow: 0 3px 10px rgba(109,94,252,.5);
}
.caption {
  flex: 1 1 auto;
  background: rgba(8,8,16,.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.1);
  color: #fff; font-size: var(--fs-body); font-weight: 600; line-height: 1.38;
  padding: 9px 13px; border-radius: 14px 14px 14px 4px;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.caption:empty { display: none; }
/* Speaking equalizer */
.cap-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 30px; padding-bottom: 6px; }
.caption-wrap:has(.caption:empty) .cap-eq { visibility: hidden; }
.cap-eq i {
  width: 3px; height: 6px; border-radius: 2px; background: var(--accent);
  animation: eq .9s ease-in-out infinite;
}
.cap-eq i:nth-child(2) { animation-delay: .18s; }
.cap-eq i:nth-child(3) { animation-delay: .36s; }
.cap-eq i:nth-child(4) { animation-delay: .54s; }
@keyframes eq { 0%,100% { height: 5px; } 50% { height: 15px; } }

/* ---------- Chat ----------
   Mobile: floating over video, bottom. Desktop: side panel. */
.chat-panel {
  position: absolute; left: 0; right: 0; z-index: 8;
  bottom: 0;
  display: flex; flex-direction: column;
  max-height: 40vh;
  padding: 0 12px calc(10px + env(safe-area-inset-bottom));
  pointer-events: none; /* let taps fall through empty areas */
}
.chat-head { display: none; } /* hidden in mobile overlay */
.chat-list {
  pointer-events: auto;
  list-style: none; margin: 0; padding: 0 0 8px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 6px;
  max-width: 78%;
  -webkit-mask-image: linear-gradient(rgba(0,0,0,0), #000 22%);
          mask-image: linear-gradient(rgba(0,0,0,0), #000 22%);
  scrollbar-width: none;
}
.chat-list::-webkit-scrollbar { display: none; }
.chat-msg {
  pointer-events: auto;
  font-size: var(--fs-sm); line-height: 1.35; color: #fff;
  background: rgba(8,8,16,.5);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 6px 11px; border-radius: 14px; width: fit-content; max-width: 100%;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  animation: chatIn .28s var(--ease);
}
@keyframes chatIn { from { transform: translateX(-8px); opacity: 0; } }
.chat-user { font-weight: 800; color: #ffd6e0; margin-right: 5px; }
.chat-msg.host {
  background: linear-gradient(135deg, rgba(255,46,99,.32), rgba(255,46,99,.16));
  border: 1px solid rgba(255,46,99,.4);
}
.chat-msg.host .chat-user { color: #ffcada; }
.chat-msg.host::before {
  content: "AI"; display: inline-block; margin-right: 6px;
  font-size: 9px; font-weight: 900; color: #fff; letter-spacing: .3px;
  background: var(--accent); padding: 1px 5px; border-radius: 5px; vertical-align: 1px;
}

.chat-form {
  pointer-events: auto;
  display: flex; gap: 8px; align-items: center; margin-top: 6px;
}
.chat-form input {
  flex: 1; min-height: var(--tap);
  background: rgba(8,8,16,.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.18); color: #fff;
  border-radius: 999px; padding: 0 16px; font-size: var(--fs-sm);
}
.chat-form input::placeholder { color: rgba(255,255,255,.55); }
.chat-form button {
  flex: 0 0 auto; width: var(--tap); height: var(--tap); border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: 17px; font-weight: 800;
  display: grid; place-items: center;
  transition: transform .12s var(--ease), filter .12s var(--ease);
}
.chat-form button:active { transform: scale(.92); }
.chat-form button:hover { filter: brightness(1.05); }

/* ---------- Start overlay ---------- */
.start-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: radial-gradient(900px 500px at 50% -10%, #241a44, rgba(6,6,12,.96));
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 24px;
}
.start-card {
  max-width: 400px; width: 100%;
  background: rgba(21,21,31,.7);
  border: 1px solid var(--d-line);
  border-radius: var(--r-lg);
  padding: 30px 26px 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.start-logo {
  width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 14px;
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 22px;
  background: linear-gradient(135deg, var(--accent), #8a1039);
  box-shadow: 0 10px 30px rgba(255,46,99,.4);
}
.start-live {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: .6px; color: #ff9db2;
  background: rgba(255,46,99,.12); border: 1px solid rgba(255,46,99,.35);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.start-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1.2s steps(1,end) infinite; }
.start-card h1 { margin: 0 0 8px; font-size: var(--fs-h1); color: var(--d-ink); }
.start-card p { color: var(--d-muted); font-size: var(--fs-sm); line-height: 1.55; margin: 0 0 20px; }
.start-card .btn { margin-bottom: 18px; }
.start-feats {
  list-style: none; margin: 0 0 16px; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.start-feats li {
  font-size: var(--fs-xs); font-weight: 600; color: var(--d-ink);
  background: var(--d-surface-2); border: 1px solid var(--d-line);
  padding: 6px 11px; border-radius: 999px;
}
.hint { font-size: var(--fs-xs); color: var(--d-muted); }

/* ============================================================
   DESKTOP — stage + side chat panel
   ============================================================ */
@media (min-width: 900px) {
  .live-wrap {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 16px;
    max-width: 1240px;
    height: 100vh;
    margin: 0 auto;
    padding: 18px;
    overflow: hidden;
  }
  .stage {
    position: relative; inset: auto;
    height: calc(100vh - 36px); width: auto; aspect-ratio: 9 / 16;
    justify-self: center;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
  }

  /* Chat becomes a solid side panel */
  .chat-panel {
    position: relative; inset: auto; z-index: auto;
    height: calc(100vh - 36px); max-height: none;
    background: var(--d-surface);
    border: 1px solid var(--d-line); border-radius: var(--r-lg);
    padding: 0; overflow: hidden;
    pointer-events: auto;
  }
  .chat-head {
    display: block; padding: 14px 16px; border-bottom: 1px solid var(--d-line);
    font-weight: 800;
  }
  .chat-head-title { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-body); }
  .chat-head-title .dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
    animation: blink 1.2s steps(1,end) infinite;
  }
  .chat-head small { display: block; color: var(--d-muted); font-weight: 400; font-size: var(--fs-xs); margin-top: 3px; }

  .chat-list {
    flex: 1; max-width: none; padding: 12px 14px;
    -webkit-mask-image: none; mask-image: none;
    scrollbar-width: thin;
  }
  .chat-list::-webkit-scrollbar { display: block; width: 6px; }
  .chat-list::-webkit-scrollbar-thumb { background: var(--d-line); border-radius: 3px; }
  .chat-msg {
    background: var(--d-surface-2); color: var(--d-ink);
    backdrop-filter: none; -webkit-backdrop-filter: none; text-shadow: none;
    max-width: 100%;
  }
  .chat-user { color: var(--d-muted); }
  .chat-msg.host { color: #fff; }

  .chat-form {
    margin: 0; padding: 12px; border-top: 1px solid var(--d-line);
    background: var(--d-surface);
  }
  .chat-form input {
    background: var(--d-surface-2); border: 1px solid var(--d-line);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .chat-form input::placeholder { color: var(--d-muted); }

  /* Bring floating bits inward from the stage edges on the tall frame */
  .action-rail { bottom: 96px; }
  .hearts { bottom: 130px; }
}

/* ============================================================
   PLACEHOLDER SCENES (CSS animations, no video assets)
   live.js emits this markup via sceneMarkup(); class names must match.
   ============================================================ */
.ph { position: absolute; inset: 0; overflow: hidden; }
.ph-room { background: linear-gradient(160deg, #2a2340, #14101f); }
.ph-room .ph-light {
  position: absolute; top: -20%; left: 50%; width: 60%; height: 80%; transform: translateX(-50%);
  background: radial-gradient(circle at 50% 0, rgba(255,220,150,.35), transparent 60%);
  animation: sway 6s ease-in-out infinite alternate;
}
.ph-room .ph-floor {
  position: absolute; bottom: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(#0000, rgba(255,255,255,.06));
}
@keyframes sway { to { transform: translateX(-40%); } }

.ph-shelf {
  background: linear-gradient(160deg, #23324a, #0f1826); display: grid;
  grid-template-columns: repeat(2, 1fr); gap: 18px; padding: 22%; align-content: center;
}
.ph-shelf span {
  display: block; height: 70px; border-radius: 10px;
  background: linear-gradient(135deg, #3a4d6e, #22314a); animation: floaty 4s ease-in-out infinite;
}
.ph-shelf span:nth-child(2) { animation-delay: .5s; }
.ph-shelf span:nth-child(3) { animation-delay: 1s; }
.ph-shelf span:nth-child(4) { animation-delay: 1.5s; }
@keyframes floaty { 50% { transform: translateY(-8px); } }

.ph-sweep { background: #0a0a12; }
.ph-sweep .ph-bar {
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.18) 50%, transparent 65%);
  animation: sweep 1.6s linear infinite;
}
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.ph-product { background: radial-gradient(circle at 50% 45%, #2b2140, #0c0912); display: grid; place-items: center; }
.ph-product .ph-box {
  width: 45%; aspect-ratio: 1; border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), #8a1039);
  box-shadow: 0 20px 60px rgba(255,46,99,.35);
  animation: spin 6s ease-in-out infinite alternate;
}
.ph-product .ph-glow {
  position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,46,99,.25), transparent 60%);
  animation: pulse 3s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(8deg) scale(1.05); } }
@keyframes pulse { 50% { transform: scale(1.15); opacity: .7; } }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .heart, .cap-eq i, .live-badge i, .viewers::before, .start-live i,
  .ph-room .ph-light, .ph-shelf span, .ph-sweep .ph-bar,
  .ph-product .ph-box, .ph-product .ph-glow, .chat-head-title .dot {
    animation: none !important;
  }
  .heart { display: none; }
}

/* ============================================================
   OPERATOR CONTROLS + stacked, scrollable layout (added)
   Panggung tetap tampil rapi; kontrol operator selalu kejangkau.
   ============================================================ */

/* MOBILE (base): halaman menumpuk & bisa di-scroll */
.live-wrap {
  height: auto; min-height: 100dvh;
  display: flex; flex-direction: column;
  overflow: visible;
}
.stage {
  position: relative; inset: auto;
  width: 100%; max-width: 430px; margin: 10px auto 0;
  aspect-ratio: 9 / 16; max-height: 66vh;
  border-radius: var(--r); align-self: center;
  box-shadow: var(--shadow-lg);
}
.side-col {
  display: flex; flex-direction: column; gap: 12px;
  padding: 12px; padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* Chat kembali ke alur normal di mobile */
.chat-panel {
  position: relative; inset: auto; bottom: auto; z-index: auto;
  max-height: 38vh; padding: 0; pointer-events: auto;
  background: var(--d-surface); border: 1px solid var(--d-line);
  border-radius: var(--r); overflow: hidden;
  display: flex; flex-direction: column;
}
.chat-panel .chat-head { display: block; padding: 12px 14px; border-bottom: 1px solid var(--d-line); font-weight: 800; }
.chat-panel .chat-head-title { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-body); }
.chat-panel .chat-head-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: blink 1.2s steps(1,end) infinite; }
.chat-panel .chat-head small { display: block; color: var(--d-muted); font-weight: 400; font-size: var(--fs-xs); margin-top: 3px; }
.chat-panel .chat-list {
  flex: 1; max-width: none; padding: 12px 14px; margin: 0;
  -webkit-mask-image: none; mask-image: none;
}
.chat-panel .chat-msg { background: var(--d-surface-2); color: var(--d-ink); backdrop-filter: none; -webkit-backdrop-filter: none; text-shadow: none; }
.chat-panel .chat-form { margin: 0; padding: 10px; border-top: 1px solid var(--d-line); }
.chat-panel .chat-form input { background: var(--d-surface-2); border: 1px solid var(--d-line); backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Panel kontrol operator */
.control-panel {
  background: var(--d-surface); border: 1px solid var(--d-line);
  border-radius: var(--r); padding: 14px;
}
.ctl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.ctl-title { font-weight: 800; font-size: var(--fs-body); }
.ctl-state {
  font-size: var(--fs-xs); font-weight: 700; color: var(--accent);
  background: rgba(255,46,99,.12); border: 1px solid rgba(255,46,99,.3);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.ctl-hint { color: var(--d-muted); font-size: var(--fs-xs); margin: 0 0 12px; }
.ctl-products { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.ctl-prod {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: var(--tap); padding: 8px 12px; text-align: left;
  background: var(--d-surface-2); border: 1px solid var(--d-line); color: var(--d-ink);
  border-radius: var(--r-sm); transition: transform .12s var(--ease), border-color .12s;
}
.ctl-prod:active { transform: scale(.97); }
.ctl-prod.active { border-color: var(--accent); background: rgba(255,46,99,.14); box-shadow: inset 0 0 0 1px var(--accent); }
.ctl-prod-name { font-weight: 700; font-size: var(--fs-sm); line-height: 1.2; }
.ctl-prod-price { font-size: var(--fs-xs); color: var(--accent); font-weight: 800; }
.ctl-idle {
  width: 100%; min-height: var(--tap); border-radius: var(--r-sm);
  background: var(--d-surface-2); border: 1px solid var(--d-line); color: var(--d-ink);
  font-weight: 700; font-size: var(--fs-sm); margin-bottom: 8px;
}
.ctl-idle.active { border-color: var(--accent); color: #fff; }
.ctl-studio {
  display: block; text-align: center; font-size: var(--fs-sm); font-weight: 700;
  color: var(--d-muted); text-decoration: none; padding: 8px;
}

/* Modal beli */
.buy-modal {
  position: fixed; inset: 0; z-index: 70; display: none;
  align-items: center; justify-content: center; padding: 22px;
  background: rgba(6,6,12,.72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.buy-modal.show { display: flex; }
.buy-card {
  position: relative; width: 100%; max-width: 360px;
  background: var(--d-surface); border: 1px solid var(--d-line);
  border-radius: var(--r-lg); padding: 26px 22px; text-align: center;
  box-shadow: var(--shadow-lg); animation: buyPop .3s var(--ease);
}
.buy-x {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--d-surface-2); color: var(--d-muted); font-size: 14px;
}
.buy-emoji { font-size: 40px; margin-bottom: 8px; }
.buy-name { margin: 0 0 4px; font-size: var(--fs-h2); color: var(--d-ink); }
.buy-price { color: var(--accent); font-weight: 900; font-size: 26px; margin-bottom: 16px; }
.buy-voucher-wrap {
  background: var(--d-surface-2); border: 1px dashed var(--accent);
  border-radius: var(--r-sm); padding: 10px; margin-bottom: 16px;
}
.buy-voucher-label { font-size: var(--fs-xs); color: var(--d-muted); margin-bottom: 4px; }
.buy-voucher { font-weight: 900; font-size: 18px; letter-spacing: 1px; color: var(--d-ink); }
.buy-cancel { display: block; width: 100%; margin-top: 10px; color: var(--d-muted); font-size: var(--fs-sm); min-height: 40px; }
@keyframes buyPop { from { transform: translateY(10px); opacity: 0; } }

/* DESKTOP: kolom kanan = panel kontrol + chat */
@media (min-width: 900px) {
  .live-wrap {
    display: grid; grid-template-columns: 1fr 380px; gap: 16px;
    max-width: 1240px; height: 100vh; margin: 0 auto; padding: 18px; overflow: hidden;
  }
  .stage {
    position: relative; inset: auto; margin: 0;
    height: calc(100vh - 36px); width: auto; max-height: none; aspect-ratio: 9 / 16;
    justify-self: center; border-radius: var(--r-lg);
  }
  .side-col { height: calc(100vh - 36px); padding: 0; gap: 14px; overflow: hidden; }
  .chat-panel { flex: 1; max-height: none; min-height: 0; }
}
