@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&family=Fredoka:wght@500;700&family=Nunito:wght@600;800&family=Outfit:wght@500;700;800&family=Space+Grotesk:wght@500;700&display=swap");

:root,
html[data-theme="unicorn"] {
  --font-main: "Baloo 2", "Segoe UI", sans-serif;
  --bg: #f4f8ff;
  --card: #fff8ff;
  --ink: #3a1f63;
  --muted: #5f327f;
  --accent: #8a46ff;
  --accent-soft: #e6ecff;
  --ok: #2b9851;
  --danger: #c0392b;
  --line: #e8c8ff;
  --body-bg: linear-gradient(160deg, #ff86da 0%, #f7a0ff 34%, #cd8fff 68%, #9fa5ff 100%);
  --blob-opacity: 0.4;
  --blob-bg:
    radial-gradient(circle at 12% 20%, #ffd3f7cc 0 70px, transparent 73px),
    radial-gradient(circle at 80% 15%, #efbcffb0 0 90px, transparent 95px),
    radial-gradient(circle at 25% 82%, #ffdcffbf 0 62px, transparent 66px),
    radial-gradient(circle at 92% 72%, #d7bcffbf 0 76px, transparent 82px);
  --footer-emojis: "💖   💜   ✨   🌈   ⭐   💖   💜   ✨";
  --footer-opacity: 0.75;
  --sticker-opacity: 1;
  --sticker-shadow: drop-shadow(0 6px 8px rgba(93, 47, 180, 0.28));
  --weather-bg: linear-gradient(90deg, #ffd9f7 0%, #efceff 100%);
  --weather-border: #e4b4ff;
  --soft-panel: #fff0ff;
  --soft-panel-border: #d9a8ff;
  --countdown-bg: linear-gradient(90deg, #ffe8f8 0%, #f0d9ff 100%);
  --countdown-ink: #6b2fc9;
  --event-bg: linear-gradient(90deg, #fff8ff 0%, #f6ebff 100%);
  --event-border: #e4c4ff;
  --event-now-bg: linear-gradient(90deg, #ffe8f8 0%, #ead4ff 100%);
  --emoji-tile-bg: linear-gradient(145deg, #ffe3f7 0%, #e8d4ff 100%);
  --nav-btn-bg: linear-gradient(140deg, #7ab8ff 0%, #5a7dff 100%);
  --mode-btn-bg: linear-gradient(140deg, #ffd4f3 0%, #c9a8ff 100%);
  --mode-btn-ink: #5f327f;
  --timer-btn-bg: linear-gradient(140deg, #ff97dc 0%, #bd79ff 100%);
}

html[data-theme="minimal"] {
  --font-main: "Outfit", "Segoe UI", sans-serif;
  --bg: #f3f4f6;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --accent: #374151;
  --accent-soft: #eef0f3;
  --line: #e5e7eb;
  --body-bg: linear-gradient(180deg, #f7f7f8 0%, #eceef2 100%);
  --blob-opacity: 0;
  --blob-bg: none;
  --footer-emojis: "";
  --footer-opacity: 0;
  --sticker-opacity: 0;
  --sticker-shadow: none;
  --weather-bg: #f3f4f6;
  --weather-border: #e5e7eb;
  --soft-panel: #f9fafb;
  --soft-panel-border: #d1d5db;
  --countdown-bg: #f3f4f6;
  --countdown-ink: #111827;
  --event-bg: #fafafa;
  --event-border: #e5e7eb;
  --event-now-bg: #eef2ff;
  --emoji-tile-bg: #f3f4f6;
  --nav-btn-bg: linear-gradient(140deg, #4b5563 0%, #1f2937 100%);
  --mode-btn-bg: #e5e7eb;
  --mode-btn-ink: #111827;
  --timer-btn-bg: linear-gradient(140deg, #6b7280 0%, #374151 100%);
}

html[data-theme="space"] {
  --font-main: "Space Grotesk", "Segoe UI", sans-serif;
  --bg: #0b1220;
  --card: #1a2438;
  --ink: #ffffff;
  --muted: #d7e3ff;
  --accent: #7dd3fc;
  --accent-soft: #1e293b;
  --line: #3d527a;
  --body-bg: linear-gradient(165deg, #070b16 0%, #121b33 45%, #1a1040 100%);
  --blob-opacity: 0.55;
  --blob-bg:
    radial-gradient(circle at 18% 22%, #ffffff33 0 2px, transparent 3px),
    radial-gradient(circle at 72% 18%, #ffffff55 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 40% 70%, #ffffff40 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 85% 62%, #a5b4fc55 0 80px, transparent 120px),
    radial-gradient(circle at 20% 80%, #38bdf855 0 70px, transparent 110px);
  --footer-emojis: "🚀   ⭐   🌙   🪐   ✨   🛸   ⭐   🌌";
  --footer-opacity: 0.85;
  --sticker-opacity: 1;
  --sticker-shadow: drop-shadow(0 0 10px rgba(125, 211, 252, 0.45));
  --weather-bg: linear-gradient(90deg, #243352 0%, #3b3480 100%);
  --weather-border: #5b6f99;
  --soft-panel: #22304a;
  --soft-panel-border: #4a628c;
  --countdown-bg: linear-gradient(90deg, #243352 0%, #3b3480 100%);
  --countdown-ink: #ffffff;
  --event-bg: linear-gradient(90deg, #22304a 0%, #2a2558 100%);
  --event-border: #4a628c;
  --event-now-bg: linear-gradient(90deg, #0284c7 0%, #4f46e5 100%);
  --emoji-tile-bg: linear-gradient(145deg, #2a3a5c 0%, #3b3480 100%);
  --nav-btn-bg: linear-gradient(140deg, #38bdf8 0%, #6366f1 100%);
  --mode-btn-bg: linear-gradient(140deg, #3b3480 0%, #243352 100%);
  --mode-btn-ink: #ffffff;
  --timer-btn-bg: linear-gradient(140deg, #22d3ee 0%, #818cf8 100%);
}

html[data-theme="space"] .reset-hint,
html[data-theme="space"] .calendar-week-free-day,
html[data-theme="space"] .event-location,
html[data-theme="space"] .calendar-empty {
  color: var(--muted);
}

html[data-theme="space"] .calendar-empty {
  background: #22304a;
  border-color: #4a628c;
}

html[data-theme="space"] .progress {
  color: #d1fae5;
  background: #14532d;
  border-color: #22c55e;
}

html[data-theme="space"] .event-title,
html[data-theme="space"] .step-text,
html[data-theme="space"] h1,
html[data-theme="space"] h2,
html[data-theme="space"] h3 {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

html[data-theme="space"] .calendar-event.is-now .event-title,
html[data-theme="space"] .calendar-event.is-now .event-time,
html[data-theme="space"] .calendar-event.is-now .event-location {
  color: #ffffff;
}

html[data-theme="rainbow"] {
  --font-main: "Fredoka", "Baloo 2", sans-serif;
  --bg: #fff9e8;
  --card: #ffffff;
  --ink: #4a1d6a;
  --muted: #7a3d9a;
  --accent: #ff4d8d;
  --accent-soft: #ffe8f4;
  --line: #ffd08a;
  --body-bg: linear-gradient(135deg, #ff8fab 0%, #ffd166 28%, #8ce99a 55%, #74c0fc 78%, #b197fc 100%);
  --blob-opacity: 0.35;
  --blob-bg:
    radial-gradient(circle at 15% 18%, #ffffffaa 0 80px, transparent 85px),
    radial-gradient(circle at 78% 22%, #ffffff88 0 70px, transparent 75px),
    radial-gradient(circle at 30% 78%, #ffffff99 0 60px, transparent 65px),
    radial-gradient(circle at 88% 70%, #ffffff77 0 75px, transparent 80px);
  --footer-emojis: "🌈   🎉   ⭐   🎈   🦄   🍭   ✨   🎊";
  --footer-opacity: 0.9;
  --sticker-opacity: 1;
  --sticker-shadow: drop-shadow(0 6px 8px rgba(255, 77, 141, 0.3));
  --weather-bg: linear-gradient(90deg, #fff3bf 0%, #ffc9de 50%, #d0bfff 100%);
  --weather-border: #ffb703;
  --soft-panel: #fff8e7;
  --soft-panel-border: #ffc2d4;
  --countdown-bg: linear-gradient(90deg, #fff3bf 0%, #ffc9de 50%, #b2f2bb 100%);
  --countdown-ink: #5b2a86;
  --event-bg: linear-gradient(90deg, #fff9db 0%, #ffe3ec 50%, #e5dbff 100%);
  --event-border: #ffc078;
  --event-now-bg: linear-gradient(90deg, #ffd43b 0%, #ff6b9d 50%, #845ef7 100%);
  --emoji-tile-bg: linear-gradient(145deg, #fff3bf 0%, #ffc9de 100%);
  --nav-btn-bg: linear-gradient(140deg, #ff6b9d 0%, #845ef7 100%);
  --mode-btn-bg: linear-gradient(140deg, #ffd43b 0%, #ff922b 100%);
  --mode-btn-ink: #5b2a86;
  --timer-btn-bg: linear-gradient(140deg, #ff6b9d 0%, #4dabf7 100%);
}

html[data-theme="icecream"] {
  --font-main: "Nunito", "Segoe UI", sans-serif;
  --bg: #fff5f7;
  --card: #fffaf8;
  --ink: #6b3a4a;
  --muted: #a66b7a;
  --accent: #f783ac;
  --accent-soft: #ffe8f0;
  --line: #ffc9de;
  --body-bg: linear-gradient(160deg, #ffd6e8 0%, #fff0f6 30%, #e3fafc 65%, #fff3bf 100%);
  --blob-opacity: 0.45;
  --blob-bg:
    radial-gradient(circle at 14% 20%, #ffc9decc 0 75px, transparent 80px),
    radial-gradient(circle at 82% 16%, #a5f3fccc 0 85px, transparent 90px),
    radial-gradient(circle at 28% 80%, #fff3bfcc 0 65px, transparent 70px),
    radial-gradient(circle at 90% 72%, #ffd8a8cc 0 70px, transparent 75px);
  --footer-emojis: "🍦   🍨   🧁   🍓   🍒   🍦   🍨   🧁";
  --footer-opacity: 0.85;
  --sticker-opacity: 1;
  --sticker-shadow: drop-shadow(0 6px 8px rgba(247, 131, 172, 0.3));
  --weather-bg: linear-gradient(90deg, #ffe8f0 0%, #e3fafc 100%);
  --weather-border: #ffc9de;
  --soft-panel: #fff0f6;
  --soft-panel-border: #ffc9de;
  --countdown-bg: linear-gradient(90deg, #ffe8f0 0%, #fff3bf 100%);
  --countdown-ink: #c2255c;
  --event-bg: linear-gradient(90deg, #fff5f7 0%, #e3fafc 100%);
  --event-border: #ffc9de;
  --event-now-bg: linear-gradient(90deg, #ffc9de 0%, #a5f3fc 100%);
  --emoji-tile-bg: linear-gradient(145deg, #ffe8f0 0%, #fff3bf 100%);
  --nav-btn-bg: linear-gradient(140deg, #f783ac 0%, #66d9e8 100%);
  --mode-btn-bg: linear-gradient(140deg, #ffc9de 0%, #fff3bf 100%);
  --mode-btn-ink: #a61e4d;
  --timer-btn-bg: linear-gradient(140deg, #f783ac 0%, #ffa94d 100%);
}

html[data-theme="ocean"] {
  --font-main: "Nunito", "Segoe UI", sans-serif;
  --bg: #e7f5ff;
  --card: #f0f9ff;
  --ink: #0b4f6c;
  --muted: #1479a8;
  --accent: #1c7ed6;
  --accent-soft: #d0ebff;
  --line: #a5d8ff;
  --body-bg: linear-gradient(165deg, #74c0fc 0%, #4dabf7 35%, #22b8cf 70%, #15aabf 100%);
  --blob-opacity: 0.4;
  --blob-bg:
    radial-gradient(circle at 16% 20%, #ffffff99 0 80px, transparent 85px),
    radial-gradient(circle at 78% 18%, #a5f3fccc 0 90px, transparent 95px),
    radial-gradient(circle at 30% 78%, #ffffff88 0 70px, transparent 75px),
    radial-gradient(circle at 88% 70%, #99e9f2cc 0 75px, transparent 80px);
  --footer-emojis: "🌊   🐠   🐚   🐙   ⭐   🦈   🦀   🌊";
  --footer-opacity: 0.85;
  --sticker-opacity: 1;
  --sticker-shadow: drop-shadow(0 6px 8px rgba(12, 100, 150, 0.3));
  --weather-bg: linear-gradient(90deg, #d0ebff 0%, #c3fae8 100%);
  --weather-border: #74c0fc;
  --soft-panel: #e3fafc;
  --soft-panel-border: #66d9e8;
  --countdown-bg: linear-gradient(90deg, #d0ebff 0%, #c3fae8 100%);
  --countdown-ink: #0b7285;
  --event-bg: linear-gradient(90deg, #e7f5ff 0%, #e3fafc 100%);
  --event-border: #a5d8ff;
  --event-now-bg: linear-gradient(90deg, #74c0fc 0%, #38d9a9 100%);
  --emoji-tile-bg: linear-gradient(145deg, #d0ebff 0%, #c3fae8 100%);
  --nav-btn-bg: linear-gradient(140deg, #228be6 0%, #15aabf 100%);
  --mode-btn-bg: linear-gradient(140deg, #a5d8ff 0%, #99e9f2 100%);
  --mode-btn-ink: #0b4f6c;
  --timer-btn-bg: linear-gradient(140deg, #339af0 0%, #20c997 100%);
}

html[data-theme="jungle"] {
  --font-main: "Fredoka", "Baloo 2", sans-serif;
  --bg: #ebfbee;
  --card: #f4fce3;
  --ink: #2b4a1e;
  --muted: #5c7a3a;
  --accent: #2f9e44;
  --accent-soft: #d8f5a2;
  --line: #b2f2bb;
  --body-bg: linear-gradient(160deg, #8ce99a 0%, #69db7c 35%, #51cf66 65%, #37b24d 100%);
  --blob-opacity: 0.35;
  --blob-bg:
    radial-gradient(circle at 18% 22%, #ffffff88 0 75px, transparent 80px),
    radial-gradient(circle at 80% 16%, #d8f5a2cc 0 85px, transparent 90px),
    radial-gradient(circle at 25% 80%, #fff3bfaa 0 65px, transparent 70px),
    radial-gradient(circle at 90% 72%, #b2f2bbcc 0 70px, transparent 75px);
  --footer-emojis: "🌴   🐵   🦋   🦜   🌿   🐯   🌺   🌴";
  --footer-opacity: 0.85;
  --sticker-opacity: 1;
  --sticker-shadow: drop-shadow(0 6px 8px rgba(37, 100, 40, 0.3));
  --weather-bg: linear-gradient(90deg, #d8f5a2 0%, #b2f2bb 100%);
  --weather-border: #8ce99a;
  --soft-panel: #ebfbee;
  --soft-panel-border: #8ce99a;
  --countdown-bg: linear-gradient(90deg, #d8f5a2 0%, #fff3bf 100%);
  --countdown-ink: #2b8a3e;
  --event-bg: linear-gradient(90deg, #f4fce3 0%, #ebfbee 100%);
  --event-border: #b2f2bb;
  --event-now-bg: linear-gradient(90deg, #a9e34b 0%, #51cf66 100%);
  --emoji-tile-bg: linear-gradient(145deg, #d8f5a2 0%, #fff3bf 100%);
  --nav-btn-bg: linear-gradient(140deg, #37b24d 0%, #74b816 100%);
  --mode-btn-bg: linear-gradient(140deg, #b2f2bb 0%, #d8f5a2 100%);
  --mode-btn-ink: #2b4a1e;
  --timer-btn-bg: linear-gradient(140deg, #40c057 0%, #94d82d 100%);
}

html[data-theme="dinosaur"] {
  --font-main: "Baloo 2", "Segoe UI", sans-serif;
  --bg: #f8f1e3;
  --card: #fff8e7;
  --ink: #4a3728;
  --muted: #7a5c42;
  --accent: #d9480f;
  --accent-soft: #ffe8cc;
  --line: #e8c39e;
  --body-bg: linear-gradient(160deg, #d8f5a2 0%, #c0eb75 30%, #ffe8a1 65%, #ffc078 100%);
  --blob-opacity: 0.4;
  --blob-bg:
    radial-gradient(circle at 15% 20%, #fff3bfcc 0 75px, transparent 80px),
    radial-gradient(circle at 80% 18%, #d8f5a2cc 0 85px, transparent 90px),
    radial-gradient(circle at 28% 78%, #ffd8a8cc 0 65px, transparent 70px),
    radial-gradient(circle at 88% 70%, #e9ecefcc 0 70px, transparent 75px);
  --footer-emojis: "🦕   🦖   🦴   🌋   🥚   🦕   🦖   🌴";
  --footer-opacity: 0.85;
  --sticker-opacity: 1;
  --sticker-shadow: drop-shadow(0 6px 8px rgba(120, 70, 30, 0.3));
  --weather-bg: linear-gradient(90deg, #fff3bf 0%, #d8f5a2 100%);
  --weather-border: #e8c39e;
  --soft-panel: #fff4e6;
  --soft-panel-border: #ffc078;
  --countdown-bg: linear-gradient(90deg, #fff3bf 0%, #ffd8a8 100%);
  --countdown-ink: #d9480f;
  --event-bg: linear-gradient(90deg, #fff8e7 0%, #f4fce3 100%);
  --event-border: #e8c39e;
  --event-now-bg: linear-gradient(90deg, #ffc078 0%, #a9e34b 100%);
  --emoji-tile-bg: linear-gradient(145deg, #fff3bf 0%, #d8f5a2 100%);
  --nav-btn-bg: linear-gradient(140deg, #e8590c 0%, #74b816 100%);
  --mode-btn-bg: linear-gradient(140deg, #ffd8a8 0%, #d8f5a2 100%);
  --mode-btn-ink: #4a3728;
  --timer-btn-bg: linear-gradient(140deg, #fd7e14 0%, #94d82d 100%);
}

html[data-theme="sports"] {
  --font-main: "Outfit", "Segoe UI", sans-serif;
  --bg: #f1f8e9;
  --card: #ffffff;
  --ink: #1b4332;
  --muted: #2d6a4f;
  --accent: #2b8a3e;
  --accent-soft: #d8f5a2;
  --line: #b7e4c7;
  --body-bg: linear-gradient(160deg, #52b788 0%, #40916c 40%, #2d6a4f 75%, #1b4332 100%);
  --blob-opacity: 0.3;
  --blob-bg:
    radial-gradient(circle at 20% 20%, #ffffff66 0 70px, transparent 75px),
    radial-gradient(circle at 75% 25%, #d8f5a255 0 90px, transparent 95px),
    radial-gradient(circle at 30% 75%, #ffffff55 0 60px, transparent 65px),
    radial-gradient(circle at 85% 70%, #95d5b255 0 80px, transparent 85px);
  --footer-emojis: "⚽   🏀   🏐   🎾   🏆   🏃   🥇   ⚽";
  --footer-opacity: 0.85;
  --sticker-opacity: 1;
  --sticker-shadow: drop-shadow(0 6px 8px rgba(27, 67, 50, 0.35));
  --weather-bg: linear-gradient(90deg, #d8f3dc 0%, #b7e4c7 100%);
  --weather-border: #95d5b2;
  --soft-panel: #d8f3dc;
  --soft-panel-border: #95d5b2;
  --countdown-bg: linear-gradient(90deg, #d8f3dc 0%, #fff3bf 100%);
  --countdown-ink: #1b4332;
  --event-bg: linear-gradient(90deg, #f1f8e9 0%, #e9f5ee 100%);
  --event-border: #b7e4c7;
  --event-now-bg: linear-gradient(90deg, #95d5b2 0%, #74c69d 100%);
  --emoji-tile-bg: linear-gradient(145deg, #d8f3dc 0%, #fff3bf 100%);
  --nav-btn-bg: linear-gradient(140deg, #2d6a4f 0%, #40916c 100%);
  --mode-btn-bg: linear-gradient(140deg, #b7e4c7 0%, #d8f3dc 100%);
  --mode-btn-ink: #1b4332;
  --timer-btn-bg: linear-gradient(140deg, #40916c 0%, #f4a261 100%);
}

html[data-theme="holiday"] {
  --font-main: "Fredoka", "Baloo 2", sans-serif;
  --bg: #fff5f5;
  --card: #fffaf0;
  --ink: #5c1a1a;
  --muted: #9b2c2c;
  --accent: #c92a2a;
  --accent-soft: #ffe3e3;
  --line: #ffc9c9;
  --body-bg: linear-gradient(155deg, #c92a2a 0%, #e03131 28%, #2f9e44 62%, #1864ab 100%);
  --blob-opacity: 0.4;
  --blob-bg:
    radial-gradient(circle at 15% 18%, #ffffff99 0 70px, transparent 75px),
    radial-gradient(circle at 78% 20%, #fff3bfcc 0 85px, transparent 90px),
    radial-gradient(circle at 28% 78%, #ffe3e3cc 0 65px, transparent 70px),
    radial-gradient(circle at 88% 70%, #d3f9d8cc 0 75px, transparent 80px);
  --footer-emojis: "🎄   🎁   ⛄   ⭐   🦌   🔔   ❄️   🎄";
  --footer-opacity: 0.9;
  --sticker-opacity: 1;
  --sticker-shadow: drop-shadow(0 6px 8px rgba(150, 30, 30, 0.35));
  --weather-bg: linear-gradient(90deg, #ffe3e3 0%, #d3f9d8 50%, #fff3bf 100%);
  --weather-border: #ffa8a8;
  --soft-panel: #fff5f5;
  --soft-panel-border: #ffa8a8;
  --countdown-bg: linear-gradient(90deg, #ffe3e3 0%, #d3f9d8 100%);
  --countdown-ink: #c92a2a;
  --event-bg: linear-gradient(90deg, #fff5f5 0%, #ebfbee 100%);
  --event-border: #ffc9c9;
  --event-now-bg: linear-gradient(90deg, #ff6b6b 0%, #51cf66 100%);
  --emoji-tile-bg: linear-gradient(145deg, #ffe3e3 0%, #d3f9d8 100%);
  --nav-btn-bg: linear-gradient(140deg, #c92a2a 0%, #2f9e44 100%);
  --mode-btn-bg: linear-gradient(140deg, #ffc9c9 0%, #b2f2bb 100%);
  --mode-btn-ink: #5c1a1a;
  --timer-btn-bg: linear-gradient(140deg, #e03131 0%, #37b24d 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--ink);
  background: var(--body-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--blob-opacity);
  background: var(--blob-bg);
}

body::after {
  content: var(--footer-emojis);
  position: fixed;
  left: -5%;
  right: -5%;
  bottom: 8px;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  letter-spacing: 18px;
  text-align: center;
  opacity: var(--footer-opacity);
  pointer-events: none;
  z-index: 0;
  animation: critter-float 12s linear infinite;
}

.fun-stickers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--sticker-opacity);
}

.sticker {
  position: absolute;
  font-size: clamp(2rem, 4.2vw, 3.5rem);
  filter: var(--sticker-shadow);
  animation: sticker-bob 5s ease-in-out infinite;
}

.s1 { top: 7%; left: 3%; }
.s2 { top: 16%; right: 5%; animation-delay: 1.1s; }
.s3 { bottom: 14%; left: 5%; animation-delay: 0.7s; }
.s4 { bottom: 8%; right: 4%; animation-delay: 1.8s; }
.s5 { top: 44%; left: 1.2%; animation-delay: 0.3s; }
.s6 { top: 50%; right: 2%; animation-delay: 1.5s; }

.app {
  max-width: 980px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 10px;
  padding-top: 52px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.corner-controls {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  z-index: 30;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.corner-button {
  position: relative;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 999px;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(70, 30, 120, 0.25);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.corner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.corner-edit {
  background: linear-gradient(140deg, #9b6bff 0%, #7a4dff 100%);
}

.corner-view {
  background: linear-gradient(140deg, #5ec8ff 0%, #4a8dff 100%);
}

.corner-view[aria-pressed="true"] {
  background: linear-gradient(140deg, #ffd56a 0%, #ff9f4a 100%);
  transform: scale(1.06);
}

.corner-edit[aria-pressed="true"] {
  background: linear-gradient(140deg, #ff8fd4 0%, #c77bff 100%);
  transform: scale(1.06);
}

.corner-baby {
  background: linear-gradient(140deg, #7bdff2 0%, #b388ff 100%);
}

.corner-reset {
  background: linear-gradient(140deg, #ff7f9f 0%, #e74c3c 100%);
}

.corner-reset.is-holding {
  transform: scale(0.96);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.65);
}

.hold-progress {
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  pointer-events: none;
  opacity: 0;
}

.corner-reset.is-holding .hold-progress {
  opacity: 1;
  border-color: transparent;
  border-top-color: #fff;
  animation: hold-ring-spin 2s linear forwards;
}

@keyframes hold-ring-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.reset-hint {
  position: absolute;
  top: 46px;
  right: 0;
  width: max-content;
  max-width: 52vw;
  margin: 0;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.corner-controls.show-reset-hint .reset-hint {
  opacity: 1;
}

.topbar {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 6px 18px rgba(35, 60, 120, 0.08);
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  text-align: center;
  letter-spacing: 0.6px;
}

.weather-strip {
  margin-top: 10px;
  border: 2px solid var(--weather-border);
  background: var(--weather-bg);
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  font-weight: 700;
}

.weather-emoji {
  font-size: 1.4rem;
}

.calendar-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.calendar-card {
  flex: 1;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(35, 60, 120, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calendar-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.calendar-header h2 {
  margin: 0;
  text-align: center;
  font-size: clamp(1.2rem, 3.8vw, 1.85rem);
  line-height: 1.15;
  flex: 1;
}

.calendar-day-nav {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.calendar-mode-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: center;
  margin: 0;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: var(--mode-btn-bg);
  color: var(--mode-btn-ink);
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(70, 30, 120, 0.18);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.calendar-mode-toggle[aria-pressed="true"] {
  background: var(--nav-btn-bg);
  color: #fff;
}

.calendar-mode-toggle:active {
  transform: scale(0.97);
}

#calendar-view-mode-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.calendar-nav-button {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 999px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
  color: #fff;
  background: var(--nav-btn-bg);
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(70, 30, 120, 0.22);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.calendar-nav-button:active {
  transform: scale(0.96);
}

.calendar-status {
  margin: 6px 0 0;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.95rem;
}

.calendar-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 4px 2px 8px;
}

.calendar-timeline.is-week-view {
  gap: 14px;
}

.calendar-week-day {
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: 10px 10px 8px;
}

.calendar-week-day.is-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
  background: var(--event-now-bg);
}

.calendar-week-day-title {
  margin: 0 0 8px;
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 800;
  color: var(--muted);
}

.calendar-week-day.is-today .calendar-week-day-title {
  color: var(--ink);
}

.calendar-week-day-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-week-free-day {
  margin: 0 0 2px;
  padding: 4px 2px 2px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}

.calendar-empty {
  text-align: center;
  padding: 28px 12px;
  border: 2px dashed var(--soft-panel-border);
  border-radius: 16px;
  background: var(--soft-panel);
  font-weight: 700;
  color: var(--muted);
}

.calendar-empty p {
  margin: 0 0 8px;
}

.calendar-event {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 2px solid var(--event-border);
  background: var(--event-bg);
  position: relative;
}

.calendar-event.is-now {
  border-color: var(--accent);
  background: var(--event-now-bg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.calendar-event.is-past {
  opacity: 0.62;
}

.calendar-event.is-all-day {
  grid-template-columns: 72px 1fr;
}

.event-emoji-wrap {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: var(--emoji-tile-bg);
  border: 2px solid var(--line);
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.65);
}

.event-body {
  min-width: 0;
}

.event-time {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--muted);
}

.event-title {
  margin: 0;
  font-size: clamp(1.05rem, 3.5vw, 1.35rem);
  font-weight: 800;
  line-height: 1.2;
  word-break: break-word;
  color: var(--ink);
}

.event-location {
  margin: 4px 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.event-now-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8fd4 0%, #9b5cff 100%);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.calendar-error {
  border-color: #f5b7b1;
  background: #fff3f2;
  color: #9b3b32;
}

.timer-panel {
  border: 2px dashed var(--soft-panel-border);
  border-radius: 14px;
  background: var(--soft-panel);
  padding: 8px;
}

.bottom-timer-panel {
  margin-top: auto;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}

.timer-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.timer-footer label {
  font-weight: 800;
  font-size: 1rem;
}

.timer-controls {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.timer-controls input[type="time"] {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 1rem;
  color: var(--ink);
  width: 100%;
}

.timer-icon-button {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  background: var(--timer-btn-bg);
  color: #fff;
  box-shadow: 0 4px 10px rgba(120, 45, 180, 0.28);
}

.timer-icon-button[aria-pressed="true"] {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px rgba(138, 70, 255, 0.35);
}

.timer-status {
  margin: 0;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.leave-countdown {
  margin: 0;
  text-align: center;
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  font-weight: 800;
  color: var(--countdown-ink);
  background: var(--countdown-bg);
  border: 3px solid var(--soft-panel-border);
  border-radius: 16px;
  padding: 6px 12px;
  letter-spacing: 0.5px;
}

.leave-countdown.leave-now {
  color: #fff;
  background: linear-gradient(90deg, #ff6eb8 0%, #9b5cff 100%);
  border-color: #8a46ff;
  animation: pulse-leave 1s ease-in-out infinite alternate;
}

.unicorn-track-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.track-start,
.track-end {
  font-size: 1.35rem;
}

.unicorn-track {
  position: relative;
  border-radius: 999px;
  border: 2px solid #e0b7ff;
  height: 28px;
  background: linear-gradient(90deg, #ffeaff 0%, #f4dfff 45%, #e6ccff 100%);
  overflow: hidden;
}

.unicorn-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff91d6 0%, #c987ff 100%);
  transition: width 0.5s linear;
}

.unicorn-runner {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  font-size: 1.4rem;
  transition: left 0.5s linear;
  filter: drop-shadow(0 2px 2px rgba(70, 25, 100, 0.25));
}

button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.primary-button,
.secondary-button {
  background: var(--accent);
  color: white;
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

.checklists {
  display: block;
  flex: 1;
}

.shared-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(70, 35, 120, 0.12);
}

.shared-card h2 {
  margin: 0;
  text-align: center;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.shared-labels-row {
  display: grid;
  grid-template-columns: 110px 1fr 110px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--muted);
}

.shared-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shared-step-row {
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--event-bg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 110px 1fr 110px;
  align-items: center;
  min-height: 58px;
}

.shared-step-row.abby-done {
  border-left-color: #4eaf70;
  border-left-width: 6px;
}

.shared-step-row.penny-done {
  border-right-color: #4eaf70;
  border-right-width: 6px;
}

.shared-step-row.both-done .step-middle {
  background: linear-gradient(90deg, #d8ffe4 0%, #edfff4 100%);
}

.side-check {
  display: flex;
  justify-content: center;
}

.side-check input[type="checkbox"] {
  width: 32px;
  height: 32px;
  accent-color: var(--ok);
}

.step-middle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 4px 0;
}

.emoji {
  font-size: 2rem;
  min-width: 2.3rem;
  text-align: center;
}

.step-text {
  font-weight: 800;
  font-size: clamp(1.25rem, 2.3vw, 1.75rem);
  line-height: 1.1;
  text-align: center;
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.progress {
  margin: 0;
  text-align: center;
  font-weight: 800;
  color: #2f6a4d;
  background: #eefef4;
  border: 2px solid #bce3ca;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 1.05rem;
}

.edit-panel {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 12px;
}

.edit-panel h2 {
  margin: 0 0 6px;
}

.edit-panel p {
  margin: 0 0 10px;
  color: var(--muted);
}

.theme-panel {
  border: 2px dashed var(--soft-panel-border);
  border-radius: 14px;
  background: var(--soft-panel);
  padding: 10px;
  margin-bottom: 12px;
}

.theme-panel h3 {
  margin: 0 0 4px;
}

.theme-panel > p {
  margin: 0 0 10px;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.theme-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 72px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-align: left;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.theme-choice .theme-choice-emoji {
  font-size: 1.4rem;
  line-height: 1;
}

.theme-choice .theme-choice-name {
  font-size: 0.95rem;
}

.theme-choice .theme-choice-blurb {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.theme-choice[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.step-editor-list {
  display: grid;
  gap: 8px;
}

.preset-panel {
  border: 2px dashed #d7a8ff;
  background: #fff0ff;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
}

.preset-panel h3 {
  margin: 0 0 4px;
}

.preset-panel p {
  margin: 0 0 8px;
}

.preset-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 8px;
}

.preset-controls select,
.preset-controls input {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  font-size: 1rem;
  min-width: 0;
}

.sound-preview-panel {
  border: 2px dashed #9fd0ff;
  background: #f2f8ff;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
}

.sound-preview-panel h3 {
  margin: 0 0 4px;
}

.sound-preview-panel p {
  margin: 0 0 8px;
}

.celebration-preview-panel {
  border: 2px dashed #ffc96a;
  background: #fff9ef;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
}

.celebration-preview-panel h3 {
  margin: 0 0 4px;
}

.celebration-preview-panel p {
  margin: 0 0 8px;
}

.celebration-preview-button {
  background: linear-gradient(90deg, #ffe9b8 0%, #ffd6f3 100%);
  border-color: #ffc56a;
}

.sound-preview-list {
  display: grid;
  gap: 8px;
}

.sound-preview-button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  background: linear-gradient(90deg, #dff0ff 0%, #efe6ff 100%);
  border: 2px solid #b8d9ff;
  color: var(--ink);
  padding: 10px 12px;
}

.sound-preview-button:active {
  transform: scale(0.98);
}

.sound-preview-emoji {
  font-size: 1.5rem;
}

.sound-preview-label {
  font-weight: 800;
}

.sound-preview-play {
  font-size: 1.2rem;
}

.step-editor-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 8px;
}

.step-editor-row input {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  font-size: 1rem;
}

.remove-step-button {
  background: #ffe9e6;
  color: #852f25;
}

.add-step-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 8px;
}

.add-step-row input {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  font-size: 1rem;
}

.hidden {
  display: none;
}

.celebration {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(14, 24, 50, 0.72);
  z-index: 20;
  overflow: hidden;
}

.celebration.hidden {
  display: none;
}

.celebration-card {
  position: relative;
  z-index: 2;
  background: white;
  border-radius: 18px;
  padding: 24px;
  border: 3px solid var(--accent);
  text-align: center;
  width: min(90vw, 540px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: card-pop 0.55s cubic-bezier(0.2, 1.2, 0.3, 1);
}

.celebration-badge {
  margin: 0 0 8px;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(90deg, #ffe3f7 0%, #ead0ff 100%);
  border: 2px solid #d7a8ff;
  animation: badge-wiggle 0.8s ease-in-out infinite alternate;
}

.emoji-rain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.rain-drop {
  position: absolute;
  top: -10%;
  animation: emoji-fall linear forwards;
  filter: drop-shadow(0 2px 3px rgba(60, 20, 100, 0.25));
}

@keyframes card-pop {
  0% {
    transform: scale(0.6) rotate(-6deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.06) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

@keyframes badge-wiggle {
  from {
    transform: rotate(-3deg) scale(1);
  }
  to {
    transform: rotate(3deg) scale(1.04);
  }
}

@keyframes emoji-fall {
  0% {
    transform: translateY(-10vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(115vh) rotate(360deg);
    opacity: 0.85;
  }
}

.theme-unicorn-stampede { background: rgba(80, 20, 90, 0.78); }
.theme-cheetah-sprint { background: rgba(90, 50, 10, 0.78); }
.theme-rainbow-blast { background: rgba(40, 30, 100, 0.78); }
.theme-disco-party { background: rgba(20, 10, 60, 0.82); }
.theme-rocket-launch { background: rgba(10, 20, 70, 0.82); }
.theme-candy-explosion { background: rgba(90, 20, 60, 0.78); }
.theme-superhero { background: rgba(20, 30, 90, 0.82); }
.theme-jungle-roar { background: rgba(20, 60, 30, 0.78); }
.theme-mermaid-magic { background: rgba(10, 50, 80, 0.78); }
.theme-mega-confetti { background: rgba(60, 20, 80, 0.78); }

.card-unicorn-stampede { border-color: #ff7fd4; background: linear-gradient(180deg, #fff6fd 0%, #ffe8fb 100%); }
.card-cheetah-sprint { border-color: #f4a640; background: linear-gradient(180deg, #fff8ef 0%, #ffeccc 100%); }
.card-rainbow-blast { border-color: #9b6bff; background: linear-gradient(180deg, #fff8ff 0%, #f2e8ff 100%); }
.card-disco-party { border-color: #7b5cff; background: linear-gradient(180deg, #f5f0ff 0%, #ebe2ff 100%); animation: card-pop 0.55s cubic-bezier(0.2, 1.2, 0.3, 1), disco-shake 0.35s ease-in-out infinite alternate; }
.card-rocket-launch { border-color: #5b8cff; background: linear-gradient(180deg, #f0f6ff 0%, #e4edff 100%); }
.card-candy-explosion { border-color: #ff6eb8; background: linear-gradient(180deg, #fff3fa 0%, #ffe6f4 100%); }
.card-superhero { border-color: #4a6dff; background: linear-gradient(180deg, #f0f4ff 0%, #e3ebff 100%); }
.card-jungle-roar { border-color: #4caf50; background: linear-gradient(180deg, #f3fff5 0%, #e5fbe8 100%); }
.card-mermaid-magic { border-color: #3ec5d8; background: linear-gradient(180deg, #effcff 0%, #dff7ff 100%); }
.card-mega-confetti { border-color: #ff5ec8; background: linear-gradient(180deg, #fff5fd 0%, #ffe9fb 100%); animation: card-pop 0.55s cubic-bezier(0.2, 1.2, 0.3, 1), mega-bounce 0.7s ease-in-out infinite alternate; }

@keyframes disco-shake {
  from { transform: rotate(-1.5deg); }
  to { transform: rotate(1.5deg); }
}

@keyframes mega-bounce {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-6px) scale(1.02); }
}

.celebration-card h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.burst-row {
  margin-top: 12px;
  font-size: 2rem;
  display: flex;
  justify-content: center;
  gap: 12px;
  animation: bounce 1s ease-in-out infinite alternate;
}

#close-celebration-button {
  margin-top: 14px;
}

#fireworks-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.celebration-flyers {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.celebration-flyers .flyer {
  position: absolute;
  font-size: clamp(2rem, 5vw, 3.5rem);
  filter: drop-shadow(0 4px 6px rgba(80, 30, 120, 0.35));
  animation: fly-across 8s linear infinite;
}

.fly-unicorn.cf1 { top: 12%; animation-duration: 7s; animation-delay: 0s; }
.fly-cheetah.cf2 { top: 28%; animation-duration: 9s; animation-delay: 1.2s; }
.fly-unicorn.cf3 { top: 52%; animation-duration: 8s; animation-delay: 2.4s; }
.fly-cheetah.cf4 { top: 68%; animation-duration: 10s; animation-delay: 0.6s; }
.fly-unicorn.cf5 { top: 38%; animation-duration: 11s; animation-delay: 3.5s; }
.fly-cheetah.cf6 { top: 82%; animation-duration: 7.5s; animation-delay: 4s; }

@keyframes fly-across {
  0% {
    left: -12%;
    transform: translateY(0) rotate(-8deg);
  }
  50% {
    transform: translateY(-18px) rotate(6deg);
  }
  100% {
    left: 112%;
    transform: translateY(0) rotate(-8deg);
  }
}

@keyframes pulse-leave {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.03);
  }
}

@keyframes bounce {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-8px);
  }
}

@keyframes critter-float {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-24px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes sticker-bob {
  0% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-10px) rotate(2deg);
  }
  100% {
    transform: translateY(0) rotate(-2deg);
  }
}

@media (max-width: 760px) {
  .app {
    padding: 8px;
    padding-top: 50px;
    gap: 6px;
  }

  h1 {
    font-size: clamp(1.45rem, 5.5vw, 1.9rem);
  }

  .weather-strip {
    font-size: 0.95rem;
    padding: 6px 10px;
  }

  .corner-button {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    font-size: 1.35rem;
  }

  .shared-labels-row,
  .shared-step-row {
    grid-template-columns: 52px 1fr 52px;
  }

  .shared-labels-row {
    font-size: 0.95rem;
  }

  .shared-step-row {
    min-height: 52px;
  }

  .side-check input[type="checkbox"] {
    width: 28px;
    height: 28px;
  }

  .emoji {
    font-size: 1.6rem;
    min-width: 1.8rem;
  }

  .step-text {
    font-size: 1.05rem;
  }

  .shared-card {
    padding: 8px;
  }

  .preset-controls {
    grid-template-columns: 1fr;
  }

  .fun-stickers .sticker {
    font-size: 1.6rem;
  }

  .leave-countdown {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
    padding: 5px 10px;
  }

  .unicorn-track {
    height: 32px;
  }

  .unicorn-runner {
    font-size: 1.5rem;
  }

  .timer-footer label {
    font-size: 0.95rem;
  }

  .timer-icon-button {
    width: 44px;
    height: 44px;
  }

  .calendar-event {
    grid-template-columns: 58px 1fr;
    gap: 10px;
    padding: 8px 10px;
  }

  .calendar-day-nav {
    grid-template-columns: 52px 1fr 52px;
    gap: 6px;
  }

  .calendar-nav-button {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    font-size: 1.2rem;
  }

  .calendar-mode-toggle {
    min-height: 44px;
    padding: 0 14px;
    font-size: 0.92rem;
  }

  .event-emoji-wrap {
    width: 52px;
    height: 52px;
    font-size: 1.8rem;
    border-radius: 14px;
  }

  .theme-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.baby-mode-panel {
  border: 2px dashed var(--soft-panel-border);
  border-radius: 14px;
  background: var(--soft-panel);
  padding: 10px;
  margin-bottom: 12px;
}

.baby-mode-panel h3 {
  margin: 0 0 4px;
}

.baby-mode-panel > p {
  margin: 0 0 10px;
}

body.baby-mode-active .app,
body.baby-mode-active .corner-controls,
body.baby-mode-active .fun-stickers,
body.baby-mode-active .celebration {
  visibility: hidden !important;
  pointer-events: none !important;
}

body.baby-mode-active {
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.baby-mode {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background:
    radial-gradient(circle at 20% 20%, #ffd6f5 0%, transparent 42%),
    radial-gradient(circle at 80% 30%, #c5f0ff 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, #ffe8a3 0%, transparent 50%),
    linear-gradient(160deg, #9adcff 0%, #ffb3e6 45%, #c9b6ff 100%);
  overflow: hidden;
  touch-action: none;
}

.baby-mode.hidden {
  display: none;
}

.baby-playfield {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}

.baby-bubbles {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.baby-bubble {
  position: absolute;
  bottom: -12vh;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.95) 0 12%, transparent 18%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.25) 0%, rgba(180, 230, 255, 0.35) 55%, rgba(255, 180, 230, 0.4) 100%);
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 8px 20px rgba(80, 40, 140, 0.18);
  animation-name: baby-bubble-rise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.baby-effects {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.baby-hint {
  position: absolute;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  z-index: 4;
  margin: 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #5b2a86;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  font-weight: 800;
  pointer-events: none;
  animation: baby-hint-fade 4s ease forwards;
}

.baby-burst {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: clamp(5.5rem, 18vw, 9rem);
  animation: baby-burst-pop 1.05s ease forwards;
  filter: drop-shadow(0 8px 14px rgba(60, 20, 100, 0.3));
}

.baby-ripple {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  border: 4px solid rgba(255, 255, 255, 0.9);
  animation: baby-ripple-expand 0.7s ease-out forwards;
}

.baby-spark {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  animation: baby-spark-fly 1s ease-out forwards;
}

.baby-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  animation: baby-flash-pulse 0.45s ease;
}

.baby-quit-button {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 5;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  background: rgba(40, 30, 60, 0.42);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  padding: 8px;
  display: grid;
  place-items: center;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.baby-quit-label {
  position: relative;
  z-index: 1;
  text-align: center;
  pointer-events: none;
}

.baby-quit-ring {
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  pointer-events: none;
  opacity: 0;
}

.baby-quit-button.is-holding .baby-quit-ring {
  opacity: 1;
  border-color: transparent;
  border-top-color: #fff;
  animation: hold-ring-spin 5s linear forwards;
}

.baby-quit-button.is-holding {
  transform: scale(0.96);
  background: rgba(20, 20, 40, 0.65);
}

@keyframes baby-bubble-rise {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0;
  }
  8% {
    opacity: 0.9;
  }
  100% {
    transform: translate3d(var(--drift, 20px), -115vh, 0) scale(1.08);
    opacity: 0.15;
  }
}

@keyframes baby-burst-pop {
  0% {
    transform: translate(-50%, -50%) scale(0.15);
    opacity: 0;
  }
  28% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -140%) scale(0.85);
    opacity: 0;
  }
}

@keyframes baby-ripple-expand {
  to {
    width: 180px;
    height: 180px;
    opacity: 0;
  }
}

@keyframes baby-spark-fly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.6);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -80px))) scale(1.2);
  }
}

@keyframes baby-flash-pulse {
  0% {
    opacity: 0;
  }
  35% {
    opacity: 0.55;
  }
  100% {
    opacity: 0;
  }
}

@keyframes baby-hint-fade {
  0%,
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* --- Draft: dynamic kids layout --- */
.kids-panel {
  border: 2px dashed var(--soft-panel-border);
  border-radius: 14px;
  background: var(--soft-panel);
  padding: 10px;
  margin-bottom: 12px;
}

.kids-panel h3 {
  margin: 0 0 4px;
}

.kids-editor-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.kid-editor-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.kid-editor-row input {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: var(--card);
}

.multi-kid-card {
  overflow-x: auto;
}

.multi-kid-labels,
.multi-kid-step-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) repeat(var(--kid-count, 2), minmax(56px, 72px));
  gap: 8px;
  align-items: center;
}

.multi-kid-labels {
  margin: 0 0 8px;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
}

.multi-kid-step-label {
  text-align: left;
}

.multi-kid-name {
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-kid-step-row {
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--event-bg);
  padding: 6px 8px;
  margin: 0;
  list-style: none;
}

.multi-kid-step-row.both-done .step-middle {
  background: linear-gradient(90deg, #d8ffe4 0%, #edfff4 100%);
  border-radius: 10px;
}

.multi-kid-step-row .step-middle {
  justify-content: flex-start;
  margin: 0;
}

.multi-kid-progress {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

@media (max-width: 640px) {
  .multi-kid-labels,
  .multi-kid-step-row {
    grid-template-columns: minmax(110px, 1.2fr) repeat(var(--kid-count, 2), minmax(48px, 58px));
    gap: 4px;
  }

  .multi-kid-step-row .step-text {
    font-size: 1.05rem;
  }
}

/* --- Install / fullscreen controls --- */
.install-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.install-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: linear-gradient(140deg, #7ab8ff 0%, #8a46ff 100%);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(70, 30, 120, 0.18);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.install-action-button[aria-pressed="true"] {
  background: linear-gradient(140deg, #ffd56a 0%, #ff9f4a 100%);
  color: #4a2a00;
}

.install-action-button:active {
  transform: scale(0.97);
}

.homescreen-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(30, 20, 50, 0.45);
}

.homescreen-modal.hidden {
  display: none;
}

.homescreen-modal-card {
  width: min(420px, 100%);
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 12px 40px rgba(40, 20, 80, 0.28);
}

.homescreen-modal-card h2 {
  margin: 0 0 10px;
}

.homescreen-modal-body {
  margin: 0 0 14px;
  font-weight: 700;
  color: var(--muted);
}

.homescreen-modal-body p {
  margin: 0 0 8px;
}

.homescreen-steps {
  margin: 0 0 10px;
  padding-left: 1.2rem;
}

.homescreen-steps li {
  margin: 0 0 8px;
}

.homescreen-tip {
  margin: 0 0 10px;
  font-weight: 800;
  color: var(--ink);
}
