/* ---------- FONT ----------------------------------------------- */
@font-face {
  font-family: "Minecraft";
  src: url("fonts/Minecraft.ttf") format("truetype");
}

/* =========================
   PINK PIXIE POP THEME 🌸✨
   ========================= */
:root {
  /* Core palette pulled from the cover: hot pinks + plum */
  --pixie-bg-1: #8a2a8b; /* plum */
  --pixie-bg-2: #c024b8; /* magenta */
  --pixie-hot: #ff3bd4; /* hot pink */
  --pixie-pop: #ff7af2; /* candy pink */
  --pixie-ice: #ffe3fb; /* soft pink */
  --pixie-ink: #1a0b1c; /* deep black-purple */
  --pixie-mute: #ffe9f9; /* near-white */

  /* Glow + borders */
  --pixie-glow: 0 0 24px rgba(255, 59, 212, 0.55),
    0 0 48px rgba(192, 36, 184, 0.35);
  --pixie-glow-strong: 0 0 32px rgba(255, 122, 242, 0.75),
    0 0 72px rgba(255, 59, 212, 0.55);

  /* Cover art (used as a soft blur overlay) */
  --cover-url: url("images/indi.jpeg"); /* <-- set to your image */
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Stack header on top, content below */
body {
  font-family: "Minecraft", monospace;
  background: radial-gradient(
    1200px 800px at 50% -10%,
    var(--pixie-pop) 0%,
    var(--pixie-bg-2) 35%,
    var(--pixie-bg-1) 80%
  );
  min-height: 100vh;
  /* key changes ↓ */
  display: flex;
  flex-direction: column; /* stack children vertically */
  align-items: center; /* center the phone frame */
  justify-content: flex-start; /* start at the top, not centered vertically */
  padding: 20px;
}

/* Sticky, centered header bar */
.top-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%; /* make it span the viewport width */
  display: flex;
  justify-content: center; /* center the logo inside */
  align-items: center;
  padding: 12px 0;
  backdrop-filter: blur(8px);
  background: linear-gradient(
    145deg,
    rgba(255, 122, 242, 0.16),
    rgba(192, 36, 184, 0.14)
  );
  border-bottom: 1px solid rgba(255, 122, 242, 0.25);
}

/* The logo itself — keep it simple */
.top-logo {
  display: block;
  margin: 0 auto;
  width: clamp(88px, 40vw, 140px);
  height: auto;
  filter: drop-shadow(0 0 16px rgba(255, 59, 212, 0.45));
}

.tagline {
  margin-top: -24px; /* pulls it a bit closer to the title */
  margin-bottom: 28px; /* space above the button */
  font-size: 12.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 234, 251, 0.95);
  text-align: center;
  opacity: 0;
  animation: taglineIn 0.8s ease 0.15s forwards;
  text-shadow: 0 0 10px rgba(255, 59, 212, 0.45);
}

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

.phone-frame {
  width: 100%;
  max-width: 400px;
  background: var(--pixie-ink);
  border-radius: 30px;
  padding: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 122, 242, 0.12);
  position: relative;
}
.phone-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 30px;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(255, 59, 212, 0.25),
    inset 0 0 40px rgba(255, 59, 212, 0.15);
}

.screen {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 22px;
  min-height: 600px;
  background: linear-gradient(
    145deg,
    rgba(255, 122, 242, 0.18),
    rgba(192, 36, 184, 0.16)
  );
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 122, 242, 0.25);
  box-shadow: var(--pixie-glow);
}
/* Blurred cover art behind content for vibe */
.screen::before {
  content: "";
  position: absolute;
  inset: -10%;
  z-index: 0;
  border-radius: 28px;
  background: var(--cover-url) center/cover no-repeat;
  filter: blur(26px) saturate(1.2) brightness(1.15);
  opacity: 0.45;
}
.screen::after {
  /* subtle vignette */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  z-index: 0;
  background: radial-gradient(
    120% 120% at 50% 0%,
    transparent 0 60%,
    rgba(26, 11, 28, 0.55) 100%
  );
}

/* Particles */
.floating-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.particle {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0 35%, transparent 36%),
    radial-gradient(circle at 50% 50%, var(--pixie-hot) 0 99%, transparent 100%);
  box-shadow: var(--pixie-glow);
  animation: float 6s infinite ease-in-out;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(100vh) scale(0.8) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.9;
  }
  60% {
    transform: translateY(10vh) scale(1.05) rotate(8deg);
  }
  90% {
    opacity: 0.85;
  }
}

/* Main screen */
.main-screen {
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: all 0.5s ease;
}
.main-title {
  font-size: 32px;
  color: var(--pixie-ice);
  letter-spacing: 0.5px;
  margin-bottom: 40px;
  text-shadow: 0 2px 12px rgba(255, 122, 242, 0.55);
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Start button */
.letter-icon-btn {
  background: radial-gradient(
    120px 120px at 30% 30%,
    var(--pixie-hot),
    var(--pixie-bg-2)
  );
  margin-top: 20px;
  border: none;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--pixie-glow);
}
.letter-icon-btn:hover {
  transform: scale(1.08) rotate(3deg);
  box-shadow: var(--pixie-glow-strong);
}
.letter-icon {
  width: 60px;
  height: 60px;
  color: #fff;
}

/* Builder */
.letter-builder {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}
.letter-builder.show {
  opacity: 1;
  transform: translateY(0);
}
.hidden {
  display: none;
}

.step-container {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 122, 242, 0.35);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.25),
    inset 0 0 24px rgba(255, 59, 212, 0.08);
  color: var(--pixie-ice);
}
.step-container.completed {
  background: rgba(255, 122, 242, 0.12);
  border-color: rgba(255, 122, 242, 0.6);
}
.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.step-number {
  background: linear-gradient(145deg, var(--pixie-hot), var(--pixie-bg-2));
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  box-shadow: var(--pixie-glow);
}
.step-number.completed {
  background: linear-gradient(145deg, #46d27e, #14b87e);
}
.step-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--pixie-mute);
}

/* Options */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.option-btn {
  background: linear-gradient(
    145deg,
    rgba(255, 122, 242, 0.22),
    rgba(192, 36, 184, 0.28)
  );
  border: 1px solid rgba(255, 122, 242, 0.45);
  border-radius: 12px;
  padding: 14px 10px;
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  text-align: center;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--pixie-glow);
}
.option-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--pixie-glow-strong);
}
.option-btn.selected {
  background: linear-gradient(145deg, #ff49d9, #f784ff);
  border-color: transparent;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 10px 30px rgba(255, 73, 217, 0.5),
    0 0 36px rgba(247, 132, 255, 0.6);
}

/* Preview */
.preview-container {
  background: rgba(26, 11, 28, 0.6);
  border-radius: 15px;
  padding: 22px;
  margin: 18px 0;
  border: 1px dashed rgba(255, 122, 242, 0.55);
  box-shadow: var(--pixie-glow);
}
.preview-title {
  font-size: 18px;
  color: var(--pixie-mute);
  margin-bottom: 12px;
  text-align: center;
}
.message-preview {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 18px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--pixie-ice);
  min-height: 80px;
  border-left: 4px solid var(--pixie-hot);
}

/* Send section */
.send-section {
  background: rgba(26, 11, 28, 0.6);
  border-radius: 15px;
  padding: 22px;
  text-align: center;
  border: 1px solid rgba(255, 122, 242, 0.35);
  box-shadow: var(--pixie-glow);
}
.email-input {
  width: 100%;
  padding: 14px;
  border: 2px solid rgba(255, 122, 242, 0.35);
  border-radius: 12px;
  font-size: 16px;
  font: inherit;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--pixie-ice);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.email-input:focus {
  outline: none;
  border-color: var(--pixie-hot);
  box-shadow: 0 0 0 4px rgba(255, 59, 212, 0.18);
}
.ig-instruction {
  margin-bottom: 15px;
  color: var(--pixie-ice);
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: none;
  text-shadow: 0 0 12px rgba(255, 59, 212, 0.45),
    0 0 28px rgba(192, 36, 184, 0.35);
}

.action-btn {
  background: linear-gradient(145deg, var(--pixie-hot), var(--pixie-pop));
  border: none;
  border-radius: 12px;
  padding: 14px 22px;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin: 6px;
  min-width: 140px;
  box-shadow: var(--pixie-glow);
}
.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--pixie-glow-strong);
}
.action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Back button (now styled to match) */
.back-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 122, 242, 0.55);
  color: var(--pixie-mute);
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 18px;
  transition: all 0.2s ease;
  box-shadow: var(--pixie-glow);
}
.back-btn:hover {
  background: rgba(255, 122, 242, 0.2);
  color: #fff;
}

/* Progress */
.progress-bar {
  background: rgba(255, 255, 255, 0.18);
  height: 8px;
  border-radius: 4px;
  margin-bottom: 18px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pixie-pop), var(--pixie-hot));
  width: 0%;
  transition: width 0.5s ease;
  border-radius: 4px;
  box-shadow: var(--pixie-glow);
}

/* Responsive */
@media (max-width: 480px) {
  .phone-frame {
    max-width: 100%;
  }
  .options-grid {
    grid-template-columns: 1fr;
  }
  .step-container {
    padding: 20px;
  }
}

/* === Create / Custom Builder — Pixie Pop === */
.create-option {
  margin-top: 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.or-text {
  color: rgba(255, 233, 249, 0.85); /* var(--pixie-mute) w/ opacity */
  font-size: 14px;
  font-weight: 400;
  text-shadow: 0 0 10px rgba(255, 59, 212, 0.25);
}
/* --- Fixed top logo --- */
/* --- Logo particles (drop, not float) --- */
.particle-logo {
  position: absolute;
  width: var(--size, 28px);
  height: var(--size, 28px);
  left: 0; /* will be randomized in JS */
  top: -120px;
  background-image: url("kandles/images/JN-logo-pixie-neon.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: auto; /* keep logo clean */
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35))
    drop-shadow(0 0 10px rgba(255, 59, 212, 0.35));
  animation: drop linear infinite;
  opacity: 0;
  will-change: transform;
}

/* drop from above viewport to below; slight rotation */
@keyframes drop {
  0% {
    transform: translateY(-120px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.95;
  }
  100% {
    transform: translateY(110vh) rotate(18deg);
    opacity: 0.9;
  }
}

.create-btn {
  background: radial-gradient(
    120px 120px at 30% 30%,
    var(--pixie-hot),
    var(--pixie-bg-2)
  );
  border: 1.5px solid rgba(255, 122, 242, 0.45);
  border-radius: 25px;
  color: var(--pixie-ice);
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 700;
  font: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(10px);
  box-shadow: var(--pixie-glow);
}
.create-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--pixie-glow-strong);
  filter: saturate(1.05);
}

.create-icon {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 0 6px rgba(255, 59, 212, 0.45));
}

.custom-builder {
  padding: 25px;
  height: 100%;
  overflow-y: auto;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--pixie-ice);
}
.custom-builder.show {
  transform: translateY(0);
  opacity: 1;
}

.custom-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1.5px solid rgba(255, 122, 242, 0.35);
}

/* If you already have a global .back-btn from the theme,
     this scoping will match the look while keeping layout tweaks here */
.custom-header .back-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 122, 242, 0.55);
  color: var(--pixie-mute);
  padding: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: var(--pixie-glow);
}
.custom-header .back-btn:hover {
  background: rgba(255, 122, 242, 0.2);
  color: #fff;
  transform: translateX(-3px);
  box-shadow: var(--pixie-glow-strong);
}

.custom-header h2 {
  color: var(--pixie-mute);
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 0 12px rgba(255, 59, 212, 0.35);
}

.custom-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

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

.form-group label {
  color: rgba(255, 233, 249, 0.95); /* var(--pixie-mute) */
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
}

.custom-input,
.custom-textarea {
  padding: 12px 16px;
  border: 2px solid rgba(255, 122, 242, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--pixie-ice);
  font-family: "Minecraft", monospace;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  resize: none;
  box-shadow: inset 0 0 24px rgba(255, 59, 212, 0.08);
}

.custom-input::placeholder,
.custom-textarea::placeholder {
  color: rgba(255, 233, 249, 0.6);
}

.custom-input:focus,
.custom-textarea:focus {
  outline: none;
  border-color: var(--pixie-hot);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(255, 59, 212, 0.18), var(--pixie-glow);
}

.custom-textarea {
  min-height: 120px;
  line-height: 1.6;
}

@media (max-height: 700px) {
  .custom-builder {
    padding: 20px;
  }
  .custom-form {
    gap: 20px;
  }
  .custom-textarea {
    min-height: 100px;
  }
}

/* === Fix pack: focus + stacking + iOS typing === */

/* Keep builders above the particle layer and other chrome */
.letter-builder,
.custom-builder {
  position: relative;
  z-index: 3; /* sit above .floating-particles (z-index:1) */
}

/* Avoid transforms on containers that contain inputs (iOS keyboard bug) */
.letter-builder {
  opacity: 0; /* removed transform */
}
.letter-builder.show {
  opacity: 1; /* no transform translateY */
}

/* Do the same for the custom builder */
.custom-builder {
  /* no transform here */
}
.custom-builder.show {
  /* keep it simple: no transform */
}

/* Make sure inputs are actually interactable on touch devices */
input,
textarea,
button {
  touch-action: manipulation;
}
/* Hide the body section until we want to reveal it */
.cyk-bubble-body.hidden {
  display: none;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-overflow-scrolling: touch; /* smoother scrolling inside textareas */
}

/* Extra safety: nothing should sit on top and steal taps */
.floating-particles {
  pointer-events: none;
  z-index: 1;
} /* already in theme, reaffirm */
/* ===== CYK-CLIPPY (assistant) ===== */
.cyk-clippy {
  position: fixed;
  bottom: 22px;
  right: 24px;
  z-index: 9999;
  display: grid;
  place-items: end;
  gap: 10px;
  user-select: none;
}

.cyk-clippy.hidden {
  display: none;
}

#cykClippyImg {
  width: 88px;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
  cursor: grab;
  transition: transform 160ms ease;
}
#cykClippyImg:active {
  cursor: grabbing;
  transform: scale(0.98);
}

.cyk-pulse {
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  background: var(--pixie-hot, #ff3bd4);
  color: #0a0a0a;
  box-shadow: 0 0 14px rgba(255, 59, 212, 0.55),
    0 0 28px rgba(192, 36, 184, 0.35);
  cursor: pointer;
}
.cyk-pulse:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cyk-bubble {
  min-width: 240px;
  max-width: 300px;
  background: var(--pixie-ink, #1a0b1c);
  color: var(--pixie-ice, #ffe3fb);
  border: 2px solid var(--pixie-hot, #ff3bd4);
  border-radius: 16px;
  box-shadow: 0 0 24px rgba(255, 59, 212, 0.3),
    0 0 48px rgba(192, 36, 184, 0.25);
  overflow: hidden;
  transform-origin: bottom right;
  animation: cyk-pop 160ms ease-out;
}
.cyk-bubble.hidden {
  display: none;
}

@keyframes cyk-pop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.cyk-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(
    135deg,
    rgba(255, 59, 212, 0.08),
    rgba(192, 36, 184, 0.08)
  );
  font-weight: 800;
  letter-spacing: 0.3px;
}

.cyk-close {
  border: none;
  background: transparent;
  color: var(--pixie-pop, #ff7af2);
  font-size: 18px;
  cursor: pointer;
}

.cyk-bubble-body {
  padding: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.cyk-bubble-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
}

/* small screens: nudge inward */
@media (max-width: 420px) {
  .cyk-clippy {
    right: 12px;
    bottom: 12px;
  }
  #cykClippyImg {
    width: 76px;
  }
}
