/* ── Design tokens ─────────────────────────────────────────────
   Palette: warm cream ground, deep-indigo ink, and four working
   colors — violet (primary/nav), gold (kudos/rewards, semantic),
   coral (secondary accent — routine icons, warmth), mint (success/
   complete, semantic). Each color has a job; nothing is decorative.
*/

:root {
  --bg: #fff8ee;
  --surface: #ffffff;
  --surface-sunk: #fbf1de;
  --ink: #241e3d;
  --ink-muted: #8b84a8;
  --border: #ece3ff;

  --violet: #6c4ff2;
  --violet-deep: #4f35c9;
  --gold: #ffb627;
  --gold-deep: #d9930f;
  --coral: #ff6b5b;
  --coral-deep: #e0503f;
  --mint: #00c896;
  --mint-deep: #009e78;

  --accent: var(--violet);
  --accent-deep: var(--violet-deep);
  --success: var(--mint);
  --success-deep: var(--mint-deep);
  --danger: var(--coral-deep);

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --nav-size: 64px;
  --banner-size: 40px;
  --content-max: 480px;
  --shadow-card: 0 2px 0 rgba(36, 30, 61, 0.06), 0 8px 20px -12px rgba(36, 30, 61, 0.18);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1530;
    --surface: #241d3f;
    --surface-sunk: #17122a;
    --ink: #f3f0ff;
    --ink-muted: #a89fd1;
    --border: #362a5c;

    --violet: #9b83ff;
    --violet-deep: #b9a6ff;
    --gold: #ffc857;
    --gold-deep: #ffd583;
    --coral: #ff8a7d;
    --coral-deep: #ffa89d;
    --mint: #35e0ae;
    --mint-deep: #6bebc5;

    --shadow-card: 0 2px 0 rgba(0, 0, 0, 0.2), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #1a1530;
  --surface: #241d3f;
  --surface-sunk: #17122a;
  --ink: #f3f0ff;
  --ink-muted: #a89fd1;
  --border: #362a5c;

  --violet: #9b83ff;
  --violet-deep: #b9a6ff;
  --gold: #ffc857;
  --gold-deep: #ffd583;
  --coral: #ff8a7d;
  --coral-deep: #ffa89d;
  --mint: #35e0ae;
  --mint-deep: #6bebc5;

  --shadow-card: 0 2px 0 rgba(0, 0, 0, 0.2), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fff8ee;
  --surface: #ffffff;
  --surface-sunk: #fbf1de;
  --ink: #241e3d;
  --ink-muted: #8b84a8;
  --border: #ece3ff;

  --violet: #6c4ff2;
  --violet-deep: #4f35c9;
  --gold: #ffb627;
  --gold-deep: #d9930f;
  --coral: #ff6b5b;
  --coral-deep: #e0503f;
  --mint: #00c896;
  --mint-deep: #009e78;

  --shadow-card: 0 2px 0 rgba(36, 30, 61, 0.06), 0 8px 20px -12px rgba(36, 30, 61, 0.18);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, ui-rounded, "SF Pro Rounded", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  transition: background-color 0.2s ease, color 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* App shell: bottom nav on mobile, top nav from tablet up (breakpoint
   below). #app-scroll is the scrolling region so the nav itself never
   scrolls with the content. */

#app-scroll {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-size) + env(safe-area-inset-bottom, 0px) + 12px);
}

#app {
  display: flex;
  flex-direction: column;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  padding: 16px;
}

h1, h2, h3 {
  margin: 0 0 12px;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: 1.6rem;
  font-weight: 800;
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 2px;
}

a {
  color: inherit;
}

/* ── Persistent shell nav ─────────────────────────────────── */

.app-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 100;
}

.app-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 0 8px;
  text-decoration: none;
  color: var(--ink-muted);
  font-weight: 700;
  font-size: 0.7rem;
  /* .app-nav-item is shared by <a> and <button> (the lock button) —
     reset button-specific defaults so both render identically. */
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.1s ease;
}

.app-nav-item:active {
  transform: scale(0.94);
}

.app-nav-item[hidden] {
  display: none;
}

.app-nav-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.app-nav-item.active {
  color: var(--violet-deep);
}

/* Unmissable while Parent Mode is unlocked on this device — gold/dark
   for contrast against the violet nav. On mobile the nav is fixed at
   the bottom, so the banner sits in normal flow (sticky top:0) with no
   padding-compensation needed — it just pushes #app-scroll's content
   down like any other block. On the desktop breakpoint the nav is fixed
   at the top instead, so the banner switches to fixed positioning below
   it, and #app-scroll's padding-top gets extra room via
   body.has-unlocked-banner (--banner-size keeps that math self-
   documenting instead of a bare magic number). */
.unlocked-banner {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--gold);
  color: #3d2a05;
  font-weight: 700;
  font-size: 0.85rem;
  min-height: var(--banner-size);
}

.unlocked-banner[hidden] {
  display: none;
}

.unlocked-banner span:last-of-type {
  flex: 1;
}

.unlocked-banner button {
  border: none;
  background: rgba(61, 42, 5, 0.15);
  color: inherit;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ── Screen-local back/title bar (not the persistent nav) ───── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.topbar .back {
  border: none;
  background: none;
  font-size: 1.4rem;
  padding: 8px;
  margin-left: -8px;
  text-decoration: none;
  border-radius: 999px;
  transition: background-color 0.15s ease;
}

.topbar .back:hover {
  background: var(--surface-sunk);
}

/* ── Tablet and up: nav moves to a sticky top bar, content widens ── */

@media (min-width: 768px) {
  :root {
    --content-max: 720px;
  }

  #app-scroll {
    padding-bottom: 0;
    padding-top: calc(var(--nav-size) + 12px);
  }

  body.has-unlocked-banner #app-scroll {
    padding-top: calc(var(--nav-size) + var(--banner-size) + 12px);
  }

  .app-nav {
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    height: var(--nav-size);
    justify-content: center;
    gap: 8px;
    border-top: none;
    border-bottom: 1px solid var(--border);
  }

  /* .app-nav is fixed and taken out of flow, so #nav-root's own height
     on this breakpoint is just the banner (when shown) sitting at the
     very top of the page — push it below the fixed nav bar instead. */
  .unlocked-banner {
    position: fixed;
    top: var(--nav-size);
    left: 0;
    right: 0;
  }

  .app-nav-item {
    flex: none;
    flex-direction: row;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 999px;
  }

  .app-nav-item.active {
    background: color-mix(in srgb, var(--violet) 14%, transparent);
  }

  .app-nav-icon {
    font-size: 1.1rem;
  }

  .app-nav-label {
    font-size: 0.9rem;
  }
}

@media (min-width: 1100px) {
  :root {
    --content-max: 960px;
  }
}

/* ── Cards / lists ─────────────────────────────────────────── */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.kudos-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 16%, var(--surface)), var(--surface));
  border-color: color-mix(in srgb, var(--gold) 30%, var(--border));
}

.kudos-card-icon {
  color: var(--gold-deep);
  filter: drop-shadow(0 2px 4px rgba(217, 147, 15, 0.3));
}

.child-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.child-chip {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  color: var(--ink);
  font-size: 1.05rem;
  transition: border-color 0.15s ease, background-color 0.15s ease, padding 0.25s ease;
}

.child-chip:active {
  transform: scale(0.96);
}

.child-chip.active {
  gap: 10px;
  padding: 8px 20px 8px 8px;
  border-color: var(--violet);
  background: color-mix(in srgb, var(--violet) 10%, var(--surface));
}

.child-chip .name {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.25s ease, opacity 0.15s ease;
}

.child-chip.active .name {
  max-width: 160px;
  opacity: 1;
}

.child-chip .avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--surface-sunk);
  border-radius: 50%;
  color: var(--violet-deep);
}

.child-chip .avatar.avatar-photo {
  background: none;
}

.avatar-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-photo img {
  object-fit: cover;
  border-radius: 50%;
}

.routine-row .icon-tile.avatar-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: none;
}

.avatar-preview-large {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-sunk);
  border-radius: 50%;
  color: var(--violet-deep);
}

.avatar-preview-large.avatar-photo {
  background: none;
}

/* Base for every rendered icon (see js/icons.js) — sizing comes from the
   width/height set per-call by icon(), not font-size, since these are
   inline SVGs. This just prevents baseline-alignment gaps inline text
   sometimes gets from raw <svg>. */
.icon {
  display: block;
  flex-shrink: 0;
}

.routine-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.routine-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  text-align: left;
  width: 100%;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.routine-row:hover {
  transform: translateY(-2px);
}

.routine-row:active {
  transform: translateY(0);
}

.routine-row .icon-tile {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-sunk);
  border-radius: var(--radius-sm);
  color: var(--violet-deep);
}

.routine-row .meta {
  flex: 1;
  min-width: 0;
}

.routine-row .name {
  font-weight: 800;
  font-size: 1.05rem;
}

.routine-row .sub {
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* Kids list rows carry three actions (Give Kudos / History / Edit) instead
   of the single trailing element other .routine-row uses have — on narrow
   screens they need to drop to their own line rather than squeezing the
   name/avatar or overflowing horizontally. */
.child-row {
  flex-wrap: wrap;
}

.child-row-actions {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .child-row-actions {
    flex-basis: 100%;
    justify-content: flex-end;
    gap: 18px;
  }
}

.progress-pill {
  background: var(--surface-sunk);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--violet-deep);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.progress-pill.done {
  color: var(--mint-deep);
  background: color-mix(in srgb, var(--mint) 16%, var(--surface));
}

/* ── Runner mode toggle (step-at-a-time vs. checklist) ──────── */

.view-mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.view-mode-toggle button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  font-weight: 700;
  font-size: 0.85rem;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.view-mode-toggle button.active {
  border-color: var(--violet);
  color: var(--violet-deep);
  background: color-mix(in srgb, var(--violet) 10%, var(--surface));
}

/* ── Checklist (list-mode runner) ─────────────────────────── */

.checklist-row {
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* ── Runner (one step at a time) ──────────────────────────── */

.runner {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 24px;
}

.runner .step-icon {
  color: var(--violet-deep);
  filter: drop-shadow(0 6px 12px rgba(36, 30, 61, 0.15));
}

.runner .step-icon svg {
  display: block;
  margin: 0 auto;
}

.runner .step-name {
  font-size: 1.9rem;
  font-weight: 800;
  text-wrap: balance;
}

.runner .step-count {
  color: var(--ink-muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.timer-ring {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--coral-deep);
  font-variant-numeric: tabular-nums;
}

/* Base: violet, the primary UI action color (login, save, unlock).
   .big-button--success (mint) is reserved for genuine task-completion
   moments — "I did it!" and the celebration screen's "Done" — so the
   color keeps meaning "you finished something," not just "big button." */
.big-button {
  width: 100%;
  padding: 20px;
  border-radius: var(--radius);
  border: none;
  background: var(--violet);
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 6px 0 var(--violet-deep);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  display: inline-block;
  text-align: center;
}

.big-button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--violet-deep);
}

.big-button--success {
  background: var(--mint);
  box-shadow: 0 6px 0 var(--mint-deep);
}

.big-button--success:active {
  box-shadow: 0 2px 0 var(--mint-deep);
}

.secondary-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.secondary-actions button {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  font-weight: 700;
  transition: background-color 0.15s ease;
}

.secondary-actions button:hover {
  background: var(--surface-sunk);
}

.step-dots {
  display: flex;
  gap: 8px;
}

.step-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.step-dots .dot.filled {
  background: var(--mint);
}

.step-dots .dot.current {
  background: var(--violet);
  transform: scale(1.3);
}

.celebration {
  color: var(--gold-deep);
  animation: celebrate-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.celebration svg {
  display: block;
  margin: 0 auto;
}

@keyframes celebrate-pop {
  0% { transform: scale(0.3) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}

/* One orchestrated burst on routine completion, not scattered effects —
   five pieces radiate outward from center and fade. Each piece's angle
   is derived from --i so they fan out evenly without hand-authored
   per-piece positions. */
.confetti-burst {
  position: absolute;
  top: 45%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  animation: confetti-fly 0.9s ease-out forwards;
  animation-delay: calc(var(--i) * 0.05s);
}

/* Each piece gets a distinct color from the palette so the burst still
   reads as colorful/celebratory now that it's line-icon SVGs instead of
   naturally-colorful emoji. */
.confetti-piece:nth-child(1) { --angle: -60deg; color: var(--gold); }
.confetti-piece:nth-child(2) { --angle: -25deg; color: var(--violet); }
.confetti-piece:nth-child(3) { --angle: 10deg; color: var(--coral); }
.confetti-piece:nth-child(4) { --angle: 45deg; color: var(--mint); }
.confetti-piece:nth-child(5) { --angle: 80deg; color: var(--gold-deep); }

@keyframes confetti-fly {
  0% {
    opacity: 0;
    transform: rotate(var(--angle)) translateY(0) scale(0.5);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--angle)) translateY(-130px) scale(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .confetti-burst {
    display: none;
  }
}

.points-earned {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
}

/* ── Forms (parent editor) ────────────────────────────────── */

label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin: 12px 0 6px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="time"], select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s ease;
}

input:focus {
  border-color: var(--violet);
  outline: none;
}

.step-editor-row {
  padding: 10px;
  background: var(--surface-sunk);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.step-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-row-main input[type="text"] {
  flex: 1;
}

.step-editor-row .remove {
  border: none;
  background: none;
  color: var(--danger);
  font-size: 1.2rem;
  padding: 4px 8px;
}

.icon-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--violet-deep);
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.icon-picker-trigger:active {
  transform: scale(0.94);
}

body.modal-open {
  overflow: hidden;
}

.icon-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.4);
}

.icon-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: min(640px, 85vh);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px;
}

.icon-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.icon-modal-header h3 {
  margin: 0;
}

.icon-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--ink-muted);
}

.icon-search-input {
  width: 100%;
  margin-bottom: 12px;
}

.icon-search-results {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-y: auto;
}

.icon-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--violet-deep);
  transition: border-color 0.15s ease, transform 0.1s ease, background-color 0.15s ease;
}

.icon-chip:active {
  transform: scale(0.94);
}

.icon-chip.active {
  border-color: var(--violet);
  background: color-mix(in srgb, var(--violet) 10%, var(--surface));
}

.icon-search-empty {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin: 4px 0 0;
}

.day-toggles {
  display: flex;
  gap: 6px;
}

.day-toggles button {
  flex: 1;
  padding: 8px 0;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ink-muted);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.day-toggles button.active {
  background: var(--violet);
  border-color: var(--violet);
  color: #ffffff;
}

.assign-toggles {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.text-button {
  border: none;
  background: none;
  color: var(--violet-deep);
  font-weight: 800;
  padding: 12px 0;
}

.danger-button {
  border: none;
  background: none;
  color: var(--danger);
  font-weight: 800;
  padding: 12px 0;
}

.save-bar {
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Store / points ────────────────────────────────────────── */

.balance-hero {
  text-align: center;
  padding: 28px 0;
}

.balance-hero .number {
  font-size: 3.4rem;
  font-weight: 800;
  color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.store-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.store-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 18px;
  text-align: center;
  transition: transform 0.12s ease;
}

.store-card:hover {
  transform: translateY(-2px);
}

.store-card .emoji {
  display: flex;
  justify-content: center;
  color: var(--gold-deep);
}

.store-card button {
  margin-top: 12px;
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--violet);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 4px 0 var(--violet-deep);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.store-card button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--violet-deep);
}

.store-card button:disabled {
  background: var(--border);
  color: var(--ink-muted);
  box-shadow: none;
}

.empty-state {
  text-align: center;
  color: var(--ink-muted);
  padding: 40px 20px;
}

/* ── Wider-screen reflow ──────────────────────────────────── */

@media (min-width: 600px) {
  .store-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  /* The runner is a focused, one-thing-at-a-time flow by design — let it
     stay centered and readable instead of stretching full width. */
  .runner {
    max-width: 420px;
    margin: 0 auto;
  }

  .store-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
