:root {
  color-scheme: dark;
  --phone-width: 375px;
  --phone-height: 812px;
  --phone-aspect: 375 / 812;
  --phone-scale: 1;
  --shopee: #ee4d2d;
  --shopee-strong: #ff5b35;
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --glass: rgba(0, 0, 0, 0.34);
  --glass-strong: rgba(0, 0, 0, 0.5);
  --glass-soft: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
  --soft-blur: blur(10px);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #050505;
}

body {
  display: grid;
  place-items: center;
  padding: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.live-shell {
  position: relative;
  width: var(--phone-width);
  height: var(--phone-height);
  min-height: 0;
  overflow: hidden;
  background: #000;
  color: var(--ink);
  isolation: isolate;
  box-shadow:
    0 24px 72px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.phone-stage {
  position: relative;
  width: calc(var(--phone-width) * var(--phone-scale));
  height: calc(var(--phone-height) * var(--phone-scale));
}

.phone-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--phone-width);
  height: var(--phone-height);
  transform: scale(var(--phone-scale));
  transform-origin: top left;
}

.live-video,
.stage-poster,
.stage-glow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.live-video {
  background: #000;
  object-fit: contain;
}

.stage-poster {
  object-fit: cover;
}

.stage-poster {
  background: #000;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.has-video .stage-poster {
  opacity: 0;
}

.stage-glow {
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.08) 24%, transparent 38%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.22) 28%, transparent 52%);
}

.video-shade {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.video-shade-top {
  top: 0;
  height: 252px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.1) 52%, transparent);
}

.video-shade-bottom {
  bottom: 0;
  height: 248px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.24) 52%, transparent);
}

.fake-status-bar {
  position: absolute;
  z-index: 28;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 0 30px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.fake-device-icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.signal-bars {
  height: 12px;
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
}

.signal-bars i {
  width: 3px;
  border-radius: 2px;
  background: #fff;
}

.signal-bars i:nth-child(1) {
  height: 4px;
}

.signal-bars i:nth-child(2) {
  height: 6px;
}

.signal-bars i:nth-child(3) {
  height: 8px;
}

.signal-bars i:nth-child(4) {
  height: 10px;
}

.wifi-icon {
  position: relative;
  width: 15px;
  height: 11px;
  display: inline-block;
}

.wifi-icon::before,
.wifi-icon::after {
  position: absolute;
  left: 50%;
  border: 2px solid #fff;
  border-bottom: 0;
  border-left-color: transparent;
  border-right-color: transparent;
  border-radius: 14px 14px 0 0;
  content: "";
  transform: translateX(-50%);
}

.wifi-icon::before {
  top: 1px;
  width: 14px;
  height: 7px;
}

.wifi-icon::after {
  top: 5px;
  width: 8px;
  height: 4px;
}

.battery-icon {
  position: relative;
  width: 22px;
  height: 11px;
  display: inline-block;
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  border-radius: 2.5px;
}

.battery-icon::before {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 5px;
  border-radius: 1.5px;
  background: #fff;
  content: "";
}

.battery-icon::after {
  position: absolute;
  top: 3px;
  right: -3.5px;
  width: 2px;
  height: 5px;
  border-radius: 0 2px 2px 0;
  background: rgba(255, 255, 255, 0.9);
  content: "";
}

.live-header {
  position: absolute;
  z-index: 25;
  top: calc(52px + env(safe-area-inset-top));
  left: 14px;
  right: 12px;
  display: grid;
  gap: 8px;
}

.title-row,
.host-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.live-title {
  min-width: 0;
  height: 24px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-align: left;
  letter-spacing: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.34);
  backdrop-filter: none;
}

.live-title span:not(.shopee-wordmark, .chevron) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shopee-wordmark {
  display: none;
}

.shopee-wordmark svg {
  width: 14px;
  height: 14px;
  display: block;
}

.chevron {
  width: 0;
  height: 0;
  flex: 0 0 auto;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(255, 255, 255, 0.9);
}

.host-chip {
  min-width: 0;
  flex: 0 1 122px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 2px 8px 2px 2px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  backdrop-filter: var(--soft-blur);
  box-shadow: none;
}

.host-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: #fff;
}

.host-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.host-copy strong,
.host-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-copy strong {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}

.host-copy span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.1;
}

.mall-tag {
  display: none;
}

.follow-button,
.primary-button,
.secondary-button {
  min-height: 34px;
  border-radius: 8px;
  font-weight: 800;
}

.follow-button {
  min-width: 65px;
  min-height: 0;
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: var(--shopee);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(238, 77, 45, 0.24);
}

.follow-button.is-following {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--shopee);
}

.follow-button.is-following::before {
  content: "";
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) 4px 3px / 1.5px 6px no-repeat,
    linear-gradient(#fff, #fff) 7px 3px / 1.5px 6px no-repeat,
    rgba(255, 255, 255, 0.22);
}

.icon-button,
.round-action,
.shop-action {
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
}

.icon-button {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  border-color: transparent;
  background: transparent;
  backdrop-filter: none;
}

.icon-button.compact {
  width: 78px;
  height: 22px;
  margin-left: auto;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  opacity: 1;
  backdrop-filter: var(--soft-blur);
}

.icon-button.dark {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.08);
}

.ui-icon,
.speaker-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
}

.ui-icon {
  fill: currentColor;
  overflow: visible;
}

.stream-status {
  position: absolute;
  z-index: 20;
  top: calc(130px + env(safe-area-inset-top));
}

.stream-status {
  left: 16px;
  max-width: 184px;
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--shadow);
  backdrop-filter: var(--soft-blur);
}

.stream-status span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 14%, transparent 15%),
    linear-gradient(135deg, #72f3ff, #6b6cff);
}

.stream-status[data-state="loading"] .status-dot {
  animation: blink 800ms ease-in-out infinite alternate;
}

.stream-status[data-state="error"] .status-dot {
  background: #fb315d;
}

.pinned-product,
.coupon-strip,
.campaign-banner,
.rank-badge,
.sale-ribbon,
.reward-panel,
.join-toast,
.safety-notice {
  display: none !important;
}

.barrage-layer {
  position: absolute;
  z-index: 21;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ai-generated-badge {
  position: absolute;
  z-index: 24;
  right: 15px;
  bottom: calc(87px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 214px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.86),
    0 0 8px rgba(0, 0, 0, 0.48);
  pointer-events: none;
}

.sparkle-mark {
  position: relative;
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  display: inline-block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.72));
}

.sparkle-mark::before,
.sparkle-mark::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%) rotate(45deg);
}

.sparkle-mark::after {
  width: 2px;
  height: 100%;
}

.comment-feed {
  position: absolute;
  left: 18px;
  right: 18px;
  z-index: 22;
}

.comment-feed {
  bottom: calc(92px + env(safe-area-inset-bottom));
  max-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  overflow: hidden;
  pointer-events: none;
}

.comment-item {
  width: fit-content;
  max-width: 351px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 13px;
  line-height: 1.28;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.42);
  backdrop-filter: none;
  box-shadow: none;
}

.comment-item b {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.comment-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-item.is-reply {
  width: fit-content;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: var(--soft-blur);
}

.comment-item.is-reply b {
  color: #fff;
}

.composer {
  position: absolute;
  z-index: 25;
  left: 12px;
  right: 12px;
  bottom: calc(34px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 38px 38px 38px;
  gap: 12px;
  align-items: center;
}

.composer-input-wrap {
  min-width: 0;
}

.composer input {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 999px;
  outline: 0;
  padding: 0 15px;
  background: rgba(0, 0, 0, 0.34);
  color: #fff;
  font-size: 13px;
  box-shadow: none;
  backdrop-filter: var(--soft-blur);
}

.composer input::placeholder {
  color: rgba(255, 255, 255, 0.66);
}

.composer.is-pending input {
  opacity: 0.74;
}

.composer.is-pending .composer-input-wrap {
  position: relative;
}

.composer.is-pending .composer-input-wrap::after {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  animation: spin 720ms linear infinite;
}

.send-button {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.shop-action {
  position: relative;
  width: 40px;
  height: 40px;
  align-self: end;
  display: block;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #ee4d2d;
  color: #fff;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
}

.shop-action .ui-icon {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 32px;
  height: 32px;
  transform: translateX(-50%);
}

.shop-action b {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  min-width: 0;
  padding: 0 3px;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.round-action {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.34);
  box-shadow: none;
}

.round-action .ui-icon {
  width: 22px;
  height: 22px;
}

.sound-action {
  color: rgba(255, 255, 255, 0.72);
}

.sound-action.is-on {
  color: #fff;
  background: rgba(238, 77, 45, 0.82);
}

.sound-action.is-on .sound-slash {
  display: none;
}

.round-action b {
  position: absolute;
  right: -4px;
  top: -8px;
  min-width: 24px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 10px;
  line-height: 1.1;
}

.floating-hearts {
  position: absolute;
  z-index: 30;
  inset: 0;
  pointer-events: none;
}

.floating-hearts span {
  position: absolute;
  right: 22px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  color: #fff;
  font-size: 24px;
  text-shadow: 0 0 14px rgba(238, 77, 45, 0.85);
  animation: float-heart 960ms ease-out forwards;
}

.toast {
  position: absolute;
  z-index: 40;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  max-width: calc(100% - 48px);
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 13px;
  line-height: 1.25;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sheet-backdrop {
  position: absolute;
  z-index: 40;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 180ms ease;
}

.sheet-backdrop.is-open {
  opacity: 1;
}

.bottom-sheet {
  position: absolute;
  z-index: 50;
  left: 0;
  bottom: 0;
  width: 100%;
  max-height: 640px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  border-radius: 8px 8px 0 0;
  background: #151515;
  color: #fff;
  transform: translateY(110%);
  transition: transform 210ms ease;
}

.bottom-sheet.is-open {
  transform: translateY(0);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
}

.sheet-header strong {
  font-size: 16px;
}

.product-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-bottom: 4px;
}

.product-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.product-thumb {
  position: relative;
  display: block;
  border-radius: 6px;
  background-image: url("./assets/live-room-realistic.png");
  background-repeat: no-repeat;
  background-size: 168px auto;
  background-position: 10% 84%;
  overflow: hidden;
}

.product-thumb.large {
  width: 76px;
  height: 76px;
}

.product-thumb::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent 48%);
  content: "";
}

.product-card-copy {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
}

.product-card-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card-copy b {
  color: #ffd75a;
  font-size: 15px;
}

.product-card-copy del,
.product-card-copy small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.product-tag {
  width: fit-content;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(238, 77, 45, 0.16);
  color: #ffb199;
  font-size: 11px;
  font-weight: 800;
}

.product-card-actions {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.primary-button,
.secondary-button {
  padding: 0 12px;
}

.primary-button {
  color: #fff;
  background: var(--shopee);
}

.secondary-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.settings-grid {
  display: grid;
  gap: 12px;
}

.settings-grid label {
  display: grid;
  gap: 6px;
}

.settings-grid span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.settings-grid input {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  outline: 0;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 481px) {
  .live-shell {
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }
}

@keyframes float-heart {
  from {
    opacity: 0;
    transform: translate(0, 10px) scale(0.7);
  }
  20% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translate(var(--x), -118px) scale(1.2);
  }
}

@keyframes blink {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
