:root {
  color-scheme: dark;
  --ink: #fff7fb;
  --muted: #b9a9b2;
  --paper: #1d1018;
  --panel: #170b12;
  --line: #432436;
  --accent: #ff2f8f;
  --accent-2: #14f1d9;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 47, 143, 0.2), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(20, 241, 217, 0.14), transparent 28%),
    #080608;
}

body.page-body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: auto;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1;
}

h2 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.app {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.roulette-panel,
.feed-stage,
.feed {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.roulette-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.feed-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
}

.feed {
  display: grid;
  grid-auto-rows: 100%;
  gap: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

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

.feed-card {
  position: relative;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 47, 143, 0.16), transparent 31%),
    linear-gradient(135deg, rgba(20, 241, 217, 0.12), transparent 38%),
    #000000;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.feed-card img,
.feed-card video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: contain;
  background: #000000;
}

.like-button {
  position: absolute;
  right: 14px;
  bottom: 96px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 70px;
  min-height: 44px;
  border: 1px solid rgba(255, 47, 143, 0.42);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(8, 6, 8, 0.76);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

.like-button.liked {
  border-color: rgba(255, 47, 143, 0.82);
  background: rgba(255, 47, 143, 0.24);
}

.like-heart {
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
}

.menu-toggle {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 12;
  display: grid;
  gap: 5px;
  width: 44px;
  height: 44px;
  place-content: center;
  border: 1px solid rgba(255, 47, 143, 0.42);
  border-radius: 8px;
  background: rgba(8, 6, 8, 0.74);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 13;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(4px);
}

.menu-backdrop[hidden] {
  display: none;
}

.side-menu {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 14;
  display: grid;
  align-content: start;
  gap: 12px;
  width: min(420px, 92vw);
  height: 100vh;
  height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) 14px 18px max(14px, env(safe-area-inset-left));
  overflow-y: auto;
  background: rgba(18, 9, 14, 0.96);
  border-right: 1px solid rgba(255, 47, 143, 0.32);
  box-shadow: var(--shadow);
  transform: translateX(0);
}

.side-menu[hidden] {
  display: none;
}

.menu-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 56px;
}

.site-logo {
  display: block;
  width: 100%;
  max-height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255, 47, 143, 0.34));
}

.age-badge,
.age-mark {
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: #080608;
  color: #ffffff;
  font-weight: 1000;
  box-shadow: 0 0 22px rgba(255, 47, 143, 0.46);
}

.age-badge {
  width: 54px;
  height: 42px;
  font-size: 1.1rem;
}

.menu-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
}

.menu-section {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(255, 47, 143, 0.24);
  border-radius: 8px;
  padding: 12px;
  background: rgba(8, 6, 8, 0.44);
}

.menu-nav {
  display: grid;
  gap: 10px;
}

.menu-link {
  display: flex;
  align-items: center;
  min-height: 52px;
  border: 1px solid rgba(255, 47, 143, 0.24);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(8, 6, 8, 0.44);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
  text-decoration: none;
}

.menu-link:hover,
.menu-link:focus-visible {
  border-color: rgba(255, 47, 143, 0.56);
  background: rgba(255, 47, 143, 0.12);
}

.timer-mode-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 47, 143, 0.24);
  border-radius: 8px;
  padding: 14px;
  background: rgba(8, 6, 8, 0.44);
}

.timer-mode-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 54px;
  height: 30px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 47, 143, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.switch span::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 160ms ease;
}

.switch input:checked + span {
  border-color: rgba(255, 47, 143, 0.9);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.switch input:checked + span::before {
  transform: translateX(24px);
}

.timer-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.timer-field input {
  width: 100%;
  border: 1px solid rgba(255, 47, 143, 0.3);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.timer-countdown {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 12;
  display: grid;
  min-width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255, 47, 143, 0.52);
  border-radius: 999px;
  background: rgba(8, 6, 8, 0.76);
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

.timer-countdown[hidden] {
  display: none;
}

.page-shell {
  position: fixed;
  inset: 0;
  z-index: 13;
  display: grid;
  place-items: center;
  padding: 72px 16px 100px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px);
}

.page-shell[hidden] {
  display: none;
}

.page-card {
  position: relative;
  display: grid;
  gap: 12px;
  width: min(620px, 100%);
  border: 1px solid rgba(255, 47, 143, 0.34);
  border-radius: 8px;
  padding: 22px;
  background: rgba(18, 9, 14, 0.96);
  box-shadow: var(--shadow);
}

.standalone-page {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: start center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 96px 16px 32px;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(8, 6, 8, 0.74);
  border-bottom: 1px solid rgba(255, 47, 143, 0.24);
  backdrop-filter: blur(14px);
}

.home-link,
.top-nav a {
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-switch {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-switch a {
  color: var(--ink);
  font-weight: 900;
}

.page-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 900;
}

.auth-form,
.upload-form {
  display: grid;
  gap: 8px;
}

.auth-form input,
.upload-form input,
.upload-form select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.34);
  color: var(--ink);
}

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

.auth-actions button,
.user-panel button,
.avatar-form button,
.links-form button,
.upload-form button,
.age-gate-card button {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, var(--accent), #ff8ac4);
  color: #ffffff;
  font-weight: 900;
}

.user-panel {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar,
.profile-avatar-placeholder {
  width: 92px;
  height: 92px;
  border: 2px solid rgba(255, 47, 143, 0.44);
  border-radius: 50%;
  background: #000000;
}

.profile-avatar {
  object-fit: cover;
}

.profile-avatar-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.avatar-form {
  display: grid;
  gap: 8px;
}

.links-form {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 47, 143, 0.24);
  padding-bottom: 16px;
}

.avatar-form label,
.links-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.avatar-form input,
.links-form input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.34);
  color: var(--ink);
}

.profile-section {
  display: grid;
  gap: 10px;
}

.profile-page {
  padding-left: 0;
  padding-right: 0;
}

.profile-top-bar {
  justify-content: space-between;
}

.profile-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 1000;
}

.tiktok-profile {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  width: min(860px, 100%);
  padding: 0 14px 32px;
}

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  border-bottom: 1px solid rgba(255, 47, 143, 0.24);
  padding: 8px 0 18px;
}

.profile-avatar-wrap {
  display: grid;
  place-items: center;
}

.profile-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.profile-main h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.6rem, 7vw, 2.8rem);
}

.profile-handle {
  color: var(--muted);
  font-weight: 900;
}

.profile-stats {
  display: grid;
  grid-template-columns: minmax(0, auto);
  justify-content: start;
  gap: 10px;
}

.profile-stats div {
  display: grid;
  gap: 2px;
  text-align: center;
}

.profile-stats strong {
  color: var(--ink);
  font-size: 1.15rem;
}

.profile-stats span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-links a,
.empty-profile-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(255, 47, 143, 0.28);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.empty-profile-link {
  color: var(--muted);
}

.profile-action,
.profile-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid rgba(255, 47, 143, 0.24);
  border-radius: 8px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.profile-avatar-form {
  border-bottom: 1px solid rgba(255, 47, 143, 0.24);
  padding-bottom: 16px;
}

.profile-tabs {
  display: grid;
  border-bottom: 1px solid rgba(255, 47, 143, 0.24);
}

.profile-tab {
  justify-self: center;
  border: 0;
  border-bottom: 3px solid var(--ink);
  padding: 12px 18px;
  background: transparent;
  color: var(--ink);
  font-weight: 1000;
}

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

.profile-upload-card {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #000000;
}

.profile-upload-media {
  aspect-ratio: 3 / 4;
  background: #000000;
}

.profile-upload-media img,
.profile-upload-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-upload-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 20px 7px 7px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.84), transparent);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.7rem;
}

.profile-upload-meta strong {
  color: var(--ink);
  text-transform: capitalize;
}

.profile-upload-type {
  position: absolute;
  top: 6px;
  left: 6px;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(0, 0, 0, 0.58);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 900;
}

.profile-upload-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  border: 0;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 47, 143, 0.86);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 900;
}

.profile-upload-remove:disabled {
  opacity: 0.6;
  cursor: progress;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state.error {
  color: #ff8aa3;
}

.status-text {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.status-text.error {
  color: #ff8aa3;
}

.upload-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.check-row {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.check-row input {
  flex: 0 0 auto;
  width: auto;
  margin-top: 2px;
  accent-color: var(--accent);
}

.disabled {
  opacity: 0.58;
}

.sliders {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.slider-card {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.slider-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.category-dot {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
}

.weight-value {
  width: 56px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.legal-panel {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.legal-panel summary {
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.legal-panel ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.legal-panel li + li {
  margin-top: 5px;
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(12px);
}

.age-gate[hidden] {
  display: none;
}

.age-gate-card {
  display: grid;
  gap: 14px;
  width: min(520px, 100%);
  border: 1px solid rgba(255, 47, 143, 0.42);
  border-radius: 8px;
  padding: 24px;
  background: #140a10;
  box-shadow: var(--shadow);
}

.age-mark {
  width: 72px;
  height: 54px;
  font-size: 1.5rem;
}

.age-gate-card h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1;
}

.age-gate-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.age-gate-card button.secondary {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

@media (min-width: 760px) {
  .side-menu {
    width: 440px;
  }

  .menu-toggle {
    top: 18px;
    left: 18px;
  }
}

@media (max-width: 520px) {
  .menu-toggle {
    width: 42px;
    height: 42px;
  }

  .side-menu {
    width: min(360px, 94vw);
    padding-right: 10px;
  }

  .menu-section {
    padding: 10px;
  }

  .auth-actions {
    grid-template-columns: 1fr;
  }

  .sliders {
    gap: 8px;
  }

  .category-name,
  .weight-value {
    font-size: 0.78rem;
  }

  .category-dot {
    width: 10px;
    height: 10px;
  }

  input[type="range"] {
    height: 18px;
  }

  .profile-hero {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
  }

  .profile-avatar,
  .profile-avatar-placeholder {
    width: 84px;
    height: 84px;
  }

  .profile-stats {
    gap: 10px;
  }

  .profile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-action,
  .profile-actions button {
    padding: 0 10px;
  }
}
