@font-face { font-family: "Zen Maru Gothic"; src: url(font/zmg-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url(font/zmg-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url(font/zmg-900.woff2) format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --bg: #e6ecf1; --bg2: #d2dce6;
  --ink: #1d3a6e; --deep: #14284f; --soft: #52678f;
  --paper: #fcfdff; --grid: #e2eaf4; --line: #c3d1e4;
  --pink: #d93d8f;
  --holo: linear-gradient(100deg, #f7c6ee 0%, #cfd2ff 48%, #b2ebf3 100%);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --lift: 0 0 0 1px rgb(20 40 79 / .06), 0 2px 4px rgb(20 40 79 / .06), 0 12px 28px -6px rgb(20 40 79 / .16);
  --out: cubic-bezier(.16, 1, .3, 1);
  --dock: 88px;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { font: 400 16px/1.4 "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif; color: var(--ink); background: linear-gradient(160deg, var(--bg), var(--bg2)) fixed; overflow: hidden; -webkit-tap-highlight-color: transparent; }
::selection { background: #f7c6ee; color: var(--deep); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
[hidden] { display: none !important; }
svg.ic { display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ghost { position: fixed; inset: 0; padding: var(--s6) var(--s5); font-weight: 900; font-size: clamp(64px, 13vw, 180px); line-height: 1.02; text-transform: uppercase; letter-spacing: -.02em; color: var(--ink); opacity: .07; overflow: hidden; pointer-events: none; text-align: right; }

#app { position: relative; height: 100dvh; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; padding: var(--s3) var(--s4) 0; overflow: hidden; }

/* top row */
.top { display: flex; align-items: center; gap: var(--s2); height: 48px; flex: none; }
.logo { font-weight: 900; font-size: 24px; line-height: .96; letter-spacing: -.01em; margin-right: auto; }
.chip { display: flex; align-items: baseline; gap: var(--s1); height: 32px; padding: 0 var(--s3) 0 40px; position: relative; border-radius: 16px; background: var(--ink); color: #fff; font-size: 13px; line-height: 32px; }
.chip b { font-weight: 900; font-size: 16px; font-variant-numeric: tabular-nums; }
.chip svg { position: absolute; left: -2px; top: -2px; width: 36px; height: 36px; padding: 7px; border-radius: 50%; background: var(--holo); color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.round { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; margin-left: var(--s1); }
.round[aria-pressed="false"] { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }

/* the notebook */
.book { position: relative; flex: 1; min-height: 0; margin: var(--s3) 0 calc(var(--dock) + var(--s2)) var(--s3); }
.book::before { content: ""; position: absolute; inset: 6px -6px -8px -4px; border-radius: 24px; background: var(--holo); box-shadow: inset 0 0 0 2px #e79bd6; transform: rotate(-.8deg); }
.paper { position: relative; height: 100%; display: flex; flex-direction: column; border-radius: 20px; border: 2px solid var(--ink); overflow: hidden; box-shadow: var(--lift);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 -1px / 100% 20px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) -1px 0 / 20px 100%,
    linear-gradient(140deg, #fdf2fa 0%, var(--paper) 38%, #eef9fc 100%); }
.book::after { content: ""; position: absolute; left: -14px; top: 28px; bottom: 28px; width: 40px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='48'%3E%3Ccircle cx='32' cy='24' r='5' fill='%23c9d6e6'/%3E%3Crect x='2' y='19.5' width='31' height='9' rx='4.5' fill='%231d3a6e'/%3E%3Crect x='6' y='21.5' width='14' height='2' rx='1' fill='%235f7fb4'/%3E%3C/svg%3E") repeat-y; }

.who { flex: none; padding: var(--s4) var(--s4) var(--s3) var(--s6); display: grid; gap: var(--s2); border-bottom: 2px dashed var(--line); }
.me { display: flex; align-items: center; gap: var(--s3); min-height: 48px; text-align: left; width: 100%; }
.face { position: relative; flex: none; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; background: var(--holo); box-shadow: 0 0 0 2px var(--ink); }
.face img, .card .pic img { position: absolute; max-width: none; height: auto; width: calc(var(--z) * 100%); left: calc(50% - var(--cx) * var(--z) * 100%); top: calc(50% - var(--cy) * var(--z) * 132.7%); }
.meName { flex: 1; display: grid; border-bottom: 2px solid var(--ink); padding-bottom: 2px; }
.meName b { font-weight: 700; font-size: 20px; line-height: .98; }
.meName span { font-size: 13px; color: var(--soft); }
.meter { display: flex; align-items: center; gap: var(--s3); }
.badge { position: relative; flex: none; width: 36px; height: 36px; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 15px; line-height: 1; font-variant-numeric: tabular-nums; }
.badge svg { position: absolute; inset: 0; fill: var(--ink); }
.badge b { position: relative; }
.meter > div { flex: 1; min-width: 0; }
.meter p { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.meter p b { font-weight: 700; }
.meter p span { color: var(--soft); }
.bar { height: 12px; border-radius: 6px; background: var(--ink); overflow: hidden; margin-top: 2px; }
.bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--holo); transition: width .6s var(--out); }

.pane { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s3) var(--s4) var(--s5) var(--s6); scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.group { font-weight: 700; font-size: 13px; line-height: .98; color: var(--soft); margin: var(--s5) 0 var(--s2); }
.group.first { margin-top: var(--s1); }

/* new task */
.type label { display: block; font-weight: 700; font-size: 13px; line-height: .98; color: var(--soft); margin-bottom: var(--s2); }
.typeRow { display: flex; gap: var(--s2); }
.type input { flex: 1; min-width: 0; height: 44px; padding: 0 var(--s4); border-radius: 22px; border: 2px solid var(--ink); background: #fff; caret-color: var(--pink); }
.type input::placeholder { color: #6b7d9f; }
.type input:focus-visible { outline-offset: 1px; }
.btn { height: 44px; padding: 0 var(--s5); border-radius: 22px; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; transition: transform .15s var(--out), background .15s; }
.btn:hover { background: var(--deep); }
.btn:active { transform: scale(.96); }
.btn.small { height: 36px; padding: 0 var(--s4); font-size: 13px; }

/* task rows */
.list { list-style: none; padding: 0; }
.list li { display: grid; grid-template-columns: 36px 1fr 32px; align-items: center; column-gap: var(--s2); min-height: 48px; border-bottom: 1px solid var(--line); }
.box { grid-row: 1 / span 2; width: 44px; height: 44px; margin-left: -8px; display: grid; place-items: center; }
.box span { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--ink); background: #fff; display: grid; place-items: center; color: transparent; transition: background .15s, transform .15s var(--out); }
.box:hover span { background: #f3e9fb; }
.box:active span { transform: scale(.88); }
.box[aria-checked="true"] span { background: var(--ink); color: #fff; }
.title { grid-column: 2; min-width: 0; padding: var(--s3) 0; overflow-wrap: anywhere; }
.title:has(+ .due:not(:empty)) { padding-bottom: 0; }
.done .title { color: var(--soft); text-decoration: line-through; }
.due { grid-column: 2; padding-bottom: var(--s2); display: flex; align-items: center; gap: var(--s1); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.due:empty { display: none; }
.due.late { color: var(--pink); }
.del { grid-column: 3; grid-row: 1 / span 2; width: 44px; height: 44px; margin-left: -4px; display: grid; place-items: center; color: var(--soft); border-radius: 50%; }
.del:hover { color: var(--pink); }

.empty { padding: var(--s5) 0 var(--s2); }
.empty h2 { font-weight: 700; font-size: 20px; line-height: .98; }
.empty p { color: var(--soft); margin: var(--s2) 0 var(--s4); }

/* stats */
.nums div { display: flex; align-items: baseline; gap: var(--s2); min-height: 40px; border-bottom: 1px solid var(--line); }
.nums dt { flex: 1; }
.nums dd { font-weight: 900; font-size: 24px; line-height: 40px; font-variant-numeric: tabular-nums; }
.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s2); align-items: end; height: 136px; }
.chart div { display: grid; justify-items: center; gap: var(--s1); align-content: end; height: 100%; font-size: 13px; }
.chart b { font-weight: 700; font-variant-numeric: tabular-nums; }
.chart i { width: 100%; max-width: 32px; min-height: 4px; border-radius: 6px; background: var(--holo); box-shadow: inset 0 0 0 2px var(--ink); }
.chart .now i { background: var(--ink); }
.chart span { color: var(--soft); }
.chart .now span { color: var(--ink); font-weight: 700; }
.set { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 48px; }

/* picker */
.girls { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.card { display: grid; text-align: left; border-radius: 16px; border: 2px solid var(--line); background: #fff; overflow: hidden; transition: transform .15s var(--out), border-color .15s; }
.card:hover { border-color: var(--ink); }
.card:active { transform: scale(.97); }
.card[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.card .pic { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--holo); }
.card b { font-weight: 700; padding: var(--s2) var(--s3) 0; line-height: 1.2; }
.card > span:last-child { font-size: 13px; color: var(--soft); padding: 0 var(--s3) var(--s2); }
.card[aria-pressed="true"] > span:last-child { color: var(--pink); font-weight: 700; }

/* dock */
.dock { position: absolute; left: var(--s4); right: var(--s4); bottom: var(--s4); display: flex; align-items: flex-end; gap: var(--s3); z-index: 6; pointer-events: none; }
.dock > * { pointer-events: auto; }
.tabs { flex: 1; display: flex; height: 48px; border-radius: 24px; background: #fff; border: 2px solid var(--ink); overflow: hidden; box-shadow: var(--lift); }
.tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: var(--s1); font-weight: 700; font-size: 15px; border-left: 1px solid var(--line); transition: background .15s; }
.tab:first-child { border-left: 0; }
.tab:hover { background: #eef2f9; }
.tab[aria-pressed="true"] { background: var(--ink); color: #fff; }
.keys { position: absolute; right: 22px; bottom: 100px; margin: 0; box-shadow: 0 0 0 3px #fff, var(--lift); }
.mic { flex: none; width: 88px; height: 88px; border-radius: 50%; background: var(--holo); display: grid; place-content: center; justify-items: center; gap: 2px; font-weight: 900; font-size: 13px; line-height: 1; box-shadow: inset 0 0 0 4px #fff, 0 0 0 2px var(--ink), 0 2px 4px rgb(20 40 79 / .06), 0 12px 28px -6px rgb(20 40 79 / .16); transition: transform .2s var(--out); }
.mic:hover { transform: translateY(-2px); }
.mic:active { transform: scale(.94); }
.mic.on { background: var(--pink); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 4px #fff, 0 0 0 2px var(--ink), 0 0 0 10px rgb(217 61 143 / .25); } }

/* the girl: slides in to talk, takes the stage to celebrate */
.stage { position: absolute; right: -24px; bottom: 0; width: 232px; aspect-ratio: 660 / 876; z-index: 4; pointer-events: none; transform: translateY(104%); transition: transform .55s var(--out), width .45s var(--out), right .45s var(--out); }
.stage img { display: block; width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgb(20 40 79 / .18)); transform-origin: 50% 100%; }
.talking .stage, .party .stage { transform: none; }
.party .stage { width: min(96%, 400px); right: calc(50% - min(48%, 200px)); }
.party .stage img { animation: hop .42s ease-in-out infinite; }
.party.spin .stage img { animation: twirl .5s var(--out); }
@keyframes hop { 50% { transform: translateY(-10px) scale(1.01, .99); } }
@keyframes twirl { from { transform: scale(.94) rotate(-3deg); filter: brightness(1.5); } }
.glow { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(120% 70% at 50% 100%, rgb(247 198 238 / .92), rgb(207 210 255 / .86) 45%, rgb(252 253 255 / .7) 100%); }
.party .glow { opacity: 1; }
.stamp { position: absolute; left: 0; top: 4%; padding: var(--s2) var(--s4); border-radius: 12px; background: var(--ink); color: #fff; font-weight: 900; font-size: 32px; line-height: .98; transform: rotate(-8deg) scale(0); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
.party .stamp { animation: slam .5s var(--out) .2s forwards; }
@keyframes slam { from { transform: rotate(-20deg) scale(2.2); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }
.stars { position: absolute; inset: -40% -10% 0; overflow: hidden; }
.stars i { position: absolute; top: -12px; width: 10px; height: 10px; border-radius: 3px; animation: fall var(--d) linear forwards; }
@keyframes fall { to { transform: translateY(640px) rotate(540deg); opacity: .2; } }

.bubble { position: absolute; right: 196px; bottom: 236px; left: var(--s4); z-index: 5; display: grid; gap: 2px; text-align: left; padding: var(--s3) var(--s4); border-radius: 18px; background: #fff; box-shadow: var(--lift); font-size: 15px; opacity: 0; transform: translateY(8px) scale(.96); transform-origin: 100% 100%; pointer-events: none; transition: opacity .25s, transform .35s var(--out); }
.bubble::after { content: ""; position: absolute; right: -7px; bottom: 22px; width: 16px; height: 16px; background: #fff; transform: rotate(45deg); border-radius: 0 4px 0 0; }
.bubble b { font-weight: 700; font-size: 13px; color: var(--pink); line-height: .98; }
.talking .bubble, .party .bubble { opacity: 1; transform: none; pointer-events: auto; }
.party .bubble { left: var(--s4); right: var(--s4); bottom: auto; top: 72px; text-align: center; }
.party .bubble::after { display: none; }
.hearing .bubble span { color: var(--soft); }

/* it is a phone app: on a wide screen it stays a phone */
@media (min-width: 560px) {
  body { display: grid; place-items: center; }
  #app { width: 390px; height: min(844px, 100dvh - 48px); margin: 0; border-radius: 44px; background: linear-gradient(160deg, var(--bg), var(--bg2)); box-shadow: 0 0 0 10px var(--deep), 0 2px 4px rgb(20 40 79 / .06), 0 12px 28px -6px rgb(20 40 79 / .16); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .party .stamp { transform: rotate(-8deg) scale(1); }
}
