:root {
  --color-bg: #FFF8F0;
  --color-pink: #FFB3C7;
  --color-mint: #B5EAD7;
  --color-sky: #C7E5FF;
  --color-yellow: #FFF1A6;
  --color-orange: #FFB088;
  --color-text: #5A4A3F;
  --color-text-soft: #8A7A6F;
  --shadow-soft: 0 4px 12px rgba(255, 179, 199, 0.25);
  --shadow-press: 0 2px 4px rgba(255, 179, 199, 0.4);
  --radius-md: 16px;
  --radius-lg: 24px;
  --font: 'M PLUS Rounded 1c', sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  font-size: 18px;
  line-height: 1.5;
}

#app { min-height: 100vh; position: relative; }

.screen { padding: 20px; min-height: 100vh; }
.screen[hidden] { display: none !important; }
.screen.active { display: block; }

.big-btn {
  display: block;
  width: 100%;
  max-width: 380px;
  min-height: 64px;
  margin: 12px auto;
  padding: 16px 24px;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  background: white;
  border: 3px solid var(--color-pink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}
.big-btn:active {
  transform: translateY(2px);
  box-shadow: var(--shadow-press);
}
.big-btn.primary {
  background: var(--color-pink);
  color: white;
}

.icon-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  font-size: 24px;
  background: white;
  border: 2px solid var(--color-pink);
  border-radius: 50%;
  cursor: pointer;
}

.logo {
  text-align: center;
  font-size: 36px;
  font-weight: 900;
  color: var(--color-pink);
  margin: 24px 0;
  text-shadow: 2px 2px 0 white, 4px 4px 0 var(--color-yellow);
}

#effects-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

.minute-meter {
  width: 100%;
  max-width: 380px;
  margin: 16px auto;
}
.mm-track {
  position: relative;
  height: 28px;
  background: var(--color-yellow);
  border: 2px solid var(--color-orange);
  border-radius: 14px;
  overflow: visible;
}
.mm-fill {
  height: 100%;
  background: linear-gradient(to right, var(--color-pink), var(--color-orange));
  border-radius: 12px 0 0 12px;
  transition: width 0.3s ease;
  width: 0;
}
.mm-marker {
  position: absolute;
  top: -6px;
  width: 4px;
  height: 40px;
  background: var(--color-text);
  border-radius: 2px;
  transition: left 0.3s ease;
}
.mm-ticks { position: absolute; inset: 0; pointer-events: none; }
.mm-ticks span {
  position: absolute;
  top: 32px;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--color-text-soft);
}
.mm-label {
  text-align: center;
  margin-top: 28px;
  font-size: 18px;
  font-weight: 700;
}
.minute-meter.wrap-forward { animation: wrap-fwd 0.6s; }
.minute-meter.wrap-back { animation: wrap-bk 0.6s; }
@keyframes wrap-fwd { 50% { transform: scale(1.05); filter: hue-rotate(20deg); } }
@keyframes wrap-bk { 50% { transform: scale(1.05) translateX(-4px); } }

.chiktak-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0;
}
.chiktak-figure { width: 96px; height: 96px; flex-shrink: 0; animation: chiktak-bob 2s ease-in-out infinite; }
@keyframes chiktak-bob { 50% { transform: translateY(-4px); } }
.chiktak-bubble {
  flex: 1;
  background: white;
  border: 2px solid var(--color-pink);
  border-radius: 16px;
  padding: 12px 16px;
  position: relative;
  font-size: 18px;
  box-shadow: var(--shadow-soft);
}
.chiktak-bubble::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 24px;
  width: 0;
  height: 0;
  border: 8px solid transparent;
  border-right-color: var(--color-pink);
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.4; }
}
.rainbow-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #FF6B6B22, #FFA94D22, #FFD43B22, #69DB7C22, #4DABF722, #9775FA22);
  animation: rainbow-fade 2.5s ease-out;
}
@keyframes rainbow-fade {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}
.sparkle {
  position: absolute;
  width: 24px; height: 24px;
  background: radial-gradient(circle, white 0%, var(--color-yellow) 50%, transparent 70%);
  border-radius: 50%;
  animation: sparkle-pop 0.8s ease-out;
  pointer-events: none;
}
@keyframes sparkle-pop {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}
.fly-sticker {
  position: absolute;
  transition: transform 1s cubic-bezier(0.5, 0, 0.5, 1), opacity 1s;
  z-index: 10000;
}
.back-btn {
  background: none;
  border: none;
  color: var(--color-pink);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}
.screen-title {
  font-size: 28px;
  margin: 12px 0 24px;
  color: var(--color-pink);
  text-align: center;
}
.lesson-list { display: flex; flex-direction: column; gap: 12px; max-width: 380px; margin: 0 auto; }
.lesson-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: white;
  border: 3px solid var(--color-pink);
  border-radius: var(--radius-lg);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-soft);
}
.lesson-card.locked { opacity: 0.4; cursor: not-allowed; }
.lesson-card.cleared { background: linear-gradient(135deg, white 70%, var(--color-yellow) 100%); }
.lesson-icon { font-size: 36px; text-align: center; }
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  background: white;
  border: 3px dashed var(--color-pink);
  border-radius: var(--radius-lg);
}
.sticker-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--color-cream, #FFF8F0);
  border-radius: 12px;
  overflow: hidden;
}
.sticker-cell.locked { opacity: 0.3; }
.sticker-silhouette {
  font-size: 32px;
  color: var(--color-text-soft);
  font-weight: 900;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 380px;
  margin: 12px auto;
  padding: 12px 20px;
  background: white;
  border: 2px solid var(--color-pink);
  border-radius: var(--radius-md);
}
.row input[type="checkbox"] { width: 24px; height: 24px; }
.big-btn.danger { border-color: #E66B6B; color: #E66B6B; }
.empty { text-align: center; padding: 32px; color: var(--color-text-soft); }
.page-indicator { text-align: center; color: var(--color-text-soft); margin: 8px 0; }
.learn-body { font-size: 20px; line-height: 1.7; padding: 16px; max-width: 480px; margin: 0 auto; }
.prompt {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  padding: 16px;
  margin: 12px auto;
  max-width: 420px;
  background: var(--color-yellow);
  border-radius: var(--radius-md);
}
#q-clock { width: 320px; margin: 0 auto; }
#q-controls { max-width: 380px; margin: 16px auto; }
.big-btn.choice { background: white; border-color: var(--color-sky); }
.shake { animation: shake 0.3s; }
@keyframes shake {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.result-big { text-align: center; font-size: 32px; font-weight: 900; color: var(--color-pink); margin: 24px 0; }
.sticker-show { text-align: center; margin: 24px auto; max-width: 200px; }
.sticker-show-label { font-size: 22px; font-weight: 900; color: var(--color-orange); margin-bottom: 12px; }
.sticker-show-art { width: 160px; height: 160px; margin: 0 auto; animation: pop-in 0.6s ease-out; }
.sticker-show-art svg { width: 100%; height: 100%; }
@keyframes pop-in { 0% { transform: scale(0) rotate(-20deg); } 70% { transform: scale(1.1) rotate(5deg); } 100% { transform: scale(1) rotate(0); } }
.sticker-choice-label { text-align: center; font-size: 22px; font-weight: 900; color: var(--color-orange); margin: 16px 0; }
.sticker-choice-grid { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; padding: 16px; }
.sticker-choice {
  width: 120px;
  height: 120px;
  background: white;
  border: 4px solid var(--color-pink);
  border-radius: 50%;
  cursor: pointer;
  padding: 8px;
  box-shadow: var(--shadow-soft);
  animation: candidate-bob 1.2s ease-in-out infinite;
}
.sticker-choice:nth-child(2) { animation-delay: 0.2s; }
.sticker-choice:nth-child(3) { animation-delay: 0.4s; }
.sticker-choice svg { width: 100%; height: 100%; }
@keyframes candidate-bob { 50% { transform: translateY(-6px); } }
