/* ============================================================
   BRAND PALETTE & CUSTOM PROPERTIES
   ============================================================ */
:root {
  --brand-red: #ff1502;
  --brand-orange: #ff6d02;
  --brand-coral: #ff4002;
  --brand-pink: #ff0259;
  --brand-darkred: #d00416;
  --brand-gold: #dfb400;
  --brand-gold-dark: #d37d00;
  --brand-teal: #00aeba;
  --brand-green: #0c8745;

  /* Default theme vars — overridden per theme body class */
  --page-bg: #f3f3f3;
  --card-bg: #ffffff;
  --card-border: #e9e9e9;
  --primary: #ff1502;
  --primary-hover: #d00416;
  --secondary: #ff6d02;
  --accent: #00aeba;

  /* Button theming — overridden by JS via applyTheme() */
  --btn-gradient: linear-gradient(135deg, #ff1502 0%, #d00416 100%);
  --btn-shadow: 0 8px 28px rgba(255, 21, 2, 0.35);

  /* Animation timing */
  --dur-fast: 0.18s;
  --dur-base: 0.35s;
  --dur-slow: 0.55s;

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   THEME BODY CLASSES — set by JS on <body>
   ============================================================ */
.theme-birthday {
  --page-bg: #fdf5ff;
  --card-bg: #ffffff;
  --card-border: #e4c4f0;
  --primary: #7b1fa2;
  --primary-hover: #6a1b9a;
  --secondary: #ff8c00;
  --accent: #ff8c00;
}
.theme-christmas {
  --page-bg: #fff5f5;
  --card-bg: #ffffff;
  --card-border: #fecdd3;
  --primary: #c8102e;
  --primary-hover: #a00d25;
  --secondary: #16a34a;
  --accent: #fbbf24;
}
.theme-easter {
  --page-bg: #f3fbfa;
  --card-bg: #ffffff;
  --card-border: #b2dfdb;
  --primary: #00897b;
  --primary-hover: #00695c;
  --secondary: #dfb400;
  --accent: #dfb400;
}
.theme-mothers {
  --page-bg: #fff5f8;
  --card-bg: #ffffff;
  --card-border: #f8c8d8;
  --primary: #e91e63;
  --primary-hover: #c2185b;
  --secondary: #ff6d02;
  --accent: #dfb400;
}
.theme-fathers {
  --page-bg: #f5f7fc;
  --card-bg: #ffffff;
  --card-border: #c8d8f0;
  --primary: #003da5;
  --primary-hover: #002d7a;
  --secondary: #f97316;
  --accent: #f97316;
}
.theme-eid {
  --page-bg: #f5fbf7;
  --card-bg: #ffffff;
  --card-border: #b8e0ca;
  --primary: #00843d;
  --primary-hover: #006630;
  --secondary: #dfb400;
  --accent: #dfb400;
}
.theme-newyear {
  --page-bg: #fff8f0;
  --card-bg: #ffffff;
  --card-border: #ffe0b2;
  --primary: #ff8f00;
  --primary-hover: #e65100;
  --secondary: #ff4500;
  --accent: #ff4500;
}
.theme-holidays {
  --page-bg: #fdf5f8;
  --card-bg: #ffffff;
  --card-border: #f0c0d0;
  --primary: #ad1457;
  --primary-hover: #880e4f;
  --secondary: #dfb400;
  --accent: #dfb400;
}
.theme-vday {
  --page-bg: #fff5f8;
  --card-bg: #ffffff;
  --card-border: #f8c8d8;
  --primary: #c2185b;
  --primary-hover: #880e4f;
  --secondary: #ff8f00;
  --accent: #ff8f00;
}

/* ============================================================
   RESET
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--page-bg);
  color: #333333;
  overflow-x: hidden;
  transition: background var(--dur-base) var(--ease-in-out);
}

button {
  font-family: var(--font-body);
  cursor: pointer;
}
input {
  font-family: var(--font-body);
}

/* ============================================================
   ACCESSIBILITY — Skip link & screen-reader only
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 99999;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 0 0 12px 12px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   GLOBAL FOCUS STYLES
   ============================================================ */
:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================================================
   APP SHELL
   ============================================================ */
#app {
  position: relative;
  min-height: 100vh;
  width: 100%;
  opacity: 0;
}
#app.app-ready {
  opacity: 1;
  transition: opacity 0.3s var(--ease-out);
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  will-change: opacity, transform;
}

.screen-inner {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 368px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reveal-inner {
  align-items: center;
}

/* ============================================================
   FLOATING BACKGROUND ELEMENTS
   ============================================================ */
.floating-elements {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.float-blob {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  filter: blur(36px);
  animation: blobPulse ease-in-out infinite;
  will-change: transform, opacity;
}

.float-sparkle {
  position: absolute;
  line-height: 0;
  animation: sparkleTwinkle ease-in-out infinite;
  opacity: 0.5;
  will-change: transform, opacity;
}

.float-dot {
  position: absolute;
  border-radius: 50%;
  animation: dotFloat ease-in-out infinite;
  box-shadow: none !important;
  opacity: 0.4;
  will-change: transform;
}

.float-dot.intense {
  animation-name: dotFloatIntense;
}

.float-ribbons {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.06;
}

@keyframes blobPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.55; }
  50% { transform: translate(-50%, -50%) scale(1.18); opacity: 0.85; }
}

@keyframes sparkleTwinkle {
  0%, 100% { transform: scale(0.75) rotate(0deg); opacity: 0.3; }
  50% { transform: scale(1.25) rotate(18deg); opacity: 0.65; }
}

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

@keyframes dotFloatIntense {
  0%, 100% { transform: translate(0, 0); }
  40% { transform: translate(6px, -9px); }
  70% { transform: translate(-5px, -15px); }
}

/* ============================================================
   THEME CAROUSEL
   ============================================================ */
.carousel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 8px;
}

.carousel-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition:
    border-color var(--dur-base) var(--ease-in-out),
    color var(--dur-base) var(--ease-in-out),
    transform var(--dur-fast),
    box-shadow var(--dur-fast),
    background var(--dur-fast);
  backdrop-filter: blur(8px);
}

.carousel-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  background: #ffffff;
}
.carousel-btn:active {
  transform: scale(0.9);
}

.carousel-label-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  min-width: 0;
  position: relative;
}

.by-cheers {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  text-align: center;
  transition: color var(--dur-base) var(--ease-in-out);
}

.by-word {
  font-size: 0.58rem;
  font-weight: 300;
  font-style: italic;
  opacity: 0.7;
}
.cheers-word {
  font-size: 0.72rem;
  font-weight: 400;
  font-style: italic;
}

.carousel-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid;
  background: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition:
    opacity var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    background var(--dur-base) var(--ease-in-out),
    border-color var(--dur-base) var(--ease-in-out);
}

.carousel-label.fade-out {
  opacity: 0;
  transform: translateY(-5px) scale(0.97);
}
.carousel-label.fade-in {
  opacity: 0;
  transform: translateY(5px) scale(0.97);
}

.carousel-emoji {
  font-size: 0.9rem;
}

.carousel-text {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: color var(--dur-base) var(--ease-in-out);
}

/* ============================================================
   HEADING
   ============================================================ */
.heading-wrap {
  text-align: center;
  margin-bottom: 24px;
  width: 100%;
}

.main-heading {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  transition:
    opacity var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.heading-line1 {
  display: block;
  color: #1a1a1a;
}

.heading-line2 {
  display: block;
  color: var(--primary);
  transition: color var(--dur-base) var(--ease-in-out);
}

.heading-sub {
  color: #777777;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.6;
}

/* ============================================================
   GLASS CARD — elevated white card
   ============================================================ */
.glass-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid var(--card-border);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 4px 12px rgba(0, 0, 0, 0.05),
    0 16px 40px rgba(0, 0, 0, 0.06);
  transition:
    background var(--dur-base) var(--ease-in-out),
    border-color var(--dur-base) var(--ease-in-out);
}

/* ============================================================
   CREATE FORM
   ============================================================ */
.create-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  color: #555555;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.optional-tag {
  color: #aaaaaa;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.75rem;
}

.name-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  background: #f7f7f8;
  border: 1.5px solid #e0e0e0;
  color: #1a1a1a;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-body);
  outline: none;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
  -webkit-appearance: none;
}

.name-input::placeholder {
  color: #b0b0b0;
  font-weight: 400;
}

.name-input:focus {
  background: #ffffff;
}

/* ============================================================
   PHOTO DROP ZONE
   ============================================================ */
.drop-zone {
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  border: 2px dashed #d8d8d8;
  background: #f9f9f9;
  min-height: 106px;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
  position: relative;
}

.drop-zone:hover {
  background: #f4f4f4;
  border-color: #bbbbbb;
}
.drop-zone.dragging {
  background: #f0f0f0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}
.drop-zone:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
}

.dz-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 26px 20px;
}

.dz-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: var(--primary);
  transition: background var(--dur-base) var(--ease-in-out), transform var(--dur-fast);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent);
}

.drop-zone:hover .dz-icon-wrap {
  transform: scale(1.08);
}

.dz-camera-icon {
  color: #ffffff;
}

.dz-text {
  text-align: center;
}

.dz-primary {
  color: #444444;
  font-size: 0.875rem;
  font-weight: 600;
}

.dz-secondary {
  color: #999999;
  font-size: 0.78rem;
  margin-top: 3px;
}

.dz-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #bbbbbb;
  font-size: 0.7rem;
}

.dz-preview {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.dz-preview.visible {
  display: flex;
}

.preview-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2.5px solid;
  transition: border-color var(--dur-base) var(--ease-in-out);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-info {
  flex: 1;
  min-width: 0;
}

.preview-uploaded {
  font-size: 0.875rem;
  font-weight: 700;
  transition: color var(--dur-base) var(--ease-in-out);
}

.preview-change {
  color: #aaaaaa;
  font-size: 0.78rem;
  margin-top: 2px;
}

.preview-remove {
  background: none;
  border: none;
  color: #bbbbbb;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 5px 9px;
  border-radius: 7px;
  transition:
    color var(--dur-fast),
    background var(--dur-fast);
  flex-shrink: 0;
}

.preview-remove:hover {
  color: #e53e3e;
  background: rgba(229, 62, 62, 0.08);
}

#file-input {
  display: none;
}

/* ============================================================
   SPOTIFY INPUT
   ============================================================ */
.spotify-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.spotify-input-icon {
  position: absolute;
  left: 13px;
  color: #1db954;
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}

.spotify-input {
  width: 100%;
  padding: 12px 14px 12px 36px;
  border-radius: 12px;
  border: 1.5px solid #e0e0e0;
  background: #f7f7f8;
  color: #1a1a1a;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-body);
  transition:
    border var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
  outline: none;
  -webkit-appearance: none;
}

.spotify-input:focus {
  border-color: rgba(29, 185, 84, 0.65);
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.12);
  background: #ffffff;
}

.spotify-input::placeholder {
  color: #b0b0b0;
  font-weight: 400;
}

.spotify-hint {
  font-size: 0.72rem;
  font-weight: 500;
  margin-top: 2px;
  padding-left: 2px;
  min-height: 1.2em;
  transition: opacity var(--dur-fast);
}
.spotify-hint.error { color: #dc2626; }
.spotify-hint.success { color: #16a34a; }

/* ============================================================
   TERMS CHECKBOX
   ============================================================ */
.terms-checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.terms-checkbox-wrap input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--primary);
  cursor: pointer;
}

.terms-checkbox-text {
  color: #888888;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.5;
  user-select: none;
}

.terms-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: opacity var(--dur-fast);
}

.terms-link:hover {
  opacity: 0.72;
}

/* ============================================================
   GENERATE BUTTON — premium gradient with shimmer
   ============================================================ */
.generate-btn {
  width: 100%;
  padding: 17px 24px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.015em;
  border: none;
  color: #c0c0c0;
  background: #eeeeee;
  box-shadow: none;
  transition:
    background var(--dur-base) var(--ease-in-out),
    color var(--dur-base) var(--ease-in-out),
    box-shadow var(--dur-base) var(--ease-in-out),
    transform var(--dur-fast) var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.generate-btn:not(:disabled) {
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--btn-shadow, 0 8px 24px rgba(0, 0, 0, 0.2));
  cursor: pointer;
}

/* Shimmer sweep on enabled state */
.generate-btn:not(:disabled)::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 100%
  );
  animation: btnShimmer 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes btnShimmer {
  0% { left: -80%; }
  60%, 100% { left: 140%; }
}

.generate-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-shadow, 0 10px 30px rgba(0, 0, 0, 0.25));
  filter: brightness(1.06);
}
.generate-btn:not(:disabled):active {
  transform: translateY(0) scale(0.98);
  filter: brightness(0.96);
}
.generate-btn:disabled {
  cursor: not-allowed;
}

/* New Year theme has a light primary so button text must be dark */
.theme-newyear .generate-btn:not(:disabled) {
  color: #1a1a1a;
}
.theme-newyear .generate-btn:not(:disabled)::before {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.07) 50%,
    transparent 100%
  );
}

/* ============================================================
   GENERATE BUTTON HINT
   ============================================================ */
.generate-hint {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #aaaaaa;
  min-height: 1.2em;
  transition: opacity var(--dur-fast) var(--ease-out);
  padding: 0 4px;
}

/* ============================================================
   SPOTIFY REVEAL PLAYER
   ============================================================ */
.spotify-player-wrap {
  width: 100%;
  margin-top: 14px;
}

.spotify-player-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #1db954;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   REVEAL — AVATAR GLOW
   ============================================================ */
.avatar-glow {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 240px;
  filter: blur(55px);
  pointer-events: none;
  z-index: 2;
  opacity: 0.4;
  transition: background var(--dur-base) var(--ease-in-out);
}

/* ============================================================
   AVATAR
   ============================================================ */
.avatar-wrap {
  position: relative;
  margin-bottom: 18px;
  animation: avatarEntry 0.55s var(--ease-spring) 0.1s both;
}

@keyframes avatarEntry {
  from { transform: scale(0.1) rotate(-18deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

.avatar-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(var(--primary), var(--secondary), var(--accent, var(--primary)), var(--primary));
  animation: ringRotate 7s linear infinite;
  transition: background var(--dur-base) var(--ease-in-out);
}

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

.avatar-circle {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  z-index: 1;
  transition: background var(--dur-base) var(--ease-in-out);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-heart {
  color: #ffffff;
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.emoji-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  font-size: 0.95rem;
  z-index: 2;
  animation: badgePulse 2.2s ease-in-out infinite;
  transition: background var(--dur-base) var(--ease-in-out);
  user-select: none;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.14); }
}

/* ============================================================
   REVEAL — GREETING SECTION
   ============================================================ */
.greeting-section {
  text-align: center;
  margin-bottom: 2px;
  animation: fadeSlideUp 0.6s var(--ease-spring) 0.3s both;
}

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

.greeting-heading {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.03em;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  word-break: break-word;
}

/* ============================================================
   REVEAL — GREETING CARD (premium)
   ============================================================ */
.greeting-card {
  width: 100%;
  margin-top: 14px;
  position: relative;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.07),
    0 24px 48px rgba(0, 0, 0, 0.05);
  animation: greetingCardEntry 0.65s var(--ease-spring) 0.45s both;
}

@keyframes greetingCardEntry {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Solid primary accent line at top of card */
.card-accent-line {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--primary);
  transition: background var(--dur-base) var(--ease-in-out);
}

.card-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

/* Pill badge: emoji + label side by side in one chip */
.card-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  transition:
    background var(--dur-base) var(--ease-in-out),
    border-color var(--dur-base) var(--ease-in-out);
}

.card-emoji-box {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  user-select: none;
}

.card-badge-text {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  transition: color var(--dur-base) var(--ease-in-out);
}

.greeting-text {
  color: #3d3d3d;
  font-size: 0.96rem;
  line-height: 1.85;
  font-weight: 500;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.card-footer-row {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

/* ============================================================
   AD SPONSOR ZONE
   ============================================================ */
.sponsor-zone {
  width: 100%;
  min-height: 76px;
  border-radius: 14px;
  margin-top: 14px;
  margin-bottom: 2px;
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px dashed #d8d0d0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c8b8b8;
  position: relative;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.3s var(--ease-out),
    transform 0.3s var(--ease-spring);
}

.sponsor-zone.ad-visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.sponsor-label {
  pointer-events: none;
}

/* ============================================================
   REVEAL — ACTION BUTTONS (clear hierarchy)
   ============================================================ */
.reveal-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  animation: fadeSlideUp 0.45s var(--ease-spring) 0.7s both;
}

/* Primary — Share (most important, most beautiful) */
.btn-primary-action {
  width: 100%;
  padding: 16px 24px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: none;
  color: #ffffff;
  background: var(--primary);
  box-shadow: var(--btn-shadow, 0 6px 20px rgba(0, 0, 0, 0.18));
  position: relative;
  overflow: hidden;
  transition:
    transform var(--dur-fast) var(--ease-spring),
    filter var(--dur-fast),
    box-shadow var(--dur-fast);
}

.btn-primary-action i {
  color: #ffffff;
}

.btn-primary-action::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: btnShimmer 3s ease-in-out infinite 1s;
  pointer-events: none;
}

.btn-primary-action:hover {
  transform: translateY(-2px);
  filter: brightness(1.07);
  box-shadow: var(--btn-shadow, 0 10px 28px rgba(0, 0, 0, 0.22));
}
.btn-primary-action:active {
  transform: scale(0.98) translateY(0);
  filter: brightness(0.96);
}

.theme-newyear .btn-primary-action {
  color: #1a1a1a;
}
.theme-newyear .btn-primary-action::before {
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.06), transparent);
}

/* Secondary — Try a Different Message */
.btn-secondary-action {
  width: 100%;
  padding: 14px 24px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.93rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid;
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
  color: var(--primary);
  transition:
    transform var(--dur-fast) var(--ease-spring),
    background var(--dur-fast),
    border-color var(--dur-fast),
    box-shadow var(--dur-fast);
  backdrop-filter: blur(4px);
}

.btn-secondary-action:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--primary) 6%, white);
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 14%, transparent);
}
.btn-secondary-action:active {
  transform: scale(0.98);
}

/* Ghost — Start over (least prominent) */
.btn-ghost-action {
  background: none;
  border: none;
  color: var(--primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  width: 100%;
  opacity: 0.75;
  transition:
    opacity var(--dur-fast),
    transform var(--dur-fast);
}

.btn-ghost-action:hover {
  opacity: 1;
  transform: translateY(-1px);
}
.btn-ghost-action:active {
  transform: scale(0.97);
}

/* ============================================================
   RESPONSIVE — Tablet
   ============================================================ */
@media (min-width: 480px) {
  .screen-inner {
    max-width: 390px;
  }
  .main-heading {
    font-size: 2.2rem;
  }
  .greeting-heading {
    font-size: 2.55rem;
  }
}

/* ============================================================
   RESPONSIVE — Small desktop
   ============================================================ */
@media (min-width: 768px) {
  .screen-inner {
    max-width: 424px;
  }
  .main-heading {
    font-size: 2.4rem;
  }
  .greeting-heading {
    font-size: 2.75rem;
  }
  .greeting-text {
    font-size: 1rem;
    line-height: 1.9;
  }
}

/* ============================================================
   RESPONSIVE — Desktop
   ============================================================ */
@media (min-width: 1024px) {
  .screen-inner {
    max-width: 548px;
  }
  .main-heading {
    font-size: 2.55rem;
  }
  .glass-card {
    padding: 28px;
  }
}

/* ============================================================
   CAROUSEL DOTS
   ============================================================ */
.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 5px;
  margin-bottom: 16px;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.14);
  border: none;
  padding: 0;
  cursor: pointer;
  transition:
    background var(--dur-base) var(--ease-in-out),
    width 0.28s var(--ease-spring),
    border-radius 0.28s var(--ease-spring),
    transform var(--dur-fast);
  flex-shrink: 0;
}

.carousel-dot.active {
  width: 18px;
  border-radius: 3px;
}
.carousel-dot:hover:not(.active) {
  background: rgba(0, 0, 0, 0.3);
  transform: scale(1.15);
}

/* ============================================================
   CHARACTER COUNTER
   ============================================================ */
.char-counter {
  display: block;
  text-align: right;
  font-size: 0.7rem;
  font-weight: 600;
  color: #bbbbbb;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
  margin-top: 3px;
  min-height: 1em;
}

/* ============================================================
   DROP ZONE ERROR
   ============================================================ */
.dz-error {
  color: #dc2626;
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
  margin-top: 4px;
  animation: fadeSlideUp 0.2s var(--ease-out) both;
}

/* ============================================================
   TOAST NOTIFICATION (improved)
   ============================================================ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
  font-family: var(--font-body);
  font-size: 0.855rem;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.22s var(--ease-out),
    transform 0.28s var(--ease-spring);
  z-index: 1000;
  max-width: min(92vw, 360px);
  text-align: center;
  line-height: 1.4;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.18),
    0 1px 3px rgba(0, 0, 0, 0.12);
}

.toast.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   SHARED-LINK LOADER
   ============================================================ */
html.is-shared #create-screen {
  opacity: 0;
  pointer-events: none;
}

.shared-loader {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: linear-gradient(160deg, #fff8f6 0%, #fff0f8 55%, #f6f0ff 100%);
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s var(--ease-out);
}
html.is-shared .shared-loader {
  display: flex;
}
.shared-loader.loader-out {
  opacity: 0;
  pointer-events: none;
}

.loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  padding: 40px 32px;
  outline: none;
}

.loader-icon {
  font-size: 4rem;
  animation: loaderFloat 2s ease-in-out infinite;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(255, 21, 2, 0.18));
}
@keyframes loaderFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-12px) scale(1.06); }
}

.loader-heading {
  font-family: var(--font-display, "Playfair Display", serif);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
  background: linear-gradient(135deg, #ff1502 0%, #ff4002 50%, #ff6d02 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* iOS-style radiating bars spinner */
.l-spinner {
  position: relative;
  width: 48px;
  height: 48px;
}
.l-bar {
  position: absolute;
  width: 3.5px;
  height: 12px;
  background: linear-gradient(180deg, #ff1502, #ff6d02);
  border-radius: 3px;
  left: calc(50% - 1.75px);
  top: 3px;
  transform-origin: 1.75px 21px;
  animation: lBarFade 1.2s linear infinite;
}
.l-bar:nth-child(1)  { transform: rotate(0deg);   animation-delay: -1.1s; }
.l-bar:nth-child(2)  { transform: rotate(30deg);  animation-delay: -1.0s; }
.l-bar:nth-child(3)  { transform: rotate(60deg);  animation-delay: -0.9s; }
.l-bar:nth-child(4)  { transform: rotate(90deg);  animation-delay: -0.8s; }
.l-bar:nth-child(5)  { transform: rotate(120deg); animation-delay: -0.7s; }
.l-bar:nth-child(6)  { transform: rotate(150deg); animation-delay: -0.6s; }
.l-bar:nth-child(7)  { transform: rotate(180deg); animation-delay: -0.5s; }
.l-bar:nth-child(8)  { transform: rotate(210deg); animation-delay: -0.4s; }
.l-bar:nth-child(9)  { transform: rotate(240deg); animation-delay: -0.3s; }
.l-bar:nth-child(10) { transform: rotate(270deg); animation-delay: -0.2s; }
.l-bar:nth-child(11) { transform: rotate(300deg); animation-delay: -0.1s; }
.l-bar:nth-child(12) { transform: rotate(330deg); animation-delay:  0.0s; }

@keyframes lBarFade {
  0%   { opacity: 1; }
  100% { opacity: 0.08; }
}

.loader-sub {
  font-size: 0.875rem;
  font-weight: 600;
  color: #aaaaaa;
  margin: 0;
  transition: opacity 0.2s var(--ease-out);
  letter-spacing: 0.01em;
}

/* ============================================================
   SHARED TEASER SCREEN
   ============================================================ */
.shared-inner {
  gap: 0;
  text-align: center;
}

.teaser-envelope {
  font-size: 5rem;
  line-height: 1;
  margin-bottom: 28px;
  display: block;
  animation: teaserFloat 2.8s ease-in-out infinite;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.12));
  user-select: none;
}

@keyframes teaserFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg) scale(1); }
  50%       { transform: translateY(-14px) rotate(4deg) scale(1.06); }
}

.teaser-from {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
  opacity: 0;
  animation: fadeSlideUp 0.5s var(--ease-spring) 0.2s both;
  transition: color var(--dur-base) var(--ease-in-out);
}

.teaser-heading {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: #1a1a1a;
  margin-bottom: 12px;
  opacity: 0;
  animation: fadeSlideUp 0.55s var(--ease-spring) 0.35s both;
}

.teaser-sub {
  font-size: 0.875rem;
  font-weight: 500;
  color: #888888;
  margin-bottom: 32px;
  line-height: 1.55;
  opacity: 0;
  animation: fadeSlideUp 0.55s var(--ease-spring) 0.45s both;
}

.teaser-btn {
  opacity: 0;
  animation: fadeSlideUp 0.55s var(--ease-spring) 0.55s both;
}

/* ============================================================
   GREETING CARD BOUNCE (on regenerate)
   ============================================================ */
@keyframes cardBounce {
  0%   { transform: translateY(0) scale(1); }
  35%  { transform: translateY(-6px) scale(1.025); }
  70%  { transform: translateY(1px) scale(0.99); }
  100% { transform: translateY(0) scale(1); }
}

.greeting-card.bouncing {
  animation: cardBounce 0.44s var(--ease-spring);
}

/* ============================================================
   MOBILE — hide drag-and-drop copy on pure touch
   ============================================================ */
@media (hover: none) {
  .dz-secondary { display: none; }
}

/* ============================================================
   VERY SMALL SCREENS (≤ 360px)
   ============================================================ */
@media (max-width: 360px) {
  .screen { padding: 20px 14px; }
  .glass-card { padding: 18px 14px; }
  .screen-inner { width: 100%; }
  .main-heading { font-size: 1.65rem; line-height: 1.22; }
  .greeting-heading { font-size: 1.85rem; }
  .carousel-wrap { gap: 7px; }
  .carousel-label-wrap { min-width: 0; overflow: hidden; }
  .carousel-text { font-size: 0.76rem; }
  .name-input,
  .spotify-input { font-size: 0.875rem; padding: 11px 13px; }
  .generate-btn { padding: 15px 18px; font-size: 0.95rem; }
  .btn-primary-action,
  .btn-secondary-action { padding: 13px 14px; font-size: 0.875rem; }
  .drop-zone { padding: 14px 10px; }
  .toast { bottom: 18px; }
  .loader-box { padding: 30px 18px; gap: 14px; }
  .loader-heading { font-size: 1.3rem; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
