:root {
  --bg: #000;
  --card: #141418;
  --text: #fff;
  --muted: #a3a3ad;
  --accent: #ff2d55;
  --line: rgba(255, 255, 255, 0.12);
  --nav: 64px;
  font-family: Outfit, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #050506; color: var(--text); }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: #050506;
}
.gate-card, .panel {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.4rem 1.2rem;
}
.brand { margin: 0; font-weight: 800; letter-spacing: -0.03em; color: var(--accent); }
h1 { font-size: 1.7rem; margin: 0.3rem 0 0.6rem; }
.muted { color: var(--muted); }
.btn, .tabbar button, .rail button, .icon-btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  font-weight: 700;
}
.btn.ghost, .text-btn { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.block { width: 100%; margin-top: 0.7rem; }
label { display: block; margin: 0.8rem 0 0.3rem; font-size: 0.9rem; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #0c0c10;
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
}
textarea { min-height: 90px; resize: vertical; }
.row-links { display: flex; justify-content: space-between; gap: 0.8rem; margin-top: 0.8rem; font-size: 0.92rem; }
.row-links button { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 700; }
#app { height: 100dvh; }
#view { height: 100%; }
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  height: calc(var(--nav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(0, 0, 0, 0.86);
  border-top: 1px solid var(--line);
  z-index: 20;
}
.tabbar button {
  background: none;
  border-radius: 0;
  color: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 0.68rem;
  padding: 0.35rem 0.2rem;
}
.tabbar svg { width: 22px; height: 22px; }
.tabbar button.active { color: var(--accent); }
#inbox-dot {
  position: absolute;
  top: 10px;
  margin-left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--accent);
}
.feed {
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  background: #000;
}
.slide {
  position: relative;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
}
.slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.shade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  pointer-events: none;
}
.meta {
  position: absolute;
  left: 0.9rem;
  right: 4.6rem;
  bottom: calc(var(--nav) + env(safe-area-inset-bottom) + 3.1rem);
}
.author { font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; gap: 0.28rem; }
.badge { width: 16px; height: 16px; flex: none; }
.badge.gold { color: #e8b923; }
.badge.blue { color: #1d9bf0; }
h1 .badge { width: 22px; height: 22px; }
.comment .badge { width: 14px; height: 14px; margin: 0 0.28rem 0 0.15rem; vertical-align: -2px; }
.scrub {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: calc(var(--nav) + env(safe-area-inset-bottom) + 0.35rem);
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
}
.skip {
  border: 0;
  background: rgba(20, 20, 24, 0.55);
  color: #fff;
  border-radius: 999px;
  padding: 0.38rem 0.62rem;
  font-size: 0.74rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}
.scrub-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.35);
}
.scrub-range::-webkit-slider-runnable-track { height: 4px; background: transparent; }
.scrub-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}
.scrub-range::-moz-range-track { height: 4px; background: transparent; border: 0; }
.scrub-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.caption { margin: 0.35rem 0 0; }
.rail {
  position: absolute;
  right: 0.55rem;
  bottom: calc(var(--nav) + env(safe-area-inset-bottom) + 3.3rem);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.rail button {
  width: 52px;
  height: 52px;
  padding: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  line-height: 1.1;
}
.rail button.on { color: var(--accent); }
.topbar {
  position: fixed;
  top: env(safe-area-inset-top);
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 100%);
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0.9rem;
  pointer-events: none;
}
.topbar a, .topbar button, .topbar .brand { pointer-events: auto; }
.top-actions { display: flex; gap: 0.45rem; }
.top-actions .btn { padding: 0.45rem 0.85rem; }
.topbar .brand { font-size: 1.05rem; }
.page {
  min-height: 100%;
  padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(var(--nav) + env(safe-area-inset-bottom) + 1rem);
  max-width: 520px;
  margin: 0 auto;
}
.stats { display: flex; gap: 1rem; margin: 0.8rem 0; }
.stats strong { display: block; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.grid a { aspect-ratio: 3/4; background: #111; overflow: hidden; }
.grid video { width: 100%; height: 100%; object-fit: cover; }
.check { display: flex; gap: 0.55rem; align-items: flex-start; margin: 0.7rem 0; }
.check input { width: auto; margin-top: 0.2rem; }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  max-height: 70dvh;
  background: #121216;
  border-radius: 18px 18px 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet header, .sheet form { padding: 0.8rem 0.9rem; }
.sheet .thread { overflow: auto; padding: 0 0.9rem 0.5rem; }
.comment { margin: 0 0 0.75rem; }
.comment b { margin-right: 0.35rem; }
.sheet form { display: flex; gap: 0.5rem; }
.sheet input { flex: 1; }
.empty { padding: 30vh 1.5rem 0; text-align: center; }
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav) + 16px);
  transform: translateX(-50%);
  background: #fff;
  color: #111;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 40;
}
#toast.show { opacity: 1; }
.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  background: #222;
}
@media (min-width: 900px) {
  body { background: #101014; }
  #app, .feed, .slide { height: 100dvh; }
  .feed, .page, .tabbar, .sheet {
    width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
  .tabbar, .sheet { left: 50%; }
}
