:root {
  color-scheme: dark;
  --bg-0: #10040a;
  --bg-1: #260814;
  --bg-2: #4a0f25;
  --text-main: #fff5f9;
  --text-muted: #ffd9e6;
  --left-accent-rgb: 237, 78, 126;
  --right-accent-rgb: 255, 165, 199;
  --neutral-accent-rgb: 241, 95, 145;
  --profile-accent-rgb: 241, 95, 145;
  --profile-accent-soft-rgb: 255, 194, 218;
  --profile-accent-deep-rgb: 104, 28, 70;
  --profile-accent-strong-rgb: 255, 122, 186;
  --profile-orbit-x: 50%;
  --selection-accent-rgb: 241, 95, 145;
  --glass-edge: rgba(255, 255, 255, 0.38);
  --glass-fill: rgba(255, 236, 246, 0.14);
  --glass-soft-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  --font-display: "Unbounded", "Sora", sans-serif;
  --font-body: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  --font-profile-display: "Syne", "Unbounded", "Sora", sans-serif;
  --font-profile-body: "Space Grotesk", "Sora", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background: #10040a;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  touch-action: manipulation;
}

button {
  font: inherit;
  color: inherit;
}

.auth-gate {
  position: fixed;
  inset: 0;
  min-height: 100svh;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(140% 100% at 50% 0%, rgba(255, 84, 150, 0.32), rgba(255, 84, 150, 0) 56%),
    radial-gradient(120% 110% at 50% 100%, rgba(180, 26, 89, 0.44), rgba(180, 26, 89, 0) 62%),
    linear-gradient(180deg, #13040b 0%, #1f0712 54%, #11050b 100%);
  transition: opacity 260ms ease, visibility 260ms ease;
}

.auth-gate.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-gate__panel {
  width: min(30rem, 100%);
  border-radius: 1.3rem;
  border: 1px solid rgba(255, 221, 235, 0.32);
  background:
    linear-gradient(145deg, rgba(255, 244, 250, 0.16), rgba(255, 244, 250, 0.06)),
    rgba(17, 5, 11, 0.88);
  padding: clamp(1.1rem, 4vw, 1.6rem);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(18px);
  transform: translateY(0) scale(1);
  transition: transform 240ms ease, opacity 240ms ease, filter 240ms ease;
}

.auth-gate.is-unlocking .auth-gate__panel {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  filter: blur(2.8px);
}

.auth-gate.is-shaking .auth-gate__panel {
  animation: auth-shake 220ms ease;
}

@keyframes auth-shake {
  0% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-8px);
  }

  40% {
    transform: translateX(7px);
  }

  60% {
    transform: translateX(-6px);
  }

  80% {
    transform: translateX(4px);
  }

  100% {
    transform: translateX(0);
  }
}

.auth-gate__eyebrow {
  margin: 0;
  color: rgba(255, 212, 229, 0.86);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.67rem;
}

.auth-gate__title {
  margin: 0.45rem 0 0;
  font-family: var(--font-profile-display);
  font-size: clamp(1.4rem, 4.4vw, 2rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: #ffe3f0;
}

.auth-gate__copy {
  margin: 0.6rem 0 1rem;
  color: rgba(255, 227, 240, 0.82);
  font-size: 0.92rem;
}

.auth-gate__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.auth-gate__input {
  min-width: 0;
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 216, 233, 0.33);
  background: rgba(255, 234, 245, 0.11);
  color: rgba(255, 239, 247, 0.98);
  font-family: var(--font-profile-body);
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.72rem 0.8rem;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.auth-gate__input::placeholder {
  letter-spacing: 0.03em;
  text-transform: none;
  color: rgba(255, 220, 236, 0.6);
}

.auth-gate__input:focus-visible {
  border-color: rgba(255, 164, 202, 0.86);
  background: rgba(255, 232, 243, 0.16);
  box-shadow:
    0 0 0 1px rgba(255, 172, 207, 0.9),
    0 0 0 4px rgba(255, 116, 175, 0.2);
}

.auth-gate__button {
  border: 0;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #ff4d97, #ff6ba7);
  color: #fff2f8;
  padding: 0.72rem 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 8px 22px rgba(255, 75, 149, 0.35),
    inset 0 1px 0 rgba(255, 220, 236, 0.4);
  transition: transform 120ms ease, filter 120ms ease, opacity 120ms ease;
}

.auth-gate__button:hover {
  filter: brightness(1.08);
}

.auth-gate__button:active {
  transform: translateY(1px);
}

.auth-gate__button:disabled,
.auth-gate__input:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.auth-gate__message {
  min-height: 1.05rem;
  margin: 0.7rem 0 0;
  font-size: 0.79rem;
  color: rgba(255, 208, 229, 0.86);
}

.auth-gate__message.is-error {
  color: rgba(255, 153, 190, 0.96);
}

.app {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

.app.app--locked {
  pointer-events: none;
  user-select: none;
  opacity: 0;
}

.app::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 35%, rgba(var(--left-accent-rgb), 0.2), transparent 52%),
    radial-gradient(circle at 82% 35%, rgba(var(--right-accent-rgb), 0.2), transparent 54%);
  transition: background 380ms ease;
}

.app.profile-open::before {
  opacity: 0;
}

@keyframes app-profile-gradient-drift {
  0% {
    background-position: 46% -10%, 0% 100%, 100% 100%;
  }

  50% {
    background-position: 60% -10%, 10% 100%, 90% 100%;
  }

  100% {
    background-position: 46% -10%, 0% 100%, 100% 100%;
  }
}

.app::after {
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
  z-index: 12;
  opacity: 0;
  transform: scale(0.68);
  background: radial-gradient(
    circle at 50% 50%,
    rgba(var(--selection-accent-rgb), 0.58) 0%,
    rgba(var(--selection-accent-rgb), 0.25) 35%,
    rgba(var(--selection-accent-rgb), 0) 68%
  );
  mix-blend-mode: screen;
}

.app.selection-animate::after {
  animation: selection-bloom 740ms cubic-bezier(0.22, 0.71, 0.23, 1) forwards;
}

@keyframes selection-bloom {
  0% {
    opacity: 0;
    transform: scale(0.68);
  }

  28% {
    opacity: 0.88;
  }

  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

.app.app--busy {
  cursor: progress;
}

.duel-hint {
  display: none;
}

.duel-arena {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  filter: blur(0);
  transition:
    opacity 460ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 620ms cubic-bezier(0.2, 0.65, 0.23, 1),
    filter 620ms cubic-bezier(0.2, 0.65, 0.23, 1);
  will-change: opacity, transform, filter;
}

.duel-arena::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 9;
  opacity: 0;
  pointer-events: none;
}

.app.like-left .duel-arena::after {
  background: none;
  animation: none;
}

.app.like-right .duel-arena::after {
  background: none;
  animation: none;
}

.arena-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  background: transparent;
}

.inspect-morph-veil {
  --morph-rgb: 241, 95, 145;
  position: fixed;
  inset: 0;
  z-index: 33;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(130% 92% at 50% 6%, rgba(var(--morph-rgb), 0.26), rgba(var(--morph-rgb), 0) 58%),
    radial-gradient(130% 120% at 50% 96%, rgba(var(--morph-rgb), 0.24), rgba(var(--morph-rgb), 0) 64%);
  transition: opacity 460ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.inspect-morph-veil.is-active {
  opacity: 1;
}

.inspect-morph-image {
  position: fixed;
  z-index: 34;
  pointer-events: none;
  object-fit: cover;
  object-position: center;
  opacity: 0.98;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.24);
  transform: translateZ(0);
  will-change: left, top, width, height, border-radius, opacity;
  transition:
    left 640ms cubic-bezier(0.18, 0.79, 0.24, 1),
    top 640ms cubic-bezier(0.18, 0.79, 0.24, 1),
    width 640ms cubic-bezier(0.18, 0.79, 0.24, 1),
    height 640ms cubic-bezier(0.18, 0.79, 0.24, 1),
    border-radius 640ms cubic-bezier(0.18, 0.79, 0.24, 1),
    opacity 260ms ease;
}

.app.inspect-morphing .profile-stage__content {
  transition-timing-function: cubic-bezier(0.2, 0.78, 0.24, 1);
}

.center-divider {
  position: absolute;
  top: 10%;
  bottom: 16%;
  left: calc(50% - 0.5px);
  width: 1px;
  pointer-events: none;
  z-index: 8;
  opacity: 0.72;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.55) 20%,
    rgba(255, 255, 255, 0.55) 78%,
    rgba(255, 255, 255, 0)
  );
  transition: opacity 280ms ease;
}

.panel {
  position: absolute;
  top: 0;
  bottom: 0;
  overflow: hidden;
  cursor: pointer;
  border: 0;
  outline: none;
  transition:
    left 520ms cubic-bezier(0.2, 0.67, 0.23, 1),
    right 520ms cubic-bezier(0.2, 0.67, 0.23, 1),
    clip-path 420ms cubic-bezier(0.2, 0.67, 0.23, 1),
    opacity 420ms ease,
    transform 420ms ease;
  clip-path: inset(0 0 0 0);
  transform: translateX(0) scale(1);
  will-change: left, right, opacity, transform;
  backface-visibility: hidden;
}

.panel:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.7);
}

.panel--left {
  left: 0;
  right: 50%;
  --panel-accent-rgb: var(--left-accent-rgb);
}

.panel--right {
  left: 50%;
  right: 0;
  --panel-accent-rgb: var(--right-accent-rgb);
}

.panel__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.01);
  filter: saturate(1) brightness(1);
  transition:
    transform 520ms cubic-bezier(0.2, 0.7, 0.3, 1),
    filter 440ms ease;
  will-change: transform, filter;
}

.panel__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to top,
    rgba(8, 2, 6, 0.62) 0%,
    rgba(8, 2, 6, 0.18) 26%,
    rgba(8, 2, 6, 0) 50%
  );
}

.panel__meta {
  position: absolute;
  right: 0;
  bottom: max(4.9rem, calc(4.9rem + env(safe-area-inset-bottom)));
  left: 0;
  z-index: 3;
  padding: clamp(1rem, 3.5vw, 1.8rem);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-start;
}

.panel__sport {
  margin: 0 0 0.4rem;
  color: rgba(255, 220, 232, 0.86);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-size: clamp(0.66rem, 1.9vw, 0.9rem);
}

.panel__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.18rem, 6.9vw, 3.65rem);
  line-height: 0.92;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 243, 248, 0.22);
  -webkit-text-stroke: 1px rgba(255, 244, 248, 0.6);
  text-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  max-width: min(94%, 15ch);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: balance;
}

.panel:hover .panel__media,
.panel:focus-visible .panel__media {
  transform: scale(1.05);
}

.panel::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 45%;
  z-index: 9;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.64);
}

.app.like-left .panel--left::after,
.app.like-right .panel--right::after {
  content: none;
  animation: none;
}

@keyframes like-winner-glow {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }

  28% {
    opacity: 0.88;
  }

  100% {
    opacity: 0;
    transform: scale(1.04);
  }
}

.wipe-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.wipe-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.wipe-layer.pixel-dissolve {
  opacity: 1;
}

.wipe-layer.pixel-dissolve::before {
  content: none;
}

.wipe-layer.pixel-dissolve-left::before {
  background: radial-gradient(96% 130% at 30% 50%, rgba(var(--wipe-rgb), 0.4), rgba(var(--wipe-rgb), 0) 70%);
}

.wipe-layer.pixel-dissolve-right::before {
  background: radial-gradient(96% 130% at 70% 50%, rgba(var(--wipe-rgb), 0.4), rgba(var(--wipe-rgb), 0) 70%);
}

.wipe-layer.pixel-reveal {
  opacity: 1;
}

.wipe-layer.pixel-reveal::before {
  content: none;
}

.wipe-layer.pixel-reveal-left::before {
  background: radial-gradient(100% 130% at 30% 52%, rgba(var(--wipe-rgb), 0.32), rgba(var(--wipe-rgb), 0) 72%);
}

.wipe-layer.pixel-reveal-right::before {
  background: radial-gradient(100% 130% at 70% 52%, rgba(var(--wipe-rgb), 0.32), rgba(var(--wipe-rgb), 0) 72%);
}

.wipe-pixel {
  position: absolute;
  border-radius: 2px;
  background: rgba(var(--wipe-rgb), var(--pixel-alpha, 0.84));
  box-shadow:
    0 0 10px rgba(var(--wipe-rgb), 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.16);
  transform: translate(-50%, -50%) scale(0.45);
  opacity: 0;
  will-change: transform, opacity;
  animation: pixel-dissolve var(--pixel-duration, 520ms) cubic-bezier(0.2, 0.7, 0.25, 1) var(--pixel-delay, 0ms)
    forwards;
}

.wipe-pixel.wipe-pixel--reveal {
  animation: pixel-reveal var(--pixel-duration, 560ms) cubic-bezier(0.2, 0.7, 0.25, 1) var(--pixel-delay, 0ms)
    forwards;
}

@keyframes pixel-dissolve-flash {
  0% {
    opacity: 0;
  }

  16% {
    opacity: 0.76;
  }

  100% {
    opacity: 0;
  }
}

@keyframes pixel-dissolve {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.45) rotate(0deg);
  }

  14% {
    opacity: var(--pixel-alpha, 0.84);
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--pixel-dx, 0px)), calc(-50% + var(--pixel-dy, 0px)))
      scale(var(--pixel-scale-end, 0.24)) rotate(var(--pixel-rot, 0deg));
  }
}

@keyframes pixel-reveal-flash {
  0% {
    opacity: 0;
  }

  20% {
    opacity: 0.66;
  }

  100% {
    opacity: 0;
  }
}

@keyframes pixel-reveal {
  0% {
    opacity: 0;
    transform: translate(calc(-50% - var(--pixel-dx, 0px)), calc(-50% - var(--pixel-dy, 0px))) scale(1.32)
      rotate(var(--pixel-rot, 0deg));
  }

  22% {
    opacity: var(--pixel-alpha, 0.84);
    transform: translate(-50%, -50%) scale(0.9) rotate(0deg);
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--pixel-dx, 0px)), calc(-50% + var(--pixel-dy, 0px)))
      scale(var(--pixel-scale-end, 0.2)) rotate(0deg);
  }
}

.app.inspect-left .panel--left {
  right: 0;
  transform: translateX(0) scale(1.002);
}

.app.inspect-left .panel--right {
  left: 100%;
  opacity: 0;
  transform: translateX(5%) scale(0.985);
}

.app.inspect-right .panel--right {
  left: 0;
  transform: translateX(0) scale(1.002);
}

.app.inspect-right .panel--left {
  right: 100%;
  opacity: 0;
  transform: translateX(-5%) scale(0.985);
}

.app.like-left .panel--left {
  left: 0;
  right: 50%;
  transform: translateX(0) scale(1);
}

.app.like-right .panel--right {
  left: 50%;
  right: 0;
  transform: translateX(0) scale(1);
}

.app.like-left .panel--right {
  left: 50%;
  right: 0;
  clip-path: inset(0 0 0 0);
  opacity: 1;
  transform: translateX(0) scale(1);
}

.app.like-right .panel--left {
  left: 0;
  right: 50%;
  clip-path: inset(0 0 0 0);
  opacity: 1;
  transform: translateX(0) scale(1);
}

.panel.is-dissolving {
  opacity: 0;
  transform: translateX(0) scale(1.01);
  transition: opacity 0ms linear, transform 0ms linear;
}

.panel.is-dissolving .panel__media {
  filter: none;
  transition: none;
}

.panel.is-revealing {
  opacity: 1;
  visibility: hidden;
  transition: none !important;
}

.app.like-left .panel--right.is-dissolving,
.app.like-right .panel--left.is-dissolving {
  opacity: 0 !important;
}

.panel.is-revealing .panel__media {
  filter: none;
  transition: none !important;
}

.app.inspect-left .panel--left .panel__media,
.app.inspect-right .panel--right .panel__media {
  transform: scale(1.04);
}

.app.inspect-left .panel--right .panel__media,
.app.inspect-right .panel--left .panel__media {
  transform: scale(1.05);
  filter: saturate(0.75) brightness(0.72);
}

.app.like-left .center-divider,
.app.like-right .center-divider,
.app.inspect-left .center-divider,
.app.inspect-right .center-divider {
  opacity: 0;
}

.profile-stage {
  position: absolute;
  inset: 0;
  z-index: 15;
  font-family: var(--font-profile-body);
  opacity: 0;
  transform: translateY(14%);
  pointer-events: none;
  transition:
    opacity 420ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 560ms cubic-bezier(0.2, 0.67, 0.25, 1);
}

.profile-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(138% 112% at var(--profile-orbit-x) 6%, rgba(var(--profile-accent-rgb), 0.68), transparent 62%),
    radial-gradient(120% 108% at 100% 18%, rgba(var(--profile-accent-strong-rgb), 0.48), transparent 70%),
    radial-gradient(112% 128% at 0% 100%, rgba(var(--profile-accent-soft-rgb), 0.46), transparent 64%),
    linear-gradient(180deg, rgba(var(--profile-accent-deep-rgb), 0.95), rgba(10, 3, 8, 0.98));
  background-size: 166% 136%, 132% 128%, 130% 136%, 100% 100%;
  background-position: 50% 0%, 100% 22%, 0% 100%, 0 0;
  transition: background 320ms ease;
}

.profile-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.38;
  background:
    radial-gradient(circle at 16% 20%, rgba(var(--profile-accent-strong-rgb), 0.4) 0 1.2px, rgba(255, 255, 255, 0) 2.2px),
    radial-gradient(circle at 70% 62%, rgba(var(--profile-accent-soft-rgb), 0.34) 0 1.1px, rgba(255, 255, 255, 0) 2px),
    radial-gradient(circle at 52% 48%, rgba(255, 255, 255, 0.18) 0 1px, rgba(255, 255, 255, 0) 1.9px);
  background-size: 24px 24px, 30px 30px, 18px 18px;
  background-position: 0 0, 10px 12px, 0 0;
  mix-blend-mode: screen;
}

.profile-stage__content {
  position: relative;
  z-index: 2;
  height: 100dvh;
  padding: max(0.35rem, env(safe-area-inset-top)) 1rem max(6.6rem, calc(6.6rem + env(safe-area-inset-bottom)));
  overflow-y: auto;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 360ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 460ms cubic-bezier(0.2, 0.7, 0.3, 1);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.app.inspect-left .duel-arena,
.app.inspect-right .duel-arena {
  opacity: 0;
  visibility: hidden;
  transform: none;
  filter: none;
  transition: none;
  pointer-events: none;
}

.app.inspect-left .profile-stage,
.app.inspect-right .profile-stage {
  opacity: 0.86;
  transform: translateY(2%);
}

.app.inspect-left .profile-stage__content,
.app.inspect-right .profile-stage__content {
  opacity: 0.18;
  transform: translateY(12px);
}

.app.profile-open .duel-arena {
  opacity: 0;
  transform: translateY(-3.6%) scale(0.986);
  filter: blur(5.5px);
  pointer-events: none;
}

.app.profile-open .profile-stage {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.app.profile-open .profile-stage__content {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 48ms;
}

.app.profile-open .profile-stage::before {
  animation:
    profile-accent-breathe 2800ms ease-in-out infinite,
    profile-gradient-drift 9400ms linear infinite;
}

.app.profile-open .profile-stage::after {
  opacity: 0.62;
  animation: none;
}

@keyframes profile-accent-breathe {
  0%,
  100% {
    filter: saturate(1.05) brightness(1.02);
  }

  50% {
    filter: saturate(1.34) brightness(1.14);
  }
}

@keyframes profile-gradient-drift {
  0% {
    background-position: 44% 0%, 100% 20%, 0% 100%, 0 0;
  }

  50% {
    background-position: 58% 0%, 94% 20%, 6% 100%, 0 0;
  }

  100% {
    background-position: 44% 0%, 100% 20%, 0% 100%, 0 0;
  }
}

@keyframes profile-dot-drift {
  0% {
    background-position: 0 0, 10px 12px, 0 0;
  }

  50% {
    background-position: 18px 0, 2px 12px, 12px 0;
  }

  100% {
    background-position: 0 0, 10px 12px, 0 0;
  }
}

.profile-shell {
  max-width: 980px;
  margin: 0 auto;
}

.profile-top {
  margin: 0 0 1rem;
  border-radius: 1.2rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.profile-top__media-wrap {
  width: 100%;
  background:
    radial-gradient(128% 124% at 12% 0%, rgba(var(--profile-accent-strong-rgb), 0.28), rgba(var(--profile-accent-strong-rgb), 0) 56%),
    linear-gradient(165deg, rgba(var(--profile-accent-deep-rgb), 0.42), rgba(var(--profile-accent-rgb), 0.2));
  display: grid;
  place-items: center;
}

.profile-top__media {
  width: 100%;
  max-height: min(56vh, 28rem);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
}

.profile-top__body {
  padding: 0.95rem 1rem 1.05rem;
}

.profile-top__id {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.profile-top__avatar {
  width: clamp(3.6rem, 12vw, 5rem);
  height: clamp(3.6rem, 12vw, 5rem);
  border-radius: 0.9rem;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.profile-top__sport {
  margin: 0;
  color: rgba(255, 216, 230, 0.85);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile-top__name {
  margin: 0.18rem 0;
  font-family: var(--font-profile-display);
  font-size: clamp(1.12rem, 4.5vw, 1.8rem);
  letter-spacing: 0.02em;
}

.profile-top__instagram {
  color: rgba(255, 231, 239, 0.95);
  text-decoration: none;
  font-size: 0.92rem;
}

.profile-top__instagram:hover,
.profile-top__instagram:focus-visible {
  text-decoration: underline;
}

.profile-top__bio {
  margin: 0.9rem 0 0;
  color: rgba(255, 238, 244, 0.9);
  line-height: 1.52;
  font-size: 0.95rem;
}

.profile-stats {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.stat-chip {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.82rem;
  padding: 0.62rem 0.5rem;
  background: rgba(255, 255, 255, 0.07);
  text-align: center;
}

.stat-chip__value {
  display: block;
  font-weight: 700;
  font-size: clamp(0.9rem, 2.8vw, 1.05rem);
}

.stat-chip__label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 218, 232, 0.8);
}

.posts-section {
  margin: 0;
}

.posts-section__title {
  margin: 0 0 0.72rem;
  font-family: var(--font-profile-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: clamp(0.95rem, 2.6vw, 1.18rem);
  color: rgba(255, 226, 236, 0.92);
}

.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.post-card {
  border-radius: 1rem;
  overflow: hidden;
  border: 2px solid rgba(0, 0, 0, 0.78);
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 10px 24px rgba(0, 0, 0, 0.34);
}

.post-card__frame {
  width: 100%;
  background:
    radial-gradient(120% 112% at 10% 0%, rgba(var(--profile-accent-rgb), 0.2), rgba(var(--profile-accent-rgb), 0) 56%),
    linear-gradient(160deg, rgba(var(--profile-accent-deep-rgb), 0.38), rgba(var(--profile-accent-rgb), 0.14));
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55);
}

.post-card__media {
  width: 100%;
  max-height: min(66vh, 31rem);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  cursor: zoom-in;
}

.post-card video.post-card__media {
  cursor: default;
}

.post-card__body {
  padding: 0.8rem 0.88rem 0.92rem;
}

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.52rem;
  margin-bottom: 0.55rem;
  color: rgba(255, 217, 231, 0.82);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-card__caption {
  margin: 0;
  line-height: 1.5;
  color: rgba(255, 238, 245, 0.96);
  font-size: 0.92rem;
}

.post-card__caption.is-muted {
  color: rgba(255, 220, 233, 0.67);
  font-style: italic;
}

.post-card__link {
  display: inline-block;
  margin-top: 0.65rem;
  color: rgba(255, 225, 237, 0.96);
  font-size: 0.84rem;
}

.post-card__link:hover,
.post-card__link:focus-visible {
  color: #ffffff;
}

.empty-feed {
  margin: 0;
  padding: 1rem;
  border-radius: 0.92rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 222, 233, 0.88);
  background: rgba(255, 255, 255, 0.06);
}

.glass-bar {
  --bar-accent-rgb: var(--neutral-accent-rgb);
  position: fixed;
  left: 50%;
  bottom: max(0.8rem, calc(0.8rem + env(safe-area-inset-bottom)));
  transform: translateX(-50%);
  z-index: 36;
  width: min(95vw, 29rem);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.52rem;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  background: var(--glass-fill);
  box-shadow:
    var(--glass-soft-shadow),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 0 38px rgba(var(--bar-accent-rgb), 0.35);
  backdrop-filter: blur(22px) saturate(175%);
  transition: box-shadow 280ms ease;
  overflow: hidden;
  isolation: isolate;
}

.glass-bar__active-pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.05) 48%),
    linear-gradient(160deg, rgba(var(--bar-accent-rgb), 0.72), rgba(var(--bar-accent-rgb), 0.44));
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.25) inset,
    0 0 26px rgba(var(--bar-accent-rgb), 0.42);
  transition:
    transform 300ms cubic-bezier(0.2, 0.7, 0.3, 1),
    width 300ms cubic-bezier(0.2, 0.7, 0.3, 1),
    height 300ms cubic-bezier(0.2, 0.7, 0.3, 1),
    opacity 220ms ease;
}

.glass-bar__active-pill.is-visible {
  opacity: 1;
}

.glass-bar::before,
.glass-bar::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
}

.glass-bar::before {
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.33), rgba(255, 255, 255, 0.05) 38%, rgba(255, 255, 255, 0));
}

.glass-bar::after {
  inset: -28%;
  background: radial-gradient(circle at 50% 65%, rgba(var(--bar-accent-rgb), 0.18), transparent 55%);
}

.control-btn {
  position: relative;
  z-index: 2;
  border: 0;
  height: clamp(2.42rem, 6.6vw, 3rem);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 247, 250, 0.98);
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.control-btn__emoji {
  font-size: clamp(1rem, 3.8vw, 1.25rem);
  line-height: 1;
}

.control-btn[data-action="like-left"],
.control-btn[data-action="like-right"] {
  border: 1px solid rgba(255, 191, 219, 0.44);
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 56%),
    linear-gradient(160deg, rgba(255, 82, 150, 0.44), rgba(255, 161, 203, 0.22));
  box-shadow:
    0 8px 20px rgba(104, 18, 59, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.13);
}

.control-btn[data-action="like-left"] .control-btn__emoji,
.control-btn[data-action="like-right"] .control-btn__emoji {
  font-size: clamp(1.08rem, 4.15vw, 1.36rem);
  filter: saturate(1.14);
}

.control-btn:hover,
.control-btn:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
  outline: none;
}

.control-btn:active {
  transform: translateY(0);
}

.control-btn.is-current {
  background:
    linear-gradient(155deg, rgba(255, 245, 249, 0.44), rgba(255, 188, 216, 0.2)),
    rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.33);
}

.control-btn[data-action="like-left"].is-current,
.control-btn[data-action="like-right"].is-current {
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0) 56%),
    linear-gradient(160deg, rgba(255, 87, 156, 0.78), rgba(255, 158, 203, 0.4));
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.38),
    0 0 24px rgba(255, 101, 168, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  animation: like-btn-pulse 980ms ease-out 2;
}

@keyframes like-btn-pulse {
  0% {
    transform: translateY(0) scale(1);
  }

  45% {
    transform: translateY(-1px) scale(1.06);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

.control-btn--home {
  background: rgba(255, 255, 255, 0.07);
}

.control-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.media-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.media-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 2, 4, 0.84);
  backdrop-filter: blur(9px);
}

.media-lightbox__panel {
  position: relative;
  z-index: 2;
  width: min(94vw, 1040px);
  max-height: 92svh;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(13, 4, 8, 0.9);
  padding: 0.55rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.media-lightbox__close {
  display: inline-flex;
  margin-left: auto;
  margin-bottom: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 236, 244, 0.97);
  cursor: pointer;
}

.media-lightbox__content {
  width: 100%;
  max-height: calc(92svh - 3rem);
  display: grid;
  place-items: center;
  overflow: auto;
}

.media-lightbox__content img,
.media-lightbox__content video {
  width: auto;
  max-width: 100%;
  max-height: calc(92svh - 3rem);
  object-fit: contain;
  border-radius: 0.65rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(max(4.9rem, calc(4.9rem + env(safe-area-inset-bottom))));
  z-index: 38;
  margin: 0;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(20, 5, 11, 0.82);
  color: rgba(255, 237, 244, 0.95);
  font-size: 0.83rem;
  transition: opacity 220ms ease, transform 220ms ease;
  backdrop-filter: blur(8px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.boot-splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: transparent;
  overflow: hidden;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.boot-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.boot-heart-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

@media (max-width: 760px) {
  .auth-gate {
    place-items: start center;
    padding-top: calc(env(safe-area-inset-top) + 1.4rem);
  }

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

  .auth-gate__button {
    width: 100%;
  }

  .panel__meta {
    padding-right: 0.82rem;
    padding-left: 0.82rem;
  }

  .panel__name {
    font-size: clamp(1rem, 5.8vw, 2.02rem);
    line-height: 0.94;
    -webkit-text-stroke: 0.85px rgba(255, 244, 248, 0.66);
    max-width: 98%;
  }

  .profile-stage__content {
    padding-right: 0.85rem;
    padding-left: 0.85rem;
  }

  .control-btn[data-action="like-left"],
  .control-btn[data-action="like-right"] {
    height: clamp(2.58rem, 9.6vw, 3.1rem);
  }

  .control-btn[data-action="like-left"] .control-btn__emoji,
  .control-btn[data-action="like-right"] .control-btn__emoji {
    font-size: clamp(1.2rem, 5.2vw, 1.55rem);
  }

  .profile-stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat-chip:last-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 960px) {
  .panel {
    transition:
      left 660ms cubic-bezier(0.17, 0.82, 0.2, 1),
      right 660ms cubic-bezier(0.17, 0.82, 0.2, 1),
      clip-path 520ms cubic-bezier(0.17, 0.82, 0.2, 1),
      opacity 520ms cubic-bezier(0.4, 0, 0.2, 1),
      transform 640ms cubic-bezier(0.2, 0.75, 0.22, 1);
  }

  .panel__media {
    transition:
      transform 720ms cubic-bezier(0.2, 0.75, 0.22, 1),
      filter 560ms ease;
  }

  .profile-stage__content {
    padding-top: max(0.6rem, env(safe-area-inset-top));
    padding-right: 1.4rem;
    padding-left: 1.4rem;
  }

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

  .post-card__media {
    max-height: 25rem;
  }
}

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