/* The goal scenes (F14, goals.js). Linked after ember.css.
 *
 * A goal's card: its scene at half width (80 x 64 cells at 2 CSS px, so
 * 160 x 128), then its name and the backend's strings under it, never over
 * it (CLAUDE.md §5). Two cards a row where two fit; one, centred, on a narrow
 * phone. The goal's own screen: the same grid at 4 CSS px (fewer only where
 * the phone is too narrow), over the tabs. The two frames swap as the room's
 * do (app.css's .f1/.f2), pause when the figures are stale, and stand still
 * under reduced motion (app.css). */

.goals {
  display: grid; grid-template-columns: repeat(auto-fill, 162px); justify-content: center; gap: 10px;
  margin: 4px 0 12px;
}
.goalcard {
  display: grid; align-content: start; width: 162px; padding: 0; margin: 0; text-align: left; cursor: pointer;
  background: var(--wall); border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; color: var(--cream);
  font: inherit;
}
.goalcard:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.goal-pic { position: relative; flex: none; overflow: hidden; background: var(--bg); }
.goal-pic canvas { position: absolute; left: 0; top: 0; image-rendering: pixelated; image-rendering: crisp-edges; }
.goal-t { display: grid; gap: 2px; padding: 8px 10px 10px; min-width: 0; font-family: var(--prose); }
.goal-name { font-family: var(--body-face); font-size: var(--t-body); line-height: var(--lh-body); color: rgb(var(--fg) / .8); overflow-wrap: anywhere; }
.goal-name .emo { display: inline-block; width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; }
.goal-name .emo svg { display: block; width: 100%; height: 100%; }
.goal-name .emo.typed { width: auto; height: auto; vertical-align: 0; }
/* The figure, the backend's string: the pixel face, wrapping rather than cut off. */
.goal-big { font-family: var(--body-face); font-weight: 700; font-size: var(--t-figure); line-height: var(--lh-figure); letter-spacing: var(--ls-figure); color: var(--amber); overflow-wrap: anywhere; }
.goal-note { font-style: normal; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: rgb(var(--fg) / .8); overflow-wrap: anywhere; }

/* The goal's own screen. */
.goalpage {
  position: fixed; inset: 0; z-index: 15; display: flex; flex-direction: column;
  background: var(--bg); color: var(--cream); font-family: var(--prose);
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
.goal-head { flex: none; display: flex; align-items: center; height: 44px; padding: 0 8px; }
.goal-back {
  background: none; border: 0; color: var(--amber); font-family: var(--prose); font-weight: 600; font-size: var(--t-body); line-height: 1; padding: 10px 8px; cursor: pointer;
}
.goal-body {
  flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 16px 28px; display: grid; align-content: start; justify-items: start; gap: 10px;
}
.goal-full { justify-self: center; border-radius: 8px; touch-action: none; }
.goal-body .goal-t { padding: 0 2px; width: 100%; }
.goal-body .goal-name { font-family: var(--body-face); font-weight: 600; font-size: var(--t-title); line-height: var(--lh-title); }
.goal-body .goal-big { font-family: var(--body-face); font-weight: 700; font-size: var(--t-display); line-height: var(--lh-display); letter-spacing: var(--ls-figure); color: var(--gold); }
.goal-body .goal-note { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); }
.goal-txh {
  margin: 8px 2px 0; font-family: var(--prose); font-weight: 600; font-size: var(--t-label); line-height: var(--lh-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--mortar);
}
.goal-tx { list-style: none; margin: 0; padding: 0 2px; width: 100%; font-family: var(--body-face); font-size: var(--t-body); line-height: var(--lh-body); }
.goal-tx li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; min-width: 0; }
.goal-tx li + li { border-top: 1px solid rgb(var(--fg) / .07); }
.goal-tx .l { min-width: 0; overflow-wrap: anywhere; }
.goal-tx .when { display: block; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: rgb(var(--fg) / .8); }
.goal-tx .amt { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.goal-tx li.note { color: rgb(var(--fg) / .8); }
/* Stale figures: the scene holds still, as the stage's do. */
.goalpage.stale .goal-pic canvas, .stage.stale .goal-pic canvas { animation-play-state: paused !important; }
