/* ============================================================================
   PINK COIN — PFP generator (the pinkifier)
   Sits on a pink band; every panel is frosted white so it stays readable.
   ========================================================================== */

.gen { overflow: hidden; }

.gen__halo {
  position: absolute;
  width: 760px;
  height: 760px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent 62%);
  filter: blur(60px);
  top: -240px;
  right: -200px;
  pointer-events: none;
  animation: haloDrift 16s ease-in-out infinite alternate;
}

.gen__halo--2 {
  top: auto;
  bottom: -280px;
  right: auto;
  left: -220px;
  width: 620px;
  height: 620px;
  animation-duration: 21s;
}

@keyframes haloDrift {
  to { transform: translate(-70px, 90px) scale(1.15); }
}

.gen__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.gen__badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 17px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gen__badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 12px currentColor;
}

.gen__badge.is-live .dot { background: #7bf1a8; }
.gen__badge.is-local .dot { background: #ffd166; }

/* layout ---------------------------------------------------------------- */

.gen__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(18px, 3vw, 30px);
  margin-top: 42px;
  align-items: start;
}

@media (max-width: 960px) { .gen__grid { grid-template-columns: 1fr; } }

.panel {
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.93);
  color: var(--plum);
  box-shadow: 0 30px 70px rgba(122, 0, 74, 0.28);
  padding: clamp(20px, 3vw, 30px);
  position: relative;
}

.panel__title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel__title span {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--pink);
  color: #fff;
  font-size: 12px;
  font-family: var(--display);
  font-weight: 900;
  flex: none;
}

/* dropzone -------------------------------------------------------------- */

.drop {
  position: relative;
  border: 3px dashed rgba(254, 1, 154, 0.35);
  border-radius: 20px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  background: var(--petal);
  transition: border-color 0.3s, background-color 0.3s, transform 0.3s var(--ease-out);
}

.drop:hover { border-color: var(--pink); background: #ffdff2; }

.drop.is-drag {
  border-color: var(--pink);
  border-style: solid;
  background: var(--blush);
  transform: scale(1.015);
}

.drop.has-image { border-style: solid; border-color: var(--pink); }

/* above the preview, so a second picture can be dropped straight onto the
   first one instead of having to clear it first */
.drop input[type='file'] {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  cursor: pointer;
}

.drop__inner {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  padding: 26px;
  pointer-events: none;
}

.drop__icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--pink);
  box-shadow: 0 10px 26px rgba(254, 1, 154, 0.24);
  animation: dropBob 3s ease-in-out infinite;
}

.drop__icon .ico { width: 30px; height: 30px; }

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

.drop__title { font-weight: 800; font-size: 17px; }

.drop__sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  opacity: 0.6;
  line-height: 1.75;
}

.drop img.preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drop.has-image .drop__inner { display: none; }

.drop__clear {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(74, 0, 48, 0.72);
  color: #fff;
  cursor: pointer;
  display: none;
  place-items: center;
  backdrop-filter: blur(6px);
}

.drop__clear .ico { width: 16px; height: 16px; }
.drop.has-image .drop__clear { display: grid; }

/* style picker ---------------------------------------------------------- */

.styles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
}

.style {
  position: relative;
  border: 2px solid rgba(254, 1, 154, 0.18);
  background: #fff;
  border-radius: 16px;
  padding: 11px 11px 13px;
  cursor: pointer;
  text-align: left;
  transition: all 0.28s var(--ease-out);
  overflow: hidden;
  color: var(--plum);
}

.style:hover { border-color: var(--pink); transform: translateY(-4px); }

.style.is-on {
  border-color: var(--pink);
  background: var(--petal);
  box-shadow: 0 12px 30px rgba(254, 1, 154, 0.26);
}

.style.is-on::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 3px rgba(254, 1, 154, 0.22);
}

.style__swatch {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  margin-bottom: 9px;
}

.style--classic .style__swatch { background: linear-gradient(120deg, #ffd1ef, #fe019a 55%, #a1006a); }
.style--blush   .style__swatch { background: linear-gradient(120deg, #fff5fb, #ffd1ef 50%, #ff9bd6); }
.style--neon    .style__swatch { background: linear-gradient(120deg, #3d0026, #ff4fb2 55%, #ffa8dd); }
.style--sticker .style__swatch { background: linear-gradient(120deg, #ffffff 0 35%, #fe019a 35% 72%, #4a0030 72%); }
.style--ribbon  .style__swatch { background: linear-gradient(120deg, #ff9bd6, #fe019a 55%, #ffd1ef); }
.style--chrome  .style__swatch { background: linear-gradient(120deg, #ffe9f7, #ff4fb2 28%, #7a004a 58%, #ffd1ef); }
.style--trench  .style__swatch { background: linear-gradient(120deg, #d6008a, #fe019a 48%, #4a0030); }

.style b { display: block; font-size: 13.5px; }
.style small { display: block; font-size: 10.5px; line-height: 1.4; opacity: 0.6; margin-top: 3px; }

/* controls -------------------------------------------------------------- */

.field { margin-top: 22px; }

.field__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 10px;
}

.field__label b { color: var(--pink); font-size: 12px; opacity: 1; }

.gen input[type='range'] {
  width: 100%;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blush), var(--pink-soft) 40%, var(--pink));
  outline: none;
  cursor: pointer;
}

.gen input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--pink);
  cursor: grab;
  box-shadow: 0 5px 16px rgba(254, 1, 154, 0.5);
}

.gen input[type='range']::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--pink);
  cursor: grab;
}

.gen textarea,
.gen select {
  width: 100%;
  border-radius: 14px;
  border: 2px solid rgba(254, 1, 154, 0.2);
  background: var(--cream);
  color: var(--plum);
  padding: 12px 14px;
  font-size: 14.5px;
  transition: border-color 0.25s, background-color 0.25s;
}

.gen textarea:focus,
.gen select:focus { border-color: var(--pink); background: #fff; }

.gen textarea { resize: vertical; min-height: 74px; }

.gen__actions { display: grid; gap: 10px; margin-top: 20px; }
.gen__actions .btn { justify-content: center; }

.mode-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--petal);
  border: 2px solid rgba(254, 1, 154, 0.16);
}

.mode-switch button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--plum);
  opacity: 0.62;
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.28s var(--ease-out);
}

.mode-switch button.is-on {
  background: var(--pink);
  color: #fff;
  opacity: 1;
  box-shadow: 0 8px 22px rgba(254, 1, 154, 0.4);
}

/* result stage ---------------------------------------------------------- */

.stage {
  position: relative;
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  background:
    conic-gradient(from 0deg, #ffe8f6 0 25%, #ffd8ef 0 50%, #ffe8f6 0 75%, #ffd8ef 0) 0 0 / 44px 44px;
  border: 2px solid rgba(254, 1, 154, 0.18);
  display: grid;
  place-items: center;
}

.stage__empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  padding: 30px;
  opacity: 0.55;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  line-height: 1.9;
}

.stage__empty .ico { width: 52px; height: 52px; opacity: 0.8; }

/* before / after slider */
.compare {
  position: absolute;
  inset: 0;
  display: none;
  user-select: none;
  touch-action: none;
}

.compare.is-on { display: block; }

.compare img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* the left half is drained to black and white, so the pink lands harder when
   the handle sweeps across; the right half stays exactly as it was rendered */
.compare__before { filter: grayscale(1) contrast(1.06); }

.compare__after { clip-path: inset(0 0 0 var(--split, 50%)); }

.compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split, 50%);
  width: 3px;
  background: #fff;
  box-shadow: 0 0 18px rgba(74, 0, 48, 0.4);
  cursor: ew-resize;
  z-index: 3;
}

.compare__handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--pink);
  border: 3px solid #fff;
  box-shadow: 0 8px 24px rgba(74, 0, 48, 0.35);
}

.compare__handle i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  display: grid;
  place-items: center;
  color: #fff;
  pointer-events: none;
}

.compare__handle i .ico { width: 22px; height: 22px; }

.compare__tag {
  position: absolute;
  bottom: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--plum);
  z-index: 2;
}

.compare__tag--a { left: 12px; }
.compare__tag--b { right: 12px; }

/* working overlay */
.working {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  text-align: center;
  padding: 26px;
  background: rgba(255, 245, 251, 0.9);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}

.working.is-on { opacity: 1; visibility: visible; }

.spinner {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 4px solid var(--blush);
  border-top-color: var(--pink);
  border-right-color: var(--pink-soft);
  animation: spin 0.9s linear infinite;
}

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

.working__msg {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose);
  min-height: 1.4em;
}

.working__bar {
  width: min(250px, 70%);
  height: 6px;
  border-radius: 999px;
  background: var(--blush);
  overflow: hidden;
}

.working__bar i {
  display: block;
  height: 100%;
  width: 25%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--pink-soft));
  animation: barSlide 1.5s var(--ease-io) infinite;
}

@keyframes barSlide {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(420%); }
}

/* result actions */
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.result-actions .btn { flex: 1; min-width: 140px; justify-content: center; }

.gen__note { margin-top: 16px; margin-bottom: 0; font-size: 12.5px; line-height: 1.6; opacity: 0.55; }

.gen__error {
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 2px solid rgba(200, 30, 60, 0.35);
  background: rgba(255, 220, 228, 0.9);
  color: #8c0025;
  font-size: 13.5px;
  line-height: 1.55;
  display: none;
}

.gen__error.is-on { display: block; }

/* gallery of past results ---------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.gallery:empty { display: none; }

.gallery button {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(254, 1, 154, 0.2);
  background: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), border-color 0.3s;
}

.gallery button:hover { transform: translateY(-4px) scale(1.03); border-color: var(--pink); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
