/* playing. — brand-faithful styles (functional version, pre-visualization).
   Paper bg, ink text, Inter for system voice, Source Serif for Luca's own words.
   No streaks, no counts, no exclamation. Quiet. */

:root {
  --paper: #FAF7F2;
  --ink: #1F2A2E;
  --red: #C25450;
  --quiet: #8B8680;
  --border: #E8E3DA;
  --mental: #5B7A99;
  --fitness: #6B8E6B;
  --skill: #B8825F;
  --card: #FFFFFF99;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
@supports (font-variation-settings: normal) {
  :root { font-family: 'Inter var', 'Inter', system-ui, sans-serif; }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }

.topbar { padding: 1.1rem 1.25rem 0.4rem; max-width: 38rem; margin: 0 auto; display: flex; align-items: center; gap: 0.4rem; }
.back-btn { border: 0; background: transparent; color: var(--ink); cursor: pointer; padding: 0.2rem; margin-left: -0.3rem; display: flex; line-height: 0; -webkit-tap-highlight-color: transparent; }
.ico-sm { width: 22px; height: 22px; }
.screen-head { font-weight: 600; font-size: 1.1rem; letter-spacing: -0.01em; color: var(--ink); }
.wordmark { font-weight: 600; font-size: 1.5rem; letter-spacing: -0.02em; color: var(--ink); }
.wordmark::after { content: '.'; color: var(--red); }
.role-chip { margin-left: auto; text-transform: lowercase; }

.main { padding: 0.25rem 1.25rem 6rem; max-width: 38rem; margin: 0 auto; }
.view { animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.screen-title { font-size: 1rem; font-weight: 500; color: var(--quiet); margin: 1.4rem 0 0.8rem; }
.lead { font-size: 1.1rem; line-height: 1.5; margin: 2.5rem 0 1.5rem; }
.muted { color: var(--quiet); }
.tiny { font-size: 0.78rem; }
.center { text-align: center; }
.empty { color: var(--quiet); line-height: 1.5; margin-top: 1.2rem; }

/* serif = Luca's own words */
.direction, .trail-text { font-family: 'Source Serif 4', Georgia, serif; }

/* buttons */
.btn { font: inherit; font-weight: 500; border: 1px solid var(--border); background: transparent;
  color: var(--ink); border-radius: 10px; padding: 0.55rem 0.85rem; cursor: pointer;
  -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(1px); }
/* filled = commit. Auto-width by default; add btn-block for the big full-width submit. */
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; }
.btn-block { width: 100%; padding: 0.85rem; font-size: 1rem; margin-top: 0.6rem; }
/* square + button to match the input height */
.btn-icon { min-width: 2.9rem; padding: 0.55rem 0; font-size: 1.4rem; line-height: 1; }
/* smaller, content-width share button with icon */
.btn-share { display: inline-flex; align-items: center; gap: 0.4rem; width: auto;
  padding: 0.5rem 0.9rem; font-size: 0.9rem; margin-top: 1.4rem; color: var(--ink); }
.btn-share .ico-sm, .btn-primary .ico-sm { width: 18px; height: 18px; }
.btn:disabled, .btn-primary:disabled { opacity: 0.45; cursor: default; }
.show-earlier { margin-top: 1.2rem; }
.btn-ghost { color: var(--quiet); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.wide { width: 100%; margin-top: 1.25rem; }
.home-actions { margin-top: 1.5rem; display: flex; gap: 0.6rem; }
.action-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.action-btn .ico-sm { width: 18px; height: 18px; }

/* goals anchor (on Today) */
.anchor { display: block; width: 100%; text-align: left; background: transparent; border: 0;
  padding: 0.5rem 0 0.8rem; cursor: pointer; border-bottom: 1px solid var(--border); }
.anchor-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.25rem; }
.anchor-edit { color: var(--quiet); font-size: 0.78rem; font-weight: 500; }
.anchor-focus-label { margin-top: 0.7rem; margin-bottom: 0.2rem; }
.hint { margin: -0.4rem 0 0.6rem; }
.focus-text { flex: 1; min-width: 0; text-align: left; background: transparent; border: 0;
  font: inherit; color: var(--ink); cursor: text; padding: 0; }
.focus-editing { display: block; }
.direction { font-size: 1.25rem; line-height: 1.35; margin: 0; color: var(--ink); }
.focus { list-style: none; padding: 0; margin: 0.7rem 0 0; }
.focus li { color: var(--ink); font-size: 0.95rem; padding-left: 0.9rem; position: relative; margin: 0.2rem 0; }
.focus li::before { content: '·'; position: absolute; left: 0; color: var(--quiet); }

/* goals editor */
.horizon { margin-bottom: 1.2rem; }
.anchor-line { display: block; width: 100%; text-align: left; background: transparent; border: 0; padding: 0; cursor: pointer; }
/* a resting goal line that reads as a tappable field (matches the focus input) */
.field-line { display: block; width: 100%; text-align: left; border: 1px solid var(--border);
  border-radius: 10px; padding: 0.6rem 0.75rem; background: var(--card); font: inherit;
  color: var(--ink); cursor: text; margin-top: 0.15rem; }
.field-line .direction { font-size: 1.1rem; }
.field-line .placeholder { color: var(--quiet); }
.ago-line { margin: 0.3rem 0 0; }
.focus-edit { list-style: none; padding: 0; margin: 0; }
.focus-edit li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.btn-x { border: 0; background: transparent; color: var(--quiet); font-size: 1.2rem; cursor: pointer; line-height: 1; }
.chip-mini { font: inherit; font-size: 0.72rem; color: var(--quiet); background: transparent;
  border: 1px solid var(--border); border-radius: 999px; padding: 0.15rem 0.55rem; cursor: pointer; white-space: nowrap; }
.chip-mini.sel { color: var(--ink); border-color: var(--ink); }
.focus-edit li { gap: 0.4rem; }
.share-preview { border: 1px solid var(--border); border-radius: 14px; padding: 0.9rem 1rem; background: var(--card); margin-bottom: 1rem; }
.share-preview .direction { font-size: 1.05rem; margin: 0.1rem 0 0.7rem; }
.share-preview .focus { margin-top: 0.2rem; }
.share-preview .note-label { margin-top: 0.8rem; }
.share-preview textarea { margin-top: 0.25rem; }
.add-row { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.text-in { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 0.6rem 0.7rem; resize: vertical; }

/* today cards */
.cards { display: flex; flex-direction: column; gap: 0.75rem; }
.event-card { border: 1px solid var(--border); border-radius: 14px; padding: 0.9rem 1rem; background: var(--card); }
.event-head { display: flex; align-items: baseline; gap: 0.55rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.event-dim { color: var(--quiet); font-weight: 500; font-size: 0.85rem; }
.event-time { color: var(--quiet); font-weight: 500; font-size: 0.85rem; margin-left: auto; }
.event-title { font-weight: 500; margin: 0.15rem 0 0; font-size: 1.02rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.actions .btn { padding: 0.4rem 0.7rem; font-size: 0.85rem; border-radius: 8px; }

/* check-in */
.field { border: 0; padding: 0; margin: 0 0 1.3rem; }
.field legend { color: var(--quiet); font-size: 0.9rem; margin-bottom: 0.5rem; padding: 0; }
/* weather: full-width segmented bar (single-select), matching fun/challenge */
.weather-row { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.weather { flex: 1; display: grid; place-items: center; height: 2.7rem; font-size: 1.35rem;
  border: 0; border-left: 1px solid var(--border); cursor: pointer; background: transparent; }
.weather:first-child { border-left: 0; }
.weather.sel { background: var(--ink); }
/* one connected, compact segmented control (lighter than five separate buttons) */
.scale { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.scale-btn { flex: 1; height: 2.3rem; border: 0; border-left: 1px solid var(--border);
  background: transparent; font: inherit; font-weight: 500; color: var(--ink); cursor: pointer; }
.scale-btn:first-child { border-left: 0; }
.scale-btn.sel { background: var(--ink); color: var(--paper); }
/* dimensions: full-width separated toggles (multi-select) — same corners + fill as the bars */
.chips { display: flex; gap: 0.5rem; }
.chip { flex: 1; height: 2.3rem; border: 1px solid var(--border); border-radius: 10px;
  background: transparent; font: inherit; color: var(--ink); cursor: pointer; }
.chip.sel { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.question { font-size: 0.95rem; color: var(--ink); }

/* trail */
.reflect-card { display: block; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: 12px; padding: 0.8rem 1rem; margin-top: 0.4rem;
  background: var(--card); color: var(--ink); font: inherit; }
.weekly-sep { margin: 1.8rem 0 0.1rem; text-align: center; }
/* due-reflection banner: full-width, distinct, dismissible */
.reflect-banner { display: flex; align-items: stretch; border: 0;
  border-radius: 12px; background: #EDE6DA; overflow: hidden; margin-bottom: 1.2rem; }
.reflect-banner-body { flex: 1; text-align: left; background: transparent; border: 0;
  font: inherit; color: var(--ink); padding: 0.8rem 0.5rem 0.8rem 1rem; cursor: pointer; }
.reflect-banner-x { border: 0; background: transparent; color: var(--quiet); font-size: 1.35rem;
  line-height: 1; padding: 0 0.95rem; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.trail { display: flex; flex-direction: column; }
.trail-day-group { margin-top: 1.1rem; }
.trail-date { font-size: 0.8rem; font-weight: 500; color: var(--quiet); margin: 0 0 0.1rem; }
.trail-row { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.trail-lead { flex: 0 0 28px; display: flex; justify-content: center; padding-top: 0.15rem; }
.wave-btn { border: 0; background: transparent; color: var(--ink); cursor: pointer; padding: 0; line-height: 0; -webkit-tap-highlight-color: transparent; }
.wave-btn:active { transform: translateY(1px); }
.ico-wave { width: 24px; height: 20px; }
.trail-glyph { font-size: 1.1rem; line-height: 1; }
.trail-body { flex: 1; min-width: 0; }
.trail-text { font-size: 1.05rem; line-height: 1.4; margin: 0; }
.trail-q { font-size: 0.8rem; color: var(--quiet); margin: 0 0 0.1rem; }
.qa { margin-bottom: 0.5rem; }
.qa:last-child { margin-bottom: 0; }
.trail-time { font-size: 0.72rem; color: var(--quiet); margin: 0.3rem 0 0; }

/* recorder bar */
.recorder { position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(4.5rem + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 0.7rem;
  background: var(--ink); color: var(--paper); padding: 0.6rem 0.7rem 0.6rem 1rem; border-radius: 999px;
  box-shadow: 0 6px 24px rgba(31,42,46,0.25); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.25 } }
.btn-stop { background: var(--paper); color: var(--ink); border: 0; padding: 0.4rem 0.9rem; }

/* toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(5rem + env(safe-area-inset-bottom)); background: var(--ink); color: var(--paper);
  padding: 0.6rem 1.1rem; border-radius: 999px; margin: 0; }

/* bottom nav */
.nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; border-top: 1px solid var(--border);
  background: var(--paper); padding-bottom: env(safe-area-inset-bottom); }
.nav-item { flex: 1; background: none; border: 0; font: inherit; cursor: pointer; padding: 1rem 0;
  color: var(--quiet); font-weight: 500; }
.nav-item.active { color: var(--ink); }
