:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #070708;
  color: #f8f8fa;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% -10%, rgba(255, 45, 85, 0.2), transparent 34rem),
    radial-gradient(circle at 92% 8%, rgba(37, 244, 238, 0.08), transparent 28rem),
    #070708;
}

body.player-open,
body.app-open-feedback-open {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

.hidden {
  display: none !important;
}

.site-header {
  width: min(1080px, calc(100% - 32px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #ff4770, #df143f);
  box-shadow: 0 8px 24px rgba(255, 45, 85, 0.3);
}

main {
  width: min(960px, calc(100% - 32px));
  margin: 24px auto 72px;
}

.state-card,
.profile-card,
.stats,
.empty-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(23, 23, 27, 0.82);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.state-card {
  min-height: 320px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 32px;
  text-align: center;
}

.state-card h1,
.state-card p {
  margin: 0;
}

.update-mark {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  font-size: 28px;
}

.state-card p {
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.55;
}

.invite-card {
  max-width: 620px;
  margin: 0 auto;
}

.invite-code-row {
  width: min(100%, 440px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.invite-code-row code {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-wrap: anywhere;
  color: #fff;
  font: 750 18px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
}

.invite-copy-status {
  min-height: 1.4em;
  color: #25f4ee !important;
  font-size: 14px;
}

.invite-actions {
  width: min(100%, 440px);
}

.invite-actions.has-download {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invite-install-note {
  max-width: 440px;
  font-size: 13px;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #ff2d55;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.profile-card {
  padding: 32px;
  border-radius: 30px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
}

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

.avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.9);
  background: #27272d;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ff4770, #7b2cff);
  font-size: 38px;
  font-weight: 800;
}

.identity {
  min-width: 0;
}

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

.name-row h1 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: -0.04em;
}

.verified {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #25f4ee;
  color: #061312;
  font-size: 13px;
  font-weight: 900;
}

.handle,
.bio {
  margin: 7px 0 0;
}

.handle {
  color: rgba(255, 255, 255, 0.5);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.bio {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.55;
  white-space: pre-wrap;
}

.button {
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: #ff2d55;
  color: #fff;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.08);
}

.button-quiet {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats {
  margin-top: 14px;
  padding: 20px;
  border-radius: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

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

.stats div + div {
  border-left: 1px solid rgba(255, 255, 255, 0.09);
}

.stats strong {
  font-size: 24px;
}

.stats span,
#video-status {
  color: rgba(255, 255, 255, 0.46);
  font-size: 13px;
}

.videos-section {
  margin-top: 36px;
}

.section-heading {
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.section-heading h2 {
  margin: 0;
  font-size: 24px;
}

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

.video-card {
  position: relative;
  aspect-ratio: 9 / 14;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: #161619;
  color: #fff;
  cursor: pointer;
}

.video-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.25s ease;
}

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

.video-card::after {
  content: "";
  position: absolute;
  inset: 34% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
}

.video-card-copy {
  position: absolute;
  z-index: 1;
  left: 13px;
  right: 13px;
  bottom: 12px;
  text-align: left;
}

.video-card-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.video-card-meta {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.empty-card {
  min-height: 160px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.58);
  text-align: center;
}

.load-more {
  margin: 20px auto 0;
}

.video-detail {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(240px, 1fr);
  gap: 28px;
  align-items: start;
}

.video-player-card,
.video-meta {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(23, 23, 27, 0.82);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.video-player-card {
  padding: 12px;
  border-radius: 28px;
}

.video-player-shell {
  width: 100%;
}

.video-meta {
  padding: 28px;
  border-radius: 28px;
}

.creator-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.video-creator-avatar {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

.creator-row strong {
  display: block;
}

.video-meta h1 {
  margin: 22px 0 10px;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.video-stats {
  display: flex;
  gap: 18px;
  margin: 20px 0 24px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
}

.player-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.9);
}

.player-shell {
  width: min(540px, 100%);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 22px;
  background: #000;
}

.player-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.close-player {
  position: fixed;
  z-index: 101;
  top: max(20px, env(safe-area-inset-top));
  right: 22px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(25, 25, 28, 0.9);
  color: #fff;
  font-size: 30px;
  cursor: pointer;
}

.player-error {
  padding: 32px;
  color: rgba(255, 255, 255, 0.66);
  text-align: center;
}

.app-open-feedback {
  position: fixed;
  z-index: 110;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(12px);
}

.app-open-feedback-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  background: #17171b;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
  text-align: center;
}

.app-open-feedback-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 18px;
  font-size: 24px;
  font-weight: 800;
}

.app-open-feedback-card h2,
.app-open-feedback-card p {
  margin: 0;
}

.app-open-feedback-card p {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.66);
  line-height: 1.55;
}

.app-open-feedback-actions {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

@media (max-width: 720px) {
  .site-header {
    height: 62px;
  }

  main {
    margin-top: 12px;
  }

  .profile-card {
    grid-template-columns: auto 1fr;
    padding: 22px;
    gap: 16px;
  }

  .profile-actions {
    grid-column: 1 / -1;
  }

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

  .avatar {
    width: 80px;
    height: 80px;
  }

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

  .video-detail {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .video-meta {
    padding: 22px;
  }
}

@media (max-width: 420px) {
  .profile-actions.has-download {
    grid-template-columns: 1fr;
  }

  .invite-code-row {
    grid-template-columns: 1fr;
  }

  .invite-actions.has-download {
    grid-template-columns: 1fr;
  }
}
