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

:root {
  --pink: #ff6b9d;
  --pink-light: #ffc2d4;
  --purple: #c89bff;
  --bg: #1a1a2e;
  --bg2: #16213e;
  --text: #f5f5f5;
  --text-soft: #ccc;
  --accent: #ff6b9d;
  --gold: #ffd700;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 20px;
  position: relative;
}
.screen.active { display: flex; align-items: center; justify-content: center; }

/* CU RAIN */
#cu-rain {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.cu-particle {
  position: absolute;
  font-size: 14px;
  color: var(--pink-light);
  opacity: 0.3;
  animation: cuFall linear forwards;
  pointer-events: none;
  user-select: none;
}
@keyframes cuFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0.4; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* INTRO */
.intro-content {
  text-align: center;
  z-index: 1;
  max-width: 500px;
}
.intro-title {
  font-size: 3em;
  margin-bottom: 10px;
  animation: bounceIn 0.8s ease;
}
.eye-emoji { display: inline-block; animation: eyeWiggle 2s infinite; }
@keyframes eyeWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(10deg); }
  75% { transform: rotate(-10deg); }
}
.intro-sub {
  font-size: 1.3em;
  color: var(--pink);
  margin-bottom: 20px;
  letter-spacing: 3px;
}
.intro-text {
  font-size: 1.1em;
  color: var(--text-soft);
  margin-bottom: 30px;
  line-height: 1.6;
}
.intro-hint {
  font-size: 0.85em;
  color: var(--text-soft);
  margin-top: 15px;
  font-style: italic;
  opacity: 0.7;
}

/* BUTTONS */
.btn-main {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  border: none;
  padding: 16px 36px;
  font-size: 1.15em;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-weight: 600;
}
.btn-main:hover { transform: scale(1.05); box-shadow: 0 5px 25px rgba(255,107,157,0.4); }
.btn-main:active { transform: scale(0.97); }

.btn-small {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 18px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background 0.2s;
}
.btn-small:hover { background: rgba(255,255,255,0.2); }

.btn-reset {
  position: fixed;
  bottom: 15px;
  right: 15px;
  background: rgba(255,255,255,0.08);
  color: var(--text-soft);
  border: 1px solid rgba(255,255,255,0.15);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1em;
  z-index: 100;
  transition: background 0.2s;
}
.btn-reset:hover { background: rgba(255,255,255,0.2); }

/* COUNTDOWN */
.countdown-content {
  text-align: center;
  z-index: 1;
  max-width: 600px;
  width: 100%;
}
.countdown-content h2 {
  font-size: 1.6em;
  margin-bottom: 25px;
}
.countdown-timer {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
}
.time-block {
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 15px 12px;
  min-width: 70px;
  text-align: center;
}
.time-block span {
  font-size: 2em;
  font-weight: 700;
  color: var(--pink);
  display: block;
}
.time-block small {
  font-size: 0.75em;
  color: var(--text-soft);
}
.countdown-msg {
  color: var(--text-soft);
  margin-bottom: 25px;
  font-style: italic;
}

/* MOSAIC */
.mosaic-preview {
  margin: 20px auto;
  max-width: 300px;
}
.mosaic-preview canvas {
  width: 100%;
  border-radius: 12px;
  border: 2px solid var(--pink-light);
}
.mosaic-hint {
  font-size: 0.8em;
  color: var(--text-soft);
  margin-top: 8px;
}

.runs-count {
  color: var(--purple);
  font-size: 0.85em;
  margin-top: 8px;
  margin-bottom: 5px;
}

/* PROGRESS BAR */
.progress-bar-container {
  margin-top: 15px;
  margin-bottom: 15px;
  background: rgba(255,255,255,0.08);
  border-radius: 20px;
  height: 24px;
  position: relative;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  border-radius: 20px;
  transition: width 0.5s ease;
  width: 0%;
}
.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75em;
  font-weight: 600;
}

/* STEP SCREEN */
.step-content {
  z-index: 1;
  max-width: 550px;
  width: 100%;
  text-align: center;
}
.step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.step-number {
  font-size: 0.9em;
  color: var(--pink);
  font-weight: 600;
}
.step-body {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 30px 25px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
}
.step-body h3 {
  font-size: 1.3em;
  margin-bottom: 10px;
  color: var(--pink-light);
}
.step-body p { color: var(--text-soft); line-height: 1.5; }

.step-sweet {
  margin-top: 20px;
  font-style: italic;
  color: var(--purple);
  font-size: 0.9em;
  min-height: 25px;
  opacity: 0;
  transition: opacity 0.5s;
}
.step-sweet.visible { opacity: 1; }

.btn-next {
  margin-top: 20px;
  animation: bounceIn 0.5s ease;
}

/* STEP SPECIFICS */
.clicker-btn {
  background: linear-gradient(135deg, var(--pink), #ff3366);
  border: none;
  color: white;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  font-size: 2em;
  cursor: pointer;
  transition: transform 0.1s;
  user-select: none;
}
.clicker-btn:active { transform: scale(0.9); }

.cu-pop {
  position: fixed;
  font-size: 1.4em;
  color: var(--pink);
  font-weight: bold;
  pointer-events: none;
  animation: cuPop 1s ease forwards;
  z-index: 50;
}
@keyframes cuPop {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(1.5); }
}

.slider-track {
  width: 100%;
  max-width: 300px;
  height: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  position: relative;
  margin: 20px 0;
}
.slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  border-radius: 10px;
  outline: none;
  cursor: pointer;
}
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  background: white;
  border-radius: 50%;
  cursor: grab;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 400px;
}
.quiz-btn {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  color: var(--text);
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.95em;
  transition: all 0.2s;
}
.quiz-btn:hover {
  border-color: var(--pink);
  background: rgba(255,107,157,0.15);
}

.trap-btn {
  background: linear-gradient(135deg, var(--gold), #ff9500);
  color: #1a1a2e;
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 1.1em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.captcha-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 250px;
}
.captcha-cell {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  padding: 15px;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1em;
  transition: all 0.2s;
  user-select: none;
}
.captcha-cell.selected {
  border-color: var(--pink);
  background: rgba(255,107,157,0.2);
}

.code-input {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.2);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 1.1em;
  text-align: center;
  width: 200px;
  outline: none;
  transition: border-color 0.2s;
}
.code-input:focus { border-color: var(--pink); }

.puzzle-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.puzzle-word {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.2s;
  user-select: none;
}
.puzzle-word.placed {
  background: rgba(255,107,157,0.2);
  border-color: var(--pink);
}

.puzzle-slots {
  display: flex;
  gap: 8px;
  justify-content: center;
  min-height: 50px;
  flex-wrap: wrap;
}
.puzzle-slot {
  background: rgba(255,255,255,0.05);
  border: 2px dashed rgba(255,255,255,0.2);
  padding: 10px 18px;
  border-radius: 10px;
  min-width: 60px;
  font-size: 1em;
  color: var(--pink);
  cursor: pointer;
}

.thermo-bar {
  width: 100%;
  max-width: 300px;
  height: 30px;
  background: rgba(255,255,255,0.08);
  border-radius: 15px;
  overflow: hidden;
  position: relative;
}
.thermo-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), #ff3366, var(--gold));
  border-radius: 15px;
  transition: width 0.3s;
  width: 0%;
}
.thermo-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8em;
  font-weight: 600;
}

/* ALL DONE MSG */
.all-done-msg {
  background: rgba(255,107,157,0.1);
  border: 1px solid var(--pink-light);
  border-radius: 12px;
  padding: 20px;
  margin: 15px 0;
}
.all-done-msg p {
  color: var(--pink-light);
  font-size: 1.05em;
  margin-bottom: 8px;
}
.all-done-msg p:last-child { margin-bottom: 0; }

.gift-locked {
  background: rgba(255,255,255,0.05);
  border: 2px dashed var(--pink-light);
  border-radius: 16px;
  padding: 25px;
  text-align: center;
}
.gift-locked p {
  margin-bottom: 10px;
  color: var(--pink-light);
}

/* FINAL */
.final-content {
  text-align: center;
  z-index: 1;
  max-width: 550px;
  width: 100%;
  padding: 20px 0;
}
.final-title {
  font-size: 2em;
  margin-bottom: 25px;
  animation: bounceIn 0.8s ease;
}
.final-message {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 25px;
  text-align: left;
  line-height: 1.7;
}
.final-message p { margin-bottom: 12px; }
.final-message p:last-child { margin-bottom: 0; }
.final-gift {
  margin: 25px 0;
}
.final-gift img {
  max-width: 300px;
  width: 100%;
  border-radius: 12px;
  border: 3px solid var(--gold);
  box-shadow: 0 0 30px rgba(255,215,0,0.3);
}
.gift-label {
  font-size: 1.2em;
  margin-top: 15px;
  color: var(--gold);
  font-weight: 700;
}
.gift-sub {
  color: var(--text-soft);
  margin-top: 5px;
}
.final-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 25px;
}

#final-confetti {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ANIMATIONS */
@keyframes bounceIn {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* RESPONSIVE */
@media (max-width: 500px) {
  .intro-title { font-size: 2.2em; }
  .btn-main { padding: 14px 28px; font-size: 1em; }
  .countdown-timer { gap: 8px; }
  .time-block { min-width: 55px; padding: 10px 8px; }
  .time-block span { font-size: 1.5em; }
  .step-body { padding: 20px 15px; }
  .quiz-options { grid-template-columns: 1fr; }
  .final-title { font-size: 1.6em; }
  .final-message { padding: 18px; font-size: 0.95em; }
}
