/* ═══════════════════════════════════════════════
   AMARE — style.css  v1.0
   Palette:
     --burgundy:     #7B2D42
     --burgundy-lt:  #9E3A56
     --burgundy-dk:  #5A1E30
     --charcoal:     #1A1A1A
     --charcoal-lt:  #242424
     --black:        #0d0d0d
     --cream:        #F5EDE6
     --cream-faint:  rgba(245,237,230,0.08)
══════════════════════════════════════════════ */

/* ─── Reset & Base ──────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --burgundy:      #7B2D42;
  --burgundy-lt:   #9E3A56;
  --burgundy-dk:   #5A1E30;
  --burgundy-glow: #c0415e;
  --charcoal:      #1a1a1a;
  --charcoal-lt:   #252525;
  --black:         #0d0d0d;
  --cream:         #F5EDE6;
  --cream-dim:     rgba(245, 237, 230, 0.55);
  --cream-faint:   rgba(245, 237, 230, 0.07);
  --font-serif:    'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-sans:     'DM Sans', system-ui, sans-serif;
  --radius-card:   20px;
  --radius-pill:   999px;
  --transition:    0.45s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-top:      env(safe-area-inset-top, 0px);
  --safe-bottom:   env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100vh; /* fallback for older ios versions */
  height: 100dvh; /* modern ios dynamic viewport */
  height: var(--app-h, 100dvh); /* real measured height (set in script.js) */
  width: 100vw;
  overflow: hidden;
  background: var(--charcoal);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Screen System ─────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  height: var(--app-h, 100dvh); /* real measured height (set in script.js) */
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition:
    opacity var(--transition),
    transform var(--transition),
    -webkit-filter 0.4s ease,
    filter 0.4s ease;
  will-change: opacity, transform;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.screen.exit {
  opacity: 0;
  transform: translateY(-18px);
  pointer-events: none;
}

/* ════════════════════════════════════════════════
   SCREEN 1 — SETUP
════════════════════════════════════════════════ */
#screen-setup {
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.setup-card {
  background: linear-gradient(145deg, #1e0d12, #2a1118);
  border: 1px solid rgba(123, 45, 66, 0.35);
  border-radius: var(--radius-card);
  padding: 36px 28px 32px;
  max-width: 420px;
  width: 100%;
  box-shadow:
    0 0 0 1px rgba(123,45,66,0.12),
    0 8px 40px rgba(0,0,0,0.6),
    0 0 60px rgba(123,45,66,0.08);
  animation: fadeUp 0.6s var(--transition) both;
}

.setup-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--burgundy-lt);
  margin-bottom: 10px;
}

.setup-title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 7vw, 36px);
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 28px;
  line-height: 1.15;
}

.setup-list {
  list-style: none;
  counter-reset: steps;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setup-list li {
  counter-increment: steps;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--cream-dim);
  line-height: 1.5;
  padding-left: 32px;
  position: relative;
}

.setup-list li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--burgundy-dk);
  border: 1px solid var(--burgundy);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(123, 45, 66, 0.18);
  border: 1px solid rgba(123,45,66,0.3);
  border-radius: 8px;
  padding: 3px 8px;
}

.step-icon {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1) opacity(0.8);
}

.step-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--cream);
}

.step-text {
  color: var(--cream-dim);
}

.setup-note {
  margin-top: 28px;
  font-size: 12px;
  color: rgba(245,237,230,0.3);
  text-align: center;
  letter-spacing: 0.04em;
}

/* ════════════════════════════════════════════════
   SCREEN 2 — INTRO ONBOARDING
════════════════════════════════════════════════ */
#screen-intro {
  background: var(--charcoal);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.intro-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 0 24px calc(80px + var(--safe-bottom));
  /* Fade top and bottom edges */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 90%, transparent 100%);
}

.intro-content {
  max-width: 520px;
  margin: 0 auto;
  padding-top: 60px;
  padding-bottom: 32px;
}

.intro-greeting {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--burgundy-lt);
  font-weight: 500;
  margin-bottom: 12px;
}

.intro-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 9vw, 54px);
  font-weight: 600;
  color: var(--cream);
  line-height: 1.1;
  margin-bottom: 20px;
}

/* ✦ GLOW WORD */
.glow-word {
  display: inline-block;
  color: #fff;
  text-shadow:
    0 0 10px rgba(192, 65, 94, 0.8),
    0 0 25px rgba(192, 65, 94, 0.55),
    0 0 50px rgba(192, 65, 94, 0.35),
    0 0 90px rgba(192, 65, 94, 0.2);
  animation: glowPulse 3.5s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  0%  { text-shadow: 0 0 10px rgba(192,65,94,0.7), 0 0 25px rgba(192,65,94,0.45), 0 0 50px rgba(192,65,94,0.25); }
  100%{ text-shadow: 0 0 16px rgba(192,65,94,1),   0 0 40px rgba(192,65,94,0.7),  0 0 80px rgba(192,65,94,0.45), 0 0 120px rgba(192,65,94,0.25); }
}

.intro-divider {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--burgundy), transparent);
  margin-bottom: 28px;
  border-radius: 2px;
}

.intro-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.intro-body p {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  color: rgba(245, 237, 230, 0.78);
  line-height: 1.8;
}

.intro-subtitle-italic {
  font-family: var(--font-serif) !important;
  font-size: 18px !important;
  font-style: italic;
  color: var(--cream-dim) !important;
  line-height: 1.7 !important;
  border-left: 2px solid var(--burgundy);
  padding-left: 16px;
}

.reminder-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 0;
}

.reminder-list li {
  font-size: 14px;
  font-weight: 300;
  color: rgba(245,237,230,0.7);
  padding-left: 20px;
  position: relative;
  line-height: 1.6;
}

.reminder-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--burgundy-lt);
  font-size: 10px;
  top: 4px;
}

.closing-line {
  font-family: var(--font-serif) !important;
  font-size: 17px !important;
  font-style: italic;
  color: var(--cream) !important;
  text-align: center;
  padding: 20px 0 8px;
}

/* Circle Arrow Button */
.circle-btn {
  position: fixed;
  bottom: calc(28px + var(--safe-bottom));
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--burgundy);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 20px rgba(123,45,66,0.5), 0 0 0 0 rgba(123,45,66,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: pulseBorder 2.5s ease-in-out infinite;
  z-index: 100;
}

.circle-btn svg {
  width: 22px;
  height: 22px;
}

.circle-btn:active {
  transform: scale(0.92);
}

@keyframes pulseBorder {
  0%   { box-shadow: 0 4px 20px rgba(123,45,66,0.5), 0 0 0 0   rgba(123,45,66,0.35); }
  70%  { box-shadow: 0 4px 20px rgba(123,45,66,0.5), 0 0 0 12px rgba(123,45,66,0); }
  100% { box-shadow: 0 4px 20px rgba(123,45,66,0.5), 0 0 0 0   rgba(123,45,66,0); }
}

/* ════════════════════════════════════════════════
   SCREEN 3 — NAME INPUT
════════════════════════════════════════════════ */
#screen-name {
  background: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.name-content {
  max-width: 400px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.name-illustration {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, rgba(123,45,66,0.25) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floatIllus 4s ease-in-out infinite;
}

.welcome-img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(123,45,66,0.45));
}

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

.name-form-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.name-title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 7vw, 36px);
  font-weight: 600;
  color: var(--cream);
  text-align: center;
  line-height: 1.2;
}

.name-subtitle {
  font-size: 13px;
  font-weight: 300;
  color: var(--cream-dim);
  text-align: center;
  margin-bottom: 6px;
}

.name-input-wrap {
  width: 100%;
}

.name-input {
  width: 100%;
  background: var(--charcoal-lt);
  border: 1px solid rgba(123,45,66,0.3);
  border-radius: 14px;
  padding: 16px 20px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  color: var(--cream);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  caret-color: var(--burgundy-lt);
}

.name-input::placeholder {
  color: rgba(245,237,230,0.25);
}

.name-input:focus {
  border-color: var(--burgundy);
  box-shadow: 0 0 0 3px rgba(123,45,66,0.2), 0 0 20px rgba(123,45,66,0.1);
}

.pill-btn {
  margin-top: 8px;
  width: 100%;
  background: linear-gradient(135deg, var(--burgundy-lt), var(--burgundy-dk));
  border: none;
  border-radius: var(--radius-pill);
  padding: 16px 32px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 4px 24px rgba(123,45,66,0.4);
}

.pill-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 28px rgba(123,45,66,0.55);
}

.pill-btn:active {
  transform: scale(0.96);
}

/* ════════════════════════════════════════════════
   SCREEN 4 — HOMESCREEN
════════════════════════════════════════════════ */
#screen-home {
  background: var(--charcoal);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 calc(24px + var(--safe-bottom));
}

.home-header {
  padding: calc(20px + var(--safe-top)) 24px 0;
  margin-bottom: 28px;
}

.home-brand {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 400;
  color: var(--burgundy-lt);
  letter-spacing: 0.04em;
}

.home-brand-sub {
  font-size: 11px;
  font-weight: 300;
  color: rgba(245,237,230,0.3);
  margin-top: 2px;
  letter-spacing: 0.06em;
}

.home-greeting-card {
  margin: 0 20px 32px;
  background: linear-gradient(145deg, #2a1118, #1f0e14);
  border: 1px solid rgba(123,45,66,0.3);
  border-radius: 24px;
  padding: 28px 24px 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 40px rgba(123,45,66,0.07);
}

.home-greeting-card::after {
  content: 'AMARE';
  position: absolute;
  bottom: -10px;
  right: 16px;
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 700;
  color: rgba(123,45,66,0.07);
  letter-spacing: 0.05em;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.home-greeting-label {
  font-size: 13px;
  font-weight: 300;
  color: var(--cream-dim);
  margin-bottom: 4px;
}

.home-username {
  font-family: var(--font-serif);
  font-size: clamp(36px, 10vw, 56px);
  font-weight: 600;
  color: var(--cream);
  line-height: 1.1;
  margin-bottom: 10px;
}

.home-tagline {
  font-size: 13px;
  font-weight: 300;
  color: rgba(245,237,230,0.4);
  font-style: italic;
}

/* Grid Tiles */
.home-placeholder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 20px;
}

.home-tile {
  border-radius: 20px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--charcoal-lt);
  border: 1px solid rgba(123,45,66,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.home-tile:active {
  transform: scale(0.96);
}

.tile-mood     { border-color: rgba(123,45,66,0.25); background: linear-gradient(145deg, #221016, #1c0d12); }
.tile-thoughts { border-color: rgba(123,45,66,0.15); }
.tile-anxiety  { border-color: rgba(123,45,66,0.20); background: linear-gradient(145deg, #1a1a20, #161416); }
.tile-journal  { border-color: rgba(123,45,66,0.25); background: linear-gradient(145deg, #221016, #1c0d12); }

.tile-emoji {
  font-size: 28px;
  margin-bottom: 4px;
}

.tile-label {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--cream);
}

.tile-sublabel {
  font-size: 11px;
  font-weight: 300;
  color: rgba(245,237,230,0.3);
  letter-spacing: 0.04em;
}

/* ════════════════════════════════════════════════
   SHARED UTILITIES & ANIMATIONS
════════════════════════════════════════════════ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glass card utility */
.glass-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 0;
}

/* Selection */
::selection {
  background: rgba(123,45,66,0.35);
  color: var(--cream);
}

/* ─── Responsive tweaks ─────────────────────── */
@media (max-height: 700px) {
  .intro-content {
    padding-top: 40px;
  }
  .name-illustration {
    width: 130px;
    height: 130px;
  }
  .welcome-img {
    width: 100px;
    height: 100px;
  }
}

/* ════════════════════════════════════════════════
   screen 5 — mood
════════════════════════════════════════════════ */
#screen-mood {
  background: var(--charcoal);
  display: flex;
  flex-direction: column;
  padding-top: 60px;
}

.mood-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  position: relative;
  border-bottom: 1px solid rgba(123, 45, 66, 0.25);
}

.back-btn {
  background: transparent;
  border: none;
  color: var(--cream);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  position: absolute;
  left: 20px;
  z-index: 10;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.back-btn svg {
  width: 24px;
  height: 24px;
}

.back-btn:active {
  transform: translatex(-4px);
  opacity: 0.7;
}

.mood-header-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--cream);
  letter-spacing: 0.02em;
}

.mood-content {
  padding: 24px 24px calc(110px + var(--safe-bottom));
  flex: 1;
  overflow: hidden; /* removes all vertical and horizontal scrolling */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── mood summary (below the calendar) ── */
.mood-summary {
  width: 100%;
  align-self: flex-start;
  text-align: left;
  margin-top: 24px;
}

.mood-summary-header {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--cream);
  letter-spacing: 0.01em;
  white-space: nowrap;   /* never wrap onto a second line */
  overflow: hidden;
}

.mood-summary-header .mood-word {
  font-weight: 600;
  /* color is set from script.js to match the mood chosen today */
}

.mood-summary-text {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--cream-dim);
}

.mood-summary-text.fade-in,
.mood-summary-header.fade-in {
  animation: summaryfade 0.5s ease both;
}

/* placeholder state (no mood logged yet today) */
.mood-summary-header.is-placeholder {
  font-style: italic;
  font-weight: 400;
  opacity: 0.85;
}

.mood-summary-text.is-placeholder {
  font-style: italic;
  opacity: 0.8;
}

@keyframes summaryfade {
  from { opacity: 0; transform: translatey(6px); }
  to   { opacity: 1; transform: translatey(0); }
}

.mood-calendar-container {
  width: 100%;
  height: auto; /* allows container to fit naturally without forcing overflow */
  background: rgba(245, 237, 230, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 237, 230, 0.15);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.calendar-header {
  padding: 20px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--cream);
  border-bottom: 1px solid rgba(245, 237, 230, 0.1);
  background: rgba(245, 237, 230, 0.03);
}

.calendar-dates {
  flex: 1;
  padding: 16px; 
  border-radius: 0 0 24px 24px;
  display: grid;
  grid-template-columns: repeat(7, 1fr); /* fits all columns perfectly into the screen width */
  grid-template-rows: max-content repeat(5, 1fr);
  gap: 6px; /* tightens gaps to fit inside a single screen organically */
  align-items: center;
  justify-items: center;
  background: rgba(245, 237, 230, 0.02);
  overflow: hidden; /* ensures no internal horizontal scrolling */
}

.cal-day {
   color: var(--cream-dim);
   font-size: 13px;
   font-weight: 500;
}

.cal-date {
   color: var(--cream);
   font-size: 16px; /* scaled back to fit inside the native grid */
   width: 100%; 
   aspect-ratio: 1 / 1; /* enforces a perfect square format */
   display: flex;
   align-items: center;
   justify-content: center;
   border-radius: 12px; /* scaled down for proportion */
   background: rgba(245, 237, 230, 0.05);
   border: 1px solid rgba(245, 237, 230, 0.15);
   box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.cal-date.today {
   background: var(--burgundy);
   border-color: var(--burgundy-lt);
   font-weight: 600;
   box-shadow: 0 4px 12px rgba(123,45,66,0.4);
}

/* ── mood colors on calendar dates (same palette as the wheel) ── */
.cal-date[class*="mood-"] {
   color: #1a1a1a;
   font-weight: 600;
}

.cal-date.mood-joy {
   background: linear-gradient(145deg, #a8e6cf, #88d8b0);
   border-color: rgba(136, 216, 176, 0.7);
   box-shadow: 0 4px 14px rgba(136, 216, 176, 0.35);
}
.cal-date.mood-happy {
   background: linear-gradient(145deg, #c3f0a2, #a4de7b);
   border-color: rgba(164, 222, 123, 0.7);
   box-shadow: 0 4px 14px rgba(164, 222, 123, 0.35);
}
.cal-date.mood-sad {
   background: linear-gradient(145deg, #fff3b0, #f7e07a);
   border-color: rgba(247, 224, 122, 0.7);
   box-shadow: 0 4px 14px rgba(247, 224, 122, 0.35);
}
.cal-date.mood-sick {
   background: linear-gradient(145deg, #ffd6a5, #ffbc73);
   border-color: rgba(255, 188, 115, 0.7);
   box-shadow: 0 4px 14px rgba(255, 188, 115, 0.35);
}
.cal-date.mood-stunned {
   background: linear-gradient(145deg, #ffb3b3, #f28b8b);
   border-color: rgba(242, 139, 139, 0.7);
   box-shadow: 0 4px 14px rgba(242, 139, 139, 0.35);
}
.cal-date.mood-angry {
   background: linear-gradient(145deg, #f28b8b, #e06c6c);
   border-color: rgba(224, 108, 108, 0.7);
   box-shadow: 0 4px 14px rgba(224, 108, 108, 0.35);
}

/* faint ring so today is still recognizable once it has a mood color */
.cal-date.today[class*="mood-"] {
   outline: 2px solid rgba(245, 237, 230, 0.3);
   outline-offset: 2px;
}

/* bright ring on whichever date is currently being viewed / edited */
.cal-date.selected {
   outline: 2px solid rgba(245, 237, 230, 0.9);
   outline-offset: 2px;
}

/* tappable past dates and today */
.cal-date:not(.future) {
   cursor: pointer;
   -webkit-tap-highlight-color: transparent;
   user-select: none;
   -webkit-user-select: none;
}

/* future dates can't be selected */
.cal-date.future {
   opacity: 0.35;
   box-shadow: none;
   pointer-events: none;
}

.add-mood-btn {
  position: fixed !important;
  bottom: calc(15px - var(--bottom-gap, 0px)) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(245, 237, 230, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 237, 230, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  z-index: 9999 !important;

  /* The button now lives on <body>, so it's only shown on the mood screen */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.35s ease, visibility 0.35s ease;
}

body.mood-active .add-mood-btn {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.add-mood-btn:active {
  transform: translatex(-50%) scale(0.92);
  background: rgba(245, 237, 230, 0.1);
}

.add-mood-btn svg {
  width: 32px;
  height: 32px;
}

/* Plus icon rotation when wheel is open */
.add-mood-btn.wheel-open {
  background: rgba(245, 237, 230, 0.12);
  border-color: rgba(245, 237, 230, 0.35);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 60px rgba(123,45,66,0.15);
}

.add-mood-btn.wheel-open svg {
  transform: rotate(45deg);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.add-mood-btn svg {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ════════════════════════════════════════════════
   MOOD WHEEL — Overlay & Layout
════════════════════════════════════════════════ */
.mood-wheel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  height: var(--app-h, 100%); /* real measured height (set in script.js) */
  z-index: 9998;
  pointer-events: none;
  visibility: hidden;
  /* no opacity fade here: it would stop the scrim's backdrop blur from rendering.
     the scrim fades itself in below. */
  transition: visibility 0.4s ease;
}

.mood-wheel-overlay.active {
  visibility: visible;
  pointer-events: all;
}

/* Scrim: blurs + dims EVERYTHING behind it, stretched far past every edge
   so the home-indicator strip at the very bottom is covered too. */
.mood-wheel-scrim {
  position: absolute;
  top: -200px;
  left: -100px;
  right: -100px;
  bottom: -300px;
  -webkit-backdrop-filter: blur(0px) saturate(1);
  backdrop-filter: blur(0px) saturate(1);
  /* own gpu layer: prevents webkit from blurring only part of the area */
  -webkit-transform: translatez(0);
  transform: translatez(0);
  transition:
    -webkit-backdrop-filter 0.4s ease,
    backdrop-filter 0.4s ease;
}

/* Dimming lives on a child layer so only it fades (opacity on the same
   element as the backdrop-filter can stop the blur from rendering). */
.mood-wheel-scrim::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 85%,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.mood-wheel-overlay.active .mood-wheel-scrim {
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
}

.mood-wheel-overlay.active .mood-wheel-scrim::before {
  opacity: 1;
}

/* guaranteed blur + dim: applied to the screen content itself, so it does not
   depend on the overlay reaching the bottom edge on every iphone. */
body.wheel-open .screen.active {
  -webkit-filter: blur(8px) brightness(0.45);
  filter: blur(8px) brightness(0.45);
}

/* the mood screen's background continues 400px below its bottom edge, so if the
   viewport reports short on some devices there is no undimmed gap. this extension
   is part of the screen, so it gets the same blur + dim. */
#screen-mood::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 400px;
  background: var(--charcoal);
  pointer-events: none;
}

/* while the wheel is open, the page behind everything turns near-black so any
   strip outside the screen matches the dimmed screen. */
html, body {
  transition: background-color 0.4s ease;
}
html.wheel-open,
body.wheel-open {
  background-color: #070707;
}

/* ── Wheel Container ── */
/* Container and track now fill the whole screen, so the mood buttons are
   positioned in screen coordinates around the Add Mood button's center. */
.mood-wheel-container {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none; /* taps on empty space fall through to the scrim (close) */
}

/* ── Wheel Track (holds 6 buttons in an arc) ── */
.mood-wheel-track {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ════════════════════════════════════════════════
   MOOD CIRCLE BUTTONS — Base
════════════════════════════════════════════════ */
.mood-circle-btn {
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: transparent;
  padding: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  /* transform, opacity, left, top all set by JS */
  transition:
    left 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    top 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.4s ease,
    filter 0.3s ease;
  will-change: transform, opacity, left, top;
}

/* Remove transition during drag for responsive feel */
.mood-wheel-track.dragging .mood-circle-btn {
  transition: none !important;
}

/* ── Inner circle (visual ring) ── */
.mood-circle-inner {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  overflow: hidden;
}

.mood-circle-btn:active .mood-circle-inner {
  transform: scale(0.88);
}

/* ── Glow halo behind each circle ── */
.mood-circle-glow {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  z-index: 1;
  opacity: 0.5;
  filter: blur(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  animation: glowBreath 3s ease-in-out infinite alternate;
}

@keyframes glowBreath {
  0%   { transform: scale(0.85); opacity: 0.35; }
  100% { transform: scale(1.1);  opacity: 0.6;  }
}

/* ── Emoji Image ── */
.mood-emoji-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Labels ── */
.mood-circle-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  z-index: 3;
}

/* ════════════════════════════════════════════════
   COLOR CODING — Pastel Gradients
   Green hues (joy, happy) → Yellow (sad, sick) → Red (stunned, angry)
════════════════════════════════════════════════ */

/* 1. JOY — Fresh Pastel Mint Green */
.mood-circle-btn[data-mood="joy"] .mood-circle-inner {
  background: linear-gradient(145deg, #a8e6cf, #88d8b0);
  border: 2px solid rgba(136, 216, 176, 0.6);
  box-shadow:
    0 4px 16px rgba(136, 216, 176, 0.35),
    inset 0 1px 2px rgba(255,255,255,0.3);
}
.mood-circle-btn[data-mood="joy"] .mood-circle-glow {
  background: radial-gradient(circle, rgba(136, 216, 176, 0.5), transparent 70%);
}
.mood-circle-btn[data-mood="joy"] .mood-circle-label { color: #a8e6cf; }

/* 2. HAPPY — Pastel Lime / Spring Green */
.mood-circle-btn[data-mood="happy"] .mood-circle-inner {
  background: linear-gradient(145deg, #c3f0a2, #a4de7b);
  border: 2px solid rgba(164, 222, 123, 0.6);
  box-shadow:
    0 4px 16px rgba(164, 222, 123, 0.35),
    inset 0 1px 2px rgba(255,255,255,0.3);
}
.mood-circle-btn[data-mood="happy"] .mood-circle-glow {
  background: radial-gradient(circle, rgba(164, 222, 123, 0.5), transparent 70%);
}
.mood-circle-btn[data-mood="happy"] .mood-circle-label { color: #c3f0a2; }

/* 3. SAD — Pastel Warm Yellow */
.mood-circle-btn[data-mood="sad"] .mood-circle-inner {
  background: linear-gradient(145deg, #fff3b0, #f7e07a);
  border: 2px solid rgba(247, 224, 122, 0.6);
  box-shadow:
    0 4px 16px rgba(247, 224, 122, 0.35),
    inset 0 1px 2px rgba(255,255,255,0.3);
}
.mood-circle-btn[data-mood="sad"] .mood-circle-glow {
  background: radial-gradient(circle, rgba(247, 224, 122, 0.5), transparent 70%);
}
.mood-circle-btn[data-mood="sad"] .mood-circle-label { color: #fff3b0; }

/* 4. SICK — Pastel Amber / Gold */
.mood-circle-btn[data-mood="sick"] .mood-circle-inner {
  background: linear-gradient(145deg, #ffd6a5, #ffbc73);
  border: 2px solid rgba(255, 188, 115, 0.6);
  box-shadow:
    0 4px 16px rgba(255, 188, 115, 0.35),
    inset 0 1px 2px rgba(255,255,255,0.3);
}
.mood-circle-btn[data-mood="sick"] .mood-circle-glow {
  background: radial-gradient(circle, rgba(255, 188, 115, 0.5), transparent 70%);
}
.mood-circle-btn[data-mood="sick"] .mood-circle-label { color: #ffd6a5; }

/* 5. STUNNED — Pastel Salmon / Coral */
.mood-circle-btn[data-mood="stunned"] .mood-circle-inner {
  background: linear-gradient(145deg, #ffb3b3, #f28b8b);
  border: 2px solid rgba(242, 139, 139, 0.6);
  box-shadow:
    0 4px 16px rgba(242, 139, 139, 0.35),
    inset 0 1px 2px rgba(255,255,255,0.3);
}
.mood-circle-btn[data-mood="stunned"] .mood-circle-glow {
  background: radial-gradient(circle, rgba(242, 139, 139, 0.5), transparent 70%);
}
.mood-circle-btn[data-mood="stunned"] .mood-circle-label { color: #ffb3b3; }

/* 6. ANGRY — Pastel Rose / Red */
.mood-circle-btn[data-mood="angry"] .mood-circle-inner {
  background: linear-gradient(145deg, #f28b8b, #e06c6c);
  border: 2px solid rgba(224, 108, 108, 0.6);
  box-shadow:
    0 4px 16px rgba(224, 108, 108, 0.35),
    inset 0 1px 2px rgba(255,255,255,0.3);
}
.mood-circle-btn[data-mood="angry"] .mood-circle-glow {
  background: radial-gradient(circle, rgba(224, 108, 108, 0.5), transparent 70%);
}
.mood-circle-btn[data-mood="angry"] .mood-circle-label { color: #f28b8b; }

/* ════════════════════════════════════════════════
   HOVER / ACTIVE STATES (desktop & touch)
════════════════════════════════════════════════ */
.mood-circle-btn:hover .mood-circle-inner {
  transform: scale(1.08);
}

.mood-circle-btn:hover .mood-circle-glow {
  opacity: 0.75;
  transform: scale(1.2);
}

.mood-circle-btn:active .mood-circle-glow {
  opacity: 0.9;
  transform: scale(1.35);
}

/* Ripple overlay on tap */
.mood-circle-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transform: scale(0);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.3s ease;
  z-index: 5;
}

.mood-circle-btn:active::after {
  transform: scale(1.4);
  opacity: 1;
  transition: none;
}

/* ════════════════════════════════════════════════
   WHEEL SWIPE INDICATOR
════════════════════════════════════════════════ */
.mood-wheel-container::before {
  display: none;
}

/* ── Floating particles for depth ── */
@keyframes moodWheelFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%      { transform: translateY(-6px) rotate(2deg); }
  75%      { transform: translateY(4px) rotate(-1deg); }
}

/* Active wheel dragging state */
.mood-wheel-track.dragging {
  transition: none !important;
  cursor: grabbing;
}

