/* Stoked Surfing — styles
   Brand palette per build brief Section 15. Mobile-first, single-column layout.
   Will expand as more screens land. */

:root {
  --ocean:        #0284c7;
  --ocean-light:  #0ea5e9;
  --ocean-deep:   #0c4a6e;
  --sun:          #fbbf24;
  --sunset:       #fb923c;
  --pale:         #f0f9ff;
  --ink:          #0c4a6e;
  --muted:        #64748b;
  --card-bg:      #ffffff;
  --border:       #e2e8f0;
  --card-shadow:  0 2px 12px rgba(2, 132, 199, 0.08);
  --card-shadow-lg: 0 8px 32px rgba(2, 132, 199, 0.16);
}

* { box-sizing: border-box; }

html {
  background: var(--pale);
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  /* Golden-hour ocean scene. Soft white-fade overlay keeps cards readable. */
  background:
    linear-gradient(180deg, rgba(240, 249, 255, 0) 0%, rgba(240, 249, 255, 0.5) 55%, rgba(240, 249, 255, 0.82) 100%),
    url('bg-ocean.svg') center center / cover no-repeat fixed,
    var(--pale);
  min-height: 100vh;
}

#app { min-height: 100vh; position: relative; }

/* Frosted glass cap over the iPhone notch / Dynamic Island region.
   Without this, content scrolling under the system area looks like a
   render bug. With it, it reads as an intentional iOS-style header. */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(env(safe-area-inset-top, 0px) + 8px);
  background: rgba(240, 249, 255, 0.88);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 1px 0 rgba(2, 132, 199, 0.06);
}

.muted { color: var(--muted); }
.muted--count {
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}

/* ─── Buttons ───────────────────────────────────────────────────── */

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--ocean);
  color: white;
}
.btn--primary:hover { background: var(--ocean-light); }

.btn--ghost {
  background: transparent;
  color: var(--muted);
}
.btn--ghost:hover { color: var(--ink); }

.btn--block { width: 100%; }

/* ─── Welcome modal ─────────────────────────────────────────────── */

.welcome {
  max-width: 480px;
  margin: 0 auto;
  padding: max(env(safe-area-inset-top), 32px) 24px max(env(safe-area-inset-bottom), 32px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.welcome__hero {
  text-align: center;
  margin-bottom: 32px;
}

.welcome__emoji {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 12px;
}

.welcome__hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  color: white;
  text-shadow: 0 2px 12px rgba(12, 74, 110, 0.45), 0 1px 2px rgba(12, 74, 110, 0.6);
}

.welcome__hero p {
  margin: 0;
  font-size: 15px;
  color: white;
  text-shadow: 0 1px 6px rgba(12, 74, 110, 0.5);
  opacity: 0.95;
}

.welcome__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─── Form fields ──────────────────────────────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: none;
  padding: 0;
  margin: 0;
}

.field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field__hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 12px;
}

.field input[type="text"],
.field select {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  background: white;
  color: var(--ink);
  transition: border-color 0.15s ease;
}

.field input[type="text"]:focus,
.field select:focus {
  outline: none;
  border-color: var(--ocean);
}

.field select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath fill='%2364748b' d='M6 8L0 0h12z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ─── Chips (radio group) ──────────────────────────────────────── */

.chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chip {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.chip input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip--selected {
  border-color: var(--ocean);
  background: linear-gradient(to right, rgba(2, 132, 199, 0.06), rgba(14, 165, 233, 0.04));
}

.chip__label {
  grid-column: 1;
  grid-row: 1;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

.chip__desc {
  grid-column: 1;
  grid-row: 2;
  font-size: 13px;
  color: var(--muted);
}

.chip__xp {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ocean);
  background: rgba(2, 132, 199, 0.1);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ─── Tutorial cards ───────────────────────────────────────────── */

.tutorial {
  max-width: 480px;
  margin: 0 auto;
  padding: max(env(safe-area-inset-top), 32px) 24px max(env(safe-area-inset-bottom), 32px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tutorial__card {
  background: white;
  border-radius: 20px;
  padding: 40px 28px;
  text-align: center;
  box-shadow: var(--card-shadow-lg);
  margin-bottom: 24px;
}

.tutorial__emoji {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 16px;
}

.tutorial__card h2 {
  margin: 0 0 12px;
  font-size: 24px;
  color: var(--ocean);
}

.tutorial__card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}

.tutorial__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.tutorial__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s ease, width 0.2s ease;
}

.tutorial__dot--active {
  background: var(--ocean);
  width: 24px;
  border-radius: 4px;
}

.tutorial__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.tutorial__actions .btn--primary { min-width: 140px; }

/* ─── Home screen ──────────────────────────────────────────────── */

.tab-view {
  max-width: 480px;
  margin: 0 auto;
  padding: max(env(safe-area-inset-top), 24px) 20px calc(140px + env(safe-area-inset-bottom, 0px));
}

.tab-header {
  padding: 12px 0 20px;
}

.tab-header h1 {
  margin: 0;
  font-size: 28px;
  color: white;
  text-shadow: 0 2px 12px rgba(12, 74, 110, 0.5), 0 1px 2px rgba(12, 74, 110, 0.6);
}

.tab-header p {
  margin: 4px 0 0;
  font-size: 14px;
  color: white;
  text-shadow: 0 1px 6px rgba(12, 74, 110, 0.5);
  opacity: 0.95;
}

.home {
  /* compatibility — same layout as .tab-view, keeps existing .home* selectors working */
}

.home__greeting {
  padding: 12px 0 20px;
}

.home__greeting h1 {
  margin: 0;
  font-size: 28px;
  color: white;
  text-shadow: 0 2px 12px rgba(12, 74, 110, 0.5), 0 1px 2px rgba(12, 74, 110, 0.6);
}

.home__greeting p {
  margin: 4px 0 0;
  font-size: 14px;
  color: white;
  text-shadow: 0 1px 6px rgba(12, 74, 110, 0.5);
  opacity: 0.95;
}

.home__greeting strong { color: var(--sun); }

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

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

/* Subtle 4px color bar across the top of every card to add visual character */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, var(--ocean), var(--ocean-light));
  opacity: 0.7;
}

.card h2 { margin: 0; font-size: 22px; color: var(--ocean); }
.card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.card__header h3 { margin: 0; }

.card__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--ocean);
  text-decoration: none;
}
.card__link:hover { color: var(--ocean-light); }

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  width: 100%;
  text-align: left;
}
.settings-row:last-child { border-bottom: none; }
.settings-row__label { font-weight: 600; color: var(--ink); }
.settings-row__value { color: var(--muted); }

button.settings-row {
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding-left: 4px;
  padding-right: 4px;
  margin: 0 -4px;
  width: calc(100% + 8px);
  transition: background 0.15s ease;
}
button.settings-row:hover { background: var(--pale); }
button.settings-row:active { background: rgba(2, 132, 199, 0.08); }

.settings-row__chev {
  color: var(--muted);
  font-size: 18px;
  font-weight: 400;
  margin-left: 6px;
  display: inline-block;
}

.backup-stats {
  background: var(--pale);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink);
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

.about-card { background: rgba(255, 255, 255, 0.7); }

.btn--danger {
  background: #fee2e2;
  color: #b91c1c;
}
.btn--danger:hover { background: #fecaca; }

.card h3 {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Ladder card ──────────────────────────────────────────────── */

.card--ladder {
  background: linear-gradient(135deg, #ffffff 0%, #dbeafe 100%);
  border: 1px solid rgba(2, 132, 199, 0.15);
}
.card--ladder::before {
  background: linear-gradient(to right, var(--ocean-deep), var(--ocean), var(--ocean-light));
  opacity: 1;
}

.ladder__tier {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.ladder__emoji {
  font-size: 48px;
  line-height: 1;
}

.ladder__progress {
  margin-top: 8px;
}

.ladder__bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.ladder__fill {
  height: 100%;
  background: linear-gradient(to right, var(--ocean), var(--ocean-light));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.ladder__progress p { margin: 0; font-size: 13px; }

/* ─── Empty states ─────────────────────────────────────────────── */

.empty {
  text-align: center;
  padding: 16px 0;
}

.empty p { margin: 4px 0; font-size: 14px; }

/* ─── Stats grid ───────────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
  margin-bottom: 14px;
}

.stat {
  appearance: none;
  border: none;
  font-family: inherit;
  background: white;
  border-radius: 14px;
  padding: 18px 8px;
  text-align: center;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.stat:nth-child(1) {
  background: linear-gradient(180deg, #ffffff 0%, #dbeafe 100%);
}
.stat:nth-child(1)::before { background: linear-gradient(to right, var(--ocean), var(--ocean-light)); }
.stat:nth-child(2) {
  background: linear-gradient(180deg, #ffffff 0%, #ccfbf1 100%);
}
.stat:nth-child(2)::before { background: linear-gradient(to right, #14b8a6, #5eead4); }
.stat:nth-child(3) {
  background: linear-gradient(180deg, #ffffff 0%, #fef3c7 100%);
}
.stat:nth-child(3)::before { background: linear-gradient(to right, #fbbf24, #fb923c); }
.stat:nth-child(2) .stat__num { color: #0d9488; }
.stat:nth-child(3) .stat__num { color: #c2410c; }
.stat:hover {
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.2);
  transform: translateY(-2px);
}
.stat:active {
  transform: scale(0.97);
}

.stat__num {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--ocean);
  line-height: 1.2;
}

.stat__label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ─── Bottom navigation ────────────────────────────────────────── */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  height: 80px;
  background: white;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -4px 20px rgba(12, 74, 110, 0.18);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px env(safe-area-inset-bottom, 0);
  z-index: 50;
}

.nav-btn {
  appearance: none;
  background: none;
  border: none;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  min-height: 60px;
  padding: 8px 4px;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}

.nav-btn__icon { font-size: 20px; line-height: 1; }
.nav-btn__label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav-btn--active { color: var(--ocean); }
.nav-btn--active .nav-btn__icon { filter: drop-shadow(0 0 8px rgba(2, 132, 199, 0.3)); }

.nav-fab {
  appearance: none;
  border: none;
  font-family: inherit;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ocean) 0%, var(--ocean-light) 100%);
  color: white;
  font-size: 32px;
  font-weight: 300;
  line-height: 60px;
  text-align: center;
  cursor: pointer;
  margin-top: -22px;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
  flex-shrink: 0;
  transition: transform 0.1s ease;
}

.nav-fab:active { transform: scale(0.92); }

/* ─── Gallery tab ──────────────────────────────────────────────── */

.gallery-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gallery-filters::-webkit-scrollbar { display: none; }

.filter-pill {
  appearance: none;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--ocean);
  color: var(--ocean);
}

.filter-pill--active {
  background: var(--ocean);
  border-color: var(--ocean);
  color: white;
}
.filter-pill--active .filter-pill__count { color: rgba(255,255,255,0.8); }

.filter-pill__count {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--pale);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.gallery-item:active { transform: scale(0.97); }

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  pointer-events: none;
}

/* ─── Media viewer (full-bleed modal) ──────────────────────────── */

.viewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.18s ease;
}

.viewer__close {
  position: absolute;
  top: max(env(safe-area-inset-top), 12px);
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.viewer__close:hover { background: rgba(255,255,255,0.25); }

.viewer__share-btn {
  position: absolute;
  top: max(env(safe-area-inset-top), 12px);
  left: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.viewer__share-btn:hover { background: rgba(255,255,255,0.25); }

.viewer__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 64px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.viewer__nav:hover { background: rgba(255,255,255,0.2); }
.viewer__nav--prev { left: 0; border-radius: 0 12px 12px 0; }
.viewer__nav--next { right: 0; border-radius: 12px 0 0 12px; }

.viewer__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: max(env(safe-area-inset-top), 60px) 60px 0;
  overflow: hidden;
}

.viewer__stage img,
.viewer__stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.viewer__caption {
  padding: 16px 24px max(env(safe-area-inset-bottom), 16px);
  color: white;
  text-align: center;
  background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
  width: 100%;
}

.viewer__title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.viewer__meta {
  font-size: 13px;
  opacity: 0.85;
}

/* ─── Settings: background preview ─────────────────────────────── */

.bg-preview {
  height: 120px;
  border-radius: 12px;
  margin-bottom: 12px;
  background-size: cover;
  background-position: center;
  background-color: var(--pale);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.bg-preview--default {
  background-image: url('bg-ocean.svg');
}

.bg-preview--custom {
  border-color: var(--ocean);
}

.bg-preview__label {
  background: rgba(12, 74, 110, 0.7);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bg-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ─── Session list (home) ──────────────────────────────────────── */

.session-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}
.session-row:last-child { border-bottom: none; }

.session-row__main {
  appearance: none;
  background: transparent;
  border: none;
  font-family: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  color: inherit;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.session-row__main:hover { background: var(--pale); }
.session-row__main:active { background: rgba(2, 132, 199, 0.08); }

.session-row__stoke {
  font-size: 26px;
  line-height: 1;
  width: 44px;
  text-align: center;
}

.session-row__stoke-inline {
  font-size: 14px;
  margin-left: 6px;
  opacity: 0.8;
}

.session-row__thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--pale);
}

.session-row__share {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  align-self: center;
  transition: background 0.15s ease;
}
.session-row__share:hover { background: var(--pale); color: var(--ocean); }

.wiz-delete-zone {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ─── Streaks card (home) ──────────────────────────────────────── */

.streaks {
  background: linear-gradient(135deg, #ffffff 0%, #ffedd5 100%);
  border: 1px solid rgba(251, 146, 60, 0.25);
}
.streaks::before {
  background: linear-gradient(to right, #f97316, #fbbf24);
  opacity: 1;
}
.streaks--hot {
  background: linear-gradient(135deg, #fff7ed 0%, #fdba74 100%);
  border-color: rgba(251, 146, 60, 0.55);
  box-shadow: 0 6px 20px rgba(251, 146, 60, 0.25);
}
.streaks--hot::before {
  background: linear-gradient(to right, #dc2626, #f97316, #fbbf24);
}

.streaks__inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.streaks__primary {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.streaks__flame {
  font-size: 48px;
  line-height: 1;
}

.streaks__num {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  color: #7c2d12;
}

.streaks--hot .streaks__num { color: #c2410c; }

.streaks__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.streaks__secondary {
  text-align: right;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 10px;
}

.streaks__sub-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.streaks__sub-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.streaks__hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ─── Challenges ───────────────────────────────────────────────── */

/* Shared progress bar */
.challenge__bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.challenge__fill {
  height: 100%;
  background: linear-gradient(to right, var(--ocean), var(--ocean-light));
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Home: featured single-challenge card */
.featured-challenge {
  display: flex;
  align-items: center;
  gap: 14px;
}

.featured-challenge__emoji {
  font-size: 40px;
  line-height: 1;
  flex-shrink: 0;
}

.featured-challenge__body { flex: 1; min-width: 0; }

.featured-challenge__title {
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 2px;
}

.featured-challenge__sub {
  font-size: 13px;
  margin-bottom: 8px;
}

/* Full challenges view */
.back-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 12px;
  text-shadow: 0 1px 4px rgba(12, 74, 110, 0.5);
}
.back-btn:hover { background: rgba(255, 255, 255, 0.28); }

.challenge-full-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.challenge-row {
  background: white;
  border-radius: 14px;
  padding: 16px 16px 14px;
  box-shadow: var(--card-shadow);
}

.challenge-row--maxed {
  background: linear-gradient(135deg, #fff, #fef3c7);
  border: 1.5px solid rgba(251, 191, 36, 0.4);
}

.challenge-row__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.challenge-row__emoji {
  font-size: 30px;
  line-height: 1;
  flex-shrink: 0;
  width: 38px;
  text-align: center;
}

.challenge-row__body { flex: 1; min-width: 0; }

.challenge-row__title {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.challenge-row__maxed-tag {
  display: inline-block;
  background: linear-gradient(135deg, #fbbf24, #fb923c);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
}

.challenge-row__desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.35;
}

.challenge-row__progress {
  margin-bottom: 12px;
}

.challenge-row__count {
  font-size: 12px;
  font-weight: 600;
  color: var(--ocean);
  margin-top: 6px;
  text-align: right;
}

.challenge-row__tiers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.tier-pip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  background: var(--pale);
  border-radius: 8px;
  border: 1.5px solid transparent;
  opacity: 0.55;
  transition: all 0.2s ease;
}

.tier-pip__label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.tier-pip__value {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.tier-pip--done {
  opacity: 1;
  background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(34,197,94,0.05));
  border-color: rgba(34,197,94,0.4);
}
.tier-pip--done .tier-pip__label,
.tier-pip--done .tier-pip__value { color: #14532d; }

.tier-pip--next {
  opacity: 1;
  background: linear-gradient(135deg, rgba(2,132,199,0.15), rgba(2,132,199,0.05));
  border-color: rgba(2,132,199,0.5);
}
.tier-pip--next .tier-pip__label,
.tier-pip--next .tier-pip__value { color: var(--ocean); }

/* ─── 'Almost There' nudges card (home) ────────────────────────── */

.almost-there {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.almost-there::before {
  background: linear-gradient(to right, #fbbf24, #fb923c);
  opacity: 1;
}

/* ─── Daily Stoke wisdom card ──────────────────────────────────── */

.daily-stoke {
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
  border: 1px solid rgba(8, 145, 178, 0.25);
}
.daily-stoke::before {
  background: linear-gradient(to right, #06b6d4, #0ea5e9, #0284c7);
  opacity: 1;
}
.daily-stoke__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0e7490;
  margin-bottom: 8px;
}
.daily-stoke__text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  font-style: italic;
  font-weight: 500;
}

/* ─── On This Day memory card ──────────────────────────────────── */

.on-this-day {
  background: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%);
  border: 1px solid rgba(168, 85, 247, 0.25);
  cursor: pointer;
  appearance: none;
  font-family: inherit;
  text-align: left;
  width: 100%;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.on-this-day:active { transform: scale(0.98); }
.on-this-day::before {
  background: linear-gradient(to right, #a855f7, #d946ef);
  opacity: 1;
}
.on-this-day__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7e22ce;
  margin-bottom: 8px;
}
.on-this-day__break {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.on-this-day__meta {
  font-size: 13px;
  color: var(--muted);
}

.nudge-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nudge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: white;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.18);
}

.nudge__emoji {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  width: 30px;
  text-align: center;
}

.nudge__text {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
}

.nudge__text strong {
  font-weight: 700;
  color: var(--ocean);
}

/* ─── Personal Bests grid (home) ───────────────────────────────── */

.pb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pb {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
  padding: 14px 12px;
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.pb:nth-child(2) { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); border-color: rgba(59, 130, 246, 0.25); }
.pb:nth-child(2) .pb__value { color: #1d4ed8; }
.pb:nth-child(3) { background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%); border-color: rgba(251, 146, 60, 0.3); }
.pb:nth-child(3) .pb__value { color: #c2410c; }
.pb:nth-child(4) { background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%); border-color: rgba(20, 184, 166, 0.3); }
.pb:nth-child(4) .pb__value { color: #0d9488; }

.pb__value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ocean);
  line-height: 1.1;
}

.pb__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-top: 4px;
}

.pb__meta {
  font-size: 11px;
  margin-top: 2px;
}

/* ─── Trip Mode ────────────────────────────────────────────────── */

.trip-cta {
  appearance: none;
  border: 1.5px dashed rgba(255, 255, 255, 0.5);
  background: rgba(12, 74, 110, 0.15);
  color: white;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 20px;
  border-radius: 14px;
  width: 100%;
  margin-bottom: 14px;
  cursor: pointer;
  text-shadow: 0 1px 4px rgba(12, 74, 110, 0.5);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.trip-cta:hover {
  background: rgba(12, 74, 110, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
}

.trip-banner {
  background: linear-gradient(135deg, #fb923c 0%, #fbbf24 100%);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(251, 146, 60, 0.3);
}

.trip-banner__body { flex: 1; }

.trip-banner__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(12, 74, 110, 0.8);
}

.trip-banner__name {
  font-size: 20px;
  font-weight: 700;
  color: #0c4a6e;
  margin: 2px 0;
}

.trip-banner__meta {
  font-size: 13px;
  color: rgba(12, 74, 110, 0.8);
}

.trip-banner__end {
  background: rgba(12, 74, 110, 0.15);
  color: #0c4a6e;
  font-size: 13px;
  padding: 8px 14px;
}
.trip-banner__end:hover { background: rgba(12, 74, 110, 0.25); }

.trip-banner--in-tab { margin-bottom: 14px; }
.trip-banner--in-tab .trip-banner__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.trip-cta--solid {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.6);
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.4), rgba(251, 191, 36, 0.3));
}

/* Active trip quick-actions stack (Add moment + Recap + End) */
.trip-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: -6px 0 16px;
}

/* Side-by-side share buttons (Summary | Timeline) */
.trip-share-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.trip-share-row .btn { width: 100%; }

/* Past trip rows: body becomes a tappable button */
button.trip-list-item__body {
  appearance: none;
  border: none;
  font-family: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
  flex: 1;
  padding: 6px 4px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
button.trip-list-item__body:hover { background: var(--pale); }

/* Make banner+detail tappable too */
.trip-banner[data-trip-open] { cursor: pointer; }

/* ─── Trip detail timeline ─────────────────────────────────────── */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(to bottom, var(--ocean-light), var(--ocean), rgba(2, 132, 199, 0.2));
  border-radius: 1px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  position: relative;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-item__dot {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: white;
  border: 2px solid var(--border);
  box-shadow: 0 1px 4px rgba(12, 74, 110, 0.08);
  z-index: 1;
}

.timeline-item__dot--session {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-color: var(--ocean);
}

.timeline-item__dot--moment {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #fbbf24;
}

.timeline-item__card {
  appearance: none;
  border: none;
  font-family: inherit;
  text-align: left;
  background: white;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  flex: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.timeline-item__card:hover { box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15); }
.timeline-item__card:active { transform: scale(0.99); }

.timeline-item__card--moment {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.timeline-item__thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.timeline-item__body { flex: 1; min-width: 0; }

.timeline-item__kicker {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 2px;
}

.timeline-item__title {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.3;
}

.timeline-item__title--moment {
  font-weight: 500;
  font-style: italic;
  font-size: 14px;
}

.timeline-item__meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.trip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trip-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}
.trip-list-item:last-child { border-bottom: none; }

.trip-list-item__body { flex: 1; min-width: 0; }
.trip-list-item__name { font-weight: 600; font-size: 15px; color: var(--ink); }
.trip-list-item__active {
  display: inline-block;
  background: linear-gradient(135deg, var(--sun), var(--sunset));
  color: white;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.trip-list-item__meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.trip-list-item__btn { font-size: 13px; padding: 8px 12px; }

/* ─── Vibe tag toggles (wizard step 5) ─────────────────────────── */

.vibe-tags {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.vibe-tag {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vibe-tag input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vibe-tag__emoji { font-size: 18px; line-height: 1; }
.vibe-tag__label { font-size: 13px; font-weight: 500; color: var(--ink); }

.vibe-tag--on {
  border-color: var(--sun);
  background: linear-gradient(135deg, #fff8e1, #fef3c7);
}
.vibe-tag--on .vibe-tag__label { color: var(--ocean-deep); font-weight: 600; }

/* (celebration footer styles live with .celebration above) */

/* ─── Share sheet (session/trip card preview) ──────────────────── */

.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in 0.18s ease;
}

.share-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 74, 110, 0.6);
}

.share-sheet__panel {
  position: relative;
  background: white;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 32px rgba(12, 74, 110, 0.3);
  animation: slide-up 0.25s ease;
  overflow: hidden;
}

@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.share-sheet__header {
  position: relative;
  flex-shrink: 0;
  padding: 8px 14px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
}

.share-sheet__handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin-top: 6px;
}

.share-sheet__close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--pale);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.share-sheet__close:hover { background: var(--border); color: var(--ink); }

.share-sheet__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 20px max(env(safe-area-inset-bottom), 24px);
}

.share-sheet__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ocean);
  margin-bottom: 4px;
}

.share-sheet__title {
  margin: 0 0 16px;
  font-size: 20px;
  color: var(--ink);
}

.share-sheet__preview {
  background: var(--pale);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.share-sheet__preview img {
  width: 60%;
  max-height: 38vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(12, 74, 110, 0.2);
}

.share-sheet__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-sheet__hint {
  font-size: 12px;
  text-align: center;
  margin: 10px 0 0;
}

.session-row__body { flex: 1; min-width: 0; }

.session-row__title {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

.session-row__meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* ─── Session wizard ───────────────────────────────────────────── */

.wizard {
  position: fixed;
  inset: 0;
  background: white;
  display: flex;
  flex-direction: column;
  z-index: 100;
  animation: wizard-in 0.25s ease;
}

@keyframes wizard-in {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.wizard__header {
  padding: max(env(safe-area-inset-top), 16px) 20px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.wizard__close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: var(--muted);
  width: 40px;
  height: 40px;
  cursor: pointer;
  position: absolute;
  top: max(env(safe-area-inset-top), 12px);
  right: 12px;
  border-radius: 50%;
  transition: background 0.15s ease;
}
.wizard__close:hover { background: var(--pale); color: var(--ink); }

.wizard__step {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ocean);
  font-weight: 600;
}

.wizard__title {
  margin: 4px 0 12px;
  font-size: 22px;
  color: var(--ink);
}

.wizard__progress {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.wizard__progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--ocean), var(--ocean-light));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.wizard__content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
}

.wizard__footer {
  padding: 12px 20px max(env(safe-area-inset-bottom), 12px);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  background: white;
}

.wizard__footer .btn { flex: 1; }
.wizard__footer .btn--ghost { flex: 0 0 96px; }
.wizard__footer .btn:disabled { opacity: 0.4; pointer-events: none; }

/* Step sections */

.wiz-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wiz-help {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.5;
}

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

.field input[type="date"],
.field input[type="number"],
.field textarea {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  background: white;
  color: var(--ink);
  width: 100%;
  transition: border-color 0.15s ease;
}

.field input[type="date"]:focus,
.field input[type="number"]:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ocean);
}

.field textarea { resize: vertical; min-height: 88px; line-height: 1.5; }

/* Sliders */

input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  outline: none;
  margin: 12px 0 4px;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ocean);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ocean);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-row input[type="range"] { flex: 1; margin: 0; }

.slider-out {
  min-width: 80px;
  text-align: right;
  font-weight: 600;
  font-size: 15px;
  color: var(--ocean);
}

/* Wave count presets */

.presets {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.preset {
  appearance: none;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.preset:hover { border-color: var(--ocean); color: var(--ocean); }

/* Move chips */

.move-group { margin-bottom: 4px; }

.move-group__title {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.move-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.move-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: white;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.move-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.move-chip__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.move-chip--selected {
  border-color: var(--ocean);
  background: var(--ocean);
}

.move-chip--selected .move-chip__label { color: white; }

/* Stoke meter */

.stoke-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 8px;
}

.stoke-meter__emoji {
  font-size: 48px;
  line-height: 1;
}

.stoke-meter__num {
  font-size: 48px;
  font-weight: 700;
  color: var(--ocean);
  line-height: 1;
}

.stoke-meter__scale {
  font-size: 18px;
  color: var(--muted);
}

/* Media step — upload actions + grid */

.media-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.media-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.media-action:hover {
  border-color: var(--ocean);
  background: var(--pale);
}

.media-action--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.media-action--disabled:hover {
  border-color: var(--border);
  background: white;
}

.media-action__icon {
  font-size: 32px;
  line-height: 1;
}

.media-action__label {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.media-action__count {
  font-size: 12px;
  color: var(--muted);
}

.media-empty {
  text-align: center;
  padding: 24px 16px;
  background: var(--pale);
  border-radius: 12px;
}

.media-empty__icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 8px;
  opacity: 0.6;
}

.media-empty p {
  margin: 2px 0;
  font-size: 14px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.media-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--pale);
  box-shadow: var(--card-shadow);
}

.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-thumb__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(12, 74, 110, 0.75);
  color: white;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.media-thumb__remove:hover { background: rgba(12, 74, 110, 0.95); }

.media-thumb__meta {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(12, 74, 110, 0.7);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.media-thumb__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* ─── Celebration modal ────────────────────────────────────────── */

.celebration {
  position: fixed;
  inset: 0;
  background: rgba(12, 74, 110, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: max(env(safe-area-inset-top), 16px) 20px max(env(safe-area-inset-bottom), 16px);
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.celebration__card {
  background: white;
  border-radius: 20px;
  max-width: 360px;
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(12, 74, 110, 0.35);
  animation: pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.celebration__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(12, 74, 110, 0.08);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease;
}
.celebration__close:hover { background: rgba(12, 74, 110, 0.18); }

.celebration__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 36px 24px 16px;
  text-align: center;
}

.celebration__footer {
  flex-shrink: 0;
  padding: 12px 20px max(env(safe-area-inset-bottom), 16px);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: white;
}

@keyframes pop-in {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.celebration__emoji {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 12px;
}

.celebration__card h2 {
  margin: 0 0 4px;
  font-size: 24px;
  color: var(--ocean);
}

.celebration__sub {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--ink);
}

.celebration__xp {
  font-size: 40px;
  font-weight: 700;
  color: var(--sun);
  margin: 12px 0 16px;
  line-height: 1;
}

/* Templated session recap text */
.celebration__recap {
  margin: 12px 4px 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  font-style: italic;
  text-align: center;
  padding: 0 4px;
}

/* Core Memory panel — only appears on special moments (first elite move,
   level-up to tier 3+, legendary stoke, session-count milestone) */
.core-memory {
  margin: 12px 0 16px;
  padding: 16px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e293b 0%, #0c4a6e 100%);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(12, 74, 110, 0.4);
}

.core-memory::before {
  content: '';
  position: absolute;
  inset: -50% -50% auto auto;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(251, 191, 36, 0.18), transparent 50%);
  pointer-events: none;
}

.core-memory__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #fbbf24;
  text-transform: uppercase;
  position: relative;
}

.core-memory__emoji {
  display: block;
  font-size: 44px;
  line-height: 1;
  margin: 10px 0 6px;
  position: relative;
}

.core-memory__reason {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
  line-height: 1.2;
  position: relative;
}

.core-memory__sub {
  font-size: 13px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
}

/* Computed Stoke Score panel — the emotional engine */
.stoke-score {
  margin: 12px 0 16px;
  padding: 14px 12px;
  border-radius: 14px;
  text-align: center;
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(148, 163, 184, 0.05));
  border: 1.5px solid rgba(148, 163, 184, 0.3);
}
.stoke-score__pct {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  color: var(--ocean-deep);
}
.stoke-score__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-top: 6px;
  color: var(--ocean);
}
.stoke-score--meh       { background: linear-gradient(135deg, rgba(148,163,184,0.18), rgba(148,163,184,0.06)); border-color: rgba(148,163,184,0.4); }
.stoke-score--alright   { background: linear-gradient(135deg, rgba(14,165,233,0.15),  rgba(14,165,233,0.05));  border-color: rgba(14,165,233,0.4); }
.stoke-score--solid     { background: linear-gradient(135deg, rgba(2,132,199,0.18),   rgba(2,132,199,0.06));   border-color: rgba(2,132,199,0.5); }
.stoke-score--stoked    { background: linear-gradient(135deg, rgba(34,197,94,0.18),   rgba(34,197,94,0.06));   border-color: rgba(34,197,94,0.5); }
.stoke-score--epic      { background: linear-gradient(135deg, rgba(251,191,36,0.22),  rgba(251,191,36,0.08));  border-color: rgba(251,191,36,0.6); }
.stoke-score--legendary {
  background: linear-gradient(135deg, #fef3c7 0%, #fdba74 100%);
  border-color: #fb923c;
  box-shadow: 0 0 24px rgba(251, 146, 60, 0.4);
}
.stoke-score--legendary .stoke-score__pct,
.stoke-score--legendary .stoke-score__label { color: #7c2d12; }

.celebration__breakdown {
  list-style: none;
  margin: 0 0 16px;
  padding: 12px 16px;
  background: var(--pale);
  border-radius: 12px;
  font-size: 14px;
  text-align: left;
}

.celebration__breakdown li {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.celebration__milestones {
  margin-bottom: 16px;
}

.celebration__milestone {
  display: inline-block;
  background: linear-gradient(135deg, var(--sun), var(--sunset));
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  margin: 4px 4px;
}

.celebration__badges-unlocked {
  margin: 16px 0;
  padding: 14px 12px;
  background: linear-gradient(135deg, #fff8e1, #fef3c7);
  border-radius: 12px;
  border: 1.5px solid rgba(251, 191, 36, 0.4);
}

.celebration__badges-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ocean-deep);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.celebration__milestone--badge {
  background: linear-gradient(135deg, #fbbf24, #fb923c);
  color: var(--ocean-deep);
}

.badge-section__sub {
  margin: -4px 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* ─── Badges grid (home) ───────────────────────────────────────── */

.badge-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.badge {
  background: var(--pale);
  border-radius: 12px;
  padding: 10px 4px;
  text-align: center;
  border: 1.5px solid transparent;
}

.badge--unlocked {
  background: linear-gradient(135deg, #fff8e1 0%, #fef3c7 100%);
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 2px 6px rgba(251, 191, 36, 0.15);
}

.badge--locked { opacity: 0.45; }

.badge__emoji {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.badge__name {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  padding: 0 2px;
}

.badge--locked .badge__name { color: var(--muted); }

/* ─── Moves Journal (home) ─────────────────────────────────────── */

.journal-group { margin-bottom: 14px; }
.journal-group:last-child { margin-bottom: 0; }

.journal-group__title {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.journal-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.journal-card {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: white;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.journal-card--locked { opacity: 0.5; }

.journal-card--landed.journal-card--common {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border-color: #94a3b8;
}
.journal-card--landed.journal-card--uncommon {
  background: linear-gradient(135deg, #ffffff 0%, #dcfce7 100%);
  border-color: #22c55e;
}
.journal-card--landed.journal-card--rare {
  background: linear-gradient(135deg, #ffffff 0%, #dbeafe 100%);
  border-color: #3b82f6;
}
.journal-card--landed.journal-card--legendary {
  background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
  border-color: #f59e0b;
}

.journal-card__name {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.journal-card--locked .journal-card__name { color: var(--muted); }

.journal-card__desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.3;
}
