/* Full-screen loading screen: the round FFA logo with a ring that fills clockwise as loading progresses.
   The ring eases through the app colors: gold #E2B66F, dark brown #6B4E38, forest green #5B8D49, and back to gold, so there is no hard join.
   Driven by assets/loader.js (FFA.loading). No inline styles or scripts (strict CSP). */
.ffa-loading {
  /* The phone's opening icon is 56.6% of the screen width. The loading logo uses that same size so it does not shrink when the ring appears. */
  --ffa-logo: min(240px, 56.6vw);
  --ffa-ring: calc(var(--ffa-logo) * 1.25);
  --ffa-p: 0;
  --ffa-gold: #E2B66F;
  --ffa-brown: #6B4E38;
  --ffa-green: #5B8D49;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #1E1B16);
  opacity: 1;
  transition: opacity .28s ease;
}
.ffa-loading[hidden] { display: none !important; }
.ffa-loading.ffa-fading { opacity: 0; pointer-events: none; }
.ffa-loading-box {
  position: relative;
  width: var(--ffa-ring);
  height: var(--ffa-ring);
}
.ffa-loading-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); /* 0% starts at 12 o'clock and fills clockwise */
}
.ffa-ring-track { fill: none; stroke: rgba(244, 240, 232, .1); stroke-width: 4; }
.ffa-ring-bar {
  fill: none;
  stroke: #fff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--ffa-p) * 100);
}
.ffa-seg { fill: none; stroke-width: 5; stroke-linecap: round; }
.ffa-loading-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--ffa-logo);
  height: var(--ffa-logo);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .4);
}
/* Safety net with no script: if loader.js never runs, the boot screen still goes away after 12 s. */
.ffa-loading.ffa-boot { animation: ffa-boot-hide .3s ease 12s forwards; }
@keyframes ffa-boot-hide { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) {
  .ffa-loading { transition: none; }
}

/* Section loads: a shimmer skeleton takes the place of the loading section, in the normal page flow (not fixed, not an overlay).
   While it shows, the real content of that section (the host) is hidden with display:none. When the data is ready the skeleton is
   removed and the content fades back in. Dark theme only (the app has no light theme). */
.ffa-host-loading { display: none !important; }
.ffa-host-loading-all > :not(.green-banner):not(.group-banner):not(.ffa-section-load) { display: none !important; }
.ffa-host-in { animation: ffa-host-in .22s ease both; }
@keyframes ffa-host-in { from { opacity: 0; } to { opacity: 1; } }
.ffa-section-load {
  position: relative;
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 6px 0 8px;
  overflow: hidden;
}
#profile-screen .ffa-section-load, #event-screen .ffa-section-load, #group-screen .ffa-section-load { padding: 0 0 8px; }
/* Shape skeletons (built by loader.js from a template per section): every block copies the size and shape of the real thing.
   Lines = text, rectangles = pictures/posters/icons, circles = avatars, pills = buttons/tags/fields. Cards keep the real card frame. */
.ffa-skel { display: block; }
.ffa-sk-line, .ffa-sk-rect, .ffa-sk-circle, .ffa-sk-pill { display: block; flex: none; max-width: 100%; }
.ffa-sk-line { border-radius: 6px; }
.ffa-sk-circle { border-radius: 50%; }
.ffa-sk-pill { border-radius: 999px; }
.ffa-sk-card { display: flex; flex-direction: column; box-sizing: border-box; overflow: hidden; border: 1px solid var(--line, rgba(244, 240, 232, .1)); background: var(--card, #28241e); }
.ffa-sk-row { display: flex; min-width: 0; }
.ffa-sk-col { display: flex; flex-direction: column; min-width: 0; box-sizing: border-box; }
.ffa-sk-row > .ffa-sk-col { flex: 1; }
.ffa-sk-sp { flex: 1; }
.ffa-sk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
/* The shimmer: one soft warm-gold band sweeps across all the placeholder blocks together (fixed attachment = one shared band
   across the screen, like CCF), so the page reads as one surface loading instead of many blinking pieces. */
.ffa-skel-bone {
  background-attachment: fixed;
  background-color: rgba(244, 240, 232, .1);
  background-image: linear-gradient(100deg, rgba(244, 240, 232, .09) 0%, rgba(244, 240, 232, .09) 38%, rgba(226, 182, 111, .2) 50%, rgba(244, 240, 232, .09) 62%, rgba(244, 240, 232, .09) 100%);
  background-size: 200% 100%;
  background-repeat: repeat-x;
  animation: ffa-shimmer 1.6s ease-in-out infinite;
}
@keyframes ffa-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* Reduced motion: static bones, no sweep, no fade (must stay after the rules above). */
@media (prefers-reduced-motion: reduce) {
  .ffa-skel-bone { animation: none; background-image: none; background-color: rgba(244, 240, 232, .12); }
  .ffa-host-in { animation: none; }
}
