:root {
  --maxw: 1640px;
  --font: "Kanit", system-ui, sans-serif;
  --radius-player: 24px;
  --glass: rgba(12, 12, 18, 0.46);
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1.15);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--color-bg);
}

body {
  padding-bottom: env(safe-area-inset-bottom);
  background: radial-gradient(100% 50% at 50% 0, var(--color-glow), var(--color-bg) 70%) var(--color-bg);
  color: var(--color-text);
  font: 400 15px/1.35 var(--font);
}

main {
  max-width: var(--maxw);
  margin-inline: auto;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 2px solid var(--color-accent-light);
  outline-offset: 2px;
}

.sprite {
  display: none;
}

/* Header */

.top {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 52px;
  padding: 0 12px 0 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-right: auto;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.6px;
}

.logo span {
  padding: 0 6px;
  border-radius: 5px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* Player stage: halo and running neon ring sit behind the 4:5 card */

.stage {
  position: relative;
  isolation: isolate;
  aspect-ratio: 4 / 5;
  max-width: calc(100% - 24px);
  max-height: calc(100svh - 212px);
  margin: 2px auto 0;
  animation: stage-in 0.3s ease-out both;
}

.stage__halo {
  position: absolute;
  z-index: -2;
  inset: 4px;
  border-radius: 32px;
  background: linear-gradient(160deg, var(--color-accent-light), var(--color-accent-deep));
  filter: blur(26px);
  opacity: 0.3;
}

.stage__ring {
  position: absolute;
  z-index: -1;
  inset: -1.5px;
  overflow: hidden;
  border-radius: calc(var(--radius-player) + 1.5px);
  background: rgba(255, 113, 10, 0.25);
}

.player {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-player);
  background: var(--color-card);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.feed {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 14%;
  transform-origin: 50% 22%;
}

.player::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 11, 18, 0.55) 0, transparent 22%),
    linear-gradient(0deg, rgba(9, 11, 18, 0.88) 0, rgba(9, 11, 18, 0.35) 34%, transparent 55%);
  pointer-events: none;
}

/* HUD */

.hud {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--color-accent);
  box-shadow: 0 0 16px rgba(255, 113, 10, 0.6);
  color: var(--color-on-accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.live i {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-on-accent);
}

.viewers,
.timer {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 500;
}

.viewers svg {
  width: 15px;
  height: 15px;
}

.timer {
  margin-left: auto;
  color: #ffe2cc;
  font-variant-numeric: tabular-nums;
}

/* Chat */

.comments {
  position: absolute;
  z-index: 2;
  right: 70px;
  bottom: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.comments li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 5px 11px 5px 5px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 13.5px;
  font-weight: 300;
  line-height: 1.25;
  transition: opacity 0.3s ease;
  animation: rise 0.3s ease-out both;
}

.comments i {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c);
  color: var(--color-on-accent);
  font: 600 11px/1 var(--font);
}

.comments b {
  color: var(--color-nick);
  font-weight: 600;
  white-space: nowrap;
}

.comments li:nth-child(2) {
  opacity: 0.75;
}

.comments .pinned {
  align-items: flex-start;
  padding: 7px 12px 7px 9px;
  background: linear-gradient(100deg, rgba(255, 89, 0, 0.82), rgba(201, 67, 0, 0.62));
  box-shadow: 0 6px 18px rgba(255, 89, 0, 0.35);
  font-weight: 400;
}

.pinned svg {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.pinned b {
  color: #fff;
}

.gift {
  box-shadow: inset 0 0 0 1px rgba(255, 196, 33, 0.55);
}

.gift b {
  color: var(--color-star);
}

.rose {
  width: 15px;
  height: 15px;
  color: var(--color-star);
}

/* Hearts */

.hearts {
  position: absolute;
  z-index: 2;
  right: 24px;
  bottom: 56px;
  width: 24px;
  height: 200px;
  pointer-events: none;
}

.hearts svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: var(--s, 26px);
  height: var(--s, 26px);
  color: var(--c);
  fill: currentColor;
  stroke: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
  opacity: 0;
  animation: float 3s ease-out var(--d) infinite;
}

.hearts svg.burst {
  opacity: 1;
  animation: none;
}

.like {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--color-accent-light), var(--color-accent-deep));
  box-shadow: 0 6px 20px rgba(255, 89, 0, 0.55);
  color: var(--color-on-accent);
}

.like svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: none;
}

.big-heart {
  position: absolute;
  z-index: 3;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  color: var(--color-accent);
  fill: currentColor;
  stroke: none;
  filter: drop-shadow(0 6px 22px rgba(255, 89, 0, 0.7));
  pointer-events: none;
}

/* Streamer row */

.streamer {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 48px;
  margin: 10px 16px 0;
}

.av {
  position: relative;
  background-image: var(--grad);
  border-radius: 50%;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 2px;
  border-radius: 50%;
}

.streamer {
  isolation: isolate;
}

.av img {
  width: 100%;
  height: 100%;
  border: 2px solid var(--color-bg);
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 14%;
}

.av i {
  position: absolute;
  bottom: -5px;
  left: 50%;
  padding: 0 4px;
  border: 1.5px solid var(--color-bg);
  border-radius: 4px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font: 600 9px/13px var(--font);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.who {
  flex: 1;
  min-width: 0;
}

.name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.15;
}

.tick {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.tick svg {
  width: 10px;
  height: 10px;
  stroke-width: 3.5;
}

.fans {
  margin-left: 2px;
  color: var(--color-muted-2);
  font-size: 13px;
  font-weight: 400;
}

.fans::before {
  content: "· ";
}

.sub {
  overflow: hidden;
  color: var(--color-muted-2);
  font-size: 13.5px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Primary button */

.join-cta {
  position: relative;
  padding: 10px 16px 0;
}

.cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  overflow: hidden;
  border-radius: 16px;
  background-color: var(--color-accent);
  background-image: linear-gradient(100deg, var(--color-accent-light), var(--color-accent) 55%, var(--color-accent-deep));
  box-shadow: 0 10px 26px rgba(255, 89, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: var(--color-on-accent);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.1px;
  transition: transform 140ms ease-out;
}

.cta:active {
  transform: scale(0.97);
}

.cta svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}

.micro {
  margin-top: 7px;
  color: var(--color-muted-2);
  font-size: 12px;
  font-weight: 300;
  text-align: center;
}

@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes float {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.4) rotate(-8deg);
  }

  12% {
    opacity: 1;
    transform: translate(calc(var(--x) * 0.2), -24px) scale(1) rotate(6deg);
  }

  40% {
    transform: translate(calc(var(--x) * -0.4), -80px) scale(1.05) rotate(-8deg);
  }

  70% {
    opacity: 0.9;
    transform: translate(calc(var(--x) * 0.7), -140px) scale(1.1) rotate(8deg);
  }

  100% {
    opacity: 0;
    transform: translate(var(--x), -196px) scale(1.2) rotate(-6deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .embers,
  .hearts {
    display: none;
  }
}
