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

:root {
  --pink: #f472b6;
  --text: #3f3f46;
  --text-soft: #a1a1aa;
  --happy: #4ade80;
  --loved: #f472b6;
  --excited: #fb923c;
  --calm: #67e8f9;
  --okay: #facc15;
  --tired: #94a3b8;
  --anxious: #fbbf24;
  --sad: #a78bfa;
  --angry: #f87171;
}

html, body { height: 100%; }

body {
  font-family: 'Quicksand', sans-serif;
  background: #fff1f2;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── Pages ── */
.page {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 24px;
  overflow-y: auto;
  text-align: center;
  opacity: 0; transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.page.active {
  opacity: 1; transform: translateY(0);
  pointer-events: auto;
}

#mood-display, .empty {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Typography ── */
.top-label {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 24px;
}
.top-label strong {
  color: var(--text);
  font-weight: 700;
}

/* ── Big emoji showcase ── */
.big-emoji {
  font-size: 7rem;
  line-height: 1;
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.mood-word {
  font-family: 'Comfortaa', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: capitalize;
  margin-top: 12px;
  text-align: center;
  width: 100%;
  transition: color 0.3s;
}

.mood-word[data-mood="happy"]   { color: #16a34a; }
.mood-word[data-mood="loved"]   { color: #db2777; }
.mood-word[data-mood="excited"] { color: #ea580c; }
.mood-word[data-mood="calm"]    { color: #0891b2; }
.mood-word[data-mood="okay"]    { color: #ca8a04; }
.mood-word[data-mood="tired"]   { color: #475569; }
.mood-word[data-mood="anxious"] { color: #b45309; }
.mood-word[data-mood="sad"]     { color: #7c3aed; }
.mood-word[data-mood="angry"]   { color: #dc2626; }

.note {
  margin-top: 16px;
  padding: 12px 20px;
  max-width: 320px;
  background: white;
  border-radius: 16px;
  font-size: 0.92rem;
  font-weight: 500;
  font-style: italic;
  color: #71717a;
  line-height: 1.55;
  word-wrap: break-word;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.note:empty { display: none; }

/* ── Mad meter (showcase) ── */
.mad-meter {
  margin-top: 16px;
  width: 100%;
  max-width: 260px;
  text-align: center;
}

.mad-label {
  font-family: 'Comfortaa', cursive;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.mad-bar {
  width: 100%;
  height: 10px;
  background: #f4f4f5;
  border-radius: 50px;
  overflow: hidden;
}

.mad-fill {
  height: 100%;
  border-radius: 50px;
  background: linear-gradient(90deg, #facc15, #f87171);
  transition: width 0.4s ease;
}

.mad-value {
  margin-top: 4px;
  font-family: 'Comfortaa', cursive;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-soft);
}

/* ── Mad slider (panel) ── */
.mad-section {
  width: 100%;
  max-width: 320px;
  text-align: center;
  margin-bottom: 16px;
}

.mad-question {
  font-family: 'Comfortaa', cursive;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 10px;
}

.mad-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 50px;
  background: linear-gradient(90deg, #fde68a, #fca5a5);
  outline: none;
  cursor: pointer;
  border: 2px solid #e4e4e7;
}

.mad-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f87171;
  border: 3px solid white;
  box-shadow: 0 2px 10px rgba(248,113,113,0.4);
  cursor: pointer;
}

.mad-range::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f87171;
  border: 3px solid white;
  box-shadow: 0 2px 10px rgba(248,113,113,0.4);
  cursor: pointer;
}

.mad-range-value {
  margin-top: 6px;
  font-family: 'Comfortaa', cursive;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-soft);
}

.date {
  margin-top: 10px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
}

.empty .mood-word { color: var(--text-soft); }

/* ── Picker ── */
.picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0 24px;
  width: 100%;
  max-width: 320px;
}

.pick {
  background: white;
  border: 3px solid #e4e4e7;
  border-radius: 20px;
  height: 100px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.pick:hover { transform: translateY(-3px); }

.pick-emoji { font-size: 2.6rem; line-height: 1; }

.pick-text {
  font-family: 'Comfortaa', cursive;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  transition: color 0.2s;
}

/* Selected */
.pick.selected { transform: scale(1.06); }
.pick.selected .pick-text { color: var(--text); }

.pick--happy.selected   { border-color: var(--happy);   background: #f0fdf4; }
.pick--loved.selected   { border-color: var(--loved);   background: #fdf2f8; }
.pick--excited.selected { border-color: var(--excited); background: #fff7ed; }
.pick--calm.selected    { border-color: var(--calm);    background: #ecfeff; }
.pick--okay.selected    { border-color: var(--okay);    background: #fefce8; }
.pick--tired.selected   { border-color: var(--tired);   background: #f1f5f9; }
.pick--anxious.selected { border-color: var(--anxious); background: #fffbeb; }
.pick--sad.selected     { border-color: var(--sad);     background: #f5f3ff; }
.pick--angry.selected   { border-color: var(--angry);   background: #fef2f2; }

/* ── Inputs ── */
.code-input {
  display: block;
  width: 200px;
  padding: 14px;
  font-family: 'Comfortaa', cursive;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 10px;
  color: var(--text);
  background: white;
  border: 2px solid #e4e4e7;
  border-radius: 50px;
  outline: none;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}
.code-input::placeholder { color: #d4d4d8; letter-spacing: 12px; }
.code-input:focus { border-color: var(--pink); }

.note-input {
  display: block;
  width: 100%;
  max-width: 320px;
  padding: 12px 16px;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: white;
  border: 2px solid #e4e4e7;
  border-radius: 18px;
  outline: none;
  resize: none;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}
.note-input::placeholder { color: #d4d4d8; }
.note-input:focus { border-color: var(--pink); }

.err { color: #fb7185; font-size: 0.8rem; font-weight: 700; margin-bottom: 6px; }

.blocked-msg {
  font-family: 'Comfortaa', cursive;
  font-size: 1.3rem;
  font-weight: 700;
  color: #dc2626;
  margin-top: 12px;
  text-align: center;
}

.blocked-sub {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-top: 6px;
  text-align: center;
}

#login-blocked {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#login-form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Buttons ── */
.actions {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  margin-top: 18px; width: 100%; max-width: 260px;
}

.btn {
  width: 100%;
  padding: 14px;
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #f472b6, #c084fc);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

.link-btn {
  background: none; border: none;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.85rem; font-weight: 700;
  color: var(--text-soft);
  cursor: pointer;
  padding: 6px;
  transition: color 0.2s;
}
.link-btn:hover { color: var(--text); }

/* ── Mobile ── */
@media (max-width: 480px) {
  .page { padding: 24px 16px; justify-content: flex-start; padding-top: 48px; }
  .big-emoji { font-size: 5.5rem; }
  .pick { height: 88px; }
  .pick-emoji { font-size: 2rem; }
  .picker { gap: 8px; max-width: 100%; }
  .mad-section { max-width: 100%; }
  .note-input { max-width: 100%; }
  .actions { max-width: 100%; }
  .note { max-width: 100%; }
}
