/* ============================================================================
   Chore Board — one stylesheet, no framework, no build step.

   DESIGN NOTES
   Two audiences share these screens, so the type scale and tap targets are set
   for the harder case: a seven-year-old on a phone. Nothing interactive is
   smaller than 48px, and colour is never the only signal for a state.

   White and blue. Blue is the action colour — if it is blue, you press it.
   Green is reserved strictly for money and approval, because "you earned this"
   reads instantly in a way a second shade of blue never would.

   Each child also carries their own colour (--kid) through their avatar,
   sign-in tile, balance card and progress bar, which is what makes a shared
   family board feel like *theirs* rather than a generic screen with their name
   typed at the top.

   NO AUTOMATIC DARK MODE, deliberately. The app stays light whatever the device
   is set to. Following the system setting meant a parent with their phone in
   dark mode saw a dim, muddy version of a children's app they had never chosen.
   A proper night theme can come back later as an explicit switch — but as an
   opt-in, not a surprise.
   ============================================================================ */

:root {
  /* Bright and white, with blue doing the work. The app stays light whatever
     the device is set to — see the note at the bottom of this file. */
  --bg: #f4f8ff;
  --bg-tint: #e8f1ff;
  --surface: #ffffff;
  --surface-2: #f5f9ff;
  --line: #dce8fa;

  --ink: #0f1e35;
  --ink-dim: #5d7593;

  /* the action colour: press this */
  --blue: #2f6fed;
  --blue-deep: #1b4dc1;
  --blue-soft: #e6efff;

  /* money, approval — green stays green, because "you earned this" reads
     instantly in a way a second shade of blue never would */
  --green: #0fa572;
  --green-deep: #077a53;
  --green-soft: #d9f5eb;

  /* attention, waiting, goals */
  --sun: #eda313;
  --sun-deep: #9a6500;
  --sun-soft: #fff3da;

  /* sent back, remove */
  --coral: #e5484d;
  --coral-soft: #ffe8e8;

  /* payouts, info */
  --sky: #2f6fed;
  --sky-soft: #e6efff;

  /* support view */
  --grape: #7355e8;

  --kid: var(--blue);           /* overridden per child */

  --radius: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;

  --shadow: 0 2px 3px rgba(23, 48, 92, .05), 0 8px 20px rgba(23, 48, 92, .08);
  --shadow-lift: 0 4px 8px rgba(23, 48, 92, .1), 0 18px 40px rgba(23, 48, 92, .16);
  --shadow-press: 0 1px 2px rgba(23, 48, 92, .12);

  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
          "Segoe UI", "Nunito", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
  /* a soft warm wash at the top so the page doesn't start as a flat slab */
  background-image: radial-gradient(120% 60% at 50% 0%, var(--bg-tint) 0%, transparent 70%);
  background-repeat: no-repeat;
}

#app { max-width: 640px; margin: 0 auto; padding: 14px 16px 72px; }

h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 12px; }
a { color: var(--blue-deep); font-weight: 700; }

.muted { color: var(--ink-dim); font-size: .875rem; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack--tight { gap: 8px; }
.row { display: flex; gap: 8px; align-items: center; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* -------------------------------------------------------------- buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;                 /* a child's fingertip, not an adult's */
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .1s cubic-bezier(.34, 1.56, .64, 1), filter .15s, background .15s;
}
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.is-busy { opacity: .7; }

/* The chunky "press me" look: a solid colour with a darker lip underneath. */
.btn--primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 0 var(--blue-deep), var(--shadow);
}
.btn--primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--blue-deep); transform: translateY(3px) scale(.99); }
.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line);
}
.btn--ghost:hover:not(:disabled) { background: var(--surface-2); }

.btn--danger { background: var(--coral); color: #fff; box-shadow: var(--shadow); }

.btn--small { min-height: 40px; padding: 8px 16px; font-size: .875rem; }
.btn--block { width: 100%; }
.btn--inline { align-self: flex-start; }
.btn--big { min-height: 82px; font-size: 1.15rem; border-radius: var(--radius-lg); }

/* ---------------------------------------------------------------- cards --- */

.card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card--flat { box-shadow: none; border: 2px solid var(--line); }
.card--accent { background: var(--blue-soft); }
.card--gold { background: var(--sun-soft); }

.section { margin: 26px 0 10px; }
.section__title {
  font-size: .82rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-dim);
}
.section__hint { color: var(--ink-dim); font-size: .85rem; margin-top: 3px; }

.empty {
  text-align: center; color: var(--ink-dim);
  padding: 30px 18px;
  border: 2.5px dashed var(--line); border-radius: var(--radius-lg);
  background: var(--surface-2);
}

/* --------------------------------------------------------------- header --- */

.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding-top: 8px; }
.topbar__title { flex: 1; min-width: 0; }
/* Family names get long ("The Fitzgerald-Okonkwo Family"). Let it shrink and
   wrap rather than shoving the sign-out button off the screen. */
.topbar__title h1 { font-size: 1.25rem; overflow-wrap: anywhere; }
@media (min-width: 480px) { .topbar__title h1 { font-size: 1.45rem; } }
.topbar__sub { color: var(--ink-dim); font-size: .85rem; font-weight: 600; }

.avatar {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius); font-size: 1.6rem;
  background: color-mix(in srgb, var(--kid) 22%, var(--surface));
  box-shadow: inset 0 0 0 2.5px color-mix(in srgb, var(--kid) 45%, transparent);
}

/* A photo simply fills whatever avatar box it is dropped into, so one rule
   covers the header, the sign-in tiles, the queue and the money list. */
.avatar.has-photo, .tile__emoji.has-photo, .kidline__emoji.has-photo,
.facechip.has-photo, .pin__face.has-photo { padding: 0; overflow: hidden; }
.avatar__img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* the small round face beside a name in the approval queue */
.facechip {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; font-size: 1.2rem;
  background: var(--bg-tint);
}

/* the big face on the PIN screen */
.pin__face {
  width: 92px; height: 92px; margin: 0 auto 4px;
  display: grid; place-items: center;
  border-radius: 50%; font-size: 3rem;
  background: color-mix(in srgb, var(--kid) 20%, var(--bg-tint));
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--kid) 45%, transparent);
}

/* the preview inside an edit dialog, with its own change/remove buttons */
.photoedit { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.photoedit__face {
  width: 72px; height: 72px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; font-size: 2.2rem;
  background: var(--bg-tint);
  box-shadow: inset 0 0 0 2.5px var(--line);
}
.photoedit__face.has-photo { padding: 0; overflow: hidden; }
.photoedit__actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* ------------------------------------------------------------------ tabs --- */

.tabs {
  display: flex; gap: 3px; padding: 4px; margin-bottom: 18px;
  background: var(--surface-2); border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 2px var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; min-height: 40px; padding: 8px 14px;
  border: none; border-radius: var(--radius-pill); background: transparent;
  color: var(--ink-dim); font: inherit; font-weight: 800; font-size: .9rem;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.tab__badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  border-radius: var(--radius-pill); background: var(--sun); color: #3d2600;
  font-size: .75rem; font-weight: 900;
}
.tab[aria-selected="true"] .tab__badge { background: var(--sun); color: #3d2600; }

@media (max-width: 420px) {
  .tabs { gap: 2px; padding: 3px; }
  .tab { padding: 8px 8px; font-size: .8rem; }
}

/* ---------------------------------------------------------- kid balance --- */

.balance {
  position: relative;
  text-align: center;
  padding: 26px 18px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg,
    color-mix(in srgb, var(--kid) 30%, var(--surface)),
    color-mix(in srgb, var(--kid) 12%, var(--surface)));
  box-shadow: var(--shadow);
  overflow: hidden;
}
/* A strong tint over a dark surface turns muddy, so dark mode uses far less of
   the child's colour — enough to still read as theirs, not enough to look like
   wet cardboard. */
/* a soft halo behind the number so it reads as the hero of the screen */
.balance::before {
  content: ''; position: absolute; inset: -40% 30% auto;
  height: 200px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--kid) 30%, transparent), transparent 70%);
  pointer-events: none;
}
.balance > * { position: relative; }

.balance__amount {
  font-size: 3.4rem; font-weight: 900; line-height: 1;
  color: var(--ink); letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.balance__label { color: var(--ink-dim); font-size: .9rem; font-weight: 700; margin-top: 8px; }
.balance__goal { font-weight: 800; margin-bottom: 6px; font-size: 1.02rem; }
.balance__countdown {
  display: inline-block; margin-left: 8px; padding: 3px 12px;
  border-radius: var(--radius-pill); background: var(--sun); color: #3d2600;
  font-size: .78rem; font-weight: 900;
}

.progress { margin-top: 18px; }
.progress__track {
  height: 18px; border-radius: var(--radius-pill); overflow: hidden;
  background: rgba(255, 255, 255, .55);
  box-shadow: inset 0 2px 4px rgba(23, 48, 92, .12);
}
.progress__fill {
  height: 100%; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--kid), color-mix(in srgb, var(--kid) 60%, var(--sun)));
  transition: width .6s cubic-bezier(.34, 1.3, .64, 1);
}
.progress__label { margin-top: 8px; font-size: .82rem; color: var(--ink-dim); font-weight: 700; }

/* ----------------------------------------------------------- chore rows --- */

.chore {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 10px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .12s, opacity .2s;
}
.chore--done { opacity: .55; box-shadow: none; background: var(--surface-2); }
.chore__emoji {
  font-size: 1.6rem; flex: none; width: 46px; height: 46px;
  display: grid; place-items: center;
  background: var(--bg-tint); border-radius: 14px;
}
.chore--done .chore__emoji { background: transparent; }
.chore__main { flex: 1; min-width: 0; }
.chore__name { font-weight: 800; overflow-wrap: anywhere; }
.chore__meta { font-size: .8rem; color: var(--ink-dim); font-weight: 600; }
.chore__amount {
  font-weight: 900; color: var(--green-deep); white-space: nowrap;
  font-variant-numeric: tabular-nums; font-size: 1.05rem;
}
.chore__action { flex: none; }
/* The finished state: informative, compact, and obviously not pressable. */
.chore__status {
  flex: none; white-space: nowrap;
  padding: 8px 13px; border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink-dim);
  font-size: .78rem; font-weight: 800;
}

/* -------------------------------------------------------- queue / cards --- */

.job { padding: 16px; margin-bottom: 12px; }
.job__head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.job__who { font-weight: 900; }
.job__when { color: var(--ink-dim); font-size: .8rem; font-weight: 600; }
.job__what { font-size: 1.1rem; font-weight: 800; margin-bottom: 4px; }
.job__note {
  margin: 10px 0; padding: 10px 14px;
  background: var(--sun-soft); border-radius: 14px;
  font-style: italic; color: var(--ink); overflow-wrap: anywhere;
}
.job__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ------------------------------------------------------------ log lines --- */

.log {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 8px;
  border-radius: 14px; background: var(--surface-2);
  font-size: .92rem; font-weight: 600;
}
.log__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.log__amount { font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; }
.log--approved { background: var(--green-soft); }
.log--approved .log__amount { color: var(--green-deep); }
.log--rejected { background: var(--coral-soft); }
.log--rejected .log__amount { color: var(--coral); }
.log--pending { background: var(--sun-soft); }
.log--pending .log__amount { color: var(--sun-deep); }
.log--payout { background: var(--sky-soft); }
.log--payout .log__amount { color: var(--sky); }

/* ------------------------------------------------------------ kid tiles --- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 24px 12px; min-height: 150px;
  background: var(--surface); border: none;
  border-radius: var(--radius-lg); cursor: pointer;
  font: inherit; color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .14s cubic-bezier(.34, 1.56, .64, 1), box-shadow .14s;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.tile:active { transform: scale(.97); }
.tile:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.tile__emoji {
  font-size: 2.8rem; line-height: 1;
  width: 74px; height: 74px; display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--kid) 24%, var(--bg-tint));
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--kid) 50%, transparent);
}
.tile__name { font-weight: 900; font-size: 1.05rem; }
.tile__meta { font-size: .76rem; color: var(--ink-dim); font-weight: 700; }

/* ------------------------------------------------------ balance summary --- */

.kidline {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "emoji name  value"
    "emoji stats stats"
    "act   act   act";
  align-items: center;
  gap: 3px 12px;
  padding: 14px 16px; margin-bottom: 10px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.kidline__emoji {
  grid-area: emoji; font-size: 1.7rem; align-self: start;
  width: 48px; height: 48px; display: grid; place-items: center;
  background: var(--bg-tint); border-radius: 14px;
}
.kidline__name { grid-area: name; font-weight: 900; min-width: 0; overflow-wrap: anywhere; }
.kidline__stats { grid-area: stats; font-size: .78rem; color: var(--ink-dim); font-weight: 600; }
.kidline__balance {
  grid-area: value;
  font-size: 1.4rem; font-weight: 900; color: var(--green-deep);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kidline__actions {
  grid-area: act;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
  margin-top: 10px;
}
@media (min-width: 520px) {
  .kidline {
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas:
      "emoji name  value act"
      "emoji stats stats act";
  }
  .kidline__actions { margin-top: 0; }
}

/* ---------------------------------------------------------------- forms --- */

.field { display: block; margin-bottom: 16px; }
.field__label { display: block; font-size: .88rem; font-weight: 800; margin-bottom: 6px; }
.field__hint { display: block; font-size: .78rem; color: var(--ink-dim); margin-top: 6px; font-weight: 600; }

.input {
  width: 100%; min-height: 52px; padding: 13px 15px;
  background: var(--surface-2); color: var(--ink);
  border: 2.5px solid var(--line); border-radius: var(--radius);
  font: inherit; font-weight: 600;
}
.input:focus {
  outline: none; border-color: var(--blue); background: var(--surface);
  box-shadow: 0 0 0 4px var(--blue-soft);
}
textarea.input { min-height: 88px; resize: vertical; }
select.input { appearance: none; cursor: pointer; }

.inline-fields { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-fields .field { flex: 1 1 130px; margin-bottom: 0; }

.editrow { padding: 14px; margin-bottom: 10px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }

/* -------------------------------------------------------------- pin pad --- */

.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 300px; margin: 0 auto; }
.pinpad button {
  min-height: 68px; font-size: 1.6rem; font-weight: 800;
  background: var(--surface); color: var(--ink);
  border: none; border-radius: var(--radius); cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .1s cubic-bezier(.34, 1.56, .64, 1);
}
.pinpad button:active { transform: scale(.93); box-shadow: var(--shadow-press); }
.pinpad button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.pindots { display: flex; justify-content: center; gap: 16px; margin: 22px 0 26px; }
.pindot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--line); background: transparent;
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), background .2s;
}
.pindot.is-filled { background: var(--blue); border-color: var(--blue); transform: scale(1.15); }

/* ------------------------------------------------------------ codeblock --- */

.codeblock {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 16px; margin: 12px 0;
  background: var(--sun-soft); border: 3px dashed var(--sun); border-radius: var(--radius);
}
.codeblock__label {
  flex-basis: 100%; font-size: .76rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: .08em; color: var(--sun-deep);
}
.codeblock__value {
  flex: 1; min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.3rem; font-weight: 800; letter-spacing: .1em;
  overflow-wrap: anywhere; user-select: all;
}

/* ---------------------------------------------------------------- modal --- */

.backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 18px; background: rgba(44, 30, 18, .5);
  backdrop-filter: blur(3px);
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }

.modal {
  width: 100%; max-width: 430px; max-height: 88dvh; overflow-y: auto;
  padding: 24px; background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lift);
  animation: pop .22s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.96); } }

.modal__title { margin-bottom: 10px; font-size: 1.3rem; }
.modal__body { color: var(--ink-dim); white-space: pre-line; font-weight: 600; }
.modal__fields { margin-top: 18px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal__actions .btn { flex: 1; }

/* --------------------------------------------------------- chore picker --- */

/* A tall scrolling body inside the dialog, so the header and the Add button
   stay put while a long list moves under them. */
.modal--tall { display: flex; flex-direction: column; max-height: 88dvh; }
.picker {
  flex: 1; min-height: 0; overflow-y: auto;
  margin: 4px -6px 0; padding: 0 6px;
  -webkit-overflow-scrolling: touch;
}
.picker .section { margin: 16px 0 6px; }

.picker__row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin-bottom: 6px;
  background: var(--surface-2); border-radius: 14px;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px transparent;
  transition: background .12s, box-shadow .12s;
}
.picker__row.is-picked { background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue); }
.picker__check { width: 22px; height: 22px; flex: none; accent-color: var(--blue); }
.picker__emoji { font-size: 1.3rem; flex: none; }
.picker__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.picker__name { font-weight: 700; font-size: .95rem; overflow-wrap: anywhere; }
.picker__meta { font-size: .75rem; color: var(--ink-dim); font-weight: 600; }
.picker__amount {
  flex: none; font-weight: 800; color: var(--green-deep);
  font-variant-numeric: tabular-nums; font-size: .92rem;
}

/* ---------------------------------------------------------------- toast --- */

#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 14px); z-index: 200;
  max-width: min(430px, calc(100vw - 32px));
  padding: 14px 22px; border-radius: var(--radius-pill);
  background: var(--ink); color: var(--bg);
  font-size: .92rem; font-weight: 800; text-align: center;
  box-shadow: var(--shadow-lift);
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s cubic-bezier(.34, 1.56, .64, 1);
}
#toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
#toast.toast--error { background: var(--coral); color: #fff; }
#toast.toast--success { background: var(--green); color: #fff; }

/* ------------------------------------------------------- support banner --- */

.supportbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 12px 16px;
  background: var(--grape); color: #fff;
  border-radius: var(--radius);
  font-size: .88rem; font-weight: 700;
}
.supportbar__text { flex: 1; min-width: 0; }
.supportbar__exit {
  background: rgba(255, 255, 255, .2); color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .4);
}

/* ---------------------------------------------------------- celebration --- */

/* Confetti and coins are absolutely positioned throwaway nodes; celebrate.js
   removes them when the animation ends. Pointer events are off so a burst can
   never swallow a tap. */
.celebrate-layer {
  position: fixed; inset: 0; z-index: 300;
  pointer-events: none; overflow: hidden;
}
.confetti {
  position: absolute; top: -20px;
  width: 11px; height: 16px; border-radius: 3px;
  will-change: transform, opacity;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(var(--drift, 0px), 105vh, 0) rotate(var(--spin, 540deg)); opacity: .9; }
}

.coin {
  position: absolute;
  font-size: 1.7rem; will-change: transform, opacity;
  animation: coin-pop .95s cubic-bezier(.2, .8, .3, 1) forwards;
}
@keyframes coin-pop {
  0%   { transform: translate3d(0, 0, 0) scale(.4); opacity: 0; }
  25%  { opacity: 1; }
  100% { transform: translate3d(var(--dx, 0px), var(--dy, -110px), 0) scale(1.15); opacity: 0; }
}

/* The balance number gives a little kick when it grows. */
.balance__amount.is-bumped { animation: bump .7s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.16); }
  100% { transform: scale(1); }
}

/* --------------------------------------------------------------- misc ----- */

.spinner {
  width: 34px; height: 34px; margin: 70px auto;
  border: 4px solid var(--line); border-top-color: var(--blue);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pill {
  display: inline-block; padding: 3px 11px; border-radius: var(--radius-pill);
  background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--line);
  font-size: .74rem; font-weight: 800; color: var(--ink-dim);
}
.pill--warn { background: var(--sun-soft); box-shadow: inset 0 0 0 2px var(--sun); color: var(--sun-deep); }

.divider { height: 2px; margin: 24px 0; background: var(--line); border: 0; border-radius: 2px; }

.footnote { margin-top: 34px; font-size: .8rem; color: var(--ink-dim); text-align: center; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .celebrate-layer { display: none; }
}

/* --------------------------------------------------------- colour picker --- */

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 42px; height: 42px; flex: none;
  border: none; border-radius: 50%; cursor: pointer;
  background: var(--swatch);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 3px transparent;
  transition: transform .12s cubic-bezier(.34, 1.56, .64, 1), box-shadow .12s;
}
.swatch:hover { transform: scale(1.08); }
/* The chosen one gets a ring in its own colour, so the selection is visible
   without relying on a tick that would sit badly on a light swatch. */
.swatch.is-chosen {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--swatch);
}
.swatch:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
