/* Stage 1/3 clean LIVE screen — UI visibility only; keep API, SSE, media, room IDs unchanged.
   The unique gift drawer is #lov-gift-drawer; mobile #lov-mo-bottom is the functional
   chat/guest/gifts shortcut strip, not the removed legacy site navigation. */
body.in-live-room #lov-studio-v2.lov-clean-room :is(
 .lov-studio-head,.lov-quicknav,.lov-game-module,.lov-gameboard,.lov-race-details,
 #lov-game-board,#lov-cinema,#lov-cinema-cell,#lov-cinema-tools,#lov-winamp,
 #lov-effects-strip,.lov-effects-strip,.lov-live-bottom,.lov-action-strip,
 #lov-layout-sheet,#lov-layout-scrim,#lov-control-scrim,#lov-extra,
 #lov-solo-pk,#lov-pk-scorebar
){display:none!important}
body.in-live-room #lov-studio-v2.lov-clean-room #lov-clean-controls{display:block;min-width:0;order:2}
body.in-live-room #lov-studio-v2.lov-clean-room #lov-clean-controls>.card{
 margin:0;padding:7px 9px;border:1px solid #215f7a;border-radius:12px;
 background:linear-gradient(125deg,#091e33,#0d2c45);box-shadow:none;
}
body.in-live-room #lov-studio-v2.lov-clean-room #lov-clean-controls>.card>h3,
body.in-live-room #lov-studio-v2.lov-clean-room #lov-clean-controls :is(
 #room-requests,#room-advanced,#gift-overlay,#platform-controls
){display:none!important}
body.in-live-room #lov-studio-v2.lov-clean-room #lov-clean-controls #room-controls{
 display:flex;flex-wrap:wrap;align-items:center;gap:6px;
}
body.in-live-room #lov-studio-v2.lov-clean-room #lov-clean-controls #room-controls>.btn{
 min-height:34px;font-size:12px;padding:6px 9px;
}
body.in-live-room #lov-studio-v2.lov-clean-room #lov-main-stage{order:1}
body.in-live-room #lov-studio-v2.lov-clean-room #lov-chat{order:3}
body.in-live-room #lov-studio-v2.lov-clean-room #lov-chat .lov-chat-gift{display:inline-flex}
body.in-live-room :is(.phone-nav,.bottom-nav,.app-bottom-nav){display:none!important}

/* liveOVER mobile LIVE Room — approved mobile overlay UI.
   Loaded AFTER styles.css, studio-v2.css and live-effects.css.
   No changes to server, LiveKit, gift ledgers or moderator permissions. */

@media (max-width: 767px) {

  /* Full-screen viewing, not a page that scrolls through cards. */
  html:has(body.lov-mo-live),
  body.in-live-room.lov-mo-live {
    width: 100%; height: 100%; overflow: hidden !important;
    overscroll-behavior: none; background: #02050c;
    touch-action: pan-x pan-y;
  }
  body.in-live-room.lov-mo-live #app,
  body.in-live-room.lov-mo-live #main,
  body.in-live-room.lov-mo-live .app-shell,
  body.in-live-room.lov-mo-live .container {
    position: fixed !important; inset: 0 !important;
    width: 100vw !important; height: 100dvh !important;
    min-width: 0 !important; max-width: none !important;
    max-height: 100dvh !important; margin: 0 !important;
    padding: 0 !important; overflow: hidden !important;
    background: #02050c;
  }
  body.in-live-room.lov-mo-live .top,
  body.in-live-room.lov-mo-live .sidebar,
  body.in-live-room.lov-mo-live .phone-nav,
  body.in-live-room.lov-mo-live #main > .headline,
  body.in-live-room.lov-mo-live #room-stats,
  body.in-live-room.lov-mo-live #room-analytics,
  body.in-live-room.lov-mo-live #lov-membership-pills,
  body.in-live-room.lov-mo-live #lov-studio-v2 > .lov-studio-head,
  body.in-live-room.lov-mo-live #lov-studio-v2 > .lov-quicknav,
  body.in-live-room.lov-mo-live #lov-studio-v2 > .lov-game-module,
  body.in-live-room.lov-mo-live #lov-studio-v2 > .lov-effects-strip,
  body.in-live-room.lov-mo-live #lov-studio-v2 > .lov-live-bottom,
  body.in-live-room.lov-mo-live #lov-studio-v2 > .lov-action-strip,
  body.in-live-room.lov-mo-live #lov-studio-v2 > .lov-extra[hidden] {
    display: none !important;
  }
  body.in-live-room.lov-mo-live #lov-studio-v2.lov-mobile-layered {
    position: fixed; inset: 0;
    width: 100vw; height: 100dvh;
    max-width: none; max-height: 100dvh;
    margin: 0; padding: 0;
    display: block; overflow: hidden;
    background: #03050a; isolation: isolate;
    border: 0 !important; border-radius: 0 !important;
  }
  body.in-live-room.lov-mo-live .room-tile,
  body.in-live-room.lov-mo-live .lov-mo-top,
  body.in-live-room.lov-mo-live .lov-mo-bottom,
  body.in-live-room.lov-mo-live .lov-gift-panel { box-sizing: border-box; min-width: 0; }

  /* Layer 1: video, true edge-to-edge, with existing LiveKit <video>s. */
  html body.in-live-room.lov-mo-live #lov-studio-v2 #lov-main-stage {
    position: absolute; inset: 0; z-index: 1;
    width: 100%; height: 100%; min-height: 0;
    margin: 0; padding: 0; gap: 0;
    overflow: hidden; display: block;
    background: #030812 !important; border: 0 !important; border-radius: 0 !important;
    box-shadow: none !important;
  }
  body.in-live-room.lov-mo-live #lov-main-stage #lov-tap-like-total,
  body.in-live-room.lov-mo-live #lov-main-stage .lov-tap-like-counter,
  body.in-live-room.lov-mo-live #lov-main-stage .lov-scene-caption,
  body.in-live-room.lov-mo-live #lov-main-stage #lov-solo-pk { display: none; }
  html body.in-live-room.lov-mo-live #lov-main-stage .lov-scene-tiles {
    position: absolute; inset: 0;
    display: grid; width: 100%; height: 100%;
    margin: 0; padding: 0;
    gap: 0; overflow: hidden;
    grid-template-columns: 1fr; grid-template-rows: 1fr;
    align-items: stretch; justify-content: stretch;
    background: #060b18;
  }
  html body.in-live-room.lov-mo-live #lov-main-stage #lov-seats-slot,
html body.in-live-room.lov-mo-live #lov-main-stage #lov-seats-slot > .card,
html body.in-live-room.lov-mo-live #lov-main-stage #room-tiles { display: contents !important; }
  html body.in-live-room.lov-mo-live #lov-main-stage .lov-scene-tiles :is(.room-tile,.empty-seat) {
    position: relative; display: block;
    width: 100%; height: 100%; min-height: 0;
    max-width: none; max-height: none;
    aspect-ratio: auto;
    padding: 0; margin: 0;
    border: 0 !important; border-radius: 0 !important;
    grid-column: auto; grid-row: auto;
    overflow: hidden; background: #0e1828;
    box-shadow: none !important;
  }
  body.in-live-room.lov-mo-live #lov-main-stage .room-tile video {
    position: absolute; inset: 0; width: 100%;
    height: 100%; max-width: none;
    object-fit: cover; border-radius: 0 !important;
  }
  body.in-live-room.lov-mo-live #lov-main-stage .room-tile .person {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: radial-gradient(ellipse at center, #25415d, #060c18 68%);
  }
  body.in-live-room.lov-mo-live #lov-main-stage .room-tile .person .avatar {
    width: clamp(44px, 12vw, 95px); height: clamp(44px, 12vw, 95px);
    max-width: 100%; object-fit: cover; border-radius: 50%;
  }
  body.in-live-room.lov-mo-live #lov-main-stage .room-tile .role {
    position: absolute; top: 7px; left: 7px;
    z-index: 4; border-radius: 7px !important;
    padding: 3px 6px; font-size: 9px !important;
    background: #090f1c9c; color: #e0fbff;
  }
  body.in-live-room.lov-mo-live #lov-main-stage .room-tile .name {
    position: absolute; bottom: 6px;
    left: 6px; right: 4px;
    z-index: 4; overflow-wrap: anywhere;
    white-space: normal !important; max-width: calc(100% - 10px);
    text-shadow: 0 2px 7px #000, 0 1px 2px #000;
    background: linear-gradient(0deg, #0009, transparent);
    font-size: clamp(9px, 2.3vw, 12px) !important;
  }
  body.in-live-room.lov-mo-live #lov-main-stage .room-tile .name .pill { font-size: 9px !important; }
  body.in-live-room.lov-mo-live #lov-main-stage .lov-seat-controls { z-index: 5; }
  body.in-live-room.lov-mo-live #lov-main-stage .empty-seat {
    display: grid; place-items: center;
    background: linear-gradient(135deg, #12263b, #07111f) !important;
    color: #a7e3f5; border: 1px solid #225068 !important;
  }
  body.in-live-room.lov-mo-live #lov-main-stage .empty-seat[hidden] { display: none !important; }
  body.in-live-room.lov-mo-live #lov-main-stage[data-layout="solo"] .lov-scene-tiles {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr;
  }
  body.in-live-room.lov-mo-live #lov-main-stage[data-layout="solo"] #speaker-grid > .room-tile:first-child {
    grid-column: 1; grid-row: 1;
  }
  /* PK LIVE Battle: red versus blue, no gaps, live server scores reused. */
  html body.in-live-room.lov-mo-live #lov-main-stage[data-layout="pk1v1"] .lov-scene-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 1fr; gap: 0;
  }
  body.in-live-room.lov-mo-live #lov-main-stage[data-layout="pk1v1"] #speaker-grid > .room-tile:nth-child(1) {
    grid-column: 1; grid-row: 1;
  }
  body.in-live-room.lov-mo-live #lov-main-stage[data-layout="pk1v1"] #speaker-grid > .room-tile:nth-child(2) {
    grid-column: 2; grid-row: 1;
  }
  html body.in-live-room.lov-mo-live #lov-main-stage[data-layout="pk2v2"] .lov-scene-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  html body.in-live-room.lov-mo-live #lov-main-stage[data-layout="multi8"] .lov-scene-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }
  /* multi8 contains exactly up to nine visible slots; other room members remain
     in the underlying authorized LIVE state and can reappear in multi15. */
  body.in-live-room.lov-mo-live #lov-main-stage[data-layout="multi8"] #speaker-grid > .room-tile:is(
    [data-lov-seat="10"],[data-lov-seat="11"],[data-lov-seat="12"],
    [data-lov-seat="13"],[data-lov-seat="14"],[data-lov-seat="15"]),
  body.in-live-room.lov-mo-live #lov-main-stage[data-layout="multi8"] #lov-seats-slot > .empty-seat:is(
    [data-seat="10"],[data-seat="11"],[data-seat="12"],
    [data-seat="13"],[data-seat="14"],[data-seat="15"]) { display: none !important; }
  html body.in-live-room.lov-mo-live #lov-main-stage[data-layout="multi15"] .lov-scene-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(5, minmax(0, 1fr));
  }
  /* Game mode retains one genuine Ludo/Belote board in the center. */
  html body.in-live-room.lov-mo-live #lov-main-stage[data-layout="game"] .lov-scene-tiles {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 3px; align-items: center;
  }
  body.in-live-room.lov-mo-live #lov-main-stage[data-layout="game"] .lov-gameboard {
    display: block; position: relative;
    grid-column: 2; grid-row: 1/span 2;
    width: 100%; align-self: center;
    min-width: 0; max-width: 100%;
    padding: 2px; margin: 0;
  }
  body.in-live-room.lov-mo-live #lov-main-stage[data-layout="game"] #speaker-grid > .room-tile:nth-child(1) { grid-column: 1; grid-row: 1; }
  body.in-live-room.lov-mo-live #lov-main-stage[data-layout="game"] #speaker-grid > .room-tile:nth-child(2) { grid-column: 3; grid-row: 1; }
  body.in-live-room.lov-mo-live #lov-main-stage[data-layout="game"] #speaker-grid > .room-tile:nth-child(3) { grid-column: 1; grid-row: 2; }
  body.in-live-room.lov-mo-live #lov-main-stage[data-layout="game"] #speaker-grid > .room-tile:nth-child(4) { grid-column: 3; grid-row: 2; }

  /* Cinema uses existing mode selection. It is closed in other layouts. */
  html body.in-live-room.lov-mo-live #lov-main-stage #lov-cinema,
  html body.in-live-room.lov-mo-live #lov-main-stage #lov-cinema-cell { display: none; }
  html body.in-live-room.lov-mo-live #lov-main-stage[data-layout="youtube"] #lov-cinema:not([hidden]),
  html body.in-live-room.lov-mo-live #lov-main-stage[data-layout="cinema"] #lov-cinema-cell:not([hidden]) {
    position: absolute !important; inset: 0 !important; display: grid !important;
    z-index: 3 !important; background: #020812f0 !important;
    border: none !important; border-radius: 0 !important;
    padding: calc(var(--mo-top) + 100px) 10px calc(var(--mo-bottom) + 100px) !important;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: auto !important;
  }
  html body.in-live-room.lov-mo-live #lov-cinema .lov-screen,
  html body.in-live-room.lov-mo-live #lov-cinema .live-media-stage {
    width: 100% !important; aspect-ratio: 16/9 !important;
    max-width: 100% !important; border: none !important;
  }
  body.in-live-room.lov-mo-live #lov-main-stage:is([data-layout="cinema"],[data-layout="youtube"]) .lov-scene-tiles {
    inset: auto 0 calc(82px + var(--mo-bottom)) 0;
    height: min(25dvh, 190px);
    z-index: 4;
  }

  /* Layer 2: floating header. */
  body.lov-mo-live #lov-mobile-overlay { position: static; }
  body.lov-mo-live .lov-mo-top {
    position: fixed; z-index: 10; top: 0; left: 0; right: 0;
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 6px; padding: calc(var(--mo-top) + 8px) 9px 10px;
    min-width: 0; pointer-events: none;
    background: linear-gradient(180deg, #0008, transparent 100%);
  }
  body.lov-mo-live .lov-mo-top button { pointer-events: auto; }
  body.lov-mo-live .lov-mo-host-stack { flex: 1 1 auto; min-width: 0; max-width: 65%; }
  body.lov-mo-live .lov-mo-host-pill {
    display: flex; align-items: center; gap: 5px;
    width: max-content; max-width: 100%; min-height: 44px;
    padding: 3px 5px; border-radius: 28px;
    background: var(--mo-glass); border: 1px solid #ffffff26;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 2px 18px #0007;
  }
  body.lov-mo-live .lov-mo-avatar-hit { background: none; border: 0; padding: 0; display: grid; place-items: center; flex-shrink: 0; }
  body.lov-mo-live .lov-mo-avatar {
    flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center;
    border: 1.5px solid #9cf0ff; border-radius: 50%; object-fit: cover;
    color: #d4fbff; background: linear-gradient(135deg, #156489, #101b39);
    font-size: 14px; font-weight: 900;
  }
  body.lov-mo-live .lov-mo-host-text {
    display: flex; flex-direction: column; min-width: 0; max-width: 110px;
    overflow: hidden; color: white; line-height: 1.1;
  }
  body.lov-mo-live .lov-mo-host-text strong,
  body.lov-mo-live .lov-mo-host-text small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.lov-mo-live .lov-mo-host-text strong { font-size: 11px; }
  body.lov-mo-live .lov-mo-host-text small { opacity: .8; font-size: 9px; }
  body.lov-mo-live .lov-mo-like { display: grid; justify-items: center; gap: 0; flex-shrink: 0; background: none; color: #ff87b2; border: none; padding: 0 2px; font-size: 10px; line-height: 1; }
  body.lov-mo-live .lov-mo-like svg { width: 15px; height: 15px; fill: #f74f8a; }
  body.lov-mo-live .lov-mo-right { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
  body.lov-mo-live .lov-mo-viewers,
  body.lov-mo-live .lov-mo-exit {
    display: inline-flex; align-items: center; justify-content: center; gap: 2px;
    min-height: 33px; padding: 4px 6px; border: 1px solid #ffffff30;
    border-radius: 22px; background: #111527a8; color: #fff;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    font-size: 10px;
  }
  body.lov-mo-live .lov-mo-viewers svg { width: 16px; height: 16px; }
  body.lov-mo-live .lov-mo-exit { width: 33px; padding: 4px; }
  body.lov-mo-live .lov-mo-exit svg { width: 20px; height: 20px; }

  /* PK points and timer remain authoritative, beneath the floating header. */
  body.in-live-room.lov-mo-live #lov-layout-scorebar:not([hidden]) {
    position: fixed !important; z-index: 11 !important;
    top: calc(var(--mo-top) + 73px) !important; left: 0 !important; right: 0 !important;
    width: 100% !important; max-width: none !important;
    margin: 0 !important; border: 0 !important; border-radius: 0 !important;
    padding: 3px 8px !important; background: #070f25bb;
    box-shadow: 0 5px 18px #0009;
  }
  body.lov-mo-live #lov-layout-scorebar .lov-layout-pk-top,
  body.lov-mo-live #lov-layout-scorebar .lov-layout-pk-values { display: flex; justify-content: space-between; align-items: center; gap: 3px; }
  body.lov-mo-live #lov-layout-scorebar .lov-layout-pk-top strong { color: #fff; font-size: 12px; white-space: nowrap; }
  body.lov-mo-live #lov-layout-scorebar .lov-layout-pk-top b { font-size: 10px; max-width: 32%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.lov-mo-live #lov-layout-scorebar .lov-layout-pk-top .blue { color: #ff6283; }
  body.lov-mo-live #lov-layout-scorebar .lov-layout-pk-top .pink { color: #70b9ff; }
  body.lov-mo-live #lov-layout-scorebar .lov-layout-pk-progress { display: flex; width: 100%; height: 9px; overflow: hidden; border-radius: 0; }
  body.lov-mo-live #lov-layout-scorebar .lov-layout-pk-progress i:first-child { background: #fb4568; }
  body.lov-mo-live #lov-layout-scorebar .lov-layout-pk-progress i:last-child { background: #318dfb; }

  /* Layer 3: transparent chat over the video, separately scrollable. */
  html body.in-live-room.lov-mo-live #lov-studio-v2 #lov-chat {
    display: flex; flex-direction: column;
    position: fixed; z-index: 10;
    left: 0; right: auto;
    bottom: calc(75px + var(--mo-bottom));
    width: min(85vw, 420px); height: auto;
    max-height: 32dvh; min-height: 0;
    overflow: hidden; pointer-events: auto;
    margin: 0; padding: 16px 8px 0;
    border: 0 !important; border-radius: 0 !important;
    box-shadow: none !important; background: linear-gradient(0deg, #0009, #0004 55%, transparent) !important;
  }
  body.in-live-room.lov-mo-live #lov-chat .lov-module-heading,
  body.in-live-room.lov-mo-live #lov-chat .room-chat > h3,
  body.in-live-room.lov-mo-live #lov-chat .chat-send { display: none; }
  body.in-live-room.lov-mo-live #lov-chat #lov-chat-slot,
  body.in-live-room.lov-mo-live #lov-chat .room-chat { display: block; flex: 1; min-height: 0; height: auto; padding: 0; }
  html body.in-live-room.lov-mo-live #lov-chat #room-lines {
    width: 100%; height: min(28dvh, 260px);
    min-height: 0; max-height: 28dvh;
    overflow-y: auto; overscroll-behavior: contain;
    background: transparent !important; border: 0 !important;
    padding: 0 3px 4px; box-shadow: none !important;
    scrollbar-width: none;
    mask-image: linear-gradient(0deg,#000 78%,transparent 100%);
    -webkit-mask-image: linear-gradient(0deg,#000 78%,transparent 100%);
  }
  body.in-live-room.lov-mo-live #room-lines::-webkit-scrollbar { display: none; }
  body.in-live-room.lov-mo-live #room-lines .line {
    width: max-content; max-width: 100%; margin: 3px 0; padding: 2px 4px !important;
    background: transparent !important; border: 0 !important;
    text-shadow: 0 2px 7px #000, 0 1px 2px #000;
    color: white !important; font-size: 12px; line-height: 1.4;
    white-space: normal; overflow-wrap: anywhere;
  }
  body.in-live-room.lov-mo-live #room-lines .line .pill { font-size: 9px; vertical-align: middle; }
  body.in-live-room.lov-mo-live #room-lines .line button,
  body.in-live-room.lov-mo-live #room-lines .line a { color: #fff; text-shadow: inherit; }

  body.lov-mo-live .lov-mo-bottom {
    position: fixed; z-index: 11; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; gap: 6px;
    width: 100%; min-width: 0;
    padding: 7px 7px calc(8px + var(--mo-bottom));
    background: linear-gradient(0deg, #000b, #0004 70%, transparent);
  }
  body.lov-mo-live .lov-mo-shortcuts { flex: 0 0 auto; display: flex; align-items: center; gap: clamp(3px, 1.1vw, 7px); }
  body.lov-mo-live .lov-mo-round {
    display: grid; place-items: center; flex: 0 0 auto;
    width: clamp(30px, 8vw, 39px); height: clamp(30px, 8vw, 39px);
    padding: 5px; color: white; background: #242b3c9c;
    border: 1px solid #ffffff30; border-radius: 50%;
    box-shadow: 0 3px 10px #0006;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  body.lov-mo-live .lov-mo-round svg { width: 21px; height: 21px; }
  body.lov-mo-live .lov-mo-gift { color: #ffadd3; background: linear-gradient(135deg, #a84b86cc, #df8c72b8); }
  body.lov-mo-live .lov-mo-round:focus-visible { outline: 2px solid #62e6fb; outline-offset: 2px; }

  body.lov-mo-live .lov-mo-more[hidden],
  body.lov-mo-live .lov-mo-toast[hidden] { display: none !important; }
  body.lov-mo-live .lov-mo-more {
    position: fixed; z-index: 18; right: 10px;
    bottom: calc(65px + var(--mo-bottom));
    width: min(290px, calc(100vw - 20px));
    display: flex; flex-direction: column; gap: 4px;
    padding: 12px; border: 1px solid #ffffff3a;
    border-radius: 20px; background: #101b2be8; color: #f5fdff;
    box-shadow: 0 12px 50px #000a;
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
  body.lov-mo-live .lov-mo-more-title { display: flex; align-items: center; justify-content: space-between; }
  body.lov-mo-live .lov-mo-more button {
    display: flex; align-items: center; gap: 10px; padding: 10px;
    width: 100%; border: 0; border-radius: 10px;
    background: #2637509e; color: white; text-align: left; font-size: 13px;
  }
  body.lov-mo-live .lov-mo-more-title button { width: 30px; height: 30px; padding: 4px; justify-content: center; }
  body.lov-mo-live .lov-mo-more button svg { width: 19px; height: 19px; }
  body.lov-mo-live .lov-mo-toast {
    position: fixed; z-index: 40; left: 50%; top: 53%; transform: translate(-50%, -50%);
    width: max-content; max-width: 85vw; padding: 10px 15px; border-radius: 12px;
    background: #151b2fe8; border: 1px solid #61ddef; color: white; font-size: 12px;
  }

  /* Layer 4: gift selector, 4 per row, with real recipient + wallet + send. */
  body.lov-mo-live #lov-gift-drawer { position: fixed !important; inset: 0 !important; z-index: 25 !important; }
  body.lov-mo-live #lov-gift-drawer .lov-gift-scrim { position: fixed !important; inset: 0 !important; background: #0009 !important; }
  html body.lov-mo-live #lov-gift-drawer .lov-gift-panel {
    position: fixed !important; left: 0 !important; right: 0 !important;
    bottom: 0 !important; top: auto !important;
    width: 100% !important; max-width: none !important;
    max-height: min(74dvh, 760px) !important;
    overflow: auto !important; border-radius: 24px 24px 0 0 !important;
    padding: 15px 10px calc(13px + var(--mo-bottom)) !important;
    background: linear-gradient(165deg, #1b2035f2, #091322f5) !important;
    border: 1px solid #7ea7bb50 !important; border-bottom: 0 !important;
    box-shadow: 0 -20px 70px #000a !important;
    backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
    animation: lov-mo-slide .22s ease-out both;
  }
  @keyframes lov-mo-slide { from { transform: translateY(100%); } to { transform: translateY(0); } }
  body.lov-mo-live #lov-gift-drawer .lov-gift-grid {
    display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important; width: 100% !important;
  }
  body.lov-mo-live #lov-gift-drawer .lov-mo-gift-cell {
    display: flex; flex-direction: column; align-items: stretch; gap: 5px;
    min-width: 0; min-height: 120px; padding: 5px 2px 7px;
    background: #25324b8a; border: 1px solid #ffffff1b;
    border-radius: 12px; text-align: center;
  }
  body.lov-mo-live #lov-gift-drawer .lov-mo-gift-cell .lov-gift-card {
    display: flex !important; flex: 1 1 auto; flex-direction: column;
    justify-content: center; align-items: center; width: 100%; min-width: 0;
    border: none !important; background: transparent !important;
    padding: 3px !important; box-shadow: none !important; border-radius: 10px !important;
  }
  body.lov-mo-live #lov-gift-drawer .lov-gift-card .lov-gift-icon {
    display: grid; place-items: center; min-height: 42px;
    font-size: 28px; line-height: 1;
  }
  body.lov-mo-live #lov-gift-drawer .lov-gift-card .lov-gift-icon svg { max-width: 44px; max-height: 44px; }
  body.lov-mo-live #lov-gift-drawer .lov-gift-name {
    max-width: 100%; font-size: 9px !important;
    white-space: normal !important; overflow-wrap: anywhere;
    line-height: 1.1;
  }
  body.lov-mo-live #lov-gift-drawer .lov-gift-card strong { font-size: 9px !important; white-space: nowrap; color: #ffcc8c; }
  body.lov-mo-live #lov-gift-drawer .lov-mo-send-gift {
    display: block; width: calc(100% - 4px); min-height: 25px;
    margin: auto 2px 0; padding: 3px 1px; border: none; border-radius: 9px;
    background: linear-gradient(125deg, #e74694, #c88658);
    color: white; font-size: 9px; font-weight: 800;
  }
  body.lov-mo-live #lov-gift-drawer .lov-mo-send-gift:disabled { opacity: .45; }
  /* Kept in DOM for the original server-validated sending handler. */
  body.lov-mo-live #lov-gift-drawer .lov-gift-footer { display: flex !important; }
  body.lov-mo-live #lov-gift-scene,
  body.lov-mo-live #lov-live-projector,
  body.lov-mo-live .real-gift-overlay { z-index: 30 !important; }

  /* Existing HOST controls, scene mode selection and Winamp open as sheets. */
  body.lov-mo-live #lov-extra:not([hidden]),
  body.lov-mo-live #lov-layout-sheet:not([hidden]),
  body.lov-mo-live #lov-winamp {
    position: fixed !important; z-index: 20 !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
    width: 100% !important; max-width: none !important;
    height: auto !important; max-height: 70dvh !important;
    overflow-y: auto !important; margin: 0 !important;
    padding: 15px 12px calc(16px + var(--mo-bottom)) !important;
    background: #0b1b2af2 !important; border: 1px solid #5891b066 !important;
    border-radius: 22px 22px 0 0 !important;
    box-shadow: 0 -18px 50px #000a !important;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  }
  body.lov-mo-live #lov-extra[hidden], body.lov-mo-live #lov-layout-sheet[hidden] { display: none !important; }
  body.lov-mo-live #lov-control-scrim:not([hidden]),
  body.lov-mo-live #lov-layout-scrim:not([hidden]) {
    position: fixed !important; z-index: 19 !important;
    inset: 0 !important; background: #0009 !important;
  }
  body.lov-mo-live #lov-winamp { display: none !important; }
  body.lov-mo-live #lov-studio-v2.lov-mo-show-winamp #lov-winamp { display: block; }
  body.lov-mo-live #lov-winamp .lov-mo-audio-close { display: inline-flex; justify-content: center; align-items: center; float: right; min-height: 31px; min-width: 31px; border-radius: 50%; background: #304b61; color: white; border: 1px solid #ffffff50; }
}

/* Mobile For You: edge-to-edge feed cards, vertical swipe/snap, no page scroll.
   The existing virtualized feed, actions, uploads and permissions are retained. */
@media (max-width: 767px) {
  body:not(.in-live-room) #app:has(.feed) { width: 100%; height: 100dvh; overflow: hidden; }
  body:not(.in-live-room) #app:has(.feed) .top,
  body:not(.in-live-room) #app:has(.feed) .sidebar { display: none !important; }
  body:not(.in-live-room) #app:has(.feed) .app-shell,
  body:not(.in-live-room) #app:has(.feed) .container,
  body:not(.in-live-room) #app:has(.feed) .feed {
    position: fixed; inset: 0; margin: 0; padding: 0;
    width: 100%; height: 100dvh; max-width: none; min-width: 0; overflow: hidden;
    background: #02050b;
  }
  body:not(.in-live-room) #app:has(.feed) .feed > .headline { display: none !important; }
  body:not(.in-live-room) #app:has(.feed) .feed > .section-tabs {
    position: fixed; z-index: 32; top: calc(env(safe-area-inset-top, 0px) + 8px);
    left: 50%; transform: translateX(-50%); margin: 0;
    background: #0609135e; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 0; border-radius: 26px; padding: 3px; display: flex; white-space: nowrap;
  }
  body:not(.in-live-room) #app:has(.feed) .feed > .section-tabs a {
    color: #fff9; font-size: 12px; font-weight: 750; text-shadow: 0 1px 5px #000;
    padding: 6px 9px; border-radius: 18px;
  }
  body:not(.in-live-room) #app:has(.feed) .feed > .section-tabs a.active {
    color: white; border-bottom: 2px solid white; background: #ffffff1f;
  }
  body:not(.in-live-room) #app:has(.feed) #feed-posts {
    width: 100%; height: 100dvh !important; max-height: 100dvh !important;
    margin: 0; padding: 0; overflow-x: hidden; overflow-y: auto;
    scroll-snap-type: y mandatory; scroll-behavior: smooth;
    overscroll-behavior-y: contain; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  body:not(.in-live-room) #app:has(.feed) #feed-posts::-webkit-scrollbar { display: none; }
  body:not(.in-live-room) #app:has(.feed) #feed-posts > .post-card {
    scroll-snap-align: start; scroll-snap-stop: always;
    position: relative !important; display: block !important;
    width: 100% !important; height: 100dvh !important;
    min-height: 100dvh !important; max-width: none !important;
    margin: 0 !important; padding: 0 !important;
    overflow: hidden; border: none !important; border-radius: 0 !important;
    background: #050814 !important; box-shadow: none !important;
  }
  body:not(.in-live-room) #app:has(.feed) .feed-live-card .post-media {
    position: absolute !important; inset: 0 !important;
    width: 100% !important; height: 100% !important;
    min-height: 100% !important; max-height: none !important;
    border: none !important; background: #050814;
  }
  body:not(.in-live-room) #app:has(.feed) .feed-live-card .post-media video,
  body:not(.in-live-room) #app:has(.feed) .feed-live-card .post-media img {
    width: 100% !important; height: 100% !important; object-fit: cover !important;
    max-height: none !important; border-radius: 0 !important;
  }
  body:not(.in-live-room) #app:has(.feed) .feed-live-card .info,
  body:not(.in-live-room) #app:has(.feed) .feed-live-card .caption {
    position: absolute !important; z-index: 2; left: 11px; right: 74px;
    bottom: calc(110px + env(safe-area-inset-bottom,0px));
    margin: 0; color: white; text-shadow: 0 1px 6px #000;
  }
  body:not(.in-live-room) #app:has(.feed) .feed-live-card .info { bottom: calc(153px + env(safe-area-inset-bottom,0px)); }
  body:not(.in-live-room) #app:has(.feed) .feed-live-card .actionbar {
    position: absolute !important; z-index: 3; right: 8px; bottom: calc(104px + env(safe-area-inset-bottom,0px));
    display: flex !important; flex-direction: column; gap: 5px;
    max-height: min(62dvh, 500px); overflow-y: auto; scrollbar-width: none;
    background: transparent !important; border: 0 !important;
  }
  body:not(.in-live-room) #app:has(.feed) .feed-live-card .actionbar .btn {
    border-radius: 50%; min-height: 34px; min-width: 34px;
    padding: 5px; background: #15172891; color: white;
  }
  body:not(.in-live-room) #app:has(.feed) .phone-nav {
    display: grid !important; z-index: 33 !important; background: linear-gradient(0deg,#000e,#0005);
    border-top: 0 !important;
  }
  body:not(.in-live-room) #app:has(.feed) #more-posts {
    position: fixed; z-index: 31; bottom: calc(67px + env(safe-area-inset-bottom,0px));
    left: 50%; transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.lov-mo-live #lov-gift-drawer .lov-gift-panel { animation: none !important; }
  body:not(.in-live-room) #app:has(.feed) #feed-posts { scroll-behavior: auto !important; }
}
/* TikTok-style Multi-Guest controls are backed by /api/live/:id/guest-settings.
   UI is still liveOVER-branded; no mock participants or local admission. */
.lov-guest-settings-open{
 display:block;width:100%;min-height:46px;margin-top:14px;border:1px solid #57c7eb;
 border-radius:12px;background:linear-gradient(130deg,#103e63,#10213c);
 color:#e0fbff;font:inherit;font-weight:750;cursor:pointer;
}
.lov-guest-settings-form{display:grid;gap:14px;text-align:left;max-height:min(66dvh,590px);overflow-y:auto;padding:4px}
.lov-guest-settings-form fieldset{min-width:0;border:0;margin:0;padding:0}
.lov-guest-settings-form legend{font-size:14px;font-weight:850;color:#dff8ff;margin:0 0 9px}
.lov-guest-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.lov-guest-choice{display:flex;align-items:center;gap:9px;min-width:0;padding:11px 9px;border:1px solid #40627c;border-radius:12px;background:#13253c;color:#edfdff;font-size:13px;cursor:pointer}
.lov-guest-choice:has(input:checked){border-color:#47d8fa;box-shadow:inset 0 0 13px #23aeeb39}
.lov-guest-choice input{flex:0 0 auto;accent-color:#22cbe9}
.lov-guest-choice span{min-width:0;overflow-wrap:anywhere}
.lov-guest-auto{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 12px;background:#112941;border:1px solid #247090;border-radius:12px;color:#e8fcff;font-weight:750}
.lov-guest-auto input{width:24px;height:24px;flex:0 0 auto;accent-color:#18cde1}
@media(max-width:390px){.lov-guest-choice{font-size:11px;padding:9px 6px}.lov-guest-settings-form{max-height:64dvh}}

/* Review patch: keep non-tile nodes out of the flattened mobile scene grid. */
@media (max-width: 767px) {
  html body.in-live-room.lov-mo-live #lov-studio-v2 #lov-main-stage #camera-status {
    position: absolute;
    width: 1px; height: 1px;
    margin: 0; padding: 0;
    overflow: hidden; clip-path: inset(50%);
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2 #lov-main-stage .empty-seat[hidden] {
    display: none !important;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2 #lov-main-stage[data-layout="solo"] .lov-mode-vacancy,
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-guest-layout="adaptive"] #lov-main-stage[data-layout="multi15"] .lov-mode-vacancy {
    display: none;
  }
}

/* Guest controls are confined to the approved guest tile; HOST can mute audio without affecting camera. */
body.in-live-room #lov-studio-v2[data-scene-owned] #lov-main-stage[data-layout="solo-guests"] #speaker-grid>.room-tile>.lov-slot-tools{
 position:absolute!important;z-index:12!important;top:6px;right:6px;display:flex!important;
 flex-direction:row;align-items:center;justify-content:flex-end;gap:5px;max-width:calc(100% - 12px);
 background:transparent!important;pointer-events:auto!important;
}
body.in-live-room #lov-studio-v2[data-scene-owned] #lov-main-stage[data-layout="solo-guests"] #speaker-grid>.room-tile>.lov-slot-tools>button{
 display:grid;place-items:center;min-width:33px;min-height:33px;padding:5px 7px;
 border:1px solid #57bfd68c;border-radius:9px;background:#08152dd9;color:#d3faff;
 font-size:15px;line-height:1;box-shadow:0 1px 10px #0008;cursor:pointer;
}
body.in-live-room #lov-studio-v2[data-scene-owned] #lov-main-stage[data-layout="solo-guests"] #speaker-grid>.room-tile>.lov-slot-tools>button:disabled{opacity:.55;cursor:not-allowed}
body.in-live-room #lov-studio-v2[data-scene-owned] #lov-main-stage[data-layout="solo-guests"] #speaker-grid>.room-tile>.lov-slot-tools>button[aria-pressed="true"]{border-color:#55e7ff;background:#103953ed}
body.in-live-room #lov-studio-v2[data-scene-owned] #lov-main-stage[data-layout="solo-guests"] #speaker-grid>.room-tile>.lov-slot-tools>button:focus-visible{outline:2px solid #7fe7ff;outline-offset:2px}
/* PK 1vs1 invitation sheet: independent from the scorebar, timer and stage layout. */
#modal-root .modal:has(.lov-pk1v1-sheet){position:fixed;left:50%;bottom:0;transform:translateX(-50%);
 width:min(100%,540px);max-height:min(82dvh,680px);overflow:auto;
 border-radius:23px 23px 0 0;border:1px solid #428da7;
 padding-bottom:calc(18px + env(safe-area-inset-bottom,0px));
 background:linear-gradient(145deg,#101c41,#16435f);color:#e8fbff;
 box-shadow:0 -12px 48px #000a}
.lov-pk1v1-sheet{display:grid;gap:9px}
.lov-pk1v1-sheet h3{font-size:13px;margin:8px 0 0;color:#88edff}
.lov-pk1v1-person{display:flex;align-items:center;gap:8px;min-width:0;
 border:1px solid #366b86;border-radius:12px;background:#0b263e;padding:9px}
.lov-pk1v1-person-avatar{flex:none}
.lov-pk1v1-name{display:grid;gap:2px;min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis}
.lov-pk1v1-name b,.lov-pk1v1-name small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lov-pk1v1-name small{font-size:10px;color:#a2d5e7}
.lov-pk1v1-buttons{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}
.lov-pk1v1-status{font-size:11px;color:#85e5ce}
.lov-pk1v1-ready{padding:9px 12px;border:1px solid #4caaac;border-radius:10px;color:#b0f6e7;background:#0c3543}
@media(max-width:450px){.lov-pk1v1-person .btn{min-height:34px;font-size:11px;padding:5px 8px}}
/* Guest and HOST: verified Diamonds sit directly below @username, not in a floating unrelated badge. */
body.in-live-room #lov-studio-v2[data-scene-owned] #lov-main-stage[data-layout="solo-guests"] #speaker-grid>.room-tile>.name{
 display:flex;flex-wrap:wrap;align-items:center;column-gap:3px;
 padding:4px 6px;bottom:5px;
 max-width:calc(100% - 10px);overflow-wrap:anywhere;
}
body.in-live-room #lov-studio-v2[data-scene-owned] #lov-main-stage[data-layout="solo-guests"] #speaker-grid>.room-tile .lov-pause-gifts{
 position:relative!important;display:block!important;order:50;flex-basis:100%;
 left:auto!important;right:auto!important;bottom:auto!important;
 min-width:0;max-width:100%;padding:1px 0!important;margin:0!important;
 background:transparent!important;border:0!important;box-shadow:none!important;
 color:#9df1ff!important;text-shadow:0 1px 4px #000!important;
 font-size:clamp(9px,1.6vw,12px)!important;text-align:left!important;
 white-space:normal!important;overflow-wrap:anywhere!important;
}
.lov-gift-receiver-label{font-size:12px;color:#9addeb;margin:4px 2px 0}
.lov-gift-receiver-label strong{color:#f0fdff}
.lov-gift-recipient-role{font-size:9px;letter-spacing:.04em;color:#7defff;font-weight:800}
.lov-gift-recipient small{display:inline-block;font-size:10px;color:#b9e9ff}
/* Approved LIVE guests keep the same scene and chat: edge-to-edge 2/4/6/9 video grid. */
html body.in-live-room #lov-studio-v2[data-scene-owned] #lov-main-stage[data-layout="solo-guests"] #lov-scene-tiles{
 display:grid;gap:0;
 grid-template-columns:repeat(var(--lov-scene-columns,2),minmax(0,1fr));
 grid-template-rows:repeat(var(--lov-scene-rows,1),minmax(0,1fr));
 width:100%;height:100%;overflow:hidden;
}
html body.in-live-room #lov-studio-v2[data-scene-owned] #lov-main-stage[data-layout="solo-guests"] #speaker-grid>.room-tile{
 position:relative;min-width:0;min-height:0;
 width:100%;height:100%;aspect-ratio:auto;
 border:0!important;border-radius:0!important;outline:0!important;
 margin:0;padding:0;box-shadow:none!important;overflow:hidden;
}
html body.in-live-room #lov-studio-v2[data-scene-owned] #lov-main-stage[data-layout="solo-guests"] #speaker-grid>.room-tile video{
 position:absolute;inset:0;width:100%;height:100%;
 max-width:none;object-fit:cover;border:0!important;border-radius:0!important;
}
body.in-live-room.lov-mo-live #lov-main-stage[data-layout="solo-guests"] #speaker-grid>.room-tile{display:block}
/* Shared geometry: only the app's computed slot coordinates are consumed. */
html body.in-live-room #lov-studio-v2[data-scene-owned] #lov-main-stage #lov-scene-tiles {
  display: grid;
  grid-template-columns: repeat(var(--lov-scene-columns, 1), minmax(0, 1fr));
  grid-template-rows: repeat(var(--lov-scene-rows, 1), minmax(80px, 1fr));
  gap: 6px; min-width: 0;
}
html body.in-live-room #lov-studio-v2[data-scene-owned] #lov-main-stage :is(#lov-seats-slot,#lov-seats-slot>.card,#room-tiles) {
  display: contents !important;
}
html body.in-live-room #lov-studio-v2[data-scene-owned] #lov-main-stage #speaker-grid > :is(.room-tile,.lov-mode-vacancy) {
  grid-column: var(--lov-slot-col) / span var(--lov-slot-col-span, 1);
  grid-row: var(--lov-slot-row) / span var(--lov-slot-row-span, 1);
  order: var(--lov-slot-order);
  min-width: 0; min-height: 0;
}
html body.in-live-room #lov-studio-v2[data-scene-owned] #lov-main-stage #speaker-grid > :is(.lov-mode-overflow,.lov-pk-spectator) { display: none !important; }

/* Step 1: lovSyncSceneZone supplies cell coordinates; CSS consumes one plan. */
@media (max-width: 767px) {
  html body.in-live-room.lov-mo-live #lov-studio-v2.lov-mobile-layered[data-scene-owned] {
    --lov-mobile-chat: 124px;
    inset: auto; left: 0;
    top: var(--lov-viewport-top, 0px);
    height: var(--lov-viewport-height, 100dvh);
    max-height: var(--lov-viewport-height, 100dvh);
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned][data-keyboard="true"] {
    --mo-bottom: 0px;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] .lov-mo-top {
    position: absolute; top: 0;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] .lov-mo-bottom {
    position: absolute; bottom: 0;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-main-stage {
    inset: calc(var(--lov-mobile-header, 60px) + 6px) 0 calc(var(--lov-mobile-footer, 60px) + var(--lov-mobile-chat) + 12px);
    height: auto; width: 100%;
    display: block; min-height: 0;
    overflow: visible;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-main-stage #lov-scene-tiles {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: grid;
    grid-template-columns: repeat(var(--lov-scene-columns, 1), minmax(0, 1fr));
    grid-template-rows: repeat(var(--lov-scene-rows, 1), minmax(0, 1fr));
    grid-auto-flow: row; gap: 4px;
    align-items: stretch; overflow: visible;
    padding: 0 4px; box-sizing: border-box;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-main-stage :is(#lov-seats-slot,#lov-seats-slot>.card,#room-tiles) {
    display: contents !important;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-main-stage #speaker-grid > :is(.room-tile,.lov-mode-vacancy) {
    position: relative; display: block;
    grid-column: var(--lov-slot-col) / span var(--lov-slot-col-span, 1);
    grid-row: var(--lov-slot-row) / span var(--lov-slot-row-span, 1);
    order: var(--lov-slot-order);
    width: 100%; height: 100%;
    min-width: 0; min-height: 0;
    max-width: none; max-height: none;
    aspect-ratio: auto; margin: 0; padding: 0;
    border-radius: 8px !important; overflow: hidden;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-main-stage #speaker-grid > :is(.lov-mode-overflow,.lov-pk-spectator) {
    display: none !important;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-main-stage #speaker-grid > .lov-mode-vacancy {
    display: grid; place-content: center; gap: 8px;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-main-stage #speaker-grid > .room-tile .person {
    position: absolute; inset: 0;
  }
  /* Four 68px cameras; the board owns the whole middle column. */
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned]:is([data-active-scene="ludo"],[data-active-scene="belote"]) #lov-main-stage #lov-scene-tiles {
    grid-template-columns: 68px minmax(0, 1fr) 68px;
    grid-template-rows: repeat(2, minmax(68px, 1fr));
    align-items: center;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned]:is([data-active-scene="ludo"],[data-active-scene="belote"]) #lov-main-stage #speaker-grid > :is(.room-tile,.lov-mode-vacancy) {
    width: 68px; height: 68px;
    align-self: center; justify-self: center;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned]:is([data-active-scene="ludo"],[data-active-scene="belote"]) #lov-main-stage #lov-game-board {
    position: relative; display: block;
    grid-column: 2; grid-row: 1 / span 2;
    align-self: center; width: 100%;
    min-width: 0; max-width: 100%;
    max-height: 100%; overflow: visible;
    box-sizing: border-box; padding: 2px;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-game-board :is(.lov-board-title,button,.btn) {
    max-width: 100%; min-width: 0;
    white-space: normal !important; overflow-wrap: anywhere;
    box-sizing: border-box; font-size: 11px !important;
  }
  /* Media is above the camera grid, and both end before the chat. */
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned]:is([data-active-scene="youtube"],[data-active-scene="cinema"]) #lov-main-stage {
    display: flex; flex-direction: column; gap: 6px;
    overflow: auto;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-main-stage :is(#lov-cinema,#lov-cinema-cell):not([hidden]) {
    position: relative !important; inset: auto !important;
    display: block !important; flex: 0 0 auto !important;
    width: 100% !important; margin: 0 !important; padding: 4px !important;
    overflow: visible !important; box-sizing: border-box;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-main-stage :is(.lov-screen,.live-media-stage) {
    width: 100%; aspect-ratio: 16 / 9;
    height: auto; min-height: 0; max-height: none;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-main-stage :is(.live-media-stage,.lov-screen) :is(iframe,video) {
    width: 100%; height: 100%; aspect-ratio: 16 / 9;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned]:is([data-active-scene="youtube"],[data-active-scene="cinema"]) #lov-main-stage #lov-scene-tiles {
    position: relative; inset: auto;
    flex: 1 0 auto; height: auto;
    min-height: calc(var(--lov-scene-rows) * 68px);
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-chat {
    position: absolute; left: 0; right: 0;
    bottom: calc(var(--lov-mobile-footer, 60px) + 6px);
    width: 100%; height: var(--lov-mobile-chat);
    max-height: none; min-height: 0;
    padding: 14px 8px 0; box-sizing: border-box;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-chat #room-lines {
    height: 110px; max-height: 110px; min-height: 110px;
    box-sizing: border-box; padding: 0 3px;
    mask-image: none !important; -webkit-mask-image: none !important;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #room-lines .line {
    line-height: 22px !important; font-size: 12px !important;
    margin: 0; padding: 0 4px;
  }
}

@media (max-width: 767px) {
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #room-lines :is(.lov-glass-badge,.avatar.sm) {
    height: 18px !important; min-height: 0 !important; vertical-align: middle;
  }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #room-lines .avatar.sm { width: 18px; }
  html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #room-lines .user-inline { line-height: inherit !important; padding-top: 0; padding-bottom: 0; }
}

/* Step 2: media controls and standard stage variants. Brand colours are inherited. */
video.lov-local-mirror { transform: scaleX(-1) !important; }
.lov-media-buttons { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.lov-media-buttons .btn { min-width: 0; min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
#modal-root .modal-backdrop:has(.lov-media-settings) { z-index: 1200; }
#modal-root .modal:has(.lov-media-settings) { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%,560px); max-height: 80dvh; overflow-y: auto; border-radius: 20px 20px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom,0px)); box-sizing: border-box; }
.lov-scene-queue { position: absolute; bottom: 0; left: 4px; right: 4px; font-size: 12px; line-height: 24px; color: #dffaff; background: #071525dd; border-radius: 6px; padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lov-scene-queue[hidden] { display: none !important; }
@media (max-width:767px) {
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-main-stage #lov-scene-tiles { container-type: size; }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned][data-guest-layout="fixed-grid"] #lov-main-stage[data-layout="multi15"] #speaker-grid > :is(.room-tile,.lov-mode-vacancy) {
  width: min(100%, calc((100cqh - (var(--lov-scene-rows) - 1) * 4px) / var(--lov-scene-rows)));
  height: auto; aspect-ratio: 1; align-self: center; justify-self: center;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned]:not([data-scene-queued="0"]) #lov-main-stage #lov-scene-tiles { height: calc(100% - 28px); }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned].lov-pk-active #lov-main-stage #lov-scene-tiles {
  inset: 96px 0 0 !important; height: auto !important;
  grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 0 !important;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-main-stage #lov-pk-scorebar {
  position: absolute !important; inset: 0 0 auto !important; height: 90px !important; max-height: 90px !important;
  box-sizing: border-box; margin: 0 !important; padding: 5px 8px !important; border-radius: 8px !important; overflow: auto !important;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-pk-scorebar :is(.lov-pk-donors,.lov-pk-boosters) { display: none !important; }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-pk-scorebar > .muted { display: none !important; }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-pk-scorebar .lov-pk-team-score { padding: 2px 4px !important; }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-pk-scorebar .lov-pk-team-score b { font-size: 16px; }
}


/* Solo is the full viewport canvas; other scene plans retain their computed zones. */
@media(max-width:767px){
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned][data-layout="solo"] #lov-main-stage{
  inset:0;height:100%;width:100%;overflow:hidden;
  border:0!important;border-radius:0!important;background:#071525!important;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned][data-layout="solo"] #lov-main-stage #lov-scene-tiles{
  inset:0;width:100%;height:100%;padding:0;gap:0;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned][data-layout="solo"] #lov-main-stage #speaker-grid>.room-tile{
  border:0!important;border-radius:0!important;box-shadow:none!important;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned][data-layout="solo"] #lov-main-stage .room-tile video{
  inset:0;width:100%;height:100%;object-fit:cover;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned][data-layout="solo"] #lov-main-stage .room-tile :is(.role,.name,.lov-pause-gifts,.lov-seat-controls){
  display:none!important;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned][data-layout="solo"] #lov-chat{
  bottom:calc(var(--lov-mobile-footer,60px) + 6px);width:min(94%,440px);
  height:clamp(144px,29%,240px);padding:8px 8px 0;background:transparent!important;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned][data-layout="solo"] #lov-chat #room-lines{
  height:100%;min-height:0;max-height:100%;
  mask-image:linear-gradient(to top,#000 92%,transparent)!important;
  -webkit-mask-image:linear-gradient(to top,#000 92%,transparent)!important;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #room-lines .line.system{
  color:#8ae4fb!important;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #room-lines .line.lov-system-likes{
  color:#c0a6ff!important;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #room-lines .lov-chat-avatar-link{display:none}
 body.lov-mo-live .lov-mo-top{gap:4px}
 body.lov-mo-live .lov-mo-host-stack{max-width:calc(100% - 132px)}
 body.lov-mo-live .lov-mo-host-pill{box-shadow:none;background:#07152580;gap:4px}
 body.lov-mo-live .lov-mo-right{gap:4px}
 body.lov-mo-live .lov-mo-goal{
  display:inline-flex;align-items:center;max-width:100%;margin:0;padding:3px 6px;
  font-size:9px;line-height:15px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;
  border-radius:12px;border:1px solid #5bd7f64d;background:#07152580;color:#b4f1ff;
 }
 body.lov-mo-live .lov-mo-bottom{gap:5px;padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}
 body.lov-mo-live .lov-mo-shortcuts{gap:3px}
 body.lov-mo-live .lov-mo-round{width:32px;height:36px;padding:5px;border:0;background:#07152566;box-shadow:none;border-radius:16px}
 body.lov-mo-live .lov-mo-gift{background:#174c6580;color:#70e6fb}
}
.chat-send button[type="submit"][hidden]{display:none!important}
.lov-chat-guild{display:inline-flex;align-items:center;max-width:70px;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;font-size:10px;line-height:18px;padding:0 4px;border:1px solid #42d6ef66;border-radius:5px;background:#0b344b99;color:#77e8fa;font-weight:800}
.lov-camera-start{position:absolute;z-index:7;left:50%;top:55%;transform:translate(-50%,-50%);width:min(85%,300px);display:grid;justify-items:center;gap:8px;text-align:center;pointer-events:auto}
.lov-camera-start[hidden]{display:none!important}
.lov-camera-start>.btn{min-height:44px;background:#1bbfd8;color:#051b30;border:1px solid #82ecff;box-shadow:0 4px 22px #05152588}
.lov-camera-start>small{font-size:12px;color:#e1f7ff;text-shadow:0 2px 5px #000}

.lov-pinned-message{display:flex;align-items:center;gap:5px;flex-wrap:wrap;position:relative;padding:6px 10px;margin:0 0 6px;
 border:1px solid #50cee890;border-radius:10px;background:linear-gradient(110deg,#071b32ee,#17435aee);color:#e9f9ff;font-size:12px;line-height:1.35;box-shadow:0 3px 14px #00172780}
.lov-pinned-message .lov-pinned-mark{font-weight:800;color:#7ceaff;white-space:nowrap}
.lov-pinned-message .lov-pinned-content{overflow-wrap:anywhere;white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;flex:1 1 90px}
.lov-pinned-message .lov-pinned-remove{border:0;background:transparent;color:#bcefff;font-size:16px;padding:2px 7px;cursor:pointer}
body.lov-mo-live #lov-chat .lov-pinned-message{z-index:2;font-size:11px;max-height:74px;margin-bottom:4px}
body.lov-mo-live #lov-chat .lov-pinned-message .lov-live-level-badges{max-width:95px;overflow:hidden}
body.lov-mo-live #lov-chat:has(.lov-pinned-message) #room-lines{height:calc(100% - 74px);max-height:calc(100% - 74px)}
.lov-mo-guests{position:relative}
.lov-mo-guest-count{position:absolute;right:-5px;top:-6px;display:grid;place-items:center;min-width:16px;height:16px;
 padding:0 4px;border-radius:10px;background:#24d2ed;color:#061526;font-size:10px;font-weight:900;box-shadow:0 0 8px #24d2ed80}
.lov-mo-guest-count[hidden]{display:none!important}
#modal-root .modal:has(.lov-guest-queue){position:fixed;left:50%;bottom:0;transform:translateX(-50%);
 width:min(100%,540px);max-height:min(78dvh,680px);overflow:auto;
 border-radius:23px 23px 0 0;border:1px solid #3b8ba8;padding-bottom:calc(20px + env(safe-area-inset-bottom,0px));
 background:linear-gradient(150deg,#101C41,#16435F);color:#eafbff;box-shadow:0 -12px 48px #000a}
.lov-guest-queue{display:grid;gap:12px}
.lov-guest-queue>.muted{margin:0 0 3px}
.lov-guest-count{padding:10px 12px;border:1px solid #377b9b;border-radius:12px;background:#0b243b}
.lov-guest-request-row{display:flex;align-items:center;gap:10px;min-width:0;padding:11px;
 border:1px solid #3c6479;border-radius:13px;background:#102b43}
.lov-guest-request-row>strong{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis}
.lov-guest-request-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
.lov-guest-request-actions .btn{min-height:34px}
.lov-guest-empty{padding:17px 12px;margin:0;border:1px dashed #4485a0;border-radius:12px;color:#d9f5ff}
@media(max-width:440px){.lov-guest-request-row{gap:7px;flex-wrap:wrap}.lov-guest-request-actions{width:100%;justify-content:flex-end}}
/* Heart Me uses the original levels-system palette and the existing shared FIFO. */
#lov-studio-v2{--lov-level-diamond:#30D5E9;--lov-level-vip:#B488E8;--lov-level-start:#101C41;--lov-level-end:#16435F}
.lov-heart-badge{display:inline-flex;align-items:center;gap:3px;vertical-align:middle;white-space:nowrap;max-width:106px;overflow:hidden;border:1px solid var(--lov-level-vip,#B488E8);border-radius:7px;padding:0 4px;line-height:18px;height:20px;font-size:10px;font-weight:700;color:var(--lov-level-vip,#B488E8);background:linear-gradient(110deg,var(--lov-level-start,#101C41),var(--lov-level-end,#16435F));box-shadow:0 0 9px #B488E840}
.lov-heart-badge svg{width:12px;height:12px;flex-shrink:0}.lov-heart-badge>span{overflow:hidden;text-overflow:ellipsis}
.lov-heart-badge.inactive{color:#a1a7b1;border-color:#727987;background:linear-gradient(110deg,#252b35,#363d47);box-shadow:none}
#room-lines .lov-glass-badge.diamond{color:var(--lov-level-diamond);border-color:var(--lov-level-diamond);background:linear-gradient(110deg,var(--lov-level-start),var(--lov-level-end))}
#lov-projector-zone{position:relative;min-height:0;pointer-events:none;grid-column:1/-1}
#lov-projector-zone #lov-live-projector{position:relative!important;inset:auto!important;left:auto!important;top:auto!important;bottom:auto!important;transform:none!important;display:flex!important;align-items:center;gap:8px;width:max-content!important;max-width:100%!important;margin:0 0 6px!important;padding:8px 10px!important;border:1px solid var(--lov-projector-accent,#30D5E9)!important;border-radius:12px!important;background:linear-gradient(110deg,#101C41eb,#16435Feb)!important;box-shadow:0 0 16px color-mix(in srgb,var(--lov-projector-accent) 35%,transparent)!important;color:#e7f7ff!important;font-size:12px!important;animation:none!important;box-sizing:border-box}
#lov-live-projector>span:last-child{white-space:normal;overflow-wrap:anywhere}
#modal-root .modal:has(.lov-heart-sheet){position:fixed;left:50%;bottom:0;transform:translateX(-50%);width:min(100%,500px);max-height:calc(var(--lov-app-height,100dvh) - 24px);overflow:auto;border-radius:20px 20px 0 0;border-color:#B488E8;padding-bottom:calc(18px + env(safe-area-inset-bottom,0px));background:linear-gradient(130deg,#101C41,#16435F)}
.lov-heart-progress{display:grid;gap:9px;margin:16px 0}.lov-heart-progress progress{width:100%;height:12px;accent-color:#B488E8}.lov-heart-sheet>.btn{width:100%;min-height:44px;font-size:16px}
body.in-live-room :is([data-action^="guest-"],[data-action^="cohost-"],[data-action^="pk-"],[data-lov-action="layout-open"],[data-lov-action="layout-select"],[data-lov-action="pk-open"],[data-lov-action="guest-settings"],[data-lov-action^="seat-role-"],[data-overlay-action="layout"],[data-overlay-action="media"],[data-lov-action="jump-game"],[data-lov-action="jump-youtube"],#lov-pk-scorebar,#lov-layout-sheet,#lov-cinema,#lov-game-board,#lov-belote-stage,#lov-cinema-cell,#lov-cinema-tools,.lov-seat-controls,.lov-mode-vacancy){display:none!important}
@media(max-width:767px){
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-projector-zone{position:absolute!important;z-index:31;left:8px;right:8px;bottom:calc(var(--lov-mobile-footer,60px) + clamp(144px,29%,240px) + 20px);max-width:min(94%,440px)}
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned] #lov-projector-zone #lov-live-projector{font-size:11px!important;padding:6px 8px!important}
 body.lov-mo-live .lov-mo-host-stack{max-width:calc(100% - 125px)}
}

.lov-guild-chat{display:inline-flex;gap:3px;align-items:center;vertical-align:middle;border:1px solid #E9B96980;border-radius:6px;padding:0 4px;line-height:18px;font-size:10px;white-space:nowrap;background:#101C41cc;color:#E9B969}.lov-guild-chat svg{width:12px;height:12px}
.lov-guild-list{display:grid;gap:10px;margin-top:12px}
.lov-guild-row{display:flex;align-items:center;flex-wrap:wrap;gap:10px;min-width:0;padding:12px;border:1px solid #386b82;border-radius:13px;background:linear-gradient(130deg,#101C41cc,#16435F99)}
.lov-guild-position{min-width:26px;color:#E9B969}
.lov-guild-emblem{display:grid;place-items:center;width:42px;height:42px;border-radius:10px;object-fit:cover;flex-shrink:0;background:#16435F}
.lov-guild-identity{display:grid;gap:3px;flex:1;min-width:110px}.lov-guild-identity>a{overflow-wrap:anywhere}.lov-guild-identity>.lov-guild-chat{justify-self:start}
.lov-guild-score{display:grid;gap:3px;text-align:right;min-width:110px}.lov-guild-row small{color:#b7d9e7;font-size:11px}
#modal-root .modal:has([data-guild-board]){position:fixed;left:50%;bottom:0;transform:translateX(-50%);width:min(100%,680px);max-height:calc(var(--lov-app-height,100dvh) - 20px);overflow:auto;border-radius:20px 20px 0 0;padding-bottom:calc(16px + env(safe-area-inset-bottom));background:linear-gradient(130deg,#101C41,#16435F)}

.lov-guild-podium{flex-direction:column;align-items:center;text-align:center;padding:8px;gap:7px}
.lov-guild-podium .lov-guild-identity{min-width:0;width:100%;align-items:center;justify-items:center;flex:none}
.lov-guild-podium .lov-guild-score{min-width:0;width:100%;text-align:center;overflow-wrap:anywhere}
.lov-guild-podium .btn{max-width:100%;white-space:normal}

/* Guild management is scoped to the main site pages, outside the LIVE scene. */
.guild-search{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin-bottom:16px}
.guild-search>label{display:grid;gap:5px;flex:1;min-width:180px}
.guild-overview-identity{display:flex;gap:16px;align-items:center}.guild-overview-identity p{white-space:pre-wrap;overflow-wrap:anywhere}
.guild-panel-emblem{display:grid;place-items:center;width:88px;height:88px;object-fit:cover;border-radius:15px;background:#16435F;flex-shrink:0}
.guild-panel-progress{display:grid;gap:7px;margin:16px 0}.guild-panel-progress progress{width:100%;height:13px;accent-color:#E9B969}
.guild-management-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));margin-top:16px}
.guild-member-row,.guild-candidate-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:12px 0;border-bottom:1px solid #386b8255}
.guild-member-row>.content,.guild-candidate-row>.content{flex:1;min-width:110px;overflow-wrap:anywhere}
.guild-management-grid textarea{width:100%;box-sizing:border-box}
@media(max-width:767px){.guild-overview-identity{align-items:flex-start;gap:10px}.guild-panel-emblem{width:66px;height:66px}.guild-management-grid .btn{min-height:40px}}


/* LIVE fullscreen geometry — step 2/3.
   Presentation only. The existing LiveKit <video> elements, chat and gift drawer stay mounted. */
html:has(body.in-live-room),
body.in-live-room{
 width:100%;
 height:100%;
 overflow:hidden!important;
 overscroll-behavior:none;
}
html body.in-live-room #lov-studio-v2.lov-clean-room{
 position:fixed;
 inset:0;
 z-index:1000;
 width:100vw;
 height:100vh;
 height:100dvh;
 min-width:0;
 min-height:0;
 max-width:none;
 max-height:100dvh;
 margin:0;
 padding:0;
 overflow:hidden;
 overscroll-behavior:none;
 box-sizing:border-box;
 background:#03050b!important;
}
html body.in-live-room #lov-studio-v2.lov-clean-room #lov-main-stage,
html body.in-live-room #lov-studio-v2.lov-clean-room #lov-main-stage #lov-scene-tiles{
 min-width:0;
 min-height:0;
 overflow:hidden;
 background:#03050b!important;
 border:0!important;
 border-radius:0!important;
 box-shadow:none!important;
}
html body.in-live-room #lov-studio-v2.lov-clean-room #lov-main-stage #speaker-grid>.room-tile{
 min-width:0;min-height:0;
 max-width:none;max-height:none;
 width:100%;height:100%;
 border:0!important;border-radius:0!important;
 outline:0!important;box-shadow:none!important;
 margin:0;padding:0;
 overflow:hidden;
}
html body.in-live-room #lov-studio-v2.lov-clean-room #lov-main-stage #speaker-grid>.room-tile video{
 position:absolute;inset:0;
 width:100%;height:100%;
 max-width:none;max-height:none;
 object-fit:cover;border:0!important;border-radius:0!important;
}
@media(min-width:768px){
 html body.in-live-room #lov-studio-v2.lov-clean-room{
  display:grid;
  grid-template-columns:minmax(0,1fr) clamp(255px,27vw,380px);
  grid-template-rows:minmax(0,1fr) auto;
  align-items:stretch;
  justify-items:stretch;
  gap:8px;
  padding:max(8px,env(safe-area-inset-top,0px)) max(8px,env(safe-area-inset-right,0px))
          max(8px,env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px));
 }
 html body.in-live-room #lov-studio-v2.lov-clean-room #lov-main-stage{
  grid-column:1;grid-row:1 / span 2;
  position:relative;
  align-self:center;justify-self:center;
  order:0;
  aspect-ratio:9 / 16;
  width:min(100%,calc(56.25dvh - 18px));
  height:auto;max-height:100%;
  display:block;
  isolation:isolate;
 }
 html body.in-live-room #lov-studio-v2.lov-clean-room #lov-main-stage #lov-scene-tiles{
  position:absolute;inset:0;
  display:grid;
  grid-template-columns:repeat(var(--lov-scene-columns,1),minmax(0,1fr));
  grid-template-rows:repeat(var(--lov-scene-rows,1),minmax(0,1fr));
  gap:0;padding:0;
  width:100%;height:100%;
 }
 html body.in-live-room #lov-studio-v2.lov-clean-room #lov-main-stage :is(#lov-seats-slot,#lov-seats-slot>.card,#room-tiles){
  display:contents!important;
 }
 html body.in-live-room #lov-studio-v2.lov-clean-room #lov-chat{
  grid-column:2;grid-row:1;
  order:0;align-self:stretch;
  display:flex;flex-direction:column;
  height:100%;max-height:100%;
  min-height:0;overflow:hidden;
  padding:10px;margin:0;
 }
 html body.in-live-room #lov-studio-v2.lov-clean-room #lov-chat #lov-chat-slot,
 html body.in-live-room #lov-studio-v2.lov-clean-room #lov-chat .room-chat{
  display:flex;flex:1 1 auto;flex-direction:column;
  min-height:0;max-height:100%;overflow:hidden;
 }
 html body.in-live-room #lov-studio-v2.lov-clean-room #lov-chat #room-lines{
  flex:1 1 auto;
  min-height:0;max-height:none;
  height:100%;overflow-y:auto;overscroll-behavior:contain;
 }
 html body.in-live-room #lov-studio-v2.lov-clean-room #lov-clean-controls{
  grid-column:2;grid-row:2;order:0;
  min-height:0;max-height:min(30dvh,240px);
  overflow-y:auto;overscroll-behavior:contain;
 }
}
@media(max-width:767px){
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room.lov-mobile-layered{
  position:fixed;inset:auto 0 auto 0;
  top:var(--lov-viewport-top,0px);
  width:100vw;height:var(--lov-viewport-height,100dvh);
  min-height:0;max-height:var(--lov-viewport-height,100dvh);
  padding:0;margin:0;overflow:hidden;
  display:block;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-main-stage{
  position:absolute;inset:0;
  width:100%;height:100%;max-height:none;
  aspect-ratio:auto;overflow:hidden;
  padding:0;margin:0;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-main-stage #lov-scene-tiles{
  position:absolute;inset:0;
  width:100%;height:100%;
  grid-template-columns:repeat(var(--lov-scene-columns,1),minmax(0,1fr));
  grid-template-rows:repeat(var(--lov-scene-rows,1),minmax(0,1fr));
  gap:0;padding:0;overflow:hidden;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-top{
  padding-top:max(7px,env(safe-area-inset-top,0px));
  padding-left:max(8px,env(safe-area-inset-left,0px));
  padding-right:max(8px,env(safe-area-inset-right,0px));
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-bottom{
  padding-bottom:max(8px,env(safe-area-inset-bottom,0px));
  padding-left:max(8px,env(safe-area-inset-left,0px));
  padding-right:max(8px,env(safe-area-inset-right,0px));
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-chat{
  max-height:min(32dvh,240px);
  overflow:hidden;
 }
}


/* TikTok LIVE HUD — step 3/3. This is a responsive presentation layer only.
   All actions use the existing LIVE SSE, LiveKit and single authoritative gift drawer. */
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-main-stage{
 isolation:isolate!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-main-stage #lov-mobile-overlay{
 position:absolute;inset:0;
 z-index:22;pointer-events:none;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-mobile-overlay .lov-mo-top{
 position:absolute;inset:0 0 auto 0;
 display:flex;justify-content:space-between;align-items:flex-start;
 min-width:0;z-index:24;
 padding:max(7px,env(safe-area-inset-top,0px)) max(8px,env(safe-area-inset-right,0px))
         8px max(8px,env(safe-area-inset-left,0px));
 pointer-events:none;
 background:linear-gradient(180deg,#0009,transparent)!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-mobile-overlay .lov-mo-top button{
 pointer-events:auto;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-host-stack{
 flex:1 1 auto;min-width:0;max-width:calc(100% - 115px);
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-host-pill{
 display:inline-flex;align-items:center;gap:5px;
 max-width:100%;min-height:45px;padding:4px 6px;
 border:1px solid #7cecff50!important;border-radius:24px!important;
 background:#071525b8!important;box-shadow:0 2px 12px #0006!important;
 backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-host-text{
 display:flex;flex-direction:column;gap:2px;
 max-width:clamp(90px,26vw,160px);min-width:0;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-hud-badges{
 display:flex!important;align-items:center!important;gap:3px!important;flex-wrap:wrap!important;
 max-height:21px!important;overflow:hidden!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-hud-badge{
 pointer-events:auto!important;display:inline-flex!important;align-items:center!important;
 min-height:17px!important;padding:1px 4px!important;border-radius:8px!important;
 font-size:9px!important;line-height:1.1!important;font-weight:750!important;
 white-space:nowrap!important;border:1px solid #b69cf580!important;
 background:#321d51d9!important;color:#e6c4ff!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-hud-guild{
 border-color:#c49a608a!important;background:#3a3025c9!important;color:#f8d7a7!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-hud-badge[hidden]{
 display:none!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-like{
 display:grid;align-items:center;justify-items:center;
 flex:none;padding:2px;min-width:30px;
 font-size:10px!important;color:#ff8eaf!important;border:0!important;background:transparent!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-right{
 display:flex;align-items:center;gap:5px;flex:none;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-viewers,
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-exit{
 flex:none;border:1px solid #ffffff50!important;
 min-height:33px;background:#071525b9!important;color:#fff!important;
 border-radius:22px!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-bottom{
 position:absolute;z-index:25;
 left:auto;right:max(9px,env(safe-area-inset-right,0px));
 top:auto;bottom:max(13px,env(safe-area-inset-bottom,0px));
 transform:none;display:block;
 width:auto;min-width:0;height:auto;
 padding:0;margin:0;border:0!important;
 background:none!important;box-shadow:none!important;
 pointer-events:none;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-shortcuts{
 display:flex;flex-direction:column;justify-content:flex-end;
 align-items:center;gap:9px;
 pointer-events:auto;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-shortcuts>.lov-mo-round{
 display:grid;place-items:center;position:relative;
 flex:0 0 42px;width:42px;height:42px;
 min-width:42px;min-height:42px;
 margin:0;padding:8px;
 border:1px solid #74d9ea73!important;border-radius:50%!important;
 background:#091c37cb!important;color:#e2fbff!important;
 box-shadow:0 3px 12px #0009!important;
 backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-shortcuts>.lov-mo-gift{
 background:#1b4464dc!important;color:#9eeaff!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-shortcuts>.lov-mo-round svg{
 width:23px;height:23px;pointer-events:none;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-shortcuts>.lov-mo-round:focus-visible{
 outline:2px solid #8cf4ff!important;outline-offset:3px!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-sheet-scrim{
 position:absolute;z-index:27;inset:0;
 background:#0009!important;pointer-events:auto;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-sheet-scrim[hidden]{
 display:none!important;pointer-events:none!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-more{
 position:absolute;z-index:28;
 inset:auto 0 0 0;transform:none;
 width:100%;max-width:none;
 height:auto;max-height:min(76%,580px);
 overflow-y:auto;overscroll-behavior:contain!important;
 display:flex;flex-direction:column;gap:9px;
 margin:0;
 padding:11px 13px max(17px,env(safe-area-inset-bottom,0px));
 border:1px solid #4c91ae!important;border-bottom:0!important;
 border-radius:23px 23px 0 0!important;
 background:linear-gradient(155deg,#101c41f7,#103952fa)!important;
 box-shadow:0 -16px 50px #000c!important;
 pointer-events:auto;
 animation:lov-hud-sheet-in .2s ease-out both;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-more[hidden]{
 display:none!important;pointer-events:none!important;
}
@keyframes lov-hud-sheet-in{from{transform:translateY(100%);opacity:.65}to{transform:translateY(0);opacity:1}}
@media(prefers-reduced-motion:reduce){html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-more{animation:none!important}}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-sheet-grab{
 flex:none;align-self:center;width:43px;height:5px;
 margin-bottom:5px;border-radius:6px!important;background:#75d1e2a5!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-more-title{
 position:sticky;top:-10px;z-index:1;
 background:#102b45f0!important;padding:5px 0;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-more-title>button{
 flex:none;width:36px;height:36px;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-chat{
 position:absolute;z-index:19;
 left:8px;right:auto;
 top:auto;
 bottom:max(15px,env(safe-area-inset-bottom,0px));
 width:calc(100% - 72px);max-width:330px;
 height:auto;max-height:min(34%,220px);min-height:0;
 overflow:hidden;display:flex;flex-direction:column;
 margin:0;padding:4px 0;
 border:0!important;border-radius:0!important;box-shadow:none!important;
 background:transparent!important;pointer-events:auto;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-chat :is(.lov-module-heading,.room-chat>h3,.chat-send){
 display:none;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-chat :is(#lov-chat-slot,.room-chat){
 display:flex;flex-direction:column;
 min-height:0;max-height:100%;
 flex:1 1 auto;overflow:hidden;
 margin:0;padding:0;border:0!important;background:none!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-chat #room-lines{
 flex:1 1 auto;width:100%;
 height:100%;min-height:0;max-height:100%;
 overflow-y:auto;overscroll-behavior:contain!important;
 border:0!important;border-radius:0!important;box-shadow:none!important;
 padding:0 4px;background:transparent!important;
 scrollbar-width:none;mask-image:linear-gradient(to top,#000 88%,transparent 100%);
 -webkit-mask-image:linear-gradient(to top,#000 88%,transparent 100%);
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-chat #room-lines::-webkit-scrollbar{display:none}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-chat .line{
 margin:2px 0;padding:2px 3px;
 background:transparent!important;border:0!important;box-shadow:none!important;
 text-shadow:0 1px 4px #000,0 1px 8px #000;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-chat .lov-pinned-message{
 flex:none;max-height:60px;overflow:hidden;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-chat .lov-pinned-message~#room-lines{
 max-height:calc(100% - 60px);
}
/* The unique real gift drawer remains above the video stage and its four HUD buttons. */
html body.in-live-room.lov-mo-live #lov-gift-drawer{z-index:1500!important}
@media(max-width:767px){
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-main-stage{
  position:absolute;inset:0;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-mobile-overlay .lov-mo-top{
  padding-top:max(8px,env(safe-area-inset-top,0px));
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-chat{
  position:fixed;
  left:max(6px,env(safe-area-inset-left,0px));
  bottom:max(12px,env(safe-area-inset-bottom,0px));
  max-height:min(31%,205px);
 }
}
@media(min-width:768px){
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-main-stage{
  overflow:hidden;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-chat{
  position:absolute;left:7px;bottom:8px;
  max-height:min(34%,210px);max-width:calc(100% - 72px);
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-top{
  padding:8px;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-bottom{
  right:8px;bottom:12px;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-shortcuts>.lov-mo-round{
  width:38px;height:38px;min-width:38px;min-height:38px;
  flex-basis:38px;
 }
}


/* HUD desktop final: one centered 9:16 scene, no secondary control menu or empty side card. */
@media(min-width:768px){
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room{
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:minmax(0,1fr);
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-main-stage{
  grid-column:1;grid-row:1;
  width:min(100%,calc(56.25dvh - 18px));
  height:auto;max-height:100%;
  aspect-ratio:9/16;
  justify-self:center;align-self:center;
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-clean-controls{
  display:none;
 }
}


/* STRICT HOST / VIEWER LIVE HUD separation — authentic room owner vs audience.
   The room, chat, gift ledger and LiveKit SFU remain single authoritative instances. */
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-mobile-overlay[data-hud-role="host"] .lov-mo-shortcuts>.lov-mo-round{
 border-color:#6fdfed80!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-mobile-overlay[data-hud-role="viewer"] .lov-mo-shortcuts,
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-mobile-overlay[data-hud-role="guest"] .lov-mo-shortcuts{
 gap:10px;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-hud-viewer-compose{
 position:absolute;z-index:25;
 left:max(8px,env(safe-area-inset-left,0px));
 bottom:max(9px,env(safe-area-inset-bottom,0px));
 width:calc(100% - 80px);max-width:380px;
 min-width:0;
 display:flex;align-items:center;
 pointer-events:auto;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-hud-viewer-compose .chat-send{
 display:flex;align-items:center;gap:4px;flex:1;
 min-width:0;width:100%;margin:0;padding:4px;
 border:1px solid #7de5ee59!important;border-radius:18px!important;
 background:#08192ba8!important;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-hud-viewer-compose .lov-chat-editor{
 display:flex;flex:1 1 auto;min-width:0;
 background:transparent!important;border:0!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-hud-viewer-compose textarea{
 flex:1 1 auto;min-width:0;
 height:32px;min-height:32px;max-height:44px;
 padding:6px;font-size:16px!important;line-height:20px!important;
 background:transparent!important;border:0!important;color:#fff!important;
 resize:none!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-hud-viewer-compose .chat-send button[type="submit"]{
 display:grid;place-items:center;
 flex:none;min-width:34px;width:34px;height:34px;
 border-radius:50%!important;padding:4px;
 background:#1086aa!important;color:white!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-hud-viewer-compose .chat-send .lov-chat-gift{
 display:none!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room:has(.lov-hud-viewer-compose) #lov-chat{
 bottom:max(73px,calc(env(safe-area-inset-bottom,0px) + 67px));
}
@media(min-width:768px){
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-hud-viewer-compose{
  left:8px;bottom:10px;width:calc(100% - 75px);
 }
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room:has(.lov-hud-viewer-compose) #lov-chat{
  bottom:64px;
 }
}


/* LIVE badges: Gifter, VIP, Guild, @username, then icon-free MOD. */
body.in-live-room #room-lines .lov-live-level-badges[data-badge-context="chat"],
body.in-live-room #lov-pinned-message .lov-live-level-badges[data-badge-context="chat"]{
 display:inline-flex;flex-wrap:wrap;align-items:center;gap:3px;
 vertical-align:middle;max-width:100%;white-space:normal;
}
body.in-live-room :is(#room-lines,#lov-pinned-message,#speaker-grid,#lov-effects-root) :is(.lov-chat-diamond,.lov-chat-mod,.lov-chat-vip,.lov-chat-guild){
 display:inline-flex;align-items:center;justify-content:center;
 border:1px solid #56b8d480;border-radius:7px;
 padding:1px 4px;font-size:10px;line-height:15px;
 font-weight:800;white-space:nowrap;vertical-align:middle;
 color:#baf6ff;background:#0b2742d9;
}
body.in-live-room :is(#room-lines,#lov-pinned-message,#speaker-grid,#lov-effects-root) .lov-chat-mod{
 color:#c5efff;border-color:#4cb9fb;background:#173e70;letter-spacing:.02em;
}
body.in-live-room :is(#room-lines,#lov-pinned-message) .lov-chat-vip{
 color:#efc5ff;border-color:#b788e282;background:#371a56c9;
}
body.in-live-room :is(#room-lines,#lov-pinned-message) .lov-chat-guild{
 color:#f6deb0;border-color:#c8aa7082;background:#3a3122cc;
}

body.in-live-room :is(#room-lines,#lov-pinned-message) .lov-chat-diamond{
 box-shadow:0 0 7px #43d9ff55,inset 0 0 5px #43d9ff22;
 text-shadow:0 0 5px #69eaff88;
}
body.in-live-room :is(#room-lines,#lov-pinned-message,#speaker-grid,#lov-effects-root) .lov-chat-mod{
 border-radius:999px;padding:0 4px;margin-left:3px;
 box-shadow:0 0 5px #4cb9fb44;
}
body.in-live-room .lov-live-mod-tail{display:inline;vertical-align:middle;margin-left:3px}
body.in-live-room .lov-live-mod-tail:empty{display:none}

html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-main-stage{
 padding:0;margin:0;border:0!important;border-radius:0!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room :is(#lov-winamp,#lov-game-board,#lov-clean-controls){display:none}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-hud-viewer-compose{
 left:auto;right:max(62px,env(safe-area-inset-right));max-width:270px;
}
@media(max-width:767px){
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-main-stage{width:100%;height:100dvh;max-height:100dvh}
}
@media(min-width:768px){
 html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-main-stage{height:min(100dvh,177.7778vw);width:min(100vw,56.25dvh)}
}

html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room #lov-mobile-overlay .lov-mo-top{
 padding-top:max(8px,env(safe-area-inset-top));
 padding-inline:max(8px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-right));
}

/* The room route exposes only its stage, overlaid chat and on-demand dialogs. */
body.in-live-room :is(header.top,.sidebar,.phone-nav),
body.in-live-room #main > :is(.headline,.live-wrap,#room-stats,#room-analytics),
body.in-live-room #main #lov-studio-v2.lov-clean-room > :is(#lov-game,#lov-winamp,#lov-cinema,#lov-clean-controls,.lov-studio-head,.lov-live-bottom,.lov-effects-strip),
body.in-live-room #main #lov-main-stage :is(.lov-scene-caption,#camera-status,#lov-game-board,#lov-cinema-cell),
body.in-live-room #lov-main-stage #lov-mobile-overlay[data-hud-role="host"] .lov-hud-viewer-compose{display:none}



@media(max-width:767px){
 html body.in-live-room.lov-mo-live #main #lov-studio-v2.lov-clean-room{
  width:100vw;height:100dvh;aspect-ratio:auto;
 }
}

/* HOST comment composer: reuse the same LIVE room-chat form, SSE and badges as VIEWER.
   Keep the three existing HOST actions and all LIVE sheets unchanged. */
html body.in-live-room.lov-mo-live #main #lov-studio-v2.lov-clean-room #lov-main-stage #lov-mobile-overlay[data-hud-role="host"] .lov-hud-viewer-compose{
 display:flex;
 visibility:visible!important;
 position:absolute;
 z-index:26;
 left:max(8px,env(safe-area-inset-left,0px));
 right:auto;
 bottom:max(12px,env(safe-area-inset-bottom,0px));
 width:calc(100% - 76px);
 max-width:none;
 min-width:0;
 align-items:center;
 pointer-events:auto;
}

/* HOST sheet and real PK / VIP modals must cover chat messages, not vice versa. */
html body.in-live-room.lov-mo-live #main #lov-studio-v2.lov-clean-room #lov-main-stage #lov-mobile-overlay .lov-mo-sheet-scrim{
 z-index:800;
}
html body.in-live-room.lov-mo-live #main #lov-studio-v2.lov-clean-room #lov-main-stage #lov-mobile-overlay .lov-mo-more{
 z-index:801;
}
body.in-live-room #modal-root:has(.lov-pk1v1-sheet,.lov-heart-sheet){
 position:relative!important;
 z-index:20000!important;
}
body.in-live-room #modal-root:has(.lov-pk1v1-sheet,.lov-heart-sheet) .modal-backdrop{
 z-index:20001!important;
}

/* Micro-task 3: compact HOST overlays in Watch Party / Multi-Guest; leave grid geometry untouched. */
body.in-live-room #lov-studio-v2 #speaker-grid>.lov-host-tile :is(.role,.name,.lov-pause-gifts,.pill,.badge,.level-badge,.lov-level-badge){
 font-size:10px!important;
 padding:2px 5px!important;
 line-height:1.2!important;
}
body.in-live-room #lov-studio-v2 #speaker-grid>.lov-host-tile .name :is(.pill,.badge,.level-badge,.lov-level-badge){
 font-size:10px!important;
 padding:2px 5px!important;
}

/* Micro-task 3: graphite glass for LIVE-only bottom sheets, without changing the feed/auth modals. */
body.in-live-room #modal-root .modal:has(:is(.lov-pk1v1-sheet,.lov-heart-sheet,.lov-guest-queue,.lov-media-settings,[data-guild-board])),
body.in-live-room #modal-root .modal:has(:is(.lov-vip-sheet,.lov-host-sheet,.lov-participant-sheet,.lov-ranking-sheet,.lov-live-modes)),
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-more:not([hidden]){
 background:rgba(22,24,35,.94)!important;
 backdrop-filter:blur(12px)!important;
 -webkit-backdrop-filter:blur(12px)!important;
 border-color:rgba(255,255,255,.08)!important;
}
html body.in-live-room.lov-mo-live #lov-studio-v2.lov-clean-room .lov-mo-more-title{
 background:rgba(22,24,35,.94)!important;
}


/* Stage 1.3 — chat, gift and interaction surfaces (existing events/actions only). */
@media(max-width:767px){
 body.in-live-room.lov-mo-live #lov-mobile-overlay{
  --lov-chat-glass:rgba(7,12,24,.56);
 }
 body.in-live-room.lov-mo-live #lov-chat{
  position:absolute!important;left:12px!important;right:auto!important;
  bottom:calc(var(--lov-mobile-footer,72px) + env(safe-area-inset-bottom,0px) + 18px)!important;
  width:min(72vw,390px)!important;max-width:calc(100vw - 24px)!important;
  max-height:min(34dvh,310px)!important;overflow:hidden!important;
  z-index:var(--lov-z-chat-mobile,30)!important;pointer-events:auto!important;border:0!important;
  background:transparent!important;box-shadow:none!important;
 }
 body.in-live-room.lov-mo-live #lov-chat :is(h3,.headline,.chat-title,.lov-chat-head){display:none!important}
 body.in-live-room.lov-mo-live #room-lines{
  display:flex!important;flex-direction:column!important;gap:7px!important;
  max-height:min(34dvh,310px)!important;overflow:auto!important;
  padding:18px 12px 8px!important;scrollbar-width:none!important;
  -webkit-mask-image:linear-gradient(to bottom,transparent 0%,#000 15%,#000 100%);
  mask-image:linear-gradient(to bottom,transparent 0%,#000 15%,#000 100%);
 }
 body.in-live-room.lov-mo-live #room-lines::-webkit-scrollbar{display:none}
 body.in-live-room.lov-mo-live #room-lines .line{
  align-self:flex-start;max-width:100%;width:max-content;box-sizing:border-box;
  padding:7px 10px;border:1px solid rgba(255,255,255,.10);border-radius:14px;
  background:var(--lov-chat-glass);color:#fff;font-size:12px;line-height:1.35;
  text-shadow:0 1px 4px #000;backdrop-filter:blur(12px) saturate(135%);
  -webkit-backdrop-filter:blur(12px) saturate(135%);
  animation:lov-chat-in .24s ease both;
 }
 body.in-live-room.lov-mo-live #room-lines .line.system,
 body.in-live-room.lov-mo-live #room-lines .line.gift{
  border-color:rgba(115,232,244,.22);background:rgba(11,35,52,.67)
 }
 body.in-live-room.lov-mo-live #room-lines .line.gift{color:#ffe5a7}
 body.in-live-room.lov-mo-live #room-lines .lov-live-level-badges{display:inline-flex;vertical-align:middle;transform:scale(.86);transform-origin:left center}
 body.in-live-room.lov-mo-live #room-lines .lov-chat-avatar-link{display:none}
 body.in-live-room.lov-mo-live #lov-mobile-overlay .lov-hud-viewer-compose{
  position:absolute!important;left:12px!important;right:12px!important;
  bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;
  z-index:12!important;display:flex!important;align-items:center!important;
  gap:7px!important;pointer-events:auto!important;
 }
 body.in-live-room.lov-mo-live #lov-mobile-overlay form[data-form="room-chat"]{
  flex:1 1 auto!important;min-width:0!important;display:flex!important;align-items:center!important;
  gap:5px!important;margin:0!important;padding:5px 7px!important;
  border:1px solid rgba(255,255,255,.16)!important;border-radius:22px!important;
  background:rgba(9,13,25,.78)!important;backdrop-filter:blur(18px)!important;
  -webkit-backdrop-filter:blur(18px)!important;
 }
 body.in-live-room.lov-mo-live #lov-mobile-overlay form[data-form="room-chat"] textarea{
  min-height:38px!important;max-height:84px!important;resize:none!important;
  border:0!important;background:transparent!important;color:#fff!important;
  box-shadow:none!important;font-size:13px!important
 }
 body.in-live-room.lov-mo-live #lov-mobile-overlay form[data-form="room-chat"] [type="submit"]{
  flex:0 0 36px!important;width:36px!important;height:36px!important;
  min-height:36px!important;border-radius:50%!important
 }
 body.in-live-room.lov-mo-live #lov-mobile-overlay .lov-viewer-actions{display:none!important}
 body.in-live-room.lov-mo-live #lov-gift-drawer{
  position:fixed!important;inset:auto 0 0!important;z-index:10020!important;
  max-height:min(78dvh,720px)!important;padding-bottom:env(safe-area-inset-bottom,0px)!important;
  border-radius:24px 24px 0 0!important;border:1px solid rgba(255,255,255,.15)!important;
  background:rgba(10,12,23,.97)!important;backdrop-filter:blur(24px)!important;
  -webkit-backdrop-filter:blur(24px)!important;box-shadow:0 -18px 70px #0009!important;
  overflow:auto!important;animation:lov-sheet-up .25s cubic-bezier(.2,.8,.2,1) both
 }
 body.in-live-room.lov-mo-live #lov-gift-scene{z-index:10030!important}
 body.in-live-room.lov-mo-live #lov-tap-particles{z-index:10010!important;pointer-events:none}
 body.in-live-room.lov-mo-live .lov-mo-more{
  max-height:min(78dvh,700px)!important;overflow:auto!important;
  padding-bottom:calc(18px + env(safe-area-inset-bottom,0px))!important
 }
 body.in-live-room.lov-mo-live .lov-mo-more [data-action="lov-media-settings"],
 body.in-live-room.lov-mo-live .lov-mo-more [data-overlay-action="share"],
 body.in-live-room.lov-mo-live .lov-mo-more [data-overlay-action="sound"]{
  min-height:48px;border:1px solid rgba(255,255,255,.1);border-radius:14px;
  background:rgba(255,255,255,.06);color:#fff
 }
}
@keyframes lov-chat-in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}
@keyframes lov-sheet-up{from{opacity:.5;transform:translateY(28px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){body.in-live-room.lov-mo-live #room-lines .line{animation:none}body.in-live-room.lov-mo-live #lov-gift-drawer{animation:none}}

@media(max-width:767px){
 body.in-live-room.lov-mo-live #lov-mobile-overlay .lov-hud-share{
  flex:0 0 42px!important;width:42px!important;height:42px!important;min-height:42px!important;
  display:grid!important;place-items:center!important;border:1px solid rgba(255,255,255,.18)!important;
  border-radius:50%!important;background:rgba(12,17,30,.78)!important;color:#fff!important;
  backdrop-filter:blur(15px)!important;-webkit-backdrop-filter:blur(15px)!important
 }
 body.in-live-room.lov-mo-live #lov-mobile-overlay .lov-hud-share svg{width:19px;height:19px}
}

/* iOS visual viewport and Pre-Live preview; restricted to LIVE / create modal. */
#lov-create-studio .lov-prep-preview{display:grid;gap:8px;padding:12px;border-radius:14px;background:#101823;border:1px solid #24526a;}
#lov-create-studio #lov-prep-video{width:100%;max-height:clamp(180px,32dvh,320px);aspect-ratio:9/16;object-fit:cover;background:#05080e;border-radius:12px;margin:0 auto;}
#lov-create-studio #lov-prep-camera-status{margin:0;color:#c8e9f0;font-size:13px;}
@media(max-width:767px){
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned][data-keyboard="true"] .lov-hud-viewer-compose{position:absolute!important;bottom:0!important;z-index:65!important;}
 html body.in-live-room.lov-mo-live #lov-studio-v2[data-scene-owned][data-keyboard="true"] .lov-mo-top{top:0!important;}
}


/* LoveApp PK HUD geometry, backed only by liveOVER's real PK state.
   Hidden when no active SOLO battle; does not affect LiveKit scene tiles. */
html body.in-live-room #lov-studio-v2 #lov-main-stage #lov-layout-scorebar:not([hidden]){
 display:grid!important;
 position:absolute!important;
 top:clamp(78px,12dvh,120px)!important;
 left:8px!important;right:8px!important;
 width:auto!important;max-width:none!important;
 padding:8px 10px!important;
 gap:5px!important;
 border:1px solid #ffffff38!important;
 border-radius:14px!important;
 background:linear-gradient(125deg,#061b2ccf,#081a32d9)!important;
 box-shadow:0 8px 24px #0009!important;
 z-index:48!important;
 pointer-events:none!important;
}
html body.in-live-room #lov-studio-v2 #lov-layout-scorebar[hidden]{display:none!important}
html body.in-live-room #lov-studio-v2 #lov-layout-scorebar .lov-layout-pk-top,
html body.in-live-room #lov-studio-v2 #lov-layout-scorebar .lov-layout-pk-values{
 display:flex;justify-content:space-between;align-items:center;gap:8px;min-width:0;
}
html body.in-live-room #lov-studio-v2 #lov-layout-scorebar .lov-layout-pk-top b{
 flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;
}
html body.in-live-room #lov-studio-v2 #lov-layout-scorebar .lov-layout-pk-top b:last-child{text-align:right}
html body.in-live-room #lov-studio-v2 #lov-layout-scorebar .lov-layout-pk-top strong{
 flex:0 0 auto;color:#fff;font-size:12px;white-space:nowrap;
}
html body.in-live-room #lov-studio-v2 #lov-layout-scorebar .lov-layout-pk-values strong{
 font-size:clamp(15px,3.4vw,23px);font-weight:900;color:#fff;
}
html body.in-live-room #lov-studio-v2 #lov-layout-scorebar .lov-layout-pk-progress{
 display:flex!important;height:9px!important;width:100%;overflow:hidden;border-radius:999px;background:#0b1422;
}
html body.in-live-room #lov-studio-v2 #lov-layout-scorebar .lov-layout-pk-progress i:first-child{background:#f14573}
html body.in-live-room #lov-studio-v2 #lov-layout-scorebar .lov-layout-pk-progress i:last-child{background:#3aabeb}
@media (min-width:768px){
 html body.in-live-room #lov-studio-v2 #lov-main-stage #lov-layout-scorebar:not([hidden]){
  left:50%!important;right:auto!important;transform:translateX(-50%)!important;
  width:min(94%,620px)!important;top:16px!important;z-index:52!important;
 }
}

/* liveOVER Luxury Blue Billiard Felt Cards Arena (Svara & Belote 4) */
.lov-cards-arena{display:grid;grid-template-columns:minmax(108px,1fr) minmax(190px,1.5fr) minmax(108px,1fr);gap:8px;align-items:stretch;padding:8px;margin-bottom:8px;border-radius:18px;background:rgba(4,13,28,.86);border:1px solid rgba(0,229,255,.32);box-shadow:0 10px 28px rgba(0,0,0,.45)}
.lov-cards-col{display:flex;flex-direction:column;justify-content:space-between;gap:8px}
.lov-seat-pod{background:linear-gradient(160deg,rgba(11,34,68,.92),rgba(6,19,40,.95));border:1px solid rgba(56,189,248,.35);border-radius:14px;padding:7px;display:flex;flex-direction:column;gap:3px;min-height:86px}
.lov-seat-empty{opacity:.68;border-style:dashed}
.lov-seat-folded{opacity:.5}
.lov-seat-tag{font-size:10px;font-weight:800;letter-spacing:.6px;color:#38bdf8;text-transform:uppercase}
.lov-seat-name{font-size:12px;font-weight:700;color:#f8fafc;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lov-seat-bet{font-size:10px;color:#fbbf24;font-weight:600}
.lov-seat-cards{display:flex;flex-wrap:wrap;gap:3px;margin-top:2px}
.lov-billiard-felt{background:radial-gradient(circle at 50% 45%,#0f3d7a 0%,#09264f 62%,#051630 100%);border:3px solid #00e5ff;box-shadow:inset 0 0 26px rgba(0,0,0,.65),0 0 18px rgba(0,229,255,.28);border-radius:24px;padding:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:6px}
.lov-felt-logo{font-size:18px;font-weight:900;letter-spacing:1.4px;color:#e0f7fa;text-shadow:0 0 12px rgba(0,229,255,.75)}
.lov-felt-sub{font-size:10px;font-weight:700;letter-spacing:1px;color:#7dd3fc}
.lov-table-pot{font-size:13px;color:#fff;background:rgba(3,12,26,.65);padding:4px 10px;border-radius:999px;border:1px solid rgba(251,191,36,.45)}
.lov-pot-tag{font-size:10px;color:#34d399;font-weight:700;margin-left:4px}
.lov-table-note{font-size:11px;color:#e2e8f0;line-height:1.3}
.lov-table-btns{display:flex;flex-wrap:wrap;gap:5px;justify-content:center}
.lov-btn-cyan,.lov-btn-gold,.lov-btn-dark{border:none;border-radius:10px;padding:5px 9px;font-size:11px;font-weight:700;cursor:pointer}
.lov-btn-cyan{background:linear-gradient(135deg,#00e5ff,#0284c7);color:#031226}
.lov-btn-gold{background:linear-gradient(135deg,#fbbf24,#d97706);color:#111827}
.lov-btn-dark{background:rgba(15,23,42,.85);color:#cbd5e1;border:1px solid rgba(148,163,184,.35)}
.lov-card-item{width:28px;height:38px;border-radius:6px;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:10px;line-height:1;box-shadow:0 2px 6px rgba(0,0,0,.4)}
.lov-card-back{background:linear-gradient(135deg,#082042,#0e4285);border:1.5px solid #00e5ff}
.lov-card-brand{font-size:6px;font-weight:900;color:#7dd3fc;transform:rotate(-28deg);letter-spacing:.3px}
.lov-card-face{background:#f8fafc;color:#0f172a;border:1px solid #cbd5e1}
.lov-card-red{color:#dc2626}
.lov-card-play{cursor:pointer;border-color:#fbbf24}
/* Post-LIVE Summary modal above LIVE stage without !important */
html body.in-live-room #modal-root .modal-backdrop:has(.lov-stage2-summary){position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:16px}
html body.in-live-room #modal-root .modal:has(.lov-stage2-summary){position:relative;z-index:10001;width:min(100%,440px);max-height:86dvh;overflow:auto}
