/* Lance's app, "Pink Organic" (mini-me-v2/CLAUDE_CODE_GUIDE.md): the pixel scene fills the screen,
   pixel chrome (bars, buttons) sits next to it, and the sheets are smooth cream cards on top.
   Pixel art is never smoothed, stretched unevenly or given soft shadows. */
:root {
  --color-bg: #f5ead8;
  --color-surface: #ebddc5;
  --color-text: #201e1d;
  --color-accent: #d4487f;
  --color-accent-2: #7a8a5e;
  --color-pink-bright: #ff8fb5;
  --color-accent-100: #fff0f5; --color-accent-200: #ffdbe7; --color-accent-300: #ffb8d0; --color-accent-400: #ff8fb5;
  --color-accent-500: #f0679a; --color-accent-600: #d4487f; --color-accent-700: #a8335f; --color-accent-800: #7a2445;
  --color-accent-2-100: #f0fae1; --color-accent-2-200: #e1eecc; --color-accent-2-300: #ccdbb2; --color-accent-2-500: #8fa073;
  --color-accent-2-700: #56633f; --color-accent-2-800: #3d472b;
  --color-neutral-100: #f9f4ed; --color-neutral-200: #eee7db; --color-neutral-300: #dcd3c4; --color-neutral-700: #645c50;
  --color-ink: #2b1d33;      /* the sprites' plum outline: borders next to pixel art */
  --cream: #fffaf5;
  --card: rgba(255, 248, 240, 0.94);
  --gold: #e0a020;
  --font-heading: "Caprasimo", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, sans-serif;
  --pixel: "Silkscreen", ui-monospace, monospace;
  --radius-md: 16px;
  --radius-lg: 28px;
  --hard: 0 3px 0 var(--color-ink);                     /* chunky shadow for chrome next to sprites */
  --shadow-lg: 0 12px 32px rgba(46, 43, 37, 0.22);
  --top: max(12px, env(safe-area-inset-top));
  --hud-h: 108px;                                         /* the health card */
  --tab-h: calc(96px + env(safe-area-inset-bottom));      /* the bottom bar, with its gap */
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--color-ink); color: var(--color-text); color-scheme: light; }
body {
  font: 15px/1.45 var(--font-body);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
h1, h2 { font-family: var(--font-heading); font-weight: 400; margin: 0; color: var(--color-accent-800); }
h1 { font-size: 24px; }
h2 { font-size: 20px; }
[hidden] { display: none !important; }
.dim { color: var(--color-neutral-700); font-size: 13px; margin: 6px 0 0; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }

/* --- the scene ---------------------------------------------------------------------------
   #world is the 216x360 sprite canvas, scaled as a whole by --s (set from app.js). The bg is
   648x792 with the canvas at (216,216), so it bleeds past the screen edges. */
.stage { position: fixed; inset: 0; overflow: hidden; background: var(--color-ink); }
.world {
  position: absolute; left: 50%; top: 50%; width: 216px; height: 360px;
  transform: translate(-50%, -50%) scale(var(--s, 1));
}
.scene-fill, .scene-bg { position: absolute; left: -216px; top: -216px; width: 648px; height: 792px; max-width: none; }
.scene-strip { position: absolute; left: 0; top: 0; width: 216px; height: 360px; background-repeat: no-repeat; }
.lance-hit {
  position: absolute; left: 36px; top: 72px; width: 144px; height: 216px; padding: 0;
  background: none; border: 0; cursor: pointer; border-radius: 40px;
}
.lance-hit:focus-visible { outline: 2px dashed var(--color-accent-100); }
/* the cat sits in the bottom-left cell, drawn at half size (96x112 frames) */
.pet {
  position: absolute; left: 10px; top: 300px; width: 96px; height: 112px; padding: 0; border: 0; cursor: pointer;
  background-color: transparent; background-repeat: no-repeat; transform: scale(0.5); transform-origin: 0 0;
}
/* speech bubble above his head; tail bottom-left points at him */
.bubble {
  position: absolute; left: 106px; top: 2px; width: 96px; height: 72px; padding: 0; border: 0; cursor: pointer;
  background-color: transparent; background-repeat: no-repeat; animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-3px); } }
.fx { position: absolute; inset: 0; pointer-events: none; }
.fx-item { position: absolute; }
.fx-item > div { background-repeat: no-repeat; transform-origin: 0 0; }
.petals { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.petals i { position: absolute; top: -32px; background-repeat: no-repeat; animation: petal-fall linear infinite; }
@keyframes petal-fall {
  0% { transform: translate(0, 0); }
  50% { transform: translate(28px, 55vh); }
  100% { transform: translate(-12px, calc(100vh + 48px)); }
}
body.admin-mode .stage { filter: blur(3px) brightness(0.8); }
body.admin-mode .hud, body.admin-mode .mood-line, body.admin-mode .tabbar, body.admin-mode .petals { display: none; }

/* --- buttons: pink pills with a plum outline --------------------------------------------- */
.btn {
  font: 600 15px/1.2 var(--font-body); color: var(--color-accent-800); cursor: pointer;
  background: var(--color-accent-200); border: 2px solid var(--color-ink); border-radius: 999px;
  padding: 10px 16px; min-height: 44px; box-shadow: var(--hard);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--color-ink); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-small { min-height: 36px; padding: 5px 12px; font-size: 14px; }
.btn-wide { width: 100%; margin-top: 12px; font-weight: 700; background: var(--color-accent-700); color: var(--color-accent-100); }
.btn.on { background: var(--color-accent-700); color: var(--color-accent-100); }
.btn-round { width: 52px; height: 52px; padding: 0; font-size: 24px; }
.btn-corner { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20; }
.badge {
  position: absolute; right: -8px; bottom: -4px; font: 700 11px/1 var(--font-body);
  background: var(--color-accent-700); color: var(--color-accent-100); border: 2px solid var(--color-ink);
  border-radius: 999px; padding: 3px 6px;
}

/* --- HUD: his health and her points --------------------------------------------------------- */
.hud { position: fixed; top: var(--top); left: 12px; right: 12px; z-index: 10; }
.health {
  max-width: 420px; margin: 0 auto; padding: 8px 12px 10px; border-radius: 22px;
  background: var(--card); border: 2px solid var(--color-ink); box-shadow: var(--hard);
}
.health-label { display: flex; align-items: baseline; justify-content: space-between; }
.health-label .name { font: 18px var(--font-heading); color: var(--color-accent-800); }
.hp-text { font: 12px var(--pixel); color: var(--color-accent-800); }
.stat-bar { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.stat-icon { flex: none; width: 32px; height: 32px; background: url("/static/sprites-v2/movables/bars/icon-love.png") 0 0 / 32px 32px no-repeat; }
/* track and fill are 128x28 pills, 3-sliced so they stretch without bending the pixel caps */
.stat-track, .stat-fill {
  border-style: solid; border-color: transparent; border-width: 0 14px; height: 28px;
}
.stat-track { position: relative; flex: 1; border-image: url("/static/sprites-v2/movables/bars/track.png") 0 14 fill / 0 14px stretch; }
.stat-fill {
  position: absolute; top: 0; bottom: 0; left: -14px; right: -14px;
  border-image: url("/static/sprites-v2/movables/bars/fill-love.png") 0 14 fill / 0 14px stretch;
  transition: clip-path 0.6s ease;
}
.stat-bar.low .stat-icon { animation: thump 0.9s ease-in-out infinite; }
@keyframes thump { 50% { transform: scale(1.18); } }
.stat-bar.big .stat-track, .stat-bar.big .stat-fill { height: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  font: 700 13px/1 var(--font-body); color: var(--color-ink); white-space: nowrap;
  padding: 6px 10px; border-radius: 999px; background: var(--cream); border: 2px solid var(--color-ink);
}
.countdown { cursor: pointer; }
.countdown.soon { background: var(--color-accent-200); color: var(--color-accent-800); }
.mood-line {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 4px); z-index: 5; margin: 0;
  font: 700 13px var(--font-body); color: var(--color-accent-800); white-space: nowrap; max-width: calc(100vw - 24px);
  overflow: hidden; text-overflow: ellipsis; padding: 6px 14px; border-radius: 999px;
  background: var(--card); border: 2px solid var(--color-ink);
}
.mood-line:empty { display: none; }
.banner {
  position: fixed; top: calc(var(--top) + var(--hud-h) + 4px); left: 16px; right: 16px; z-index: 9; margin: 0 auto; max-width: 420px;
  text-align: center; font: 600 13px var(--font-body); padding: 6px 10px; border-radius: 999px;
  background: var(--color-accent-100); color: var(--color-accent-800); border: 2px solid var(--color-ink);
}

/* --- bottom bar: four pink pixel buttons ------------------------------------------------------ */
.tabbar {
  position: fixed; z-index: 10; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
  max-width: 420px; margin: 0 auto; padding: 6px 4px 4px; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border: 2px solid var(--color-ink); border-radius: var(--radius-lg); box-shadow: var(--hard);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 0; border: 0; background: none;
  font: 700 11px var(--font-body); color: var(--color-accent-800); cursor: pointer; min-height: 44px;
}
.tab-ball {
  position: relative; width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: url("/static/sprites-v2/movables/ui/button-round.png") 0 0 / 108px 54px no-repeat;
}
.tab:active .tab-ball, .tab.on .tab-ball { background-position: -54px 0; }
.tab:disabled { opacity: 0.55; }

/* --- sheets: smooth cream cards on top of the scene --------------------------------------------- */
.sheet {
  position: fixed; z-index: 15; left: 12px; right: 12px; top: calc(var(--top) + var(--hud-h));
  max-width: 440px; margin: 0 auto; padding: 16px;
  max-height: calc(100vh - var(--top) - var(--hud-h) - var(--tab-h) - 6px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--card); border: 2px solid var(--color-ink); border-radius: var(--radius-lg);
  box-shadow: var(--hard), var(--shadow-lg);
  animation: drop-in 0.18s ease-out;
}
.sheet-low { top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); max-height: none; overflow: visible; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sheet-note { margin: 10px 0 0; text-align: center; font-size: 13px; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.bingo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.btn.square {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 30px; padding: 6px; border-radius: 22px; background: var(--cream); color: var(--color-text);
}
.square small { font: 700 11px/1.1 var(--font-body); color: var(--color-neutral-700); text-align: center; }
.btn.square.done { background: var(--color-accent-2-200); }
.square.done small { color: var(--color-accent-2-800); }
.square.line { outline: 3px solid var(--color-accent-500); outline-offset: 1px; }

textarea, input, select {
  width: 100%; font: inherit; color: var(--color-text); background: var(--cream);
  border: 2px solid var(--color-neutral-300); border-radius: var(--radius-md); padding: 10px 12px; user-select: text;
}
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--color-accent-600); }
input { min-height: 44px; border-radius: 999px; padding: 10px 16px; }
textarea { resize: none; margin-top: 4px; }

/* --- to-do list -------------------------------------------------------------------------------- */
.todo-scroll { max-height: min(70vh, calc(100vh - var(--top) - 130px)); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--color-neutral-300); }
.todo-list li:first-child { border-top: 0; }
.todo-item {
  flex: 1; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 4px;
  font: inherit; color: var(--color-text); text-align: left; background: none; border: 0; cursor: pointer;
}
.todo-item .box {
  flex: 0 0 24px; height: 24px; border-radius: 8px; border: 2px solid var(--color-ink); background: var(--cream);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; line-height: 1;
}
.todo-item .text { overflow-wrap: anywhere; }
.todo-list li.done .box { background: var(--color-accent-2-500); color: var(--cream); }
.todo-list li.done .text { text-decoration: line-through; color: var(--color-neutral-700); }
.todo-del { min-height: 36px; min-width: 40px; padding: 4px 8px; font-size: 15px; flex: 0 0 auto; }
.todo-progress { margin: 8px 0 10px; text-align: center; }
.todo-empty { padding: 8px 0; text-align: center; }
.todo-finish { opacity: 0.6; }
.todo-finish.ready { opacity: 1; background: var(--color-accent-2-700); color: var(--cream); }

/* --- ADMIN page --------------------------------------------------------------------------------- */
.admin {
  position: fixed; inset: 0; z-index: 12; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--top) + 4px) 16px calc(24px + env(safe-area-inset-bottom));
}
.admin-head {
  display: flex; align-items: center; justify-content: space-between; max-width: 560px; margin: 0 auto 12px;
  padding: 8px 12px; border-radius: 22px; background: var(--card); border: 2px solid var(--color-ink);
}
.card {
  max-width: 560px; margin: 0 auto 14px; padding: 16px;
  background: var(--card); border: 2px solid var(--color-ink); border-radius: var(--radius-lg); box-shadow: var(--hard);
}
.card h2 { margin-bottom: 4px; font-size: 18px; }
.row { display: flex; gap: 8px; margin-top: 10px; }
.row > * { flex: 1; }
.row.wrap { flex-wrap: wrap; }
.row.wrap > * { flex: 1 1 30%; }
.row.wrap > .btn { border-radius: 18px; }
.review { padding: 10px 0; border-top: 1px solid var(--color-neutral-300); }
.review:first-child { border-top: 0; }
.review select { margin-top: 8px; min-height: 40px; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 44px); gap: 6px; margin-top: 10px; }
.mini-grid span {
  height: 44px; display: flex; align-items: center; justify-content: center; font-size: 22px;
  border-radius: 12px; background: var(--color-neutral-200);
}
.mini-grid span.done { background: var(--color-accent-2-300); }
.history { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.history li { display: flex; gap: 8px; padding: 5px 0; border-top: 1px solid var(--color-neutral-300); }
.history .amt { font-weight: 700; min-width: 48px; text-align: right; }
.history .amt.plus { color: var(--color-accent-2-700); }
.history .amt.minus { color: var(--color-accent-700); }
.history .why { flex: 1; color: var(--color-neutral-700); }

/* --- arcade --------------------------------------------------------------------------------------- */
.arcade-game { padding: 12px 0; border-top: 1px solid var(--color-neutral-300); }
.arcade-game:first-child { border-top: 0; padding-top: 0; }
.arcade-game h3 { font: 17px var(--font-heading); font-weight: 400; color: var(--color-accent-800); margin: 0; }
.arcade-game p { margin: 4px 0 0; font-size: 13px; color: var(--color-neutral-700); }
.tiers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tier { font: 700 12px var(--font-body); padding: 4px 9px; border-radius: 999px; background: var(--color-neutral-200); color: var(--color-neutral-700); }
.tier.paid { background: var(--color-accent-2-200); color: var(--color-accent-2-800); }
/* the games themselves keep their dark arcade screen */
.game {
  position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column;
  background: #0b0e22; color: #f2f4ff; padding-bottom: env(safe-area-inset-bottom);
}
.game-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(var(--top) - 4px) 12px 6px; font: 13px var(--pixel);
}
.game-bar > span:last-child { width: 44px; }
#game-canvas { flex: 1; width: 100%; min-height: 0; display: block; touch-action: none; }
.game-pad { display: flex; gap: 10px; padding: 10px 14px 14px; touch-action: none; }
.pad-btn {
  width: 76px; height: 76px; border-radius: 26px; font: 26px var(--pixel); color: var(--color-accent-800);
  background: var(--color-accent-300); border: 2px solid var(--color-accent-100); box-shadow: 0 4px 0 var(--color-accent-700); touch-action: none;
}
.pad-btn.on { background: var(--color-accent-400); transform: translateY(3px); box-shadow: 0 1px 0 var(--color-accent-700); }
.pad-gap { flex: 1; }
.pad-jump { width: 110px; font-size: 18px; }
.game-over {
  position: absolute; left: 16px; right: 16px; top: 30%; max-width: 380px; margin: 0 auto; padding: 20px;
  text-align: center; color: var(--color-text); background: var(--card); border: 2px solid var(--color-ink);
  border-radius: var(--radius-lg); box-shadow: var(--hard);
}
.game-over p { white-space: pre-line; margin: 10px 0 0; }

/* --- cheer, toast, errors ---------------------------------------------------------------------- */
.cheer {
  position: fixed; left: 0; right: 0; top: 30%; z-index: 30; text-align: center; pointer-events: none;
  font: 28px/1.25 var(--font-heading); color: var(--color-accent-100); white-space: pre-line;
  text-shadow: 2px 0 0 var(--color-ink), -2px 0 0 var(--color-ink), 0 2px 0 var(--color-ink), 0 -2px 0 var(--color-ink),
    0 4px 0 var(--color-ink), 0 0 22px rgba(255, 143, 181, 0.85);
  animation: cheer 2.4s ease-out forwards;
}
@keyframes cheer {
  0% { opacity: 0; transform: translateY(20px) scale(0.8); }
  15% { opacity: 1; transform: translateY(0) scale(1.08); }
  70% { opacity: 1; transform: translateY(-10px) scale(1); }
  100% { opacity: 0; transform: translateY(-40px); }
}
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + 12px); z-index: 60;
  max-width: 440px; margin: 0 auto; padding: 12px 16px; border-radius: 22px; text-align: center; font: 600 14px var(--font-body);
  background: var(--color-ink); color: var(--color-accent-100); box-shadow: var(--shadow-lg);
}
.error {
  position: fixed; left: 16px; right: 16px; top: 45%; z-index: 50; margin: 0 auto; max-width: 360px; text-align: center;
  font: 600 14px var(--font-body); color: var(--color-accent-800); padding: 10px 14px; border-radius: 22px;
  background: var(--card); border: 2px solid var(--color-ink);
}

/* --- coupon shop ----------------------------------------------------------------------------------- */
.sheet-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.shop-balance { margin: 0 0 10px; font: 700 14px var(--font-body); color: var(--color-accent-700); text-align: left; }
.coupons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.coupon {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px 10px; text-align: center;
  border-radius: 22px; background: var(--cream); border: 2px dashed var(--color-accent-400);
}
.coupon .big { font-size: 30px; line-height: 1.1; }
.coupon .name { font-size: 13px; font-weight: 600; line-height: 1.2; min-height: 2.4em; display: flex; align-items: center; }
.coupon .price { font: 700 13px var(--font-body); color: var(--color-accent-700); }
.coupon .left { font-size: 11px; color: var(--color-neutral-700); }
.coupon .btn { width: 100%; min-height: 38px; padding: 6px; font-size: 13px; }
.coupon.cant { opacity: 0.6; border-color: var(--color-neutral-300); }
.coupon .btn.sure { background: var(--color-accent-700); color: var(--color-accent-100); font-weight: 700; }
.sub { font: 16px var(--font-heading); margin: 18px 0 6px; color: var(--color-accent-800); }
.wallet, .shelf { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.wallet li, .shelf li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--color-neutral-300); }
.wallet li:first-child, .shelf li:first-child { border-top: 0; }
.wallet .what, .shelf .what { flex: 1; }
.wallet .state { font: 700 11px var(--font-body); padding: 3px 8px; border-radius: 999px; background: var(--color-neutral-200); color: var(--color-neutral-700); }
.wallet .state.waiting { background: #ffe7a8; color: #6e4f08; }
.wallet .state.done { background: var(--color-accent-2-200); color: var(--color-accent-2-800); }
.shelf li.hidden .what { opacity: 0.5; text-decoration: line-through; }
.shelf .btn { min-height: 32px; padding: 4px 10px; font-size: 12px; flex: 0 0 auto; }
.emoji-input { flex: 0 0 64px !important; text-align: center; font-size: 20px; padding: 8px; }

/* --- memory calendar ---------------------------------------------------------------------------------- */
.streak-box {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 22px;
  background: var(--color-accent-100); border: 2px solid var(--color-accent-300);
}
.streak-big { font: 26px var(--font-heading); color: #c4561c; white-space: nowrap; }
.streak-text { font-size: 13px; color: var(--color-neutral-700); white-space: pre-line; line-height: 1.35; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 6px; }
.cal-nav h3 { font: 17px var(--font-heading); font-weight: 400; color: var(--color-accent-800); margin: 0; }
.cal-nav .btn { min-width: 44px; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekdays span { text-align: center; font: 700 11px var(--font-body); color: var(--color-neutral-700); }
.cal-grid { margin-top: 4px; }
.tile {
  position: relative; aspect-ratio: 0.82; padding: 3px; border-radius: 10px; border: 2px solid var(--color-neutral-300);
  background: var(--cream); color: var(--color-text); font: inherit; display: flex; flex-direction: column; gap: 2px; cursor: pointer;
}
.tile .n { font: 700 10px var(--font-body); color: var(--color-neutral-700); line-height: 1; }
.tile .dots { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5px; }
.tile .dots i { border-radius: 2px; background: var(--color-neutral-200); }
.tile .dots i.on { background: var(--color-accent-2-500); }
.tile.streak { border-color: #f0a060; }
.tile.full { background: var(--color-accent-200); border-color: var(--color-accent-600); }
.tile.full .dots i.on { background: var(--color-accent-600); }
.tile.today { outline: 2px solid var(--color-ink); outline-offset: 1px; }
.tile.future { opacity: 0.35; cursor: default; }
.tile.picked { box-shadow: 0 0 0 3px var(--color-accent-500); }
.tile .mark { position: absolute; right: 2px; top: 1px; font-size: 9px; line-height: 1; }
.cal-day { margin-top: 12px; padding: 12px; border-radius: 22px; background: var(--color-neutral-100); border: 2px solid var(--color-neutral-300); }
.cal-day h4 { margin: 0 0 8px; font: 16px var(--font-heading); font-weight: 400; color: var(--color-accent-800); }
.cal-day .mini-grid { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
.cal-day .mini-grid span { flex-direction: column; height: 52px; font-size: 20px; }
.cal-day .mini-grid small { font: 700 10px var(--font-body); color: var(--color-accent-2-800); }
.cal-day ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--color-neutral-700); }
.cal-day li.done { text-decoration: line-through; }
.stickers { display: flex; flex-wrap: wrap; gap: 6px; }
.sticker { font: 600 12px var(--font-body); padding: 5px 10px; border-radius: 999px; background: var(--color-accent-100); border: 2px solid var(--color-accent-300); }

/* --- countdown and special days ----------------------------------------------------------------------- */
.sheet.special { border-width: 3px; }
.sheet.special-birthday { border-color: var(--color-accent-400); box-shadow: var(--hard), 0 0 26px rgba(255, 143, 181, 0.7); }
.sheet.special-anniversary { border-color: var(--color-accent-600); box-shadow: var(--hard), 0 0 26px rgba(212, 72, 127, 0.55); }
.sheet.special-meetup { border-color: #6aa8d8; box-shadow: var(--hard), 0 0 26px rgba(106, 168, 216, 0.55); }
.sheet.special-custom { border-color: var(--gold); box-shadow: var(--hard), 0 0 26px rgba(224, 160, 32, 0.5); }
.sheet.special .square:not(.done) { background: var(--color-accent-100); }
.letter-btn { margin: 0 0 12px; }
.letter { top: calc(var(--top) + var(--hud-h) + 12px); }
.letter-sprite { width: 96px; height: 96px; margin: -6px auto 6px; background-repeat: no-repeat; }
.letter-text {
  margin: 0; padding: 16px; border-radius: 18px; white-space: pre-wrap; user-select: text;
  background: #fff6ea; color: #3a2a20; font-size: 16px; line-height: 1.5; box-shadow: inset 0 0 0 2px #f2d9bf;
}
.letter-sign { margin: 10px 4px 0; text-align: right; font: 16px var(--font-heading); color: var(--color-accent-700); }
.confetti { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 14px; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--color-accent-600); }
select { flex: 1; min-height: 44px; border-radius: 999px; padding: 0 12px; }
.tile .mark.special { left: 2px; right: auto; top: auto; bottom: 2px; font-size: 10px; }
.cal-day .letter-text { margin-top: 8px; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .sheet, .cheer, .bubble, .stat-bar.low .stat-icon { animation: none; }
  .confetti, .petals { display: none; }
  .stat-fill { transition: none; }
}
