.studio { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.studio .host-only { display: none !important; }
.studio.is-host .host-only:not([hidden]) { display: flex !important; }
.studio.is-host input.host-only { display: block !important; }
.studio.is-host .viewer-only { display: none !important; }

.studio-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.studio-title { min-width: 0; }
.studio-title strong, .studio-title span { display: block; }
.studio-title span { font-size: 12px; color: var(--muted); }
.studio-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(52, 211, 153, .13); color: var(--green); }
.badge.warn { background: rgba(251, 191, 36, .13); color: var(--amber); }
.code-badge { font-family: ui-monospace, monospace; font-weight: 700; letter-spacing: 2px; padding: 5px 12px; border-radius: 7px; border: 1px dashed #5a5f73; background: var(--input); color: #7dd3fc; }

.studio-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.stage-col { display: flex; flex-direction: column; min-height: 0; background: #050507; overflow-y: auto; }

/* ===== Pemutar ===== */
.player-shell { display: flex; flex-direction: column; flex: 1; min-height: 0; background: #000; }
.stage { position: relative; flex: 1; min-height: 280px; overflow: hidden; background: #000; }
.video-mount > * { position: absolute; border: 0; max-width: none; }
.video-mount video { object-fit: fill; }
.video-shield { position: absolute; inset: 0; z-index: 2; }
.fx-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.fx-emoji { position: absolute; bottom: 20px; font-size: 38px; animation: float-up 2.6s ease-out forwards; }
.fx-sticker { position: absolute; bottom: 24px; width: clamp(90px, 14vw, 150px); text-align: center; animation: sticker-pop 3.4s ease forwards; }
.fx-sticker img { width: 100%; filter: drop-shadow(0 8px 14px rgba(0,0,0,.6)); }
.fx-sticker span { font-size: 12px; font-weight: 700; background: rgba(0,0,0,.65); padding: 2px 8px; border-radius: 99px; }
@keyframes float-up { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-300px) scale(1.15); opacity: 0; } }
@keyframes sticker-pop { 0% { transform: scale(.3); opacity: 0; } 10% { transform: scale(1.12); opacity: 1; } 18%, 85% { transform: scale(1); opacity: 1; } 100% { transform: translateY(-30px); opacity: 0; } }

.stage-overlay { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px; background: rgba(0,0,0,.62); border: 0; font-weight: 600; }
.stage-overlay.passive { pointer-events: none; }
.countdown { font-family: var(--display); font-size: clamp(90px, 18vw, 190px); line-height: 1; pointer-events: none; }
.unlock-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--red); display: grid; place-items: center; font-size: 28px; }

/* ===== Kontrol ===== */
.controls { background: var(--surface); border-top: 1px solid var(--line); padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.timeline { display: flex; align-items: center; gap: 14px; padding-top: 14px; }
.timeline-track { position: relative; flex: 1; height: 6px; border-radius: 99px; background: #343846; }
.timeline-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: var(--red); }
.timeline-track input { position: absolute; left: 0; top: -9px; width: 100%; height: 24px; opacity: 0; cursor: pointer; z-index: 2; }
.timeline-track input:focus-visible { opacity: .6; }
.timeline-markers { position: absolute; inset: 0; pointer-events: none; }
.marker { position: absolute; bottom: 8px; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: #101116; border: 2px solid var(--green); transition: left .5s linear; }
.marker.off { border-color: var(--amber); z-index: 1; }
.time { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); white-space: nowrap; }
.control-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.control-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.control-right { margin-left: auto; }
.volume { width: 80px; accent-color: var(--red); }
.zoom-control { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.zoom-control input { width: 90px; accent-color: var(--red); }
.viewer-note { font-size: 12px; color: var(--muted); }
.react-btn { font-size: 17px; padding: 3px 9px; }

.player-shell:fullscreen, .player-shell.pseudo-fullscreen { position: fixed; inset: 0; z-index: 50; }
.player-shell:fullscreen .controls, .player-shell.pseudo-fullscreen .controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; background: rgba(15,16,21,.9); transition: opacity .25s; }
.player-shell.idle { cursor: none; }
.player-shell.idle .controls { opacity: 0; pointer-events: none; }

.media-panel { align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; background: #101118; border-top: 1px solid var(--line); font-size: 13px; }
.media-panel select { max-width: 260px; }

/* ===== Sidebar ===== */
.sidebar { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); }
.tabs-flat { border-radius: 0; border-bottom: 1px solid var(--line); }
.unread { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: #fff; color: #111; font-size: 11px; }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-list, .member-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.chat-msg { background: var(--surface-2); border-radius: 10px; padding: 8px 11px; font-size: 13px; overflow-wrap: anywhere; }
.chat-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 2px; }
.chat-head time { color: var(--muted); font-size: 11px; }
.chat-sticker { width: 108px; height: 108px; object-fit: contain; display: block; margin-top: 4px; }
.chat-system { text-align: center; font-size: 12px; color: var(--amber); }
.host-tag { margin-left: 6px; padding: 1px 5px; border-radius: 4px; background: var(--red); font-size: 9px; font-weight: 800; }
.sticker-tray { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); flex: none; gap: 6px; padding: 10px; max-height: 220px; overflow-y: auto; border-top: 1px solid var(--line); background: var(--input); }
.sticker-tray button { min-width: 0; background: none; border: 1px solid transparent; border-radius: 8px; padding: 4px; aspect-ratio: 1; }
.sticker-tray button:hover { background: var(--surface-2); border-color: var(--line); }
.sticker-tray img { width: 100%; height: 100%; object-fit: contain; }
.sticker-tray p { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.chat-form { display: flex; gap: 7px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form .btn { padding: 8px 11px; font-size: 13px; }

.room-clock { padding: 14px; text-align: center; border-bottom: 1px solid var(--line); }
.room-clock span, .room-clock small { display: block; font-size: 12px; color: var(--muted); }
.room-clock strong { font-family: ui-monospace, monospace; font-size: 28px; }
.member { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.member-top { display: flex; align-items: center; gap: 10px; }
.member-avatar { font-size: 20px; }
.member-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.member-name small { display: block; font-weight: 500; color: var(--green); font-size: 12px; }
.member.off .member-name small { color: var(--amber); }
.member-time { font-family: ui-monospace, monospace; font-size: 13px; }
.member-bar { height: 4px; margin-top: 8px; border-radius: 99px; background: #343846; overflow: hidden; }
.member-bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .5s linear; }
.member.off .member-bar i { background: var(--amber); }
.kick-btn { background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; }

@media (max-width: 960px) {
  .studio { height: auto; min-height: 100dvh; }
  .studio-body { grid-template-columns: minmax(0, 1fr); }
  .stage-col { overflow: visible; }
  .player-shell { flex: none; }
  .stage { flex: none; aspect-ratio: 16 / 9; min-height: 200px; }
  .player-shell:fullscreen .stage, .player-shell.pseudo-fullscreen .stage { flex: 1; aspect-ratio: auto; }
  .sidebar { height: 70dvh; min-height: 420px; border-left: 0; border-top: 1px solid var(--line); }
  .volume { width: 64px; }
  .control-right { margin-left: 0; }
}

/* ===== Intro & subtitle ===== */
.intro-mount { position: absolute; inset: 0; z-index: 1; background: #000; }
.subtitle-layer {
  position: absolute; left: 0; right: 0; bottom: 6%; z-index: 3; padding: 0 5%;
  display: flex; justify-content: center; pointer-events: none; text-align: center;
  --sub-size: clamp(14px, 2.1vw, 28px);
}
.subtitle-layer[data-size="s"] { --sub-size: clamp(12px, 1.6vw, 21px); }
.subtitle-layer[data-size="l"] { --sub-size: clamp(17px, 2.8vw, 38px); }
.subtitle-text {
  display: inline-block; max-width: 100%; padding: 3px 12px; border-radius: 6px;
  background: rgba(0, 0, 0, .72); color: #fff; font-size: var(--sub-size); line-height: 1.35;
  font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; text-shadow: 0 1px 2px #000;
}
.intro-badge {
  position: absolute; top: 12px; left: 12px; z-index: 4; pointer-events: none;
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(0, 0, 0, .7); border: 1px solid rgba(255, 255, 255, .2);
}
.intro-check { margin: 0; }
#introHint a { color: #7dd3fc; }
.control-right select.input-sm { max-width: 150px; }
.player-shell:fullscreen .subtitle-layer, .player-shell.pseudo-fullscreen .subtitle-layer { bottom: 9%; }
