:root {
  --bg: #08090d;
  --bg-elevated: #111218;
  --surface: rgba(20, 21, 29, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.065);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --text: #f7f7f8;
  --muted: #9b9ca7;
  --faint: #656672;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #ff3b6b;
  --accent-hot: #ff174f;
  --accent-soft: rgba(255, 59, 107, 0.18);
  --violet: #8f68ff;
  --success: #52e0a0;
  --warning: #f6c45a;
  --danger: #ff5672;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --safe-top: max(env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px));
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: #08090d;
  overscroll-behavior: none;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% -10%, rgba(123, 67, 151, 0.18), transparent 34%),
    radial-gradient(circle at 95% 35%, rgba(255, 59, 107, 0.08), transparent 27%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.is-hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
  pointer-events: none;
}

.ambient-one {
  top: -160px;
  left: -100px;
  background: var(--violet);
}

.ambient-two {
  right: -160px;
  top: 42%;
  background: var(--accent);
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--bg);
  transition: opacity 260ms ease;
}

.boot.is-leaving {
  opacity: 0;
}

.boot p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.boot-mark,
.brand-signal,
.go-live-button > span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.boot-mark span,
.brand-signal i,
.go-live-button i {
  display: block;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff7696, var(--accent-hot));
  box-shadow: 0 0 18px rgba(255, 23, 79, 0.5);
  animation: signal 900ms ease-in-out infinite alternate;
}

.go-live-button.is-locked {
  opacity: .64;
  filter: saturate(.25);
}

.go-live-button[hidden],
.primary-button[hidden] {
  display: none;
}

.boot-mark span {
  width: 6px;
}

.boot-mark span:nth-child(1),
.brand-signal i:nth-child(1),
.go-live-button i:nth-child(1) { height: 13px; animation-delay: -350ms; }
.boot-mark span:nth-child(2),
.brand-signal i:nth-child(2),
.go-live-button i:nth-child(2) { height: 25px; animation-delay: -100ms; }
.boot-mark span:nth-child(3),
.brand-signal i:nth-child(3),
.go-live-button i:nth-child(3) { height: 17px; animation-delay: -250ms; }
.boot-mark span { height: 32px !important; }
.boot-mark span:nth-child(1) { height: 20px !important; }
.boot-mark span:nth-child(3) { height: 26px !important; }

@keyframes signal {
  to { transform: scaleY(0.48); opacity: 0.7; }
}

.app-shell {
  width: min(100%, 720px);
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  padding-top: var(--safe-top);
  padding-bottom: calc(86px + var(--safe-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 10px 18px;
  background: linear-gradient(180deg, rgba(8, 9, 13, 0.97) 65%, rgba(8, 9, 13, 0));
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.brand-signal {
  width: 31px;
  height: 31px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(255, 59, 107, 0.18), rgba(143, 104, 255, 0.08));
}

.brand-signal i {
  width: 3px;
  box-shadow: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.avatar-button,
.round-button,
.glass-button,
.composer-action,
.send-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  cursor: pointer;
}

.icon-button,
.avatar-button {
  width: 40px;
  height: 40px;
  border-radius: 15px;
}

.icon-button svg,
.glass-button svg,
.composer-action svg,
.send-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.avatar-button {
  position: relative;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--violet), #4d32a0);
  font-weight: 800;
}

.avatar-button img,
.profile-avatar img,
.creator-avatar img,
.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.presence-dot {
  position: absolute;
  right: -1px;
  bottom: 1px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--success);
}

.main-content {
  padding: 0 16px 28px;
}

.screen {
  display: none;
  animation: screen-in 250ms ease both;
}

.screen.is-active {
  display: block;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(7px); }
}

.home-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 2px 21px;
}

.eyebrow,
.section-kicker,
.profile-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
  animation: live-pulse 1.8s ease infinite;
}

@keyframes live-pulse {
  50% { box-shadow: 0 0 0 2px var(--accent-soft); }
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.home-intro h1,
.inner-header h1 {
  max-width: 480px;
  margin: 10px 0 0;
  font-size: clamp(30px, 8.4vw, 48px);
  line-height: 0.99;
  letter-spacing: -0.052em;
}

.home-intro h1 em {
  color: var(--accent);
  font-style: normal;
}

.live-count {
  flex: none;
  margin-bottom: 3px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 59, 107, 0.3);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #ffb0c3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.category-rail {
  display: flex;
  gap: 8px;
  margin: 0 -16px 18px;
  padding: 0 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-rail::-webkit-scrollbar { display: none; }

.category-chip {
  flex: none;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: 160ms ease;
}

.category-chip.is-active {
  border-color: var(--text);
  background: var(--text);
  color: #0a0a0e;
}

.featured-wrap {
  min-height: 260px;
}

.featured-card {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #191a20;
  box-shadow: var(--shadow);
  cursor: pointer;
  isolation: isolate;
}

.featured-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(7, 7, 10, 0.04) 25%, rgba(7, 7, 10, 0.93) 95%),
    linear-gradient(120deg, rgba(143, 104, 255, 0.1), rgba(255, 59, 107, 0.14));
}

.featured-card > img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 650ms cubic-bezier(.2,.8,.2,1);
}

.featured-card:hover > img { transform: scale(1.025); }

.featured-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
}

.badge-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-badge,
.viewer-pill,
.provider-badge,
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(8, 9, 13, 0.58);
  backdrop-filter: blur(13px);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.live-badge {
  border-color: rgba(255, 62, 105, 0.62);
  background: rgba(232, 26, 74, 0.9);
}

.live-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: live-pulse-dot 1.2s ease infinite;
}

@keyframes live-pulse-dot { 50% { opacity: 0.42; } }

.viewer-pill svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.featured-card-copy {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 28px 22px 22px;
}

.creator-mini {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
}

.mini-avatar,
.creator-avatar,
.message-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--violet), #463181);
  color: #fff;
  font-weight: 850;
}

.mini-avatar {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.creator-mini div {
  display: grid;
  gap: 1px;
}

.creator-mini b { font-size: 13px; }
.creator-mini span { color: rgba(255,255,255,.68); font-size: 11px; }

.featured-card h2 {
  max-width: 520px;
  margin: 0 0 9px;
  font-size: clamp(27px, 7vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.featured-card-copy > p {
  max-width: 510px;
  margin: 0 0 18px;
  color: rgba(255,255,255,.72);
  line-height: 1.45;
}

.watch-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border: 0;
  border-radius: 15px;
  background: #fff;
  color: #0b0b0e;
  font-weight: 800;
}

.watch-button span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 32px 2px 15px;
}

.section-heading.compact { margin-top: 28px; }

.section-heading h2 {
  margin: 4px 0 0;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.text-button {
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.stream-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stream-card {
  min-width: 0;
  cursor: pointer;
}

.stream-card-cover {
  position: relative;
  aspect-ratio: 0.8;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 30% 20%, rgba(143,104,255,.6), transparent 36%),
    #202129;
}

.stream-card-cover::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
}

.stream-card-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.stream-card:active .stream-card-cover > img { transform: scale(1.035); }

.card-badges {
  position: absolute;
  top: 10px;
  right: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-badges > span:first-child {
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-live {
  padding: 5px 7px;
  border-radius: 8px;
  background: var(--accent-hot);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}

.card-provider {
  padding: 5px 6px;
  border-radius: 8px;
  background: rgba(0,0,0,.6);
  color: rgba(255,255,255,.8);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .04em;
}

.card-viewers {
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(0,0,0,.55);
  font-size: 9px;
  font-weight: 750;
  backdrop-filter: blur(8px);
}

.stream-card-body {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 3px 2px;
}

.stream-card-body .mini-avatar {
  width: 31px;
  height: 31px;
  border-width: 1px;
}

.stream-card-copy { min-width: 0; }

.stream-card-copy h3 {
  overflow: hidden;
  margin: 0 0 3px;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-card-copy p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 46px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  text-align: center;
}

.empty-state span {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: var(--surface-soft);
  color: var(--accent);
  font-size: 23px;
}

.empty-state h3 { margin-bottom: 7px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.inner-header {
  padding: 30px 2px 26px;
}

.inner-header p {
  margin: 11px 0 0;
  color: var(--muted);
}

.stack-list,
.creator-streams {
  display: grid;
  gap: 10px;
}

.follow-card,
.creator-stream-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  cursor: pointer;
}

.follow-card-cover,
.creator-stream-cover {
  width: 66px;
  height: 76px;
  flex: none;
  overflow: hidden;
  border-radius: 14px;
  background: #25262f;
}

.follow-card-cover img,
.creator-stream-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.follow-card-copy,
.creator-stream-copy { min-width: 0; flex: 1; }
.follow-card-copy b,
.creator-stream-copy b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.follow-card-copy p,
.creator-stream-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

.status-pill {
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #ff9fb6;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.activity-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
}

.activity-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 14px;
  background: rgba(143,104,255,.18);
  color: #bba7ff;
  font-size: 18px;
}

.activity-card b { display: block; margin: 1px 0 5px; }
.activity-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.muted-card { opacity: .72; }

.profile-hero {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 25px 2px 17px;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  overflow: hidden;
  flex: none;
  border: 2px solid rgba(255,255,255,.12);
  border-radius: 24px;
  background: linear-gradient(145deg, var(--violet), #493192);
  color: #fff;
  font-size: 26px;
  font-weight: 900;
}

.profile-hero > div { min-width: 0; flex: 1; }
.profile-hero h1 { overflow: hidden; margin: 3px 0; font-size: 27px; letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.profile-hero p { margin: 0; color: var(--muted); font-size: 13px; }

.round-button {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  color: var(--muted);
  letter-spacing: .08em;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 4px 0 16px;
  padding: 18px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
}

.profile-stats div {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.profile-stats div + div { border-left: 1px solid var(--line); }
.profile-stats b { font-size: 20px; }
.profile-stats span { color: var(--muted); font-size: 10px; }

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 17px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--accent-hot), #ff5c80);
  box-shadow: 0 12px 32px rgba(255, 23, 79, 0.22);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.primary-button.full { width: 100%; }
.primary-button.tall { min-height: 55px; border-radius: 17px; }
.primary-button:disabled { opacity: .55; cursor: wait; }

.pulse-dot {
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255,255,255,.18);
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  width: min(100%, 720px);
  min-height: calc(70px + var(--safe-bottom));
  margin: auto;
  padding: 7px 8px var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: rgba(11, 12, 17, 0.93);
  backdrop-filter: blur(24px) saturate(145%);
}

.nav-item {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 53px;
  padding: 7px 3px 4px;
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.is-active { color: var(--text); }
.nav-item.is-active svg { filter: drop-shadow(0 0 9px rgba(255,255,255,.2)); }

.go-live-button {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: -22px auto 4px;
  border: 5px solid var(--bg-elevated);
  border-radius: 21px;
  background: linear-gradient(145deg, #ff5d82, var(--accent-hot));
  box-shadow: 0 12px 34px rgba(255, 23, 79, 0.33);
  cursor: pointer;
}

.go-live-button i {
  width: 3px;
  background: #fff;
  box-shadow: none;
}

/* Stream room */
.stream-room {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(100%, 720px);
  margin: auto;
  background: #050508;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: opacity 220ms ease, transform 260ms cubic-bezier(.2,.8,.2,1), visibility 220ms;
}

.stream-room.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.player-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #111218;
  isolation: isolate;
}

.player-mount,
.player-mount > video,
.player-mount > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #07070a;
}

.player-mount > video {
  object-fit: cover;
}

.player-mount.platform-embed {
  position: relative;
  inset: auto;
  width: calc(100% - 24px);
  height: 300px;
  min-height: 300px;
  margin: calc(76px + var(--safe-top)) 12px 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: #000;
}

.player-stage.has-platform-embed {
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #050508;
}

.player-stage.has-platform-embed .player-poster,
.player-stage.has-platform-embed .player-shade {
  display: none;
}

.player-stage.has-platform-embed .room-content {
  position: relative;
  right: auto;
  bottom: auto;
  left: auto;
  padding-top: 22px;
}

.player-stage.has-platform-embed .room-messages {
  mask-image: none;
}

.player-stage.has-platform-embed .floating-reactions {
  display: none;
}

.player-poster {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.85) brightness(.78);
}

.player-shade {
  position: absolute;
  z-index: 1;
  right: 0;
  left: 0;
  height: 38%;
  pointer-events: none;
}

.player-shade.top {
  top: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.68), transparent);
}

.player-shade.bottom {
  bottom: 0;
  height: 66%;
  background: linear-gradient(0deg, rgba(5,5,8,.98) 2%, rgba(5,5,8,.6) 62%, transparent);
}

.room-topbar {
  position: absolute;
  z-index: 8;
  top: var(--safe-top);
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: 43px 1fr 43px;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
}

.glass-button {
  width: 43px;
  height: 43px;
  border-color: rgba(255,255,255,.15);
  border-radius: 50%;
  background: rgba(0,0,0,.36);
  backdrop-filter: blur(14px);
  font-size: 14px;
  letter-spacing: .08em;
}

.room-live-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.room-live-meta .viewer-pill,
.room-live-meta .provider-badge { background: rgba(0,0,0,.36); }

.provider-badge {
  max-width: 78px;
  overflow: hidden;
  color: rgba(255,255,255,.75);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-content {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 24px 17px 15px;
  pointer-events: none;
}

.room-content button,
.room-content input,
.room-messages { pointer-events: auto; }

.creator-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.creator-avatar {
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255,255,255,.8);
}

.creator-line > div {
  display: grid;
  min-width: 0;
  flex: 1;
}

.creator-line b { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.creator-line span { color: rgba(255,255,255,.62); font-size: 10px; }

.follow-button {
  min-height: 35px;
  padding: 0 13px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #0b0b0f;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.follow-button.is-following {
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
}

.room-content h2 {
  margin: 15px 0 5px;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -.04em;
}

.room-content > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 12px;
  color: rgba(255,255,255,.65);
  font-size: 12px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.room-messages {
  display: grid;
  align-content: end;
  gap: 7px;
  max-width: 88%;
  height: 126px;
  overflow: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(transparent 0, #000 28%, #000 100%);
}

.room-messages::-webkit-scrollbar { display: none; }

.room-message {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px 6px 6px;
  border-radius: 13px;
  background: rgba(0,0,0,.3);
  backdrop-filter: blur(8px);
  animation: message-in 200ms ease both;
}

@keyframes message-in { from { opacity: 0; transform: translateY(4px); } }

.message-avatar {
  width: 24px;
  height: 24px;
  margin-top: 1px;
  font-size: 9px;
}

.room-message p {
  overflow-wrap: anywhere;
  margin: 0;
  color: rgba(255,255,255,.9);
  font-size: 11px;
  line-height: 1.35;
}

.room-message b {
  margin-right: 5px;
  color: #ffb5c6;
  font-size: 10px;
}

.reaction-strip {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}

.reaction-strip button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  font-size: 16px;
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.reaction-strip button:active { transform: scale(.88); }

.floating-reactions {
  position: absolute;
  z-index: 9;
  right: 20px;
  bottom: 42px;
  width: 54px;
  height: 250px;
  overflow: hidden;
  pointer-events: none;
}

.floating-reaction {
  position: absolute;
  right: 4px;
  bottom: -30px;
  font-size: 25px;
  animation: float-reaction 2.3s cubic-bezier(.18,.72,.24,1) forwards;
}

@keyframes float-reaction {
  0% { opacity: 0; transform: translate(0, 0) scale(.55) rotate(0); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift), -230px) scale(1.18) rotate(var(--turn)); }
}

.message-composer {
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 43px 43px;
  gap: 8px;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(8,9,13,.98);
}

.message-input {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 43px;
  padding: 0 12px 0 7px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.message-input span {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: none;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--violet), #463181);
  font-size: 10px;
  font-weight: 850;
}

.message-input span img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.message-input input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.message-input input::placeholder { color: var(--faint); }

.composer-action,
.send-button {
  width: 43px;
  height: 43px;
  border-radius: 15px;
}

.send-button {
  border: 0;
  background: var(--accent);
  color: #fff;
}

.external-player-state {
  position: absolute;
  z-index: 4;
  top: 23%;
  right: 22px;
  left: 22px;
  display: grid;
  justify-items: center;
  text-align: center;
}

.external-player-state h3 { margin: 16px 0 7px; font-size: 21px; }
.external-player-state p { max-width: 320px; margin: 0 0 17px; color: rgba(255,255,255,.65); font-size: 12px; line-height: 1.5; }

.external-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  background: rgba(255,255,255,.07);
}

.external-orbit::before,
.external-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,59,107,.25);
  border-radius: 50%;
}

.external-orbit::before { inset: -7px; }
.external-orbit::after { inset: -14px; opacity: .5; }
.external-orbit i { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 25px var(--accent); }

/* Sheets */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0,0,0,.58);
  opacity: 0;
  visibility: hidden;
  backdrop-filter: blur(5px);
  transition: 200ms ease;
}

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

.bottom-sheet {
  position: fixed;
  z-index: 80;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 720px);
  max-height: calc(100dvh - var(--safe-top) - 16px);
  margin: auto;
  overflow: auto;
  padding: 10px 17px calc(18px + var(--safe-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background: rgba(20,21,28,.985);
  box-shadow: 0 -30px 80px rgba(0,0,0,.5);
  transform: translateY(104%);
  visibility: hidden;
  transition: transform 320ms cubic-bezier(.18,.8,.25,1), visibility 320ms;
}

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

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 99px;
  background: rgba(255,255,255,.18);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.sheet-header h2 { margin: 4px 0 0; font-size: 26px; letter-spacing: -.04em; }

.close-sheet {
  width: 39px;
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.create-form {
  display: grid;
  gap: 14px;
}

.create-form > label,
.form-row label {
  display: grid;
  gap: 7px;
}

.create-form label > span,
.form-row label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.create-form label > span i {
  color: var(--faint);
  font-style: normal;
  font-weight: 500;
}

.create-form input,
.create-form textarea,
.create-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: 0;
  background: rgba(255,255,255,.055);
  color: var(--text);
  transition: border-color 160ms ease, background 160ms ease;
}

.create-form input,
.create-form select {
  height: 49px;
  padding: 0 13px;
}

.create-form textarea {
  resize: vertical;
  min-height: 85px;
  padding: 13px;
  line-height: 1.45;
}

.create-form input:focus,
.create-form textarea:focus,
.create-form select:focus {
  border-color: rgba(255,59,107,.58);
  background: rgba(255,255,255,.075);
}

.create-form input::placeholder,
.create-form textarea::placeholder { color: var(--faint); }
.create-form small { color: var(--faint); font-size: 10px; line-height: 1.4; }
.create-form select { appearance: none; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rights-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
}

.rights-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.rights-check label { color: var(--muted); font-size: 11px; line-height: 1.4; }

.compact-sheet { padding-top: 9px; }

.sheet-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 53px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.sheet-action:last-child { border-bottom: 0; }
.sheet-action span { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 10px; background: var(--surface-soft); }
.sheet-action.danger { color: var(--danger); }

.toast-stack {
  position: fixed;
  z-index: 120;
  top: calc(14px + var(--safe-top));
  right: 12px;
  left: 12px;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 440px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(28,29,37,.96);
  box-shadow: 0 18px 48px rgba(0,0,0,.35);
  color: var(--text);
  font-size: 12px;
  backdrop-filter: blur(18px);
  animation: toast-in 260ms ease both;
}

.toast::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--success);
}

.toast.is-error::before { background: var(--danger); }
.toast.is-leaving { animation: toast-out 180ms ease both; }

@keyframes toast-in { from { opacity: 0; transform: translateY(-9px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.055);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer { to { transform: translateX(100%); } }

@media (min-width: 650px) {
  .app-shell {
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    background: rgba(8,9,13,.52);
  }

  .stream-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .featured-card { min-height: 490px; }
  .stream-card-cover { aspect-ratio: .78; }
}

@media (max-width: 370px) {
  .main-content { padding-right: 12px; padding-left: 12px; }
  .category-rail { margin-right: -12px; margin-left: -12px; padding-right: 12px; padding-left: 12px; }
  .room-live-meta .viewer-pill { display: none; }
  .home-intro h1 { font-size: 29px; }
  .featured-card { min-height: 405px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
