/* ============================================================
   Moonflip — components: panels, feed, story, forms
   ============================================================ */

/* ---------- panels ---------- */

.panel {
  position: relative;
  width: min(560px, 100%);
  padding: clamp(24px, 4vw, 40px);
  background: linear-gradient(170deg, rgba(18, 21, 36, 0.9), rgba(9, 11, 20, 0.94));
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: rise 0.75s var(--ease) both;
}
.panel--intro {
  width: min(640px, 100%);
  background: linear-gradient(170deg, rgba(16, 19, 33, 0.82), rgba(7, 9, 17, 0.9));
}
.panel--wide { width: min(680px, 100%); }
.panel--post { width: min(520px, 100%); }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.panel__close {
  position: absolute;
  top: 12px; right: 14px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ink-faint);
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.panel__close:hover {
  color: var(--ink);
  border-color: var(--glass-line);
  background: rgba(255, 255, 255, 0.04);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, box-shadow 0.35s;
}
.btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.1); }
.btn:active { transform: translateY(0); }

.btn--primary {
  color: #1a1206;
  background: linear-gradient(140deg, #ffe0b8, var(--warm));
  border-color: transparent;
  box-shadow: 0 12px 34px -12px rgba(255, 184, 119, 0.7);
}
.btn--primary:hover {
  background: linear-gradient(140deg, #fff0da, #ffc68d);
  box-shadow: 0 16px 42px -12px rgba(255, 184, 119, 0.85);
}
.btn--secondary {
  color: var(--warm);
  background: rgba(255, 184, 119, 0.08);
  border-color: rgba(255, 184, 119, 0.4);
}
.btn--ghost { background: transparent; color: var(--ink-soft); }
.btn--ghost:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.btn--lg { padding: 15px 30px; font-size: 0.95rem; }
.btn--sm { padding: 9px 16px; font-size: 0.79rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.row--center { justify-content: center; }

/* ---------- chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.chip:hover { color: var(--ink); border-color: rgba(244, 241, 234, 0.3); }
.chip[aria-pressed="true"] {
  color: #14100a;
  background: var(--c, var(--warm));
  border-color: transparent;
}
.chip--theme {
  cursor: default;
  color: var(--c, var(--warm));
  border-color: color-mix(in srgb, var(--c, var(--warm)) 40%, transparent);
  background: color-mix(in srgb, var(--c, var(--warm)) 12%, transparent);
}
.chip__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c, var(--warm));
  box-shadow: 0 0 8px var(--c, var(--warm));
}
.chip[aria-pressed="true"] .chip__dot { background: #14100a; box-shadow: none; }

/* ============================================================
   Homepage — the intro panel only

   Everything here is scoped to .panel--intro (or to #btn-begin) on purpose:
   .fineprint, .eyebrow and .display are shared with the other screens and
   must keep looking the way they do there.
   ============================================================ */

/* ---------- the wordmark ---------- */

.brandmark {
  margin: 0 0 28px;                    /* 1.5× the old title/subtitle gap */
  font-family: var(--font-brand);
  font-weight: 600;
  /* ~1.4× the old .display size at the top end, and still allowed to shrink
     a long way down so "MoonFlip" never wraps or runs off a narrow screen */
  font-size: clamp(2.4rem, 11vw, 6.44rem);
  line-height: 1.02;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--ink);
}
.title-small { font-size: 0.75em; }

/* ---------- the line under it ---------- */

.panel--intro .tagline {
  margin: 0 0 40px;
  font-family: var(--font-brand);
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--warm);
}

/* ---------- the button (type only — size, gradient and glow are untouched) ---------- */

#btn-begin {
  font-family: var(--font-brand);
  font-weight: 500;
  letter-spacing: 0.08em;
}

/* ---------- the note at the bottom ---------- */

.panel--intro .fineprint {
  font-family: var(--font-note);
  font-weight: 300;
  font-size: 12px;
}
.panel--intro .fineprint strong {
  font-weight: 400;
  color: var(--ink);                   /* a touch brighter than the rest */
}

/* ============================================================
   Bright side: the feed
   ============================================================ */

.screen--bright { pointer-events: none; }
.screen--bright.is-active { pointer-events: none; }

.feed {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* the feed layer itself must never swallow drags meant for the Moon */
.screen--bright.is-active > .feed,
.screen--bright.is-active > .toasts,
.screen--bright.is-active > .hint { pointer-events: none; }
.screen--bright.is-active > .feed .post-card { pointer-events: auto; }

.post-card {
  position: absolute;
  width: clamp(190px, 21vw, 248px);
  padding: 0;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: linear-gradient(165deg, rgba(23, 27, 45, 0.9), rgba(12, 14, 26, 0.92));
  border: 1px solid rgba(180, 205, 255, 0.18);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 46px -18px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255,255,255,0.02) inset;
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s, opacity 0.6s;
  animation: cardIn 0.9s var(--ease) both, drift var(--drift, 11s) var(--ease-soft) infinite alternate;
  animation-delay: var(--delay, 0s), var(--delay, 0s);
}
.post-card:hover,
.post-card:focus-visible {
  transform: translateY(-6px) scale(1.035);
  border-color: rgba(190, 215, 255, 0.5);
  box-shadow: 0 26px 60px -18px rgba(0, 0, 0, 0.95), 0 0 34px -6px var(--cool-glow);
  z-index: 5;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(26px) scale(0.94); }
  to   { opacity: 1; }
}
@keyframes drift {
  from { translate: 0 0; }
  to   { translate: 0 -14px; }
}

.post-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--grad, linear-gradient(135deg, #5b7cff, #b06bff));
}
.post-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 55% at 30% 25%, rgba(255,255,255,0.4), transparent 70%),
    linear-gradient(180deg, transparent 45%, rgba(0,0,0,0.35));
  mix-blend-mode: screen;
}
.post-card__emoji {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.45));
  z-index: 1;
}
.post-card__badge {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
  padding: 3px 8px;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.92);
  background: rgba(8, 10, 18, 0.62);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.post-card__body { padding: 11px 13px 13px; }
.post-card__head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}
.post-card__avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--grad);
  flex: none;
}
.post-card__handle {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.post-card__time { font-size: 0.66rem; color: rgba(244,241,234,0.35); margin-left: auto; }
.post-card__caption {
  margin: 0 0 9px;
  font-size: 0.86rem;
  line-height: 1.4;
}
.post-card__meta {
  display: flex;
  gap: 12px;
  font-size: 0.68rem;
  color: rgba(244,241,234,0.42);
}

/* ---------- a post the visitor wrote ---------- */

.post-card--mine {
  border-color: rgba(255, 184, 119, 0.45);
  box-shadow: 0 18px 46px -18px rgba(0, 0, 0, 0.9), 0 0 30px -10px var(--warm-glow);
}
.post-card--mine:hover,
.post-card--mine:focus-visible {
  border-color: var(--warm);
  box-shadow: 0 26px 60px -18px rgba(0, 0, 0, 0.95), 0 0 38px -6px var(--warm-glow);
}
.post-card__badge--mine {
  color: #1a1206;
  background: linear-gradient(140deg, #ffe0b8, var(--warm));
  border-color: transparent;
  letter-spacing: 0.2em;
}
.post-card__mine-note {
  margin: 0;
  font-size: 0.66rem;
  color: rgba(255, 184, 119, 0.75);
}
/* a written post arrives softly rather than dropping in with the rest */
.post-card--mine.is-fresh {
  animation: mineIn 1.1s var(--ease) both,
             drift var(--drift, 10.5s) var(--ease-soft) 1.1s infinite alternate;
}
@keyframes mineIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ---------- writing from the near side ---------- */

.near-actions {
  position: absolute;
  left: 50%;
  bottom: clamp(62px, 11vh, 92px);
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  pointer-events: auto;
  /* above the drifting cards, which stack from 6 upward */
  z-index: 20;
}
/* the feed drifts underneath it, so it needs to read over anything */
.near-actions .btn {
  background: linear-gradient(140deg, rgba(40, 26, 14, 0.92), rgba(24, 18, 12, 0.92));
  border-color: rgba(255, 184, 119, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9);
}
.near-actions .btn:hover {
  background: linear-gradient(140deg, rgba(58, 38, 20, 0.95), rgba(34, 25, 16, 0.95));
  border-color: var(--warm);
}

/* hero version inside the post sheet */
.post-card--hero {
  position: relative;
  width: 100%;
  animation: rise 0.6s var(--ease) both;
  cursor: default;
}
.post-card--hero:hover { transform: none; box-shadow: 0 18px 46px -18px rgba(0,0,0,0.9); }
.post-card--hero .post-card__media { aspect-ratio: 16 / 9; }
.post-card--hero .post-card__emoji { font-size: 3rem; }
.post-card--hero .post-card__caption { font-size: 1rem; }

/* mobile: feed becomes a scrollable stack */
@media (max-width: 760px) {
  .screen--bright.is-active > .feed { pointer-events: auto; }
  .feed {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 96px 16px 150px;
    overflow-y: auto;
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
  }
  .post-card {
    position: relative !important;
    left: auto !important; top: auto !important; right: auto !important;
    width: 100%;
    animation: cardIn 0.7s var(--ease) both;
  }
}

/* ---------- comparison toasts ---------- */

.toasts {
  position: absolute;
  top: clamp(64px, 9vh, 92px);
  right: clamp(12px, 3vw, 26px);
  width: min(240px, 60vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  z-index: 6;
}
.toast {
  padding: 9px 12px;
  font-size: 0.74rem;
  color: var(--ink-soft);
  background: rgba(14, 18, 34, 0.82);
  border: 1px solid rgba(160, 190, 255, 0.2);
  border-left: 2px solid var(--cool);
  border-radius: 10px;
  box-shadow: 0 10px 26px -12px rgba(0,0,0,0.9);
  backdrop-filter: blur(8px);
  animation: toastIn 0.5s var(--ease) both;
}
.toast.is-out { animation: toastOut 0.6s var(--ease) both; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(26px); } }

/* ---------- hints ---------- */

.hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 20px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
}
.hint--bottom { bottom: clamp(18px, 4vh, 38px); }
.hint__pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cool);
  box-shadow: 0 0 12px var(--cool);
  animation: breathe 2.2s var(--ease-soft) infinite;
  flex: none;
}

/* ---------- the question under a post ---------- */

.post-question {
  margin: 20px 0 0;
  padding: 16px 18px;
  border-left: 2px solid var(--warm);
  background: linear-gradient(90deg, rgba(255, 184, 119, 0.09), transparent);
  border-radius: 0 10px 10px 0;
}
.post-question__q {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.22rem;
  line-height: 1.3;
  color: var(--ink);
}
.post-question__hint {
  margin: 7px 0 0;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* ============================================================
   Flight
   ============================================================ */

.screen--flight {
  display: grid;
  place-items: end center;
  padding: 0 20px clamp(26px, 8vh, 74px);
}
.flight { width: min(460px, 100%); text-align: center; }
.flight__line {
  min-height: 3.2em;
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 2.6vw, 1.42rem);
  line-height: 1.4;
  color: var(--ink);
  text-shadow: 0 2px 26px rgba(0,0,0,0.85);
  transition: opacity 0.6s var(--ease);
}
.flight__track {
  height: 1px;
  background: rgba(244, 241, 234, 0.16);
  overflow: hidden;
  border-radius: 1px;
}
.flight__track span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cool), var(--warm));
  box-shadow: 0 0 12px var(--warm-glow);
}

/* ============================================================
   Far side
   ============================================================ */

.screen--far { pointer-events: none; }
.screen--far.is-active { pointer-events: none; }
.screen--far.is-active .far-top,
.screen--far.is-active .far-bottom,
.screen--far.is-active .story-panel { pointer-events: auto; }

.far-top {
  position: absolute;
  top: clamp(64px, 10vh, 96px);
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 28px));
  display: flex;
  justify-content: center;
}
.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.filters__label {
  font-size: 0.64rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.filters__chips { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }

@media (max-width: 760px) {
  .filters { border-radius: var(--radius); }
  .filters__label { display: none; }
}

.far-bottom {
  position: absolute;
  bottom: clamp(16px, 3.5vh, 32px);
  left: 50%;
  transform: translateX(-50%);
  width: min(620px, calc(100vw - 28px));
  text-align: center;
}
.far-hint {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--ink-faint);
  text-shadow: 0 2px 18px rgba(0,0,0,0.8);
}
.constellation-count {
  margin: 12px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--warm);
  opacity: 0.85;
  min-height: 1.2em;
}

/* ---------- story panel ---------- */

.story-panel {
  position: absolute;
  top: 50%;
  right: clamp(14px, 3vw, 34px);
  transform: translate(26px, -50%);
  width: min(390px, calc(100vw - 28px));
  max-height: min(70vh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 26px 22px;
  background: linear-gradient(168deg, rgba(26, 20, 16, 0.92), rgba(11, 10, 16, 0.95));
  border: 1px solid rgba(255, 184, 119, 0.22);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 80px -30px rgba(255, 170, 110, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), visibility 0.6s step-end;
}
.story-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), visibility 0s;
}

.story-panel__seen-label,
.story-panel__label {
  margin: 18px 0 6px;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.story-panel__seen {
  margin: 0;
  padding-left: 13px;
  border-left: 2px solid rgba(160, 190, 255, 0.45);
  font-size: 0.88rem;
  color: rgba(200, 216, 255, 0.82);
}
.story-panel__label { color: var(--warm); margin-top: 22px; }
.story-panel__text {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 2.4vw, 1.3rem);
  line-height: 1.48;
  color: var(--ink);
}
.story-panel__note {
  margin: 14px 0 0;
  font-size: 0.72rem;
  line-height: 1.55;
  color: rgba(244, 241, 234, 0.38);
}
.story-panel__nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.signals {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.signals__label {
  margin: 0 0 10px;
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.signals__buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.signal-btn {
  padding: 9px 15px;
  font: inherit;
  font-size: 0.8rem;
  color: var(--ink);
  background: rgba(255, 184, 119, 0.09);
  border: 1px solid rgba(255, 184, 119, 0.3);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.signal-btn:hover { background: rgba(255, 184, 119, 0.18); transform: translateY(-2px); }
.signal-btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; }
.signals__status {
  margin: 11px 0 0;
  min-height: 1.3em;
  font-size: 0.78rem;
  color: var(--warm);
}

@media (max-width: 860px) {
  .story-panel {
    top: auto;
    bottom: 0;
    right: 0; left: 0;
    width: 100%;
    max-height: 66vh;
    transform: translateY(24px);
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .story-panel.is-open { transform: none; }

  /* the panel becomes a bottom sheet and would sit on top of the action bar,
     so the bar steps aside — but only while a panel is actually open, or the
     way onward is unreachable on a phone */
  .far-bottom { display: none; }
  .screen--far:has(.story-panel:not(.is-open)) .far-bottom {
    display: block;
    bottom: clamp(14px, 3vh, 26px);
  }
  .screen--far:has(.story-panel:not(.is-open)) .far-hint { display: none; }
}

/* ============================================================
   Contribute
   ============================================================ */

.form { margin-top: 20px; }
.field { display: block; margin-bottom: 18px; position: relative; }
.field__label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(180, 205, 255, 0.8);
  padding: 0;
}
.field--warm .field__label { color: var(--warm); }
.field__input {
  display: block;
  width: 100%;
  padding: 13px 15px;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-sm);
  resize: vertical;
  transition: border-color 0.25s, background 0.25s;
}
.field--warm .field__input {
  font-family: var(--font-display);
  font-size: 1.06rem;
}
.field__input::placeholder { color: rgba(244, 241, 234, 0.3); }
.field__input:focus {
  outline: none;
  border-color: var(--warm);
  background: rgba(255, 255, 255, 0.07);
}
.field__count {
  position: absolute;
  right: 4px;
  bottom: -17px;
  font-size: 0.66rem;
  color: rgba(244, 241, 234, 0.32);
  font-variant-numeric: tabular-nums;
}
.field--row { border: 0; margin: 26px 0 18px; padding: 0; }
.field--row legend { margin-bottom: 9px; }

.form__error {
  margin: 4px 0 0;
  min-height: 1.2em;
  font-size: 0.8rem;
  color: var(--warm-2);
}

.my-lights { margin-top: 22px; }
.my-light {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  margin-bottom: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-sm);
}
.my-light__body { flex: 1; min-width: 0; }
.my-light__bright {
  margin: 0 0 5px;
  font-size: 0.8rem;
  color: rgba(200, 216, 255, 0.78);
}
.my-light__far {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.99rem;
  color: var(--ink);
}
.my-light__tag {
  margin: 7px 0 0;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.my-light__del {
  flex: none;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.7rem;
  color: var(--ink-faint);
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}
.my-light__del:hover { color: var(--warm-2); border-color: rgba(255, 143, 107, 0.4); }
.my-lights__title {
  margin: 0 0 11px;
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ============================================================
   Closing
   ============================================================ */

.action-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 20px 0 6px;
}
.action-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px 16px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s;
}
.action-card:hover { transform: translateY(-3px); border-color: rgba(255, 184, 119, 0.45); }
.action-card[aria-pressed="true"] {
  border-color: var(--warm);
  background: rgba(255, 184, 119, 0.1);
  box-shadow: 0 0 34px -12px var(--warm-glow);
}
.action-card__icon { font-size: 1.25rem; line-height: 1; }
.action-card__title { font-size: 0.92rem; font-weight: 500; }
.action-card__desc { font-size: 0.76rem; color: var(--ink-faint); line-height: 1.5; }

.checkin {
  margin-top: 18px;
  padding: 16px;
  background: rgba(255, 184, 119, 0.06);
  border: 1px solid rgba(255, 184, 119, 0.22);
  border-radius: var(--radius-sm);
  animation: rise 0.5s var(--ease) both;
}
.checkin__label {
  margin: 0 0 9px;
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--warm);
}
.checkin__text {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  resize: vertical;
}
.checkin__text:focus { outline: none; border-color: var(--warm); }
.checkin__copied { font-size: 0.78rem; color: var(--warm); }

.closing-line {
  margin: 26px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.closing-line blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  line-height: 1.35;
  color: var(--ink);
  text-align: center;
}

.resources {
  margin: 4px 0 0;
  padding-left: 20px;
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--ink-soft);
}
.resources strong { color: var(--ink); font-weight: 500; }

/* ============================================================
   My constellation — the private view
   ============================================================ */

.glass-panel {
  position: absolute;
  top: 50%;
  right: clamp(14px, 3vw, 34px);
  transform: translate(26px, -50%);
  width: min(360px, calc(100vw - 28px));
  max-height: min(74vh, 700px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 24px 22px;
  background: linear-gradient(168deg, rgba(30, 24, 17, 0.62), rgba(12, 11, 18, 0.72));
  border: 1px solid rgba(255, 184, 119, 0.28);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 80px -30px var(--warm-glow);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), visibility 0.6s step-end;
}
.glass-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), visibility 0s;
}
.glass-panel__title {
  margin: 0.2em 0 0.8em;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--ink);
}
.glass-panel__empty {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ---------- the streak moon ---------- */

.streak {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warm);
}
.streak__moon { flex: none; }
.streak__moon-dark { fill: rgba(244, 241, 234, 0.13); }
.streak__moon-lit  { fill: #ffe6c2; }

/* ---------- earned keepsakes ---------- */

.keepsakes { margin: 0; padding: 0; list-style: none; }
.keepsake {
  display: flex;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.keepsake:last-child { border-bottom: 0; }
.keepsake__mark {
  flex: none;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--c, var(--warm));
  text-shadow: 0 0 12px var(--c, var(--warm-glow));
}
.keepsake__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.keepsake__body strong {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
}
.keepsake__body em {
  font-style: normal;
  font-size: 0.79rem;
  line-height: 1.5;
  color: var(--ink-faint);
}

/* ---------- the card ---------- */

#btn-make-card { margin-top: 18px; }

.card {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.card__toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.card__toggle input { accent-color: var(--warm); width: 15px; height: 15px; }
.card-slot { display: block; }
.card-preview {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-line);
}
.card__note {
  margin: 12px 0 0;
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--ink-faint);
}

/* a light that is not part of your own sky, while the private view is on */
.marker.is-muted { opacity: 0.1 !important; pointer-events: none; }

@media (max-width: 860px) {
  .glass-panel {
    top: auto;
    bottom: 0;
    right: 0; left: 0;
    width: 100%;
    max-height: 72vh;
    transform: translateY(24px);
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .glass-panel.is-open { transform: none; }
}

/* ============================================================
   A quiet offer of help

   Sits above the panels (#ui is z-index 20) but below the scrim modals
   (30), so tapping "Support resources" covers this with the real notice
   rather than fighting it. Warm, not alarming: same glass and gold as
   everything else, no red, no icon, no interception.
   ============================================================ */

.care {
  position: fixed;
  left: 50%;
  top: 58%;
  transform: translateX(-50%);
  z-index: 25;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
  animation: careIn 0.9s var(--ease) both;
}
.care[hidden] { display: none; }

.care__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 44px 16px 20px;
  pointer-events: auto;
  background: linear-gradient(168deg, rgba(34, 26, 18, 0.88), rgba(14, 12, 18, 0.92));
  border: 1px solid rgba(255, 184, 119, 0.32);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow), 0 0 60px -26px var(--warm-glow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.care__line {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--ink);
}
.care__link {
  align-self: flex-start;
  font-size: 0.82rem;
  color: var(--warm);
  border-bottom-color: var(--warm-glow);
}
.care__close {
  position: absolute;
  top: 8px; right: 10px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--ink-faint);
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.care__close:hover {
  color: var(--ink);
  border-color: var(--glass-line);
  background: rgba(255, 255, 255, 0.05);
}

@keyframes careIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%); }
}

@media (max-width: 860px) {
  /* the story panel is a bottom sheet here, so sit above it instead */
  .care { top: auto; bottom: calc(66vh + 16px); }
}
