/* Firelight — starlit dusk, lamplight, one living flame. No confetti, ever.
   Rebuilt 2026-08-18 from the approved overhaul plan. */

@font-face {
  font-family: "Kaisei HarunoUmi";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/kaisei-700.woff2") format("woff2");
}
@font-face {
  font-family: "Kaisei HarunoUmi";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/kaisei-400.woff2") format("woff2");
}

:root {
  /* ground */
  --night:       #171420;   /* dusk indigo-plum */
  --night-deep:  #100e18;
  --night-high:  #241f38;   /* top of the sky gradient */
  --card:        #221e30;
  --card-soft:   #2a2440;
  --card-edge:   #3a3352;
  /* ink */
  --ink:         #f2e9d8;   /* warm cream */
  --ink-dim:     #bfb2a0;
  /* Instruction tier keeps ≥4.5:1 on --night; the audience skews 40+.
     Decorative-only text may use --ink-ghost. */
  --ink-faint:   #9a9083;
  --ink-ghost:   #6b6357;
  /* light */
  --ember:       #f0a860;   /* lamplight amber — the one accent */
  --ember-hot:   #ffd9a0;
  --ember-deep:  #c96f42;   /* terracotta depth */
  --good:        #97b585;   /* moss — loved only */
  --danger:      #c97a6b;   /* clay — flagged only */
  /* legacy aliases (app.js and inline styles reference these) */
  --accent:      var(--ember);
  --accent-soft: var(--ember-deep);
  --bg:          var(--night);
  --bg-soft:     var(--night-deep);
  /* type */
  --display: "Kaisei HarunoUmi", Georgia, serif;
  --body: Georgia, "Times New Roman", serif;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  /* shape & rhythm (8px scale) */
  --radius: 16px;
  --radius-lg: 20px;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px;
  --tabbar-h: 62px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: linear-gradient(180deg, var(--night-high) 0%, var(--night) 30%, var(--night) 75%, var(--night-deep) 100%) fixed var(--night);
  color: var(--ink);
  font: 17px/1.55 var(--body);
  overscroll-behavior: none;
}

/* ---- the sky (painted once by app.js; shown only on open-air screens) ---- */
#sky {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  opacity: 0; transition: opacity 1.2s ease;
}
body.sky-on #sky { opacity: 1; }
.tw {
  position: fixed; border-radius: 50%; background: var(--ember-hot);
  pointer-events: none; z-index: 0; opacity: 0;
  animation: shimmer var(--d, 7s) ease-in-out infinite;
}
body:not(.sky-on) .tw { display: none; }
@keyframes shimmer { 0%, 100% { opacity: 0.1; } 50% { opacity: 0.65; } }

#app {
  position: relative; z-index: 1;
  max-width: 560px; margin: 0 auto; min-height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 14px)
           calc(env(safe-area-inset-right, 0px) + 18px)
           calc(env(safe-area-inset-bottom, 0px) + 60px)
           calc(env(safe-area-inset-left, 0px) + 18px);
}
body.with-tabs #app { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tabbar-h) + 28px); }

.screen { display: none; animation: fade 0.5s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

h1 {
  font-family: var(--display); font-weight: 700;
  font-size: 1.85rem; line-height: 1.2; letter-spacing: 0.01em;
  text-wrap: balance;
}
h2 {
  font-family: var(--ui); font-size: 0.76rem; font-weight: 600;
  color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.14em;
  margin: var(--s3) 0 10px;
}
.dim { color: var(--ink-dim); }
.faint { color: var(--ink-faint); font-size: 0.85rem; }

button {
  font: 0.95rem/1.3 var(--ui); color: var(--ink);
  background: var(--card-soft);
  border: none; border-radius: var(--radius);
  padding: 12px 18px; min-height: 44px; cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
}
button:active { transform: scale(0.97); filter: brightness(1.18); }
button.primary {
  background: linear-gradient(180deg, var(--ember-hot), var(--ember));
  color: #2b1a0c; font-weight: 600;
  box-shadow: 0 2px 14px rgba(240, 168, 96, 0.22);
}
button.quiet { background: none; color: var(--ink-dim); padding: 11px 10px; }
button:disabled { opacity: 0.45; cursor: default; transform: none; filter: none; }

textarea, input[type="text"], input[type="password"] {
  font: inherit; width: 100%; color: var(--ink); background: rgba(16, 14, 24, 0.7);
  border: 1px solid var(--card-edge); border-radius: 12px; padding: 12px 14px;
  min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
textarea:focus, input:focus { outline: none; border-color: var(--accent-soft); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* ---- tab bar ---- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: none;
  justify-content: space-around; align-items: flex-start;
  padding: 8px 6px calc(env(safe-area-inset-bottom, 0px) + 6px);
  min-height: var(--tabbar-h);
  background: rgba(16, 14, 24, 0.82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid rgba(58, 51, 82, 0.6);
}
body.with-tabs .tabbar { display: flex; }
.tabbar button {
  flex: 1; max-width: 120px; background: none; border-radius: 12px;
  padding: 4px 2px 6px; min-height: 44px;
  font-family: var(--ui); font-size: 0.68rem; letter-spacing: 0.04em;
  color: var(--ink-faint);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
/* Drawn icons: one stroke weight, the label's own ink, lit with it. */
.tabbar button .t-ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.tabbar button .t-ic .knob { fill: var(--night-deep); }
.tabbar button.on { color: var(--ember-hot); }
.tabbar button.on .t-ic { opacity: 1; }
.tabbar button:active { transform: none; filter: none; background: rgba(240, 168, 96, 0.08); }

/* ---- home: the ask above, the loom below ---- */
.greet { font-family: var(--display); font-size: 1.05rem; color: var(--ink-faint); margin: var(--s1) 0 2px; }
.weather-row { display: flex; gap: var(--s1); margin: 14px 0 22px; flex-wrap: wrap; }
.chip {
  border: none; border-radius: 999px; padding: 8px 16px; min-height: 36px;
  background: rgba(242, 233, 216, 0.06); color: var(--ink-dim);
  font-family: var(--ui); font-size: 0.88rem;
}
.chip.on { color: var(--ember-hot); background: rgba(240, 168, 96, 0.14); }

/* The ask — the question gets the room (Su 08-29): the question, the flame
   under it, the pill under that. Day zero is the same shape, larger and alone. */
.ask { margin: 22px 0 6px; text-align: center; }
.ask-orb-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer;
  background: none; border: none; border-radius: 0; padding: 0; margin: 0 auto 10px; min-height: 0; font: inherit; color: inherit;
}
.ask-orb-wrap:active { transform: none; filter: none; }
.ask-hint { font-family: var(--ui); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--ink-faint); white-space: nowrap; }
.ask-q { display: block; text-align: center; font-size: 1.85rem; margin: 6px 0 14px; }
.ask-cold-note { display: none; text-align: center; max-width: 34ch; margin: 0 auto 18px; font-size: 0.92rem; }
.ask.cold { margin-top: 42px; }
.ask.cold .ask-cold-note { display: block; }
.ask.cold .orb-ask { width: 132px; height: 132px; }
.ask-pill {
  display: flex; align-items: center; gap: 6px;
  background: rgba(16, 14, 24, 0.55); border: 1px solid var(--card-edge); border-radius: 999px;
  padding: 4px 4px 4px 18px; min-height: 50px;
}
.ask-pill input[type="text"] {
  flex: 1; min-width: 0; background: none; border: none; border-radius: 0; padding: 8px 0; min-height: 40px;
  font-family: var(--display); font-size: 1.08rem; color: var(--ink);
}
.ask-pill input::placeholder { color: var(--ink-faint); font-style: italic; }
.ask-pill input:focus { border: none; }
.ask-go {
  width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 50%; flex: none;
  background: linear-gradient(180deg, var(--ember-hot), var(--ember)); color: #2b1a0c;
  font-size: 1.1rem; font-weight: 700;
}
/* The guide's line — Firelight speaks first, about her. Tapping opens catch-up. */
.guide {
  display: block; width: 100%; text-align: left; margin: 18px 0 0;
  background: none; border: none; border-radius: 0; padding: 4px 0; min-height: 0;
  font-family: var(--display); font-weight: 400; font-size: 1.02rem; line-height: 1.5; color: var(--ember-hot);
}
.guide::after { content: "\00a0→"; color: var(--ember); white-space: nowrap; }
.guide:active { transform: none; filter: none; }

/* Sideways rows under the question (Su 08-29): picks, then listen again. */
.row-label {
  font-family: var(--ui); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint); margin: 24px 0 8px;
}
.pick-row, .shelf {
  display: flex; gap: 8px; flex-wrap: nowrap; margin: 0 -18px; padding: 2px 18px 6px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.pick-row::-webkit-scrollbar, .shelf::-webkit-scrollbar { display: none; }
.pick-row .chip { font-family: var(--body); font-size: 0.92rem; color: var(--ink-dim); white-space: nowrap; flex: none; padding: 9px 16px; min-height: 40px; }
.shelf { gap: 10px; }
.shelfcard {
  flex: 0 0 168px; display: flex; flex-direction: column; gap: 4px; text-align: left;
  background: linear-gradient(165deg, var(--card-soft), var(--card));
  border: 1px solid rgba(58, 51, 82, 0.9); border-radius: var(--radius-lg);
  padding: 14px 14px 12px; min-height: 122px; color: var(--ink); font-family: var(--body);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}
.shelfcard.hero {
  background: linear-gradient(160deg, #302848, var(--card));
  border-color: rgba(240, 168, 96, 0.28);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(240, 168, 96, 0.06), inset 0 1px 0 rgba(255, 217, 160, 0.08);
}
.shelfcard .eyebrow {
  font-family: var(--ui); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ember); min-height: 0.9em;
}
.shelfcard .ttl { font-family: var(--display); font-size: 1.02rem; line-height: 1.25; }
.shelfcard .holds { font-size: 0.82rem; color: var(--ink-dim); line-height: 1.4; font-style: italic; flex: 1; }
.shelfcard .meta { font-size: 0.74rem; color: var(--ink-faint); line-height: 1.4; margin-top: 4px; }
.shelfcard.all { justify-content: center; align-items: center; text-align: center; color: var(--ink-dim); font-size: 0.92rem; background: none; border-style: dashed; box-shadow: none; }

.more-ways { margin-top: var(--s2); width: 100%; text-align: center; }

/* legacy sheet block (kept for anything still inside panels) */
.sheet { margin-top: 12px; }
.type-row { display: flex; gap: var(--s1); flex-wrap: wrap; margin: 10px 0; }

.tile-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.tile {
  min-width: 150px; text-align: left; background: var(--card);
  border: 1px solid var(--card-edge); border-radius: var(--radius); padding: 12px 14px;
}
.tile .t-title { font-size: 0.98rem; font-family: var(--body); }
.tile .t-sub { color: var(--ink-faint); font-size: 0.78rem; margin-top: 4px; }
.tile.keystone { border-color: var(--accent-soft); }

/* The move she kept — one quiet line above the loom, never a card that nags. */
.move-chip {
  margin: 16px 0 0; padding: 10px 12px; border-radius: var(--radius);
  background: rgba(42, 36, 64, 0.45); border: 1px dashed var(--card-edge);
  color: var(--ink-dim); font-size: 0.88rem; line-height: 1.45;
}
.move-chip .chip { min-height: 32px; padding: 6px 12px; font-size: 0.8rem; }

/* ---- bottom sheets (replace the <details> disclosures) ---- */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 8, 16, 0.6);
  animation: fade 0.25s ease;
}
.sheet-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-width: 560px; margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--card-edge); border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 10px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  animation: rise 0.3s ease;
  max-height: 80vh; overflow-y: auto;
}
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-grip {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--card-edge); margin: 0 auto 14px;
}
.sheet-panel h3 {
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  margin-bottom: 10px;
}
.sheet-panel textarea { margin: 8px 0; min-height: 64px; }

/* ---- review ---- */
.beat {
  background: var(--card); border: 1px solid var(--card-edge); border-radius: 14px;
  padding: 12px 14px; margin: 10px 0; position: relative;
}
.beat.flagged { border-color: var(--danger); }
.beat.loved { border-color: var(--good); }
.beat .pause-note { color: var(--ink-faint); font-size: 0.75rem; margin-top: 6px; }
.beat .flagbtn { position: absolute; top: 8px; right: 8px; }
.beat textarea { margin-top: 6px; }
.flag-menu { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.flag-menu button { font-size: 0.8rem; padding: 8px 12px; min-height: 36px; border-radius: 999px; }
.review-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--night) 30%); padding: 18px 0 8px; display: flex; gap: 10px; }
.review-actions button { flex: 1; }

/* ---- player ---- */
#player-screen { text-align: center; }
#player-screen .topbar, #player-screen h1, #player-screen .seg-progress,
#player-screen .faint, #player-screen .player-controls { transition: opacity 0.4s ease; }
#player-screen.dimmed .topbar, #player-screen.dimmed h1, #player-screen.dimmed .seg-progress,
#player-screen.dimmed .faint, #player-screen.dimmed .player-controls { opacity: 0.08; transition: opacity 2.5s ease; }
#player-screen.dimmed .orb { opacity: 0.85; }

/* ---- the orb: a flame, not a sphere. A soft-edged tongue of light, brightest
   low in its core and thinning upward into the dark; a wide, faint halo around
   it. No concentric rings, no highlight dot — light with no edge, never an object. ---- */
.orb-wrap { display: flex; justify-content: center; margin: 56px 0 40px; }
/* The orbs and the mic are real buttons now (2026-08-29) — named for a screen
   reader, reachable by keyboard — so the button chrome is stripped back off. */
.orb, .mic { border: none; padding: 0; font: inherit; min-height: 0; display: block; }
.orb:active { transform: none; filter: none; }
.orb {
  --flame-blur: 10px;
  width: 168px; height: 168px; border-radius: 50%; position: relative;
  background: none;
  animation: breathe 9s ease-in-out infinite;
  cursor: pointer;
  transition: opacity 0.6s ease, filter 0.6s ease;
}
.orb:focus-visible { outline: 2px solid var(--ember); outline-offset: 6px; }
.orb::before {
  /* the halo */
  content: ""; position: absolute; inset: -22%; border-radius: 50%;
  /* closest-side: the glow reaches nothing before its own circle clips it — no visible rim */
  background: radial-gradient(circle closest-side at 50% 56%, rgba(240, 168, 96, 0.28) 0%, rgba(240, 168, 96, 0.09) 45%, rgba(240, 168, 96, 0) 92%);
}
.orb::after {
  /* the flame body: a teardrop, narrow at the tip, blurred past any edge */
  content: ""; position: absolute; left: 29%; right: 29%; top: 8%; bottom: 18%;
  border-radius: 50% 50% 50% 50% / 74% 74% 26% 26%;
  background: linear-gradient(180deg,
    rgba(201, 111, 66, 0) 0%, rgba(224, 136, 80, 0.42) 26%,
    rgba(246, 180, 110, 0.86) 58%, rgba(255, 232, 190, 0.98) 86%, rgba(255, 244, 222, 1) 100%);
  filter: blur(var(--flame-blur));
  transform-origin: 50% 90%;
  animation: flicker 6s ease-in-out infinite alternate;
}
/* flame.js draws the living flame on a canvas inside the orb; the CSS teardrop
   underneath is the fallback and hides once the canvas is live. */
.orb canvas.flame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.orb.live::after { display: none; }
.orb-ask { --flame-blur: 2.5px; width: 54px; height: 54px; margin: 0; animation-duration: 7s; }
.orb-ask::before { inset: -16%; opacity: 0.7; }
.orb-ask::after { left: 29%; right: 29%; top: 10%; bottom: 16%; }
@keyframes breathe {
  0%, 100% { transform: scale(0.94); }
  45%, 60% { transform: scale(1.04); }
}
@keyframes flicker {
  0%   { transform: scaleY(0.97) skewX(-1.5deg); opacity: 0.86; }
  35%  { transform: scaleY(1.03) skewX(1deg); opacity: 1; }
  70%  { transform: scaleY(0.99) skewX(-0.5deg); opacity: 0.93; }
  100% { transform: scaleY(1.04) skewX(1.5deg); opacity: 1; }
}
.orb.paused { animation-play-state: paused; opacity: 0.55; }
.orb.paused::after { animation-play-state: paused; }
.orb.muted { animation-play-state: paused; opacity: 0.3; }
.orb.muted::after { animation-play-state: paused; }
.orb.listening {
  animation: none; transform: scale(1.02);
  filter: hue-rotate(-28deg) saturate(1.05);
}
.orb.listening::after { animation-duration: 2.6s; }

.seg-progress { display: flex; gap: 2px; margin: 30px 0 10px; height: 4px; }
.seg-progress i { flex: 1; background: var(--card-edge); border-radius: 2px; }
.seg-progress i.done { background: var(--accent-soft); }
.seg-progress i.now { background: var(--accent); }
.player-controls { display: flex; justify-content: center; gap: 14px; margin-top: 30px; }

/* ---- turn ---- */
#turn-screen { text-align: center; }
.cv-promise { max-width: 42ch; margin: 0 auto 6px; text-align: center; line-height: 1.5; }
.mic {
  width: 92px; height: 92px; border-radius: 50%; margin: 40px auto 10px;
  background: radial-gradient(circle at 50% 42%, var(--card-soft), var(--card));
  border: 1px solid var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
  cursor: pointer; color: var(--ember);
}
.mic.rec { background: rgba(201, 122, 107, 0.18); border-color: var(--danger); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(201, 122, 107, 0.3); } 50% { box-shadow: 0 0 0 18px rgba(201, 122, 107, 0); } }

/* ---- release ---- */
#release-screen { text-align: center; padding-top: 90px; }
#release-screen p { color: var(--ink-dim); max-width: 40ch; margin: 16px auto; }

/* ---- memory (threads) ---- */
.mem-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 12px 0; }
.mem-tabs button { font-size: 0.8rem; padding: 8px 12px; min-height: 36px; white-space: nowrap; }
.mem-tabs button.on { color: var(--ember-hot); background: rgba(240, 168, 96, 0.14); }
#mem-text { min-height: 50vh; font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; }
#mem-rendered { min-height: 30vh; padding: 4px 2px; }
#mem-rendered p { margin: 10px 0; font-size: 0.98rem; }
#mem-rendered h2 { margin: 22px 0 8px; }
#mem-rendered .mem-li { margin: 6px 0 6px 8px; color: var(--ink-dim); }
#mem-rendered .mem-note { color: var(--ink-faint); font-size: 0.88rem; font-style: italic; }
/* At a glance — one page in the app's hand above the eight detailed ones.
   Each card is the gist of one page; tapping it opens that page to edit. */
.glance { display: grid; gap: 10px; margin-top: 4px; }
.glance-card {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--card-edge); border-radius: 14px;
  padding: 12px 14px; color: var(--ink); font-family: var(--body); min-height: 0;
}
.glance-card:active { transform: none; filter: brightness(1.08); }
.glance-card .g-k { font-family: var(--ui); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ember); }
.glance-card .g-k::after { content: "\00a0→"; color: var(--ink-ghost); letter-spacing: 0; }
.glance-card .g-v { font-size: 0.95rem; line-height: 1.45; color: var(--ink); margin-top: 4px; }
.glance-card .g-v.empty { color: var(--ink-faint); font-style: italic; }
.glance-card .g-v .g-more { color: var(--ink-faint); font-size: 0.82rem; }

/* ---- library (tracks) ---- */
.lib-row {
  display: flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--card-edge); border-radius: 14px;
  padding: 12px 6px 12px 14px; margin: 10px 0;
}
.lib-row.keystone { border-color: var(--accent-soft); }
.lib-row .lib-main { flex: 1; cursor: pointer; font-family: var(--body); }
.lib-row .t-holds { color: var(--ink-dim); font-size: 0.86rem; font-style: italic; margin-top: 2px; line-height: 1.4; }

/* ---- conversation ---- */
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 16px; margin: 8px 0; line-height: 1.5; }
.bubble.app { background: var(--card); border: 1px solid var(--card-edge); }
.bubble.me { background: rgba(240, 168, 96, 0.1); border: 1px solid rgba(240, 168, 96, 0.3); margin-left: auto; }
.bubble.thinking { color: var(--ink-faint); }

/* voice conversation: the orb listens, speaks, and breathes */
.cv-orb { width: 128px; height: 128px; }
.cv-orb.thinking { animation-duration: 3.5s; opacity: 0.7; }
.cv-caption {
  min-height: 3.2em; max-width: 42ch; margin: 0 auto;
  color: var(--ink-dim); font-size: 1.02rem; line-height: 1.6;
  transition: opacity 0.6s ease;
}
#cv-log .bubble { font-size: 0.88rem; opacity: 0.75; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--s1); min-height: 44px;
}
.spin { display: inline-block; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.note { margin: 14px 0; color: var(--ink-dim); font-size: 0.92rem; }
.err { color: var(--danger); }

/* ---- in-world dialog (replaces every native alert/prompt/confirm) ---- */
.dlg-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(10, 8, 16, 0.72);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade 0.25s ease;
}
.dlg {
  width: 100%; max-width: 400px;
  background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--radius-lg);
  padding: 22px 20px 18px;
}
.dlg h3 { font-family: var(--display); font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; }
.dlg .dlg-body { color: var(--ink-dim); font-size: 0.95rem; margin-bottom: 4px; white-space: pre-line; }
.dlg input { margin-top: 10px; }
.dlg .dlg-buttons { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.dlg .dlg-buttons button { flex: 1; min-width: 40%; }
.dlg .dlg-buttons button.danger { border: 1px solid var(--danger); color: var(--danger); background: none; }

@media (prefers-reduced-motion: reduce) {
  .orb, .orb::after, .tw, .spin { animation: none !important; }
  .tw { opacity: 0.4; }
}

/* ---- the loop (2026-08-30): the offered move and her cue, on the release screen ---- */
.loop { margin: 26px auto 0; max-width: 42ch; }
.loop-block { margin-top: 18px; }
.loop-line { color: var(--ink-dim); font-size: 0.95rem; line-height: 1.5; margin: 0; }
.loop-line em { color: var(--ink); font-style: italic; }
.loop-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.loop-note { color: var(--ink-faint); font-size: 0.8rem; margin: 8px 0 0; }
.shelfcard .meta .cue { color: var(--ember); }
