.profile-page {
  margin: 0;
  min-height: 100dvh;
  background: #05070d;
  color: #f7f8fb;
  overflow: hidden;
}

.profile-page::before,
.profile-page::after {
  display: none;
}

.scene,
.scene-background,
.scene-overlay,
.scene-stars,
.shooting-stars,
.stage {
  position: fixed;
  inset: 0;
}

.scene {
  min-height: 100dvh;
}

.scene-background {
  background-image: url("../pngs/background-first.png");
  background-position: center;
  background-size: cover;
  transform: scale(1.06);
  filter: saturate(1.05) contrast(1.03) brightness(0.52);
}

.scene-overlay {
  background:
    radial-gradient(circle at 50% 45%, rgba(16, 27, 48, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(3, 6, 12, 0.42), rgba(4, 7, 15, 0.78)),
    rgba(2, 4, 10, 0.46);
  backdrop-filter: blur(1.5px);
}

.stage {
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.identity-card {
  width: min(100%, 29rem);
  padding: 2.35rem 2rem 2.1rem;
  border-radius: 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(6, 11, 23, 0.54);
  backdrop-filter: blur(14px);
  box-shadow:
    0 24px 80px rgba(1, 5, 15, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  animation: card-rise 900ms ease both;
  transform-origin: center;
}

.identity-card h1 {
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 4.8rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
  font-weight: 700;
  color: #fbfcff;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
}

.identity-meta {
  margin: 1.1rem auto 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.72rem;
  min-width: 12.2rem;
  padding: 0.72rem 1.05rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(244, 247, 255, 0.9);
  font-size: 0.98rem;
  letter-spacing: 0.02em;
}

.meta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.meta-icon svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scene-stars,
.shooting-stars {
  pointer-events: none;
  z-index: 2;
}

.birthday-mode-layer {
  position: fixed;
  inset: 0;
  z-index: 8;
  overflow: auto;
}

.birthday-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 82, 149, 0.4), transparent 24%),
    radial-gradient(circle at 80% 18%, rgba(255, 211, 61, 0.36), transparent 22%),
    radial-gradient(circle at 50% 80%, rgba(59, 130, 246, 0.4), transparent 26%),
    linear-gradient(135deg, rgba(122, 28, 172, 0.88), rgba(15, 85, 203, 0.84) 45%, rgba(255, 95, 109, 0.84));
}

.birthday-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -10%;
  width: 12px;
  height: 20px;
  border-radius: 4px;
  opacity: 0.96;
  animation: confetti-fall var(--duration, 3200ms) linear forwards;
}

.birthday-shell {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.35rem 0 2rem;
}

.birthday-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.birthday-kicker,
.game-kicker {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.birthday-head h2 {
  margin: 0.45rem 0 0;
  font-size: clamp(2.3rem, 7vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.birthday-close,
.game-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.05rem;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.birthday-close:hover,
.game-button:hover,
.gift-button:hover,
.balloon:hover {
  transform: translateY(-1px);
}

.birthday-intro {
  max-width: 38rem;
  margin: 1rem 0 1.5rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.7;
}

.birthday-intro code {
  font-size: 0.95em;
  padding: 0.14rem 0.36rem;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.14);
}

.birthday-games {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.birthday-game {
  padding: 1.2rem;
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 40px rgba(33, 10, 74, 0.16);
}

.birthday-game h3 {
  margin: 0.45rem 0 0.55rem;
  font-size: 1.4rem;
  line-height: 1.05;
}

.birthday-game p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.birthday-game > p:not(.game-kicker):not(.game-score) {
  line-height: 1.55;
}

.game-button {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.2);
}

.secondary-game-button {
  margin-top: 0;
  background: rgba(255, 255, 255, 0.14);
}

.game-score {
  margin-top: 0.85rem !important;
  color: rgba(255, 255, 255, 0.82) !important;
  font-size: 0.95rem;
}

.gift-row,
.balloon-board {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.gift-button,
.balloon {
  appearance: none;
  border: 0;
  border-radius: 1rem;
  min-width: 3.35rem;
  min-height: 3.35rem;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.45rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.gift-button.is-hit,
.balloon.is-popped {
  background: rgba(255, 255, 255, 0.28);
}

.gift-button:disabled,
.balloon.is-popped {
  opacity: 0.56;
  cursor: default;
}

.birthday-game-wide {
  grid-column: span 2;
}

.balloon-footer {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.profile-page.birthday-mode .identity-card {
  border-color: rgba(255, 255, 255, 0.26);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06)),
    rgba(76, 18, 119, 0.22);
  box-shadow:
    0 24px 80px rgba(117, 34, 165, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(247, 251, 255, 0.9);
  box-shadow: 0 0 10px rgba(164, 214, 255, 0.45);
  animation: twinkle 3.4s ease-in-out infinite;
}

.star:nth-child(1) {
  top: 14%;
  left: 18%;
  animation-delay: 0s;
}

.star:nth-child(2) {
  top: 20%;
  left: 76%;
  animation-delay: 0.8s;
}

.star:nth-child(3) {
  top: 31%;
  left: 10%;
  animation-delay: 1.2s;
}

.star:nth-child(4) {
  top: 64%;
  left: 82%;
  animation-delay: 1.8s;
}

.star:nth-child(5) {
  top: 78%;
  left: 22%;
  animation-delay: 2.2s;
}

.star:nth-child(6) {
  top: 12%;
  left: 54%;
  animation-delay: 2.8s;
}

.shooting-star {
  position: absolute;
  width: min(24vw, 180px);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.96) 35%,
    rgba(162, 214, 255, 0.76) 62%,
    rgba(255, 255, 255, 0)
  );
  opacity: 0;
  transform: rotate(-18deg) translate3d(0, 0, 0);
  filter: drop-shadow(0 0 10px rgba(164, 214, 255, 0.52));
  animation: shooting 7.5s ease-out infinite;
}

.shooting-star:nth-child(1) {
  top: 18%;
  left: 58%;
  animation-delay: 0.8s;
}

.shooting-star:nth-child(2) {
  top: 28%;
  left: 20%;
  animation-delay: 3s;
}

.shooting-star:nth-child(3) {
  top: 10%;
  left: 72%;
  animation-delay: 5.4s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.28;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.5);
  }
}

@keyframes shooting {
  0% {
    opacity: 0;
    transform: rotate(-18deg) translate3d(0, 0, 0);
  }

  8% {
    opacity: 1;
  }

  32% {
    opacity: 0;
    transform: rotate(-18deg) translate3d(-180px, 120px, 0);
  }

  100% {
    opacity: 0;
    transform: rotate(-18deg) translate3d(-180px, 120px, 0);
  }
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -10vh, 0) rotate(0deg);
  }

  12% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translate3d(var(--drift, 0px), 112vh, 0) rotate(720deg);
  }
}

@media (max-width: 640px) {
  .identity-card {
    padding: 1.9rem 1.25rem 1.75rem;
    width: min(100%, 23.5rem);
  }

  .identity-meta {
    width: 100%;
  }

  .shooting-star {
    width: min(40vw, 150px);
  }
}

@media (max-width: 920px) {
  .birthday-games {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .birthday-game-wide {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .birthday-shell {
    width: min(100%, calc(100% - 1rem));
    padding-top: 1rem;
  }

  .birthday-head,
  .balloon-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .birthday-games {
    grid-template-columns: 1fr;
  }

  .birthday-game-wide {
    grid-column: span 1;
  }

  .birthday-close,
  .game-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .identity-card,
  .star,
  .shooting-star,
  .confetti-piece {
    animation: none !important;
  }
}
