:root {
  color-scheme: dark;
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --soft: rgba(255, 255, 255, 0.12);
  --accent: #fe2c55;
  --cyan: #25f4ee;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #050507;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.live-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #050507;
}

.live-room {
  position: relative;
  width: min(100vw, 460px);
  height: 100vh;
  min-height: 680px;
  overflow: hidden;
  background: linear-gradient(180deg, #fbefde 0%, #fbefde 58%, #970505 100%);
}

.cover-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.live-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #0a0a0d;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.live-room.is-started .live-video {
  opacity: 1;
}

.live-room.is-started .cover-image {
  opacity: 0;
}

.shade {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
}

.shade-top {
  top: 0;
  height: 190px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
}

.shade-bottom {
  bottom: 0;
  height: 360px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
}

.live-topbar {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.host-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 11px 6px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}

.avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: block;
  overflow: hidden;
  background: #fff;
}

.avatar {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.62);
}

h1 {
  margin: 0;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0;
}

.host-card p {
  margin: 2px 0 0;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.live-status {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(254, 44, 85, 0.92);
  box-shadow: 0 8px 20px rgba(254, 44, 85, 0.28);
  font-size: 13px;
  font-weight: 800;
}

.live-status.is-live {
  background: rgba(254, 44, 85, 0.96);
}

.wait-layer,
.play-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 18px;
  pointer-events: none;
}

.countdown-card {
  width: min(330px, 100%);
  padding: 18px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  pointer-events: auto;
  text-align: center;
}

.countdown-card span,
.countdown-card small {
  display: block;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.countdown-card strong {
  display: block;
  margin: 8px 0;
  font-variant-numeric: tabular-nums;
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.enter-btn,
.play-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 22px;
  background: linear-gradient(90deg, var(--cyan), var(--accent));
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.enter-btn {
  width: 100%;
  margin-top: 15px;
}

.enter-btn:disabled {
  cursor: default;
  background: rgba(255, 255, 255, 0.2);
}

.play-layer {
  z-index: 8;
  background: rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.is-hidden {
  display: none;
}

.comment-area {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 7;
}

.comment-list {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 7px;
  height: 150px;
  margin-bottom: 10px;
  overflow: hidden;
  pointer-events: none;
}

.comment {
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
  backdrop-filter: blur(8px);
}

.comment b {
  margin-right: 7px;
  color: #9af8f2;
}

.comment-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-form input {
  min-width: 0;
  flex: 1;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0 15px;
  outline: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
}

.comment-form input::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.comment-form button {
  flex: 0 0 auto;
  height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: #fff;
  color: #111;
  font-weight: 900;
  cursor: pointer;
}

.danmaku-layer {
  position: absolute;
  inset: 90px 0 220px;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.danmaku {
  position: absolute;
  left: 100%;
  display: inline-block;
  max-width: 80%;
  padding: 6px 11px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.34);
  white-space: nowrap;
  font-size: 14px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  animation: fly 8s linear forwards;
}

@keyframes fly {
  to {
    transform: translateX(-150vw);
  }
}

@media (min-width: 760px) {
  .live-page {
    padding: 28px;
    background:
      radial-gradient(circle at center, rgba(254, 44, 85, 0.18), transparent 42%),
      #050507;
  }

  .live-room {
    height: min(92vh, 920px);
    border-radius: 8px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  }
}

@media (max-width: 420px) {
  .live-room {
    width: 100vw;
  }

  .comment-area {
    right: 10px;
    left: 10px;
  }

  .countdown-card strong {
    font-size: 36px;
  }
}
