/* Collab days — a stamp card (スタンプカード): every day you're free gets stamped with OniGiri's face.
   Colours from her icon: lilac hair, cheek pink, rice white, the aqua of her ice lolly; Japanese calendar
   weekday colours (Sunday red, Saturday blue). Type: Pink Chicken (the rush meter commission's font) for names and
   numbers, Nunito for everything you read. */
@font-face { font-family: 'Pink Chicken'; font-display: swap; src: url(/rush/fonts/PinkChicken-Regular.woff2) format('woff2'); }
@font-face { font-family: 'Nunito CD'; font-style: normal; font-weight: 200 1000; font-display: swap; src: url(/fonts/nunito-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito CD'; font-style: normal; font-weight: 200 1000; font-display: swap; src: url(/fonts/nunito-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --lilac: #EFE6FB;        /* page */
  --dot: #E2D3F7;
  --rice: #FFFDF9;         /* the card */
  --plum: #3B2352;         /* text */
  --muted: #6E5A86;
  --faint: #B9A9D0;
  --hair: #7A54B5;         /* buttons, links, titles */
  --hair-deep: #5B3A92;
  --hair-soft: #F2EAFD;
  --line: #DDCDF4;
  --cheek: #FF8FB1;        /* stamp ink */
  --cheek-deep: #E8507F;
  --cheek-soft: #FFC9D9;
  --aqua: #36C9BC;         /* best day */
  --aqua-deep: #0E8C81;
  --sun: #D9415A;
  --sat: #3866D1;
  --round: 'Nunito CD', 'M PLUS Rounded 1c', ui-rounded, system-ui, -apple-system, 'Segoe UI', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  --cute: 'Pink Chicken', var(--round);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  font: 500 16px/1.5 var(--round); color: var(--plum);
  background-color: var(--lilac);
  background-image: radial-gradient(var(--dot) 2.2px, transparent 2.6px), radial-gradient(var(--dot) 2.2px, transparent 2.6px);
  background-size: 28px 28px; background-position: 0 0, 14px 14px;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
[hidden] { display: none !important; }
a { color: var(--hair-deep); }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--hair); outline-offset: 2px; }

/* ── header ─────────────────────────────────────────────── */
.top { max-width: 600px; margin: 0 auto; padding: 18px 18px 0; }
.home { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--plum); border-radius: 999px; padding-right: 10px; }
.logo { width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--rice); box-shadow: 0 2px 0 var(--line); display: block; }
.brand { font: 1.35rem/1 var(--cute); letter-spacing: .01em; }

main { max-width: 600px; margin: 0 auto; padding: 8px 18px 24px; }
.loading { text-align: center; color: var(--muted); padding: 48px 0; }

.intro { padding: 18px 4px 16px; }
.title { font: 2.25rem/1.08 var(--cute); color: var(--hair); margin: 0; overflow-wrap: anywhere; letter-spacing: .005em; }
.lede, .note { margin: 10px 0 0; color: var(--muted); max-width: 46ch; }
.note { white-space: pre-line; color: var(--plum); }

h2 { font: 1.3rem/1.2 var(--cute); color: var(--plum); margin: 0 0 10px; font-weight: 400; }

/* ── the card ───────────────────────────────────────────── */
.card {
  background: var(--rice); border-radius: 28px; padding: 18px;
  border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line);
}
.field { display: block; margin-bottom: 16px; }
.label { display: block; font-weight: 800; font-size: .95rem; margin-bottom: 6px; }
.opt { font-weight: 600; color: var(--muted); }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.label-row .label { margin: 0; }
.count { font-size: .9rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
input, textarea {
  width: 100%; border: 2px solid var(--line); border-radius: 16px; background: #fff;
  padding: 12px 14px; font-size: 1rem; font-weight: 600; outline: none; resize: vertical;
}
input::placeholder, textarea::placeholder { color: var(--faint); font-weight: 600; }
input:focus, textarea:focus { border-color: var(--hair); box-shadow: 0 0 0 3px rgb(122 84 181 / .18); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  border: 0; border-radius: 999px; padding: 13px 24px; min-height: 48px; cursor: pointer;
  background: var(--hair); color: #fff; font-weight: 800; font-size: 1.02rem;
  box-shadow: 0 4px 0 var(--hair-deep); transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:hover { background: #6C47A8; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--hair-deep); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.small { padding: 9px 16px; min-height: 40px; font-size: .92rem; box-shadow: 0 3px 0 var(--hair-deep); }
.btn.soft { background: var(--hair-soft); color: var(--hair-deep); box-shadow: 0 3px 0 var(--line); }
.btn.soft:hover { background: #E9DDFB; }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { background: var(--hair-soft); }
.btn.danger { background: #FFE9EE; color: #B3243F; box-shadow: 0 3px 0 #F6C6D2; }
.btn.danger:hover { background: #FFDCE4; }
.actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.actions.wrap { flex-wrap: wrap; margin-top: 10px; }
.actions .btn:first-child { flex: 1 1 auto; }
.actions.wrap .btn:first-child { flex: 0 0 auto; }
.link { border: 0; background: none; padding: 0; color: var(--hair-deep); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.error { margin: 12px 0 0; padding: 10px 14px; border-radius: 14px; background: #FFE9EE; color: #A3203A; font-weight: 700; font-size: .95rem; }
.aside { margin: 12px 0 0; font-size: .92rem; color: var(--muted); }
.hint { margin: 0 0 10px; font-size: .92rem; color: var(--muted); }
.empty { color: var(--muted); margin: 0; }

.chip {
  border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; min-height: 36px;
  font-weight: 700; font-size: .88rem; color: var(--hair-deep); cursor: pointer;
}
.chip:hover { background: var(--hair-soft); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.pager { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pager .month { font: 1.15rem/1 var(--cute); }
.nav { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 1.4rem; line-height: 1; color: var(--hair-deep); cursor: pointer; }
.nav:disabled { opacity: .35; cursor: default; }

/* ── tabs ───────────────────────────────────────────────── */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--hair-soft); border-radius: 999px; padding: 4px; margin: -4px -4px 18px; }
.tabs [role=tab] {
  border: 0; border-radius: 999px; padding: 9px 10px; min-height: 42px; background: transparent; cursor: pointer;
  font-weight: 800; color: var(--muted);
}
.tabs [role=tab][aria-selected=true] { background: #fff; color: var(--plum); box-shadow: 0 2px 0 var(--line); }

/* ── the calendar: stamp slots ──────────────────────────── */
.mon + .mon { margin-top: 14px; }
.mon-name { font: 1.1rem/1 var(--cute); margin: 4px 2px 8px; }
.wk, .row { display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(4px, 1.6vw, 9px); }
.row + .row { margin-top: clamp(4px, 1.6vw, 9px); }
.wk { margin-bottom: 6px; }
.wk span { text-align: center; font-size: .75rem; font-weight: 800; color: var(--muted); }
.wk .sun { color: var(--sun); } .wk .sat { color: var(--sat); }

.slot {
  position: relative; aspect-ratio: 1; width: 100%; max-width: 64px; justify-self: center;
  border-radius: 50%; border: 2px dashed var(--line); background: #fff; padding: 0;
  display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
  font: clamp(.95rem, 4vw, 1.15rem)/1 var(--cute); color: var(--plum);
}
.slot.sun { color: var(--sun); } .slot.sat { color: var(--sat); }
.slot.blank { border: 0; background: none; cursor: default; color: var(--faint); font-size: clamp(.8rem, 3.4vw, .95rem); }
.slot.blank.sun, .slot.blank.sat { color: var(--faint); }
button.slot:hover { border-color: var(--hair); }
.slot:disabled { cursor: default; }

/* stamped: her face in pink ink, a little crooked, like a real rubber stamp */
.slot .ink {
  position: absolute; inset: 2px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: var(--cheek-soft) url(/icons/brand.webp) center / cover no-repeat;
  background-blend-mode: multiply; filter: grayscale(.15) contrast(1.05) saturate(.9);
  transform: rotate(var(--r, -6deg)) scale(.6);
}
.slot.on { border: 3px solid var(--cheek-deep); background: var(--cheek-soft); }
.slot.on .ink { opacity: .92; transform: rotate(var(--r, -6deg)); }
.slot.on .num {
  position: absolute; right: -5px; bottom: -5px; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 999px;
  display: grid; place-items: center; background: var(--rice); border: 2px solid var(--cheek-deep);
  font-size: .72rem; color: var(--plum);
}
.slot.on.sun .num { color: var(--sun); } .slot.on.sat .num { color: var(--sat); }
.slot.thunk .ink { animation: thunk .32s cubic-bezier(.2, .9, .3, 1.25); }
@keyframes thunk {
  0% { opacity: 0; transform: rotate(calc(var(--r, -6deg) - 14deg)) scale(1.6); }
  55% { opacity: 1; transform: rotate(var(--r, -6deg)) scale(.92); }
  100% { opacity: .92; transform: rotate(var(--r, -6deg)) scale(1); }
}
.saved .slot.on .ink { animation: wave .5s ease-out both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes wave { 0%, 100% { transform: rotate(var(--r, -6deg)) scale(1); } 40% { transform: rotate(calc(var(--r, -6deg) + 8deg)) scale(1.14); } }

/* the plan maker's calendar: picked days are filled lilac (no stamp: stamps are for people) */
#make-cal .slot.on { border: 3px solid var(--hair); background: var(--hair-soft); }
#make-cal .slot.on .ink { display: none; }
#make-cal .slot.on .num { position: static; min-width: 0; height: auto; padding: 0; border: 0; background: none; font-size: inherit; color: var(--hair-deep); }
#make-cal .slot.past { border-style: solid; border-color: transparent; color: var(--faint); background: none; }

/* everyone: how many are free (heat), the best day ringed in aqua */
#all-cal button.slot { border-style: solid; border-color: var(--line); background: color-mix(in srgb, var(--cheek) var(--heat, 0%), #fff); }
#all-cal .slot .tally {
  position: absolute; right: -5px; bottom: -5px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; background: var(--plum); color: #fff; font: .72rem/1 var(--cute);
}
#all-cal .slot.best { border: 3px solid var(--aqua); box-shadow: 0 0 0 3px rgb(54 201 188 / .25); }
#all-cal .slot.best .tally { background: var(--aqua-deep); }
#all-cal .slot[aria-pressed=true] { outline: 3px solid var(--plum); outline-offset: 2px; }

.who { margin-top: 16px; min-height: 1.5em; }
.who-day { font: 1.1rem/1.2 var(--cute); margin: 0 0 8px; }
.names { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.names li { background: var(--hair-soft); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: .92rem; }
.names li.me { background: var(--cheek-soft); }

/* ── share ──────────────────────────────────────────────── */
.share {
  display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 6px 6px 6px 16px;
  background: #fff; border: 2px dashed var(--line); border-radius: 999px;
}
.share-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--muted); font-size: .92rem; user-select: all; }

/* ── best days, people ──────────────────────────────────── */
.block { margin-top: 26px; }
.best { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.best > li { background: var(--rice); border: 2px solid var(--line); border-radius: 22px; padding: 12px 16px; display: grid; gap: 6px; }
.best > li:first-child { border-color: var(--aqua); box-shadow: 0 4px 0 rgb(54 201 188 / .35); }
.best-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.best-day { font: 1.25rem/1.1 var(--cute); }
.best-n { font-weight: 800; color: var(--muted); font-size: .92rem; }
.tag { display: inline-block; background: var(--aqua); color: #06312D; font-weight: 900; font-size: .8rem; border-radius: 999px; padding: 2px 10px; margin-left: 6px; vertical-align: 2px; }

.people { list-style: none; padding: 0; margin: 0; background: var(--rice); border: 2px solid var(--line); border-radius: 22px; }
.people li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.people li + li { border-top: 2px dotted var(--line); }
.person { flex: 1; min-width: 0; }
.person-name { font-weight: 800; overflow-wrap: anywhere; }
.person-days { font-size: .88rem; color: var(--muted); }
.you { font-size: .75rem; font-weight: 900; background: var(--cheek-soft); color: #8E1E44; border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 1px; }
.people .link { font-size: .9rem; }
.people .remove { color: #B3243F; }

.organizer { background: rgb(255 255 255 / .6); border: 2px dashed var(--line); border-radius: 22px; padding: 14px 16px; }
.organizer h2 { font-size: 1.1rem; margin-bottom: 0; }
.organizer .aside { margin-top: 4px; }

/* ── your plans ─────────────────────────────────────────── */
.mine { margin-top: 26px; }
.mine ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mine a { display: flex; justify-content: space-between; gap: 10px; background: var(--rice); border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px; text-decoration: none; color: var(--plum); font-weight: 800; }
.mine a:hover { border-color: var(--hair); }
.mine .role { color: var(--muted); font-weight: 700; font-size: .88rem; white-space: nowrap; }

#gone .btn { margin-top: 8px; }

/* ── footer, toast ──────────────────────────────────────── */
.foot { max-width: 600px; margin: 0 auto; padding: 8px 22px 36px; color: var(--muted); font-size: .85rem; text-align: center; }
.foot p { margin: 4px 0; }
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--plum); color: #fff; font-weight: 800; border-radius: 999px; padding: 11px 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 700px) {
  .top { padding-top: 28px; }
  .title { font-size: 2.8rem; }
  .card { padding: 24px; }
}
/* wide screens: the stamp card on the left, the best days and who's in beside it */
@media (min-width: 980px) {
  body[data-view=plan] :is(.top, main, .foot) { max-width: 1040px; }
  #plan { display: grid; grid-template-columns: minmax(0, 1fr) 380px; column-gap: 32px; align-items: start; }
  #plan > .intro, #plan > .share { grid-column: 1 / -1; }
  #plan > .share { max-width: 640px; }
  #plan > .stampcard { grid-column: 1; grid-row: 3 / span 4; }
  #plan > .block { grid-column: 2; margin-top: 0; margin-bottom: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
