@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=Nunito:wght@600;700;800&family=Pixelify+Sans:wght@400;600;700&display=swap');

:root {
  --blush: #fff5f7;
  --cream: #fffdd0;
  --lavender-bg: #f3e5f5;
  --hotpink: #ff1493;
  --gummy-pink: #ff69b4;
  --soft-pink: #ffb6c1;
  --lavender: #b57edc;
  --deep-purple: #7b1fa2;
  --lime: #b8ff57;
  --cyan: #00ffcc;
  --magenta: #ff00ff;
  --baby-blue: #89cff0;
  --mint: #98ff98;
  --peach: #ffcba4;
  --yellow: #ffee58;
  --chrome: #c0c0c0;
  --slime: #79c314;
  --text: #5c4f6e;
  --text-soft: #a99bbe;
  --slickveil: #4fc3f7;
  --slipcore: #69f0ae;
  --fraymark: #ff5252;
  --voltage: #ffee58;
  --clearmark: #ce93d8;
  --lowline: #78909c;
}

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

body {
  font-family: 'Pixelify Sans', 'Nunito', sans-serif;
  background: var(--blush);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
}

/* rainbow gradient bg that breathes */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(
    135deg,
    #fff5f7 0%, #fce4ec 12%, #f3e5f5 24%,
    #e8eaf6 36%, #e0f7fa 48%, #f1f8e9 60%,
    #fff9c4 72%, #fce4ec 84%, #fff5f7 100%
  );
  background-size: 500% 500%;
  animation: rainbowBreath 25s ease infinite;
  z-index: -3;
}

@keyframes rainbowBreath {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 50% 100%; }
  75% { background-position: 0% 0%; }
}

/* dot grid — hobonichi energy */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(181,126,220,0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  z-index: -2;
}

/* scanlines — subtle UMF whisper */
#scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px, transparent 3px,
    rgba(0,0,0,0.012) 3px, rgba(0,0,0,0.012) 4px
  );
  pointer-events: none;
  z-index: 50;
  mix-blend-mode: multiply;
}

#sparkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.pulse-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  z-index: 1;
}

/* title — bouncy pixel rainbow */
.pulse-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  letter-spacing: 6px;
  text-transform: lowercase;
  background: linear-gradient(90deg, var(--hotpink), var(--lavender), var(--cyan), var(--lime), var(--yellow), var(--hotpink));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rainbowText 4s linear infinite;
}

@keyframes rainbowText {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* washi tape — full color */
.washi {
  width: 90%;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--hotpink) 0px, var(--hotpink) 8px,
    var(--cream) 8px, var(--cream) 10px,
    var(--lavender) 10px, var(--lavender) 18px,
    var(--cream) 18px, var(--cream) 20px,
    var(--cyan) 20px, var(--cyan) 28px,
    var(--cream) 28px, var(--cream) 30px,
    var(--lime) 30px, var(--lime) 38px,
    var(--cream) 38px, var(--cream) 40px,
    var(--yellow) 40px, var(--yellow) 48px,
    var(--cream) 48px, var(--cream) 50px
  );
  border-radius: 3px;
  opacity: 0.7;
}

/* state mirror pill */
.state-mirror {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 50px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  border: 2px dashed var(--lavender);
  font-size: 12px;
}

.state-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: dotBounce 1.5s ease infinite;
}

@keyframes dotBounce {
  0%, 100% { transform: scale(1); box-shadow: 0 0 6px currentColor; }
  50% { transform: scale(1.3); box-shadow: 0 0 14px currentColor; }
}

.state-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 2px;
}

.coined-color {
  font-family: 'VT323', monospace;
  font-size: 13px;
  color: var(--text-soft);
}

/* prompt — fun, warm */
.prompt {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.5;
}

.cards {
  display: flex;
  gap: 14px;
  width: 100%;
}

/* CARDS — candy sticker energy */
.card {
  flex: 1;
  aspect-ratio: 3/4;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 3px solid rgba(181,126,220,0.2);
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    0 6px 24px rgba(181,126,220,0.15),
    0 2px 0 rgba(255,255,255,0.8) inset;
  position: relative;
  overflow: hidden;
  animation: cardBounce 4s ease-in-out infinite;
}

.card:nth-child(2) { animation-delay: -2s; }

@keyframes cardBounce {
  0%, 100% { transform: translateY(0) rotate(-0.5deg); }
  50% { transform: translateY(-6px) rotate(0.5deg); }
}

/* glossy candy-shell overlay */
.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 100%);
  border-radius: 24px 24px 0 0;
  pointer-events: none;
  z-index: 3;
}

.card .card-texture {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  filter: saturate(1.4) brightness(1.1);
  transition: opacity 0.3s;
  z-index: 0;
  border-radius: 21px;
}

.card:hover .card-texture { opacity: 0.3; }

.card:active {
  transform: scale(0.93) rotate(0deg) !important;
  animation: none !important;
}

.card.chosen {
  border: 3px solid var(--hotpink);
  box-shadow:
    0 0 0 3px var(--hotpink),
    0 0 30px rgba(255,20,147,0.25),
    0 0 60px rgba(255,20,147,0.1),
    inset 0 2px 0 rgba(255,255,255,0.8);
  transform: scale(1.05) rotate(0deg) !important;
  animation: none !important;
}

.card.not-chosen {
  opacity: 0.12;
  transform: scale(0.85) rotate(-2deg) translateY(15px) !important;
  filter: grayscale(0.6) blur(1px);
  animation: none !important;
  transition: all 0.6s ease;
}

/* word */
.card .word {
  font-family: 'Nunito', sans-serif;
  font-size: 22px;
  font-weight: 800;
  text-transform: lowercase;
  text-align: center;
  line-height: 1.2;
  color: var(--text);
  position: relative;
  z-index: 2;
}

.card .meaning {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 8px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.card .phrase {
  font-family: 'VT323', monospace;
  font-size: 12px;
  color: var(--lavender);
  margin-top: 10px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s;
  line-height: 1.5;
  position: relative;
  z-index: 2;
}

.card:hover .phrase { opacity: 0.8; }

/* heat dot */
.card .heat-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  position: absolute;
  top: 14px; right: 14px;
  z-index: 4;
  border: 2px solid rgba(255,255,255,0.6);
}

.heat-frozen { background: #90caf9; box-shadow: 0 0 8px #90caf9; }
.heat-cold { background: #4fc3f7; box-shadow: 0 0 8px #4fc3f7; }
.heat-cool { background: #80deea; box-shadow: 0 0 8px #80deea; }
.heat-warm { background: #ffb74d; box-shadow: 0 0 8px #ffb74d; }
.heat-hot { background: #ff5252; box-shadow: 0 0 8px #ff5252; }
.heat-molten { background: #ff1744; animation: moltenPulse 0.6s ease infinite; }

@keyframes moltenPulse {
  0%, 100% { box-shadow: 0 0 8px #ff1744; transform: scale(1); }
  50% { box-shadow: 0 0 18px #ff1744, 0 0 30px #ff1744; transform: scale(1.2); }
}

/* zone badge — pill shaped */
.card .zone-badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: white;
  background: var(--lavender);
  padding: 3px 8px;
  border-radius: 50px;
  position: absolute;
  top: 14px; left: 12px;
  z-index: 4;
}

/* intensity pips — colorful */
.card .intensity-bar {
  display: flex;
  gap: 4px;
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
}

.intensity-pip {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--soft-pink);
  opacity: 0.3;
  border: 1px solid rgba(255,255,255,0.5);
}

.intensity-pip.active {
  opacity: 1;
  background: var(--hotpink);
  box-shadow: 0 0 6px var(--hotpink);
}

/* archetype */
.card .archetype-icon { font-size: 48px; position: relative; z-index: 2; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1)); }
.card .archetype-name { font-family: 'Nunito', sans-serif; font-size: 18px; font-weight: 700; text-transform: lowercase; position: relative; z-index: 2; margin-top: 8px; }
.card .archetype-phase {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: white;
  background: var(--hotpink);
  padding: 3px 10px;
  border-radius: 50px;
  margin-top: 8px;
  position: relative;
  z-index: 2;
}

/* zone cards */
.card .zone-glyph { font-size: 36px; opacity: 0.5; position: relative; z-index: 2; }
.card .zone {
  font-family: 'Nunito', sans-serif; font-size: 24px; font-weight: 800;
  text-transform: lowercase; position: relative; z-index: 2;
  background: linear-gradient(135deg, var(--hotpink), var(--lavender), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* movement */
.card .movement-arrow { font-size: 30px; opacity: 0.4; position: relative; z-index: 2; }
.card .movement { font-family: 'Nunito', sans-serif; font-size: 22px; font-weight: 700; text-transform: lowercase; position: relative; z-index: 2; }

/* texture cards — saturated state bgs */
.card.texture-card { border: 3px solid rgba(255,255,255,0.3); }
.card.texture-card .word {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px; letter-spacing: 3px;
  color: white;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.state-SLICKVEIL { background: linear-gradient(135deg, #4fc3f7, #b3e5fc, #e1f5fe); }
.state-SLIPCORE { background: linear-gradient(135deg, #69f0ae, #a5d6a7, #c8e6c9); }
.state-FRAYMARK { background: linear-gradient(135deg, #ff5252, #ff8a80, #ffcdd2); }
.state-VOLTAGE { background: linear-gradient(135deg, #ffee58, #fff176, #fff9c4); }
.state-CLEARMARK { background: linear-gradient(135deg, #ce93d8, #e1bee7, #f3e5f5); }
.state-LOWLINE { background: linear-gradient(135deg, #78909c, #b0bec5, #eceff1); }

/* color hint backgrounds — saturated candy */
.hint-orange { background: linear-gradient(135deg, rgba(255,152,0,0.2), rgba(255,243,224,0.8)) !important; }
.hint-moss { background: linear-gradient(135deg, rgba(104,159,56,0.2), rgba(241,248,233,0.8)) !important; }
.hint-red { background: linear-gradient(135deg, rgba(255,82,82,0.15), rgba(255,235,238,0.8)) !important; }
.hint-blue { background: linear-gradient(135deg, rgba(66,165,245,0.2), rgba(227,242,253,0.8)) !important; }
.hint-purple { background: linear-gradient(135deg, rgba(171,71,188,0.15), rgba(243,229,245,0.8)) !important; }
.hint-yellow { background: linear-gradient(135deg, rgba(255,238,88,0.25), rgba(255,253,231,0.8)) !important; }
.hint-pink { background: linear-gradient(135deg, rgba(255,20,147,0.12), rgba(252,228,236,0.8)) !important; }
.hint-mint { background: linear-gradient(135deg, rgba(0,255,204,0.15), rgba(224,255,247,0.8)) !important; }
.hint-lime { background: linear-gradient(135deg, rgba(184,255,87,0.2), rgba(241,255,224,0.8)) !important; }
.hint-coral { background: linear-gradient(135deg, rgba(255,111,97,0.15), rgba(255,235,232,0.8)) !important; }
.hint-gold { background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,248,225,0.8)) !important; }
.hint-silver { background: linear-gradient(135deg, rgba(192,192,192,0.2), rgba(245,245,245,0.8)) !important; }
.hint-chartreuse { background: linear-gradient(135deg, rgba(192,202,51,0.2), rgba(249,251,231,0.8)) !important; }
.hint-lavender { background: linear-gradient(135deg, rgba(181,126,220,0.15), rgba(243,229,245,0.8)) !important; }
.hint-green { background: linear-gradient(135deg, rgba(76,175,80,0.2), rgba(232,245,233,0.8)) !important; }
.hint-teal { background: linear-gradient(135deg, rgba(0,150,136,0.15), rgba(224,242,241,0.8)) !important; }
.hint-peach { background: linear-gradient(135deg, rgba(255,183,152,0.2), rgba(255,241,235,0.8)) !important; }

/* slider */
.slider-container {
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 18px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
  border-radius: 24px;
  padding: 24px 20px;
  border: 3px solid rgba(181,126,220,0.15);
  box-shadow: 0 6px 24px rgba(181,126,220,0.1);
}

.slider-row { display: flex; flex-direction: column; gap: 6px; }
.slider-label { font-family: 'Pixelify Sans', sans-serif; font-size: 16px; font-weight: 600; text-transform: lowercase; }
.slider-extremes { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-soft); font-style: italic; }

.slider-row input[type="range"] {
  width: 100%; height: 8px;
  -webkit-appearance: none; appearance: none;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--baby-blue), var(--hotpink), var(--lime));
  outline: none;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--hotpink);
  box-shadow: 0 2px 8px rgba(255,20,147,0.3);
  cursor: pointer;
}

.slider-submit {
  font-family: 'Nunito', sans-serif;
  font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg, var(--hotpink), var(--lavender));
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 50px;
  cursor: pointer;
  text-transform: lowercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 16px rgba(255,20,147,0.3);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.slider-submit:active { transform: scale(0.95); }

/* micro invite — warm sticker energy */
.micro-invite {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 16px;
  color: var(--text);
  text-align: center;
  line-height: 1.7;
  padding: 20px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  border: 2px dashed var(--lavender);
  max-width: 400px;
  animation: invitePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes invitePop {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* tap burst */
.tap-burst { position: fixed; pointer-events: none; z-index: 99; }
.tap-burst span {
  position: absolute;
  border-radius: 50%;
  animation: burstOut 0.6s ease-out forwards;
}

@keyframes burstOut {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* loading */
.loading {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--text-soft);
  letter-spacing: 3px;
  animation: loadBlink 1.2s ease infinite;
}

@keyframes loadBlink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* tap counter — cute pill */
.tap-count {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--lavender);
  opacity: 0.4;
  position: fixed;
  bottom: 14px;
  right: 14px;
  background: rgba(255,255,255,0.5);
  padding: 4px 10px;
  border-radius: 50px;
}
