@font-face {
  font-family: 'Nunito';
  src: url('fonts/nunito-latin.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  src: url('fonts/nunito-latin-ext.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #fff3e2;
  --bg2: #ffe9d2;
  --card: #fffdf8;
  --ink: #4a3530;
  --soft: #8a6f66;
  --line: #f0dcc6;
  --peach: #ffb38a;
  --peach-deep: #f28b5b;
  --rose: #f9a8b8;
  --butter: #ffdc7a;
  --sage: #b5dba9;
  --sage-deep: #5d9a57;
  --sky: #a9d8ee;
  --lilac: #d3c1f5;
  --shadow: 0 6px 0 rgba(74, 53, 48, 0.1), 0 14px 28px rgba(160, 100, 60, 0.14);
  --r: 26px;
  --on: #4a3530; /* text on coloured buttons */
  --pick: var(--butter); /* selected chips and tabs */
  --glow-a: var(--rose);
  --glow-b: var(--butter);
  --blob-hi: #ffd9bf;
  --blob-shadow: rgba(200, 110, 70, 0.35);
  --blob-glow: rgba(240, 130, 80, 0.35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2b211f;
    --bg2: #35282a;
    --card: #3a2d2a;
    --ink: #fbeadb;
    --soft: #cbb0a3;
    --line: #4d3d38;
    --shadow: 0 6px 0 rgba(0, 0, 0, 0.25), 0 14px 28px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

/* Turquoise kawaii: used by the Turkish version. Minty paper, turquoise buttons, pink for anything selected. */
:root[data-theme='turquoise'] {
  --bg: #e4faf7;
  --bg2: #d2f4ef;
  --card: #fbfffe;
  --ink: #1f4a4d;
  --soft: #5a8a8b;
  --line: #c3ebe6;
  --peach: #6fdcd3;
  --peach-deep: #1fa9a2;
  --sage: #b9ecc4;
  --sky: #a5e3f2;
  --on: #123f42;
  --pick: #ffc4dc;
  --glow-a: #8fe6dc;
  --glow-b: #ffc4dc;
  --blob-hi: #d5fbf6;
  --blob-shadow: rgba(20, 140, 135, 0.38);
  --blob-glow: rgba(60, 200, 190, 0.4);
  --shadow: 0 6px 0 rgba(31, 74, 77, 0.1), 0 14px 28px rgba(30, 150, 145, 0.16);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='turquoise'] {
    --bg: #10302f;
    --bg2: #163b3a;
    --card: #1b4342;
    --ink: #e2fbf8;
    --soft: #9dcdc8;
    --line: #2c5957;
    --shadow: 0 6px 0 rgba(0, 0, 0, 0.25), 0 14px 28px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Nunito', ui-rounded, 'SF Pro Rounded', 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--ink);
  background:
    radial-gradient(60rem 30rem at 110% -10%, color-mix(in srgb, var(--glow-a) 28%, transparent), transparent 60%),
    radial-gradient(50rem 28rem at -10% 110%, color-mix(in srgb, var(--glow-b) 30%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  transition: background-color 0.4s;
  display: flex;
  flex-direction: column;
}
body[data-route='distract'],
body[data-route='still'] {
  background:
    radial-gradient(40rem 24rem at 100% 0%, color-mix(in srgb, var(--lilac) 45%, transparent), transparent 65%),
    radial-gradient(40rem 24rem at 0% 30%, color-mix(in srgb, var(--sky) 45%, transparent), transparent 65%),
    radial-gradient(44rem 26rem at 60% 110%, color-mix(in srgb, var(--butter) 55%, transparent), transparent 65%),
    var(--bg);
  background-attachment: fixed;
}

#view { outline: none; flex: 1 0 auto; width: 100%; }
.page {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 20px 120px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: rise 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.page.center { align-items: center; text-align: center; min-height: 100dvh; justify-content: center; padding-bottom: 130px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

h1 { font-size: 1.9rem; line-height: 1.15; font-weight: 900; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 1rem; font-weight: 800; margin: 14px 0 0; color: var(--soft); text-transform: lowercase; letter-spacing: 0.04em; }
p { margin: 0; text-wrap: pretty; }
.soft { color: var(--soft); font-size: 0.92rem; }
.funny { font-size: 1.12rem; font-weight: 700; }
.note { background: var(--card); border: 2px dashed var(--line); border-radius: 18px; padding: 10px 14px; font-size: 0.9rem; color: var(--soft); }
.note a { color: inherit; text-decoration: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- buttons ---------- */
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--peach-deep); outline-offset: 3px; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  font-weight: 800;
  font-size: 1.05rem;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  width: 100%;
  max-width: 340px;
  align-self: center;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(74, 53, 48, 0.1); }
.btn.primary { background: var(--peach); color: var(--on); }
.btn.good { background: var(--sage); color: #2f4a2c; }
.btn.plain { background: var(--card); border: 2px solid var(--line); box-shadow: none; }
.btn.big { padding: 18px 28px; font-size: 1.2rem; }
.btn.rainbow {
  color: #4a3530;
  background: linear-gradient(120deg, var(--rose), var(--butter), var(--sage), var(--sky), var(--lilac), var(--rose));
  background-size: 300% 100%;
  animation: slide 9s linear infinite;
}
.btn.huge { padding: 30px 26px; font-size: 1.7rem; font-weight: 900; border-radius: 40px; display: flex; flex-direction: column; gap: 4px; max-width: 400px; }
.btn.huge small { font-size: 1rem; font-weight: 700; opacity: 0.85; }
@keyframes slide { to { background-position: 300% 0; } }
.link { background: none; border: 0; padding: 10px; color: var(--soft); font-weight: 700; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; align-self: center; }
.link.danger { margin-top: 20px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.settings .chips { justify-content: flex-start; }
.chip {
  border: 2px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.12s, background 0.2s;
}
.chip:active { transform: scale(0.95); }
.chip[aria-pressed='true'] { background: var(--pick); border-color: transparent; color: var(--on); }
.chip.small { padding: 4px 10px; font-size: 0.8rem; }

/* ---------- mascot + home ---------- */
.mascot {
  width: 96px; height: 96px; border-radius: 46% 54% 52% 48% / 55% 48% 52% 45%;
  background: var(--peach); color: var(--on);
  display: grid; place-items: center; font-size: 2rem; font-weight: 900;
  box-shadow: var(--shadow);
  animation: bob 4s ease-in-out infinite;
}
.mascot.happy { background: var(--sage); font-size: 1.6rem; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }

.greet { font-size: 1.5rem; font-weight: 900; }
.blob {
  width: min(64vw, 250px); aspect-ratio: 1;
  border: 0;
  background: radial-gradient(circle at 32% 28%, var(--blob-hi), var(--peach) 55%, var(--peach-deep));
  color: #4a3530;
  border-radius: 46% 54% 52% 48% / 55% 48% 52% 45%;
  box-shadow: 0 10px 0 var(--blob-shadow), 0 26px 50px var(--blob-glow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  animation: morph 9s ease-in-out infinite, bob 5s ease-in-out infinite;
  transition: transform 0.2s;
  margin: 12px 0 6px;
}
.blob:hover { transform: scale(1.04); }
.blob:active { transform: scale(0.94); }
.blob-text { font-weight: 800; opacity: 0.8; }
@keyframes morph {
  33% { border-radius: 54% 46% 44% 56% / 46% 56% 44% 54%; }
  66% { border-radius: 48% 52% 58% 42% / 58% 44% 56% 42%; }
}

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin-top: 12px; }
.trio.two { grid-template-columns: repeat(2, 1fr); margin-top: 0; }
.stat { background: var(--card); border-radius: 20px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: 0 3px 0 var(--line); }
.stat b { font-size: 1.5rem; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.78rem; color: var(--soft); line-height: 1.25; }
.stat.good { background: color-mix(in srgb, var(--sage) 45%, var(--card)); }
.stat.muted b { color: var(--soft); }

/* ---------- ask + logged ---------- */
.question { font-size: 2.4rem; margin-bottom: 18px; }
.ask .btn.plain { margin-top: 8px; font-size: 0.95rem; max-width: 260px; }

/* ---------- distraction menu ---------- */
.fun-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 10px 0; }
.fun {
  border: 0; border-radius: 34px; padding: 22px 16px 20px; min-height: 190px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  color: #4a3530; box-shadow: var(--shadow);
  transition: transform 0.2s cubic-bezier(0.2, 1.4, 0.4, 1);
  animation: pop 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.fun:nth-child(odd) { rotate: -1.5deg; }
.fun:nth-child(even) { rotate: 1.5deg; }
.fun:nth-child(2) { animation-delay: 0.07s; }
.fun:nth-child(3) { animation-delay: 0.14s; }
.fun:nth-child(4) { animation-delay: 0.21s; }
.fun:hover { transform: scale(1.05) rotate(1deg); }
.fun:active { transform: scale(0.95); }
.fun-emoji { font-size: 3.4rem; line-height: 1.1; animation: wiggle 3.2s ease-in-out infinite; }
.fun:nth-child(even) .fun-emoji { animation-delay: -1.6s; }
.fun-name { font-weight: 900; font-size: 1.15rem; line-height: 1.2; }
.fun-hint { font-size: 0.85rem; opacity: 0.8; line-height: 1.3; }
.fun-doodle { background: linear-gradient(150deg, #ffc3cf, var(--rose)); }
.fun-fortune { background: linear-gradient(150deg, #ffeaa6, var(--butter)); }
.fun-breath { background: linear-gradient(150deg, #cdeaf7, var(--sky)); }
.fun-tiny { background: linear-gradient(150deg, #d3efc9, var(--sage)); }
.breath-pick .fun { min-height: 150px; rotate: 0deg; }
.breath-pick .fun.second { background: linear-gradient(150deg, #e6dafb, var(--lilac)); }
@keyframes pop { from { opacity: 0; transform: scale(0.7); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(8deg) translateY(-4px); } }

/* ---------- doodle ---------- */
.paper {
  width: 100%; aspect-ratio: 1 / 1; max-height: 56dvh;
  background: #fffaf0; border-radius: var(--r); box-shadow: var(--shadow);
  touch-action: none; cursor: crosshair; display: block;
}
.tools { display: flex; flex-direction: column; gap: 10px; }
.swatches, .sizes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--card); background: var(--c); box-shadow: 0 0 0 2px var(--line); transition: transform 0.15s; }
.swatch[aria-pressed='true'] { transform: scale(1.2); box-shadow: 0 0 0 3px var(--ink); }
.size { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); display: grid; place-items: center; }
.size i { width: var(--d); height: var(--d); border-radius: 50%; background: var(--ink); display: block; }
.size[aria-pressed='true'] { background: var(--pick); border-color: transparent; }
.size[aria-pressed='true'] i { background: #4a3530; }

/* ---------- gallery ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.thumb { border: 0; padding: 8px 8px 6px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; transition: transform 0.15s; }
.thumb:nth-child(odd) { rotate: -1deg; }
.thumb:nth-child(even) { rotate: 1deg; }
.thumb:hover { transform: scale(1.04); }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; }
.thumb span { font-size: 0.75rem; color: var(--soft); }

/* ---------- kawaii face ---------- */
.face { width: 100%; height: 100%; display: block; overflow: visible; fill: #4a3530; }
.face .line { fill: none; stroke: #4a3530; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.face .glint { fill: #fff; }
.face .blush { fill: #ff7d95; opacity: 0.55; }
.face .mouth { fill: #e8604c; stroke: #4a3530; stroke-width: 3.5; stroke-linejoin: round; }
.face .tear { fill: #7cc4ea; stroke: none; }
.face-happy circle:not(.glint) { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
.mascot { padding: 10px; }
.blob-face { width: 62%; aspect-ratio: 1; margin-bottom: -8%; }

/* the wince after logging a smoke: pain face for three seconds, then back to calm */
.mascot .face-pain { display: none; }
.mascot.hurting { background: #ffc7c2; animation: wince 0.45s ease-in-out 6; }
.mascot.hurting .face-pain { display: block; }
.mascot.hurting .face-happy { display: none; }
.mascot.hurting .tear { animation: drip 1s ease-in infinite; }
@keyframes wince { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-6px) rotate(-5deg); } 75% { transform: translateX(6px) rotate(5deg); } }
@keyframes drip { from { transform: translateY(-4px); opacity: 1; } to { transform: translateY(12px); opacity: 0; } }

/* ---------- crystal ball ---------- */
body[data-route='fortune'] {
  background:
    radial-gradient(40rem 26rem at 50% 0%, color-mix(in srgb, var(--lilac) 60%, transparent), transparent 65%),
    radial-gradient(40rem 24rem at 0% 100%, color-mix(in srgb, var(--rose) 35%, transparent), transparent 65%),
    radial-gradient(40rem 24rem at 100% 100%, color-mix(in srgb, var(--sky) 40%, transparent), transparent 65%),
    var(--bg);
  background-attachment: fixed;
}
.ball-wrap { position: relative; width: min(52vw, 190px); margin: 6px 0 2px; }
.ball {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 34% 28%, #ffffff, #e6dcff 30%, #a996ee 68%, #6e5cc4);
  box-shadow: 0 0 50px color-mix(in srgb, var(--lilac) 90%, transparent), inset 0 -14px 26px rgba(70, 50, 150, 0.35);
  animation: glow 3.6s ease-in-out infinite;
}
.ball .mist {
  position: absolute; inset: -20%; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, #ffd6ea 18%, transparent 36%, #bfe6ff 55%, transparent 72%, #fff3b8 88%, transparent);
  filter: blur(14px); opacity: 0.8; animation: spin 9s linear infinite;
}
.ball .shine { position: absolute; left: 20%; top: 14%; width: 26%; height: 16%; border-radius: 50%; background: rgba(255, 255, 255, 0.8); transform: rotate(-28deg); filter: blur(2px); }
.ball-stand { width: 62%; height: 22px; margin: -8px auto 0; border-radius: 10px 10px 16px 16px; background: linear-gradient(#b98a5e, #8a5a3c); box-shadow: var(--shadow); position: relative; }
.spark { position: absolute; color: #fff3b8; font-size: 1.4rem; text-shadow: 0 0 10px #ffd972; animation: twinkle 2.4s ease-in-out infinite; }
.spark.s1 { left: -16%; top: 10%; }
.spark.s2 { right: -14%; top: 0; animation-delay: 0.6s; font-size: 1.8rem; }
.spark.s3 { right: -20%; top: 56%; animation-delay: 1.2s; }
.spark.s4 { left: -22%; top: 62%; animation-delay: 1.8s; font-size: 1.1rem; }
@keyframes glow { 50% { box-shadow: 0 0 80px color-mix(in srgb, var(--lilac) 100%, transparent), inset 0 -14px 26px rgba(70, 50, 150, 0.35); transform: translateY(-5px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%, 100% { opacity: 0.2; transform: scale(0.7); } 50% { opacity: 1; transform: scale(1.2) rotate(20deg); } }

.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.kind {
  border: 0; border-radius: 26px; padding: 16px 8px 14px; color: #4a3530; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  transition: transform 0.2s cubic-bezier(0.2, 1.4, 0.4, 1); animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.kind:nth-child(2) { animation-delay: 0.08s; }
.kind:nth-child(3) { animation-delay: 0.16s; }
.kind:hover { transform: translateY(-4px) scale(1.03); }
.kind:active { transform: scale(0.95); }
.kind-emoji { font-size: 2.4rem; line-height: 1.1; }
.kind-name { font-weight: 900; font-size: 0.98rem; line-height: 1.15; }
.kind-hint { font-size: 0.74rem; opacity: 0.8; line-height: 1.25; }
.kind-cookie { background: linear-gradient(150deg, #ffeaa6, var(--butter)); }
.kind-coffee { background: linear-gradient(150deg, #f3d9c2, #e2b594); }
.kind-tea { background: linear-gradient(150deg, #ffd0bd, #f6a58a); }
@media (max-width: 380px) { .kinds { grid-template-columns: 1fr; } .kind { flex-direction: row; text-align: left; padding: 12px 16px; gap: 12px; } .kind-hint { display: none; } }

/* ---------- fortune vessels: cookie, coffee cup, tea glass ---------- */
.vessel { border: 0; background: none; padding: 0; width: min(66vw, 250px); position: relative; animation: bob 3.5s ease-in-out infinite; }
.vessel svg { width: 100%; display: block; overflow: visible; filter: drop-shadow(0 10px 10px rgba(120, 80, 40, 0.22)); }
.revealed .vessel { animation: none; }
.revealed .tap-hint { visibility: hidden; }

.vessel .half path:first-child { fill: #edbd77; stroke: #c98f4a; stroke-width: 3; stroke-linejoin: round; }
.vessel .crease { fill: none; stroke: #c98f4a; stroke-width: 3; stroke-linecap: round; opacity: 0.6; }
.vessel .half { transition: transform 0.7s cubic-bezier(0.3, 1.4, 0.5, 1); transform-box: fill-box; transform-origin: center bottom; }
.revealed .half.left { transform: translate(-44px, 18px) rotate(-24deg); }
.revealed .half.right { transform: translate(44px, 18px) rotate(24deg); }
.crumbs i { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: #d9a55c; opacity: 0; }
.revealed .crumbs i { animation: crumb 0.9s ease-out forwards; }
.crumbs i:nth-child(1) { --x: -60px; --y: 50px; }
.crumbs i:nth-child(2) { --x: 50px; --y: 60px; }
.crumbs i:nth-child(3) { --x: -20px; --y: 80px; }
.crumbs i:nth-child(4) { --x: 26px; --y: 74px; }
.crumbs i:nth-child(5) { --x: 70px; --y: 30px; }
@keyframes crumb { 0% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)); } }

.vessel .saucer { fill: #fffaf2; stroke: #e0b25a; stroke-width: 3; }
.vessel .saucer-in { fill: #f4e6d2; }
.vessel .saucer-rim { fill: none; stroke: #d6453d; stroke-width: 3; stroke-dasharray: 7 6; }
.vessel .grounds { fill: #5a3826; opacity: 0; transition: opacity 0.8s 0.4s; }
.revealed .grounds { opacity: 0.9; }
.vessel .cup { transition: transform 0.9s cubic-bezier(0.3, 1.3, 0.5, 1); transform-box: fill-box; transform-origin: center; }
.revealed .cup { transform: translate(34px, -44px) rotate(20deg); }
.vessel .cup .body { fill: #fffaf2; stroke: #d9c2a8; stroke-width: 3; stroke-linejoin: round; }
.vessel .cup .foot { fill: #f1e3cf; stroke: #d9c2a8; stroke-width: 2; }
.vessel .cup .handle { fill: none; stroke: #d9c2a8; stroke-width: 7; stroke-linecap: round; }
.vessel .cup .band { fill: none; stroke: #c8433b; stroke-width: 5; }
.vessel .cup .band.gold { stroke: #e0b25a; stroke-width: 2.5; }

.vessel .glass { fill: rgba(255, 255, 255, 0.28); stroke: #b9cdd6; stroke-width: 3; }
.vessel .glass-shine { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; opacity: 0.7; }
.vessel .tea { fill: #b4441a; transform-box: fill-box; transform-origin: center bottom; transition: transform 1.2s ease-in-out; }
.revealed .tea { transform: scaleY(0.1); }
.vessel .leaves { fill: #3d2414; transform-box: fill-box; transform-origin: center; animation: drift 4s ease-in-out infinite; transition: transform 1.2s ease-in; }
.revealed .leaves { animation: none; transform: translateY(34px) scale(0.75, 0.35); }
@keyframes drift { 50% { transform: translateY(8px) rotate(8deg); } }

.slip {
  width: 100%; max-width: 420px; margin-top: -4px;
  background: #fffdf5; color: #4a3530; border-radius: 8px; padding: 18px 20px;
  box-shadow: 0 4px 14px rgba(120, 80, 40, 0.18);
  border-left: 5px dotted #f3c9a0; border-right: 5px dotted #f3c9a0;
  font-size: 1.15rem; font-weight: 700; font-style: italic;
  transform: scaleX(0) rotate(-2deg); opacity: 0;
  transition: transform 0.7s 0.5s cubic-bezier(0.2, 1.3, 0.4, 1), opacity 0.4s 0.5s;
}
.revealed .slip { transform: scaleX(1) rotate(-1deg); opacity: 1; }
.slip .sym { display: block; font-size: 2.4rem; font-style: normal; line-height: 1.2; margin-bottom: 4px; }
.slip .sym:empty { display: none; }
.fortune-coffee .slip, .fortune-tea .slip { border: 0; border-radius: 24px; }
.revealed.fortune-coffee .slip, .revealed.fortune-tea .slip { transform: none; }
.after { display: flex; flex-direction: column; gap: 8px; width: 100%; animation: rise 0.5s both; }
.after[hidden] { display: none; }

/* ---------- breath ---------- */
.orb-wrap { width: min(74vw, 300px); aspect-ratio: 1; display: grid; place-items: center; position: relative; margin: 10px 0; }
.orb-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px dashed color-mix(in srgb, var(--sky) 70%, var(--line)); }
.orb {
  --s: 0.5;
  width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, var(--sky) 55%, #7fbfdf);
  box-shadow: 0 0 60px color-mix(in srgb, var(--sky) 70%, transparent);
  transform: scale(var(--s));
  transition: transform 4s cubic-bezier(0.45, 0.05, 0.55, 0.95), background 1s;
  display: grid; place-items: center;
}
.orb[data-cue='hold'] { box-shadow: 0 0 60px color-mix(in srgb, var(--lilac) 80%, transparent); }
.orb[data-cue='done'] { background: radial-gradient(circle at 35% 30%, #ffffff, var(--sage) 55%, #8cc783); }
.orb-count { font-size: 3rem; font-weight: 900; color: #33566a; font-variant-numeric: tabular-nums; }
.breath-label { font-size: 1.6rem; font-weight: 900; min-height: 2.4rem; }
.breath-round { min-height: 1.4rem; }

/* ---------- tiny things ---------- */
.tiny-list { display: grid; gap: 10px; }
.tiny-card {
  border: 0; border-radius: 20px; padding: 14px 16px; background: var(--card);
  display: flex; align-items: center; gap: 12px; text-align: left; font-weight: 800;
  box-shadow: 0 3px 0 var(--line); border-left: 8px solid var(--g, var(--peach));
  transition: transform 0.15s;
}
.tiny-card:hover { transform: translateX(4px); }
.tiny-card:active { transform: scale(0.97); }
.tiny-emoji { font-size: 1.7rem; }
.tiny-card .star { margin-left: auto; color: #e0a800; }
.g-sip { --g: var(--sky); }
.g-nibble { --g: var(--butter); }
.g-move { --g: var(--sage); }
.g-senses { --g: var(--rose); }
.g-mind { --g: var(--lilac); }
.g-done { --g: var(--peach); }
.tiny-big {
  width: 130px; height: 130px; border-radius: 44% 56% 50% 50% / 54% 46% 54% 46%;
  background: var(--g); display: grid; place-items: center; font-size: 4rem; box-shadow: var(--shadow);
  animation: bob 4s ease-in-out infinite;
}
.do { font-size: 1.15rem; font-weight: 700; }
.why { background: var(--card); border-radius: 20px; padding: 12px 16px; font-size: 0.92rem; text-align: left; border: 2px dashed var(--line); }
.why b { font-size: 0.78rem; color: var(--soft); letter-spacing: 0.04em; }

/* ---------- writing page + journal ---------- */
#pad {
  width: 100%; min-height: 220px; resize: vertical;
  font: inherit; font-weight: 600; line-height: 1.75; color: #4a3530;
  background: repeating-linear-gradient(#fffaf0, #fffaf0 30px, #f3dfc8 31px, #fffaf0 32px);
  background-attachment: local;
  border: 0; border-radius: var(--r); padding: 6px 18px 18px; box-shadow: var(--shadow);
}
#pad::placeholder { color: #b89f8f; }
#pad:focus-visible { outline: 3px solid var(--peach-deep); outline-offset: 3px; }
.tabs { justify-content: flex-start; }
.notes { display: grid; gap: 12px; }
.note-card { background: var(--card); border-radius: 20px; padding: 14px 16px; box-shadow: 0 3px 0 var(--line); border-left: 8px solid var(--peach); display: grid; gap: 8px; }
.note-card header { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; justify-content: space-between; }
.note-card p { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-card .chip { justify-self: end; }

/* ---------- celebration ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 12px; height: 16px; border-radius: 4px; animation: fall 3.2s ease-in forwards; }
.confetti i:nth-child(5n + 1) { background: var(--rose); }
.confetti i:nth-child(5n + 2) { background: var(--butter); }
.confetti i:nth-child(5n + 3) { background: var(--sage); }
.confetti i:nth-child(5n + 4) { background: var(--sky); }
.confetti i:nth-child(5n) { background: var(--lilac); }
.confetti i:nth-child(1) { left: 6%; animation-delay: 0s; }
.confetti i:nth-child(2) { left: 14%; animation-delay: 0.3s; }
.confetti i:nth-child(3) { left: 22%; animation-delay: 0.1s; }
.confetti i:nth-child(4) { left: 30%; animation-delay: 0.5s; }
.confetti i:nth-child(5) { left: 38%; animation-delay: 0.2s; }
.confetti i:nth-child(6) { left: 46%; animation-delay: 0.6s; }
.confetti i:nth-child(7) { left: 54%; animation-delay: 0.05s; }
.confetti i:nth-child(8) { left: 62%; animation-delay: 0.4s; }
.confetti i:nth-child(9) { left: 70%; animation-delay: 0.25s; }
.confetti i:nth-child(10) { left: 78%; animation-delay: 0.55s; }
.confetti i:nth-child(11) { left: 86%; animation-delay: 0.15s; }
.confetti i:nth-child(12) { left: 93%; animation-delay: 0.45s; }
.confetti i:nth-child(13) { left: 34%; animation-delay: 0.8s; }
.confetti i:nth-child(14) { left: 66%; animation-delay: 0.9s; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: 0.6; } }

/* ---------- progress ---------- */
.chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; height: 170px; background: var(--card); border-radius: var(--r); padding: 14px 10px 8px; box-shadow: 0 3px 0 var(--line); }
.bar { display: grid; grid-template-rows: 16px 1fr 18px; align-items: end; justify-items: center; min-width: 0; }
.bar i { width: 100%; max-width: 20px; min-height: 4px; border-radius: 8px 8px 4px 4px; background: var(--peach); display: block; align-self: end; }
.bar.old i { background: color-mix(in srgb, var(--peach) 40%, var(--line)); }
.bar.today i { background: var(--peach-deep); }
.bar .n { font-size: 0.68rem; font-weight: 800; color: var(--soft); }
.bar .d { font-size: 0.58rem; color: var(--soft); overflow: hidden; }
.bar.today .d { color: var(--ink); font-weight: 900; }
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.entries li { background: var(--card); border-radius: 16px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.entries li .chip { margin-left: auto; }

/* ---------- pages with the bar and credit under them ---------- */
.has-nav .page { padding-bottom: 28px; }
.has-nav .page.center { min-height: calc(100dvh - 150px); padding-bottom: 28px; }
.has-footer:not(.has-nav) .page.center { min-height: calc(100dvh - 70px); padding-bottom: 28px; }

/* ---------- language switch, top corner of the main pages ---------- */
#lang { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 6; }
#lang .chips { gap: 4px; background: color-mix(in srgb, var(--card) 85%, transparent); border-radius: 999px; padding: 4px; box-shadow: 0 3px 0 var(--line); }
#lang .chip { padding: 5px 12px; font-size: 0.8rem; border-color: transparent; background: transparent; }
#lang .chip[aria-pressed='true'] { background: var(--pick); }
.has-footer .page { padding-top: max(64px, calc(env(safe-area-inset-top) + 56px)); }

/* ---------- about pages (static) ---------- */
.about-body { display: block; }
.about { align-items: stretch; padding-bottom: 48px; }
.about .mascot { align-self: center; }
.about h1 { text-align: center; }
.about .lead { font-size: 1.15rem; font-weight: 700; text-align: center; }
.about h2 { font-size: 1.3rem; color: var(--ink); text-transform: none; letter-spacing: 0; margin-top: 26px; font-weight: 900; }
.about h3 { font-size: 1.02rem; margin: 12px 0 0; font-weight: 900; }
.about ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.about a.btn { display: block; text-align: center; text-decoration: none; margin: 10px auto; }
.about .soft { text-align: center; }
.about .soft a { color: inherit; font-weight: 800; }
a.btn { text-decoration: none; text-align: center; display: block; color: var(--ink); }
a.btn.primary { color: var(--on); }

/* ---------- footer credit ---------- */
.credit { margin-top: 18px; font-size: 0.8rem; color: var(--soft); text-align: center; align-self: center; }
#credit { margin: 0; padding: 6px 16px max(18px, env(safe-area-inset-bottom)); flex: none; line-height: 1.9; }
#credit[hidden], #lang[hidden] { display: none; }
.credit a { color: inherit; font-weight: 800; text-underline-offset: 3px; }

/* ---------- nav, toast, dialogs ---------- */
#nav {
  position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 5;
  width: min(calc(100% - 24px), 480px); margin: 0 auto 10px; flex: none;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(10px);
  border-radius: 999px; box-shadow: var(--shadow); padding: 6px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
}
#nav[hidden] { display: none; }
#nav a { text-decoration: none; color: var(--soft); font-size: 0.74rem; font-weight: 800; display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: 999px; }
#nav a span { font-size: 1.3rem; line-height: 1.2; }
#nav a[aria-current='page'] { background: var(--pick); color: var(--on); }

#toast {
  position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); transform: translate(-50%, -150%);
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 800; font-size: 0.92rem;
  transition: transform 0.4s cubic-bezier(0.2, 1.3, 0.4, 1); z-index: 10; max-width: calc(100% - 32px); text-align: center; pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); }

dialog { border: 0; border-radius: var(--r); background: var(--card); color: var(--ink); padding: 22px; width: min(calc(100% - 40px), 420px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(74, 53, 48, 0.45); backdrop-filter: blur(3px); }
dialog form { display: flex; flex-direction: column; gap: 16px; text-align: center; }
dialog .row { flex-wrap: nowrap; }
dialog .btn { padding: 12px 14px; font-size: 0.95rem; }
#viewer img { width: 100%; border-radius: 16px; display: block; }

@media (max-width: 360px) {
  .fun-grid { grid-template-columns: 1fr; }
  .fun { min-height: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .page, .fun, .btn, .blob { transition: none; }
  .confetti { display: none; }
  /* breathing: fade instead of grow */
  .orb { transform: scale(0.8); opacity: calc(0.1 + var(--s) * 0.9); transition-property: opacity; }
  .vessel .half, .vessel .cup, .vessel .tea, .vessel .leaves, .vessel .grounds, .slip { transition-duration: 0.01s; transition-delay: 0s; }
}
.logged .mascot { width: 132px; height: 132px; padding: 14px; }
