:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #151922;
  --panel-2: #1f2531;
  --text: #f6f7fb;
  --muted: #aeb7c7;
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(12, 15, 22, 0.62);
  --accent: #28d7a5;
  --accent-2: #ff4f7a;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

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

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(9, 11, 16, 0.92), rgba(9, 11, 16, 0));
  pointer-events: none;
}

.brand,
.nav-actions,
.nav-actions form {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07080b;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0;
}

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

.icon-button,
.text-button,
.primary-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 25, 34, 0.82);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 28px;
  line-height: 1;
}

.text-button {
  padding: 9px 12px;
}

.text-button.strong,
.primary-action {
  background: var(--accent);
  color: #04100d;
  border-color: transparent;
  font-weight: 800;
}

.feed-shell {
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  background: #050608;
  scrollbar-width: none;
}

.feed-shell::-webkit-scrollbar {
  display: none;
}

.video-card,
.empty-state {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
}

.video-card::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(8, 10, 14, 0.54);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.video-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 50%;
  left: calc(50% + 4px);
  width: 0;
  height: 0;
  border-top: 17px solid transparent;
  border-bottom: 17px solid transparent;
  border-left: 25px solid #fff;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.video-card.is-paused::before,
.video-card.is-paused::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.feed-video {
  width: 100%;
  height: 100dvh;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

.video-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  min-height: 38vh;
  padding: 96px 18px max(24px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.3) 48%, rgba(0, 0, 0, 0));
  pointer-events: none;
}

.creator,
.caption,
.video-overlay time {
  margin: 0;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.72);
}

.creator {
  font-weight: 800;
}

.caption {
  max-width: min(680px, 72vw);
  margin-top: 8px;
  line-height: 1.35;
}

.video-copy {
  min-width: 0;
  padding-right: 8px;
  pointer-events: none;
}

.video-overlay time {
  flex: none;
  color: var(--muted);
  font-size: 13px;
}

.video-actions {
  flex: none;
  display: grid;
  justify-items: end;
  gap: 8px;
  pointer-events: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.ghost-button,
.danger-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 10px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

.ghost-button:active {
  transform: scale(0.97);
}

.rail-button {
  min-width: 76px;
  min-height: 40px;
  font-weight: 800;
}

.danger-button {
  background: rgba(255, 107, 107, 0.14);
  color: #ffd2d2;
  border-color: rgba(255, 107, 107, 0.36);
}

.auth-page,
.empty-state {
  min-height: 100vh;
  padding: 86px 18px 28px;
  display: grid;
  place-items: center;
}

.panel {
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.36);
}

.panel h1,
.empty-state h1 {
  margin: 0 0 18px;
  font-size: clamp(28px, 8vw, 44px);
  line-height: 1.02;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 12px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
}

.primary-action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 12px 16px;
  width: 100%;
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.form-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 107, 107, 0.12);
  color: #ffd2d2;
  border: 1px solid rgba(255, 107, 107, 0.32);
}

.form-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(40, 215, 165, 0.12);
  color: #bdf8e8;
  border: 1px solid rgba(40, 215, 165, 0.32);
}

.upload-progress {
  height: 10px;
  margin: 2px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.upload-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 180ms ease;
}

.upload-status {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.check-row {
  grid-template-columns: 22px 1fr;
  align-items: start;
  color: var(--text);
  font-weight: 650;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.fine-print {
  margin: 14px 0 0;
  color: var(--muted);
}

.fine-print a {
  color: var(--accent);
  font-weight: 800;
}

.share-page {
  min-height: 100vh;
  padding: 76px 0 24px;
  background: #050608;
}

.share-shell {
  width: min(540px, 100%);
  margin: 0 auto;
}

.share-video {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #000;
}

.share-meta {
  padding: 16px 18px 0;
}

.share-meta .caption {
  max-width: none;
  margin: 10px 0 16px;
}

.copy-note {
  margin: 10px 0 0;
  color: var(--accent);
  font-weight: 800;
}

.report-modal {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(16, 20, 28, 0.96);
  color: var(--text);
  box-shadow: 0 28px 120px rgba(0, 0, 0, 0.62);
}

.report-modal::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
}

.report-dialog {
  padding: 18px;
}

.report-dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-dialog-heading h2 {
  margin: 0;
  font-size: 22px;
}

.modal-close {
  width: 34px;
  height: 34px;
  font-size: 18px;
}

.reason-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 0;
  border: 0;
}

.reason-list legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.reason-option {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
}

.reason-option input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.reason-option strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
}

.reason-option:has(input:checked) {
  border-color: rgba(40, 215, 165, 0.56);
  background: rgba(40, 215, 165, 0.12);
}

.dialog-actions {
  justify-content: end;
}

.dialog-actions .ghost-button,
.dialog-actions .danger-button {
  min-height: 40px;
}

.admin-page {
  min-height: 100vh;
  padding: 86px 18px 32px;
}

.admin-hero {
  width: min(1120px, 100%);
  margin: 0 auto 18px;
}

.admin-hero h1 {
  margin: 0;
  font-size: clamp(30px, 6vw, 52px);
  line-height: 1;
}

.admin-grid {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.panel-heading,
.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading {
  margin-bottom: 12px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 20px;
}

.panel-heading span,
.muted,
.admin-row small {
  color: var(--muted);
}

.admin-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.admin-row.compact {
  align-items: center;
}

.admin-row-main {
  min-width: 0;
  flex: 1;
}

.admin-row-main p {
  margin: 4px 0;
}

.admin-thumb {
  width: 72px;
  height: 96px;
  object-fit: cover;
  background: #000;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.small-action {
  width: auto;
  min-height: 36px;
  padding: 8px 12px;
}

@media (min-width: 820px) {
  .feed-video {
    width: min(540px, 100vw);
    box-shadow: 0 0 0 1px var(--line);
  }

  .video-overlay {
    width: min(540px, 100vw);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}
