:root {
  --bg: #120827;
  --bg-soft: rgba(255, 255, 255, 0.1);
  --bg-strong: rgba(255, 255, 255, 0.16);
  --text: #fef7ff;
  --muted: #d7c9ef;
  --pink: #ff87d5;
  --purple: #996dff;
  --blue: #66d6ff;
  --teal: #75ffe8;
  --rose: #ff406e;
  --border: rgba(255, 255, 255, 0.24);
  --shadow: 0 20px 50px rgba(15, 8, 35, 0.35);
  --hero-gradient: linear-gradient(135deg, rgba(255, 122, 214, 0.35), rgba(102, 214, 255, 0.2));
  --page-gradient: radial-gradient(circle at top left, rgba(255, 129, 206, 0.32), transparent 30%),
    radial-gradient(circle at top right, rgba(108, 166, 255, 0.24), transparent 28%),
    linear-gradient(140deg, #130726 0%, #1b1247 42%, #101c4c 100%);
}

body.light-mode {
  --bg: #f6edff;
  --bg-soft: rgba(255, 255, 255, 0.62);
  --bg-strong: rgba(255, 255, 255, 0.8);
  --text: #322049;
  --muted: #6e6186;
  --border: rgba(167, 126, 255, 0.24);
  --shadow: 0 16px 42px rgba(121, 96, 176, 0.18);
  --page-gradient: radial-gradient(circle at top left, rgba(255, 182, 223, 0.75), transparent 28%),
    radial-gradient(circle at top right, rgba(143, 213, 255, 0.62), transparent 26%),
    linear-gradient(140deg, #ffeefe 0%, #f2f5ff 44%, #eaf7ff 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background: var(--page-gradient);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px;
  isolation: isolate;
}

.aurora,
.particles,
.balloons {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.aurora {
  filter: blur(50px);
  opacity: 0.65;
  z-index: -2;
  animation: drift 12s ease-in-out infinite alternate;
}

.aurora-one {
  inset: 8% auto auto 4%;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  background: rgba(255, 103, 197, 0.26);
}

.aurora-two {
  inset: auto 8% 10% auto;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  background: rgba(86, 215, 255, 0.24);
  animation-duration: 15s;
}

.aurora-three {
  inset: 22% auto auto 44%;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  background: rgba(164, 107, 255, 0.24);
  animation-duration: 18s;
}

.glass {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar,
.tab-nav,
.tab-panel,
.modal-card {
  animation: fadeUp 0.8s ease both;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  font-weight: 800;
  font-size: 1.45rem;
  color: white;
  background: linear-gradient(135deg, var(--pink), var(--blue));
  box-shadow: 0 0 24px rgba(134, 166, 255, 0.48);
}

.brand h1,
.section-heading h3,
.modal-card h3 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inline-field {
  min-width: 170px;
}

.field span {
  font-size: 0.8rem;
  color: var(--muted);
}

.field input {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

body.light-mode .field input {
  background: rgba(255, 255, 255, 0.7);
}

.glow-button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 0 22px rgba(175, 113, 255, 0.28);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

body.light-mode .glow-button {
  color: #fff;
}

.glow-button.secondary {
  background: linear-gradient(135deg, rgba(102, 214, 255, 0.35), rgba(178, 120, 255, 0.35));
}

.glow-button:hover,
.glow-button:focus-visible {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 30px rgba(114, 215, 255, 0.42), 0 0 22px rgba(255, 122, 214, 0.22);
  filter: brightness(1.08);
}

.tab-nav {
  position: sticky;
  top: 18px;
  z-index: 10;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  margin: 22px auto 0;
  padding: 12px;
  border-radius: 999px;
}

.tab-button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.tab-button.active,
.tab-button:hover,
.tab-button:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 22px rgba(148, 123, 255, 0.22);
  transform: translateY(-1px);
}

.content {
  max-width: 1240px;
  margin: 24px auto 0;
}

.tab-panel {
  display: none;
  padding: 30px;
  border-radius: 34px;
}

.tab-panel.active {
  display: block;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: center;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 170, 223, 0.18), transparent 26%),
    radial-gradient(circle at 82% 24%, rgba(105, 221, 255, 0.2), transparent 26%),
    var(--hero-gradient),
    var(--bg-soft);
}

.hero-copy {
  max-width: 620px;
}

.glow-text {
  text-shadow: 0 0 18px rgba(255, 122, 214, 0.55);
}

.hero-copy h2 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.95;
}

.hero-subtitle {
  margin: 14px 0 8px;
  font-family: "Quicksand", sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: #fff3ff;
}

body.light-mode .hero-subtitle {
  color: #52356c;
}

.hero-description,
.message-card p,
.music-card p,
.wish-back,
.tips-list {
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.mini-card {
  border-radius: 24px;
  padding: 18px;
}

.mini-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.hero-visual {
  display: grid;
  place-items: center;
}

.character-frame {
  position: relative;
  display: grid;
  place-items: center;
}

.photo-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 340px);
  padding: 14px;
  border-radius: 34px;
  overflow: hidden;
}

.character-glow {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 135, 213, 0.36), rgba(102, 214, 255, 0.08) 55%, transparent 70%);
  filter: blur(24px);
  animation: pulseGlow 3.6s ease-in-out infinite;
}

.waiguru-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 26px;
  box-shadow: 0 0 38px rgba(255, 135, 213, 0.22);
  animation: portraitFloat 4.8s ease-in-out infinite;
}

.nameplate {
  position: absolute;
  bottom: 14px;
  right: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 2;
}

.section-heading {
  margin-bottom: 24px;
}

.message-layout,
.music-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.message-card,
.music-card {
  border-radius: 28px;
  padding: 24px;
}

.typed-message {
  min-height: 180px;
  font-size: 1.05rem;
  white-space: pre-wrap;
}

.typed-message::after,
#typedWish::after {
  content: "|";
  margin-left: 3px;
  animation: caret 0.8s steps(1) infinite;
}

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

.gallery-item {
  margin: 0;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.45s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
  filter: saturate(1.15) brightness(1.04);
}

.wish-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  perspective: 1000px;
}

.wish-card {
  position: relative;
  min-height: 240px;
  transform-style: preserve-3d;
  transition: transform 0.7s ease;
}

.wish-card:hover {
  transform: rotateY(180deg) translateY(-4px);
}

.wish-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: 26px;
  backface-visibility: hidden;
  text-align: center;
}

.wish-front {
  font-size: 1.7rem;
  font-weight: 700;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08)),
    linear-gradient(135deg, rgba(255, 122, 214, 0.22), rgba(102, 214, 255, 0.18));
}

.wish-back {
  transform: rotateY(180deg);
}

.tips-list {
  margin: 0;
  padding-left: 18px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(9, 6, 18, 0.5);
  z-index: 40;
  padding: 24px;
}

.modal.hidden {
  display: none;
}

.modal-card {
  max-width: 460px;
  padding: 28px;
  border-radius: 28px;
  text-align: center;
}

.particle,
.balloon {
  position: absolute;
  border-radius: 50%;
}

.particle {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.75);
  animation: floatParticle linear infinite;
}

.balloon {
  bottom: -140px;
  width: 72px;
  height: 92px;
  opacity: 0.82;
  animation: rise linear infinite;
}

.balloon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 25%),
    var(--balloon-color, linear-gradient(180deg, #ff8ed7, #956dff));
  box-shadow: 0 0 26px rgba(255, 255, 255, 0.15);
}

.balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 88px;
  width: 2px;
  height: 80px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.45);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: translate3d(-12px, -12px, 0) scale(0.96);
  }
  to {
    transform: translate3d(18px, 8px, 0) scale(1.04);
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

@keyframes portraitFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes floatParticle {
  from {
    transform: translateY(110vh) scale(0.9);
    opacity: 0;
  }
  10%,
  90% {
    opacity: 1;
  }
  to {
    transform: translateY(-10vh) translateX(18px) scale(1.2);
    opacity: 0;
  }
}

@keyframes rise {
  from {
    transform: translateY(0) translateX(0) rotate(0deg);
  }
  to {
    transform: translateY(-135vh) translateX(32px) rotate(8deg);
  }
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

@media (max-width: 1080px) {
  .hero-panel,
  .message-layout,
  .music-layout,
  .wish-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 14px;
  }

  .tab-panel,
  .topbar {
    border-radius: 24px;
    padding: 20px;
  }

  .hero-panel,
  .message-layout,
  .music-layout,
  .gallery-grid,
  .wish-grid,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .tab-nav {
    width: 100%;
    justify-content: center;
    border-radius: 24px;
  }

  .tab-button {
    flex: 1 1 calc(50% - 10px);
  }

  .hero-copy h2 {
    font-size: clamp(2.2rem, 10vw, 3.4rem);
  }

  .character-glow {
    width: 280px;
    height: 280px;
  }
}
