/* The story card (src/panels/story.rs): the new player's journey told over the view, the world
   dimmed behind it. A frame, a large title, lines of paper or figures of icons, and its buttons:
   the call to action first, then words. */
#story {
  position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 24px 30px;
  background: radial-gradient(90% 80% at 50% 45%, var(--haze), var(--veil));
  backdrop-filter: blur(4px); font: 18px/1.55 var(--face);
  &[hidden] { display: none; }
  .story-card { width: min(620px, calc(100vw - 60px)); padding: 34px 40px 30px;
    animation: story-in 0.6s var(--ease-spring) both; }
  h1 { margin: 0 0 18px; font: 500 34px/1.15 var(--face); color: var(--paper-bright); letter-spacing: 0.01em; }
  p {
    margin: 0 0 12px; color: var(--muted);
    &:first-of-type { color: var(--paper); }
    &.kicker { margin: 0 0 6px; font: 600 14px/1 var(--face); letter-spacing: 0.22em; text-transform: uppercase;
      color: var(--muted); }
  }
  /* The welcome home, the journey's end: set in the middle, told in pictures. */
  &[data-kind="welcome"] {
    .story-card { width: min(680px, calc(100vw - 60px)); text-align: center; }
    h1 { margin-bottom: 10px; font-size: 42px; }
    .story-actions { justify-content: center; }
  }
  /* What every shinobi carries: figures side by side, a hairline between them, each its icons over
     a short label. Several icons are set round a ring, arriving one after another; one icon is
     drawn large. */
  .story-gifts { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin: 26px 0 4px;
    border-top: 1px solid var(--line); padding-top: 24px; }
  .gift { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 0; padding: 0 18px;
    & + .gift { border-left: 1px solid var(--line); }
  }
  .gift-icons { --ring: 66px; --icon: 48px; position: relative; display: grid; place-items: center;
    width: calc(2 * var(--ring) + var(--icon)); aspect-ratio: 1;
    &::before { content: ""; position: absolute; inset: calc(var(--icon) / 2); border: 1px solid var(--line);
      border-radius: 50%; }
    img { position: absolute; left: 50%; top: 50%; width: var(--icon); height: var(--icon); margin: calc(var(--icon) / -2);
      --turn: calc(var(--i) / var(--n) * 1turn);
      transform: rotate(var(--turn)) translateY(calc(-1 * var(--ring))) rotate(calc(-1 * var(--turn)));
      animation: gift-in 0.5s var(--ease-out) both; animation-delay: calc(0.35s + var(--i) * 0.07s); }
    img:only-child { position: relative; left: auto; top: auto; width: 112px; height: 112px; margin: 0; transform: none;
      animation: gift-in 0.6s var(--ease-out) 0.5s both, gift-asleep 3.2s ease-in-out 1.1s infinite; }
    &:has(img:only-child)::before { display: none; }
  }
  figcaption { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 250px;
    font-size: 16px; line-height: 1.35; color: var(--paper); }
  /* A gift's state: small capitals in the ink of what is hidden. */
  .gift-tag { color: var(--violet-hi); }
  .story-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 30px; margin-top: 26px; }
  @media (prefers-reduced-motion: reduce) { .story-card, .gift-icons img { animation: none !important; } }
  @media (max-width: 560px) {
    .story-gifts { grid-auto-flow: row; row-gap: 22px; }
    .gift + .gift { border-left: 0; }
  }
}
@keyframes story-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes gift-in { from { opacity: 0; scale: 0.6; } }
/* A power asleep: its glow rises and falls like breath. */
@keyframes gift-asleep {
  0%, 100% { filter: drop-shadow(0 0 6px var(--violet-glow)); }
  50% { filter: drop-shadow(0 0 22px var(--violet-glow)); }
}
body:has(#story:not([hidden])) :is(#help, #resume-hint) { display: none; }
