/* The SAB logo drawn live (logo-mark.js): the loading intro (intro.js) on the board and the config
   page, the SAB card swiped through the sports while the page loads, then its pin tapped, covering
   the page until it's done; and the pinned look and the tap, shared with the board's header logo. */

.loading-intro {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; overflow: hidden;
  background: #2f5f8f; /* the home-screen icon's deep blue (icons.mjs) */
  transition: opacity 0.4s ease; /* intro.js OUT */
  /* If intro.js never runs (a network that drops it), the intro still goes, after intro.js LIMIT. */
  animation: intro-give-up 0.4s ease 18s forwards;
}
@keyframes intro-give-up { to { opacity: 0; visibility: hidden; } }
/* A home-screen board on an iPhone leaves the strip under the home bar out of a fixed element's
   inset: 0, and iOS colours it from the page (the board's near-black) as a black bar under the intro.
   So while the intro is up the page is its blue, its shadow paints past its edges, and index.html's
   theme-color starts blue (intro.js gone sets it back). */
html:has(.loading-intro:not(.out)), html:has(.loading-intro:not(.out)) body { background: #2f5f8f; }
.loading-intro:not(.out) { box-shadow: 0 0 0 100vmax #2f5f8f; }
.loading-intro > * { grid-area: 1 / 1; width: min(72vw, 480px); } /* px: the board scales rem by layout */
.loading-intro svg, .loading-intro img { display: block; width: 100%; height: auto; overflow: visible; }

/* A swipe (intro.js SWIPE): the card leaves to the left as the next comes in from the right.
   The next card waits unseen (.waiting) until its letters have drawn. */
.intro-slot.waiting { opacity: 0; }
.intro-slot.enter { animation: intro-in 0.35s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.intro-slot.leave { animation: intro-leave 0.35s cubic-bezier(0.5, 0, 0.8, 0.4) forwards; }
@keyframes intro-in { from { transform: translateX(70%) rotate(5deg); opacity: 0; } }
@keyframes intro-leave { to { transform: translateX(-70%) rotate(-5deg); opacity: 0; } }

.sab-sport {
  text-anchor: middle; dominant-baseline: central;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

/* Pinned: the pin and the outline red. The tap that pins it: the pin presses in, a ring spreads from it. */
.sab-outline { transition: stroke 0.25s ease 0.12s; }
.sab-pin path { transition: fill 0.2s ease 0.12s; }
.sab-ripple { fill: none; stroke: #ff4b55; stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; }
.pinned .sab-outline { stroke: #ff4b55; }
.pinned .sab-pin path { fill: #ff4b55; }
/* The board's header only (logo-mark.js headerMark): its top live game a favorite's, not pinned: the
   outline gold, the pin kept blue, as on a favorite's card (only a pin turns a pin red). */
.favorite .sab-outline { stroke: #f3b42c; }
.tapped .sab-pin { animation: intro-press 0.3s ease; }
.tapped .sab-ripple { animation: intro-ripple 0.55s ease-out 0.12s; }
@keyframes intro-press { 40% { transform: scale(0.78); } }
/* The witching hour's hourglass (logo-mark.js): pinned, it turns over rather than pressing in. */
.tapped .sab-glass { animation: glass-flip 0.6s ease-in-out; }
@keyframes glass-flip { from { transform: rotate(0deg); } to { transform: rotate(180deg); } }
@keyframes intro-ripple { from { opacity: 0.9; transform: scale(0.4); } to { opacity: 0; transform: scale(1.6); } }

/* Done: the card grows a little as the intro fades to the page. */
.loading-intro.out { opacity: 0; pointer-events: none; }
.loading-intro.out > * { transition: transform 0.4s ease; transform: scale(1.08); }

@media (prefers-reduced-motion: reduce) {
  .loading-intro > * { animation: none !important; }
  .loading-intro.out > * { transform: none; }
}

