/* === production ≡ reference-preview.html (LiveMe shell) === */

/* LiveMe entry.css sets html{font-size:100px} for rem layout — keep Kemetok readable */
html.liveme-native-html {
  font-size: 16px !important;
}

.liveme-native-root {
  font-size: 16px;
}

.live-page.app-page.live-watch-page {
  height: 100%;
  width: 100%;
  position: relative;
  background: #000;
}

.liveme-native-root {
  direction: ltr !important;
  unicode-bidi: isolate;
}

html[dir="rtl"] .liveme-native-root,
[dir="rtl"] .liveme-native-root {
  direction: ltr !important;
}

/* ---- header (reference-preview L27–34) ---- */
.liveme-native-top {
  pointer-events: none;
}

.liveme-native-top .liveme-native-header {
  pointer-events: auto;
}

.liveme-native-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  gap: 10px;
}

.liveme-host-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(78vw, 420px);
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px);
  min-height: 48px;
  flex: 0 1 auto;
}

.liveme-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  line-height: 0;
}

.liveme-avatar img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: block;
}

.liveme-host-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 40px;
}

.liveme-host-meta strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.liveme-host-meta strong a {
  color: #fff;
  text-decoration: none;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

.liveme-host-meta em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.liveme-live-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--gradient-living, linear-gradient(122.91deg, #f88954 10.31%, #fcbb55 91.65%));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

/* legacy Kemetok classes hidden inside shell */
.liveme-native-root .lm-host-chip,
.liveme-native-root .live_video_header,
.liveme-native-root .liveme-native-close {
  all: unset;
  display: none !important;
}

/* ---- stage / video (reference gradient fallback) ---- */
.liveme-native-stage .player.live_main_video_mount {
  min-height: 100%;
  background: linear-gradient(160deg, #1a1a2e, #16213e 45%, #0f3460);
}

.liveme-native-stage .klw-video-liveme {
  object-fit: cover;
}

/* ---- chat overlay (reference L41–44 + message-section) ---- */
.liveme-chat-overlay {
  position: absolute;
  left: 12px;
  right: 88px;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  max-height: 34vh;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 20;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  -webkit-mask-image: linear-gradient(180deg, transparent 1.46%, #000 8.77%, #000 91.23%, transparent 98.54%);
  mask-image: linear-gradient(180deg, transparent 1.46%, #000 8.77%, #000 91.23%, transparent 98.54%);
}

.liveme-chat-line,
.liveme-chat-overlay .message-content-item,
.liveme-chat-overlay .live_float_chat_item {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  display: inline-block;
  line-height: 16px;
  min-width: 20px;
  padding: 5px 8px;
  margin-bottom: 4px;
  max-width: 100%;
  font-size: 14px;
  color: #fff;
  word-wrap: break-word;
}

.liveme-chat-line b,
.liveme-chat-line .liveme-chat-nick,
.liveme-chat-overlay .live_float_chat_user {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
  margin-right: 5px;
}

.liveme-chat-line.is-gift {
  color: #fff05f;
}

/* ---- bottom (reference L47–55) ---- */
.liveme-native-root .liveme-native-send {
  display: none !important;
}

.liveme-native-composer textarea.lmSize {
  padding: 10px 16px !important;
  text-align: start;
}

.liveme-native-composer textarea.lmSize[dir="rtl"] {
  text-align: right;
}

.liveme-native-tools .live_gift_call {
  background: url("/themes/default/static/liveme-ref/icon_tool_gift.CEnXrBQQ.png") center / 70% no-repeat,
    linear-gradient(135deg, #9d1dff, #ff526d) !important;
  box-shadow: 0 6px 16px rgba(157, 29, 255, 0.4);
}

/* ---- gift sheet ---- */
.liveme-native-root .live_footer_holder.live_footer_holder_show.liveme-gift-panel {
  border-radius: 20px 20px 0 0 !important;
}

/* ---- PK ---- */
.liveme-native-root .live_pk_overlay_bar {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 28;
}