/* Brood Front: Title, Colonies, Briefing, Result, Settings (T814). Everything
   fits 100dvh; only .fl-list scrolls inside its own region. */
.screen.fl-screen { gap: 10px; }
.screen.fl-top { justify-content: flex-start; align-items: stretch; text-align: left; padding-top: 8px; }
.fl-h { margin: 0; font-size: 1.3rem; color: #e6dcff; letter-spacing: 0.04em; text-transform: uppercase; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
.fl-h.fl-big { font-size: 2rem; text-align: center; }
.fl-h.win { color: #ffd36b; }
.fl-h.loss { color: #ff8a8a; }
.fl-grow { flex: 1 1 auto; text-align: center; }
.fl-center { text-align: center; }
.fl-sub { font-size: 0.85rem; color: #d3c6f4; }
.fl-stack { display: flex; flex-direction: column; gap: 10px; width: min(100%, 320px); align-self: center; }
.fl-row { display: flex; gap: 10px; }
.fl-row .fl-btn { flex: 1 1 0; }
.fl-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; min-height: 48px; padding: 0 16px;
  border: 1px solid #5b49a0; border-radius: 12px;
  font: inherit; font-weight: 700; color: #f0eaff; background: linear-gradient(180deg, #4d3a9a 0%, #3b2a78 55%, #2e2062 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 3px 0 #170f3a, 0 5px 10px rgba(0, 0, 0, 0.35);
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
  transition: transform 0.06s ease-out, box-shadow 0.06s ease-out;
}
/* T944: a glyph before the label, set from data-ic by flow.js */
.fl-btn[data-ic]::before { content: attr(data-ic); flex: none; font-size: 0.95em; line-height: 1; color: #3ec6c1; text-shadow: 0 0 6px rgba(62, 198, 193, 0.55); }
.fl-btn:active:not(:disabled), .fl-btn.pressed {
  transform: translateY(3px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45), 0 0 0 #170f3a;
  filter: brightness(0.92);
}
.fl-btn:focus-visible { outline: 2px solid #3ec6c1; outline-offset: 2px; }
.fl-btn.primary {
  background: linear-gradient(180deg, #ffe49a 0%, #ffd36e 50%, #e4a93c 100%); border-color: #fff0c0; color: #14121f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 0 rgba(120, 70, 0, 0.35), 0 3px 0 #7a5410, 0 5px 12px rgba(255, 211, 110, 0.25);
}
.fl-btn.primary[data-ic]::before { color: #14121f; text-shadow: none; }
.fl-btn.primary:active:not(:disabled) { box-shadow: inset 0 2px 4px rgba(90, 50, 0, 0.5), 0 0 0 #7a5410; }
.fl-btn.dim { background: linear-gradient(180deg, #3a2c78 0%, #2c2060 55%, #231a4e 100%); border-color: #4a3f78; }
.fl-btn.sq { width: 48px; flex: 0 0 48px; padding: 0; }
.fl-btn:disabled { opacity: 0.4; box-shadow: none; }
.fl-btn.toggle[aria-pressed="true"] { background: linear-gradient(180deg, #8f63e8 0%, #7a4fd0 55%, #5f3bb0 100%); border-color: #b99cff; }
.fl-btn.toggle { justify-content: space-between; }
.fl-nav { display: flex; align-items: center; gap: 10px; }
.fl-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; }
/* T944: dark glass panels with a teal edge light and a bevel */
.fl-card, .fl-stars, .fl-lines {
  background: linear-gradient(180deg, rgba(40, 32, 76, 0.78), rgba(16, 12, 34, 0.86));
  border: 1px solid rgba(62, 198, 193, 0.4); border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -2px 0 rgba(0, 0, 0, 0.4), 0 0 10px rgba(62, 198, 193, 0.14), 0 4px 10px rgba(0, 0, 0, 0.35);
}
.fl-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; flex: 0 0 auto;
}
.fl-card.locked { opacity: 0.5; }
.fl-name { font-weight: 700; color: #e6dcff; }
.fl-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }      /* T861: twelve slots, two rows of six */
.fl-slot {
  min-height: 56px; min-width: 0; padding: 0 2px; border: 2px solid #7a4fd0; border-radius: 10px; overflow: hidden;
  font: inherit; font-size: 0.62rem; line-height: 1.1; font-weight: 700; overflow-wrap: anywhere; color: #e6dcff; background: rgba(122, 79, 208, 0.22);
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.fl-slot.locked { opacity: 0.35; border-style: dashed; }
/* T900: the five stats sit in two columns, so the Result keeps room for the Unlocked and Next lines on a 360 x 640 phone. */
.fl-lines { padding: 8px 12px; box-sizing: border-box; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; width: min(100%, 320px); }
.fl-line { display: flex; justify-content: space-between; gap: 6px; min-width: 0; color: #c9b8f0; }
.fl-line b { color: #ffd36b; }

/* Result stars (T863): three objectives with lit or dim stars, then the bonus line. */
.fl-stars { padding: 8px; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; width: min(100%, 320px); align-self: center; }
.fl-star-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fl-star {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; padding: 4px 4px 6px;
  border-radius: 10px; background: rgba(122, 79, 208, 0.18); text-align: center; color: #c4b8e6;
}
.fl-star.lit { background: rgba(255, 211, 107, 0.16); color: #ffe7a8; }
.fl-star-g { font-size: 1.6rem; line-height: 1.1; color: #8c7fbd; }
.fl-star.lit .fl-star-g { color: #ffd36b; text-shadow: 0 0 8px rgba(255, 211, 107, 0.6); }
.fl-star.new { outline: 2px solid #ffd36b; outline-offset: -1px; }
.fl-star-t { font-size: 0.68rem; line-height: 1.15; }
.fl-bonus { text-align: center; font-weight: 700; font-size: 0.85rem; color: #ffd36b; }
/* Result unlock lines (T889): what the level opened, then the next unlock and its level. */
.fl-unlocks { display: flex; flex-direction: column; gap: 3px; width: min(100%, 320px); align-self: center; }
.fl-unlock { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 0.85rem; color: #c9b8f0; }
.fl-unlock .fl-un-k { flex: none; font-weight: 700; color: #a89ad0; }
.fl-unlock .fl-un-v { min-width: 0; text-align: right; color: #ffd36b; overflow-wrap: anywhere; }
#result-unlocked { padding: 3px 8px; border-radius: 8px; background: rgba(255, 211, 107, 0.16); }
#result-unlocked .fl-un-k { color: #ffe7a8; }
@media (prefers-reduced-motion: no-preference) {
}
@keyframes fl-star-pop { 0% { transform: scale(0.4); opacity: 0; } 70% { transform: scale(1.25); } 100% { transform: scale(1); opacity: 1; } }

/* Title (T944): the key art canvas fills the screen behind a bottom-aligned menu. */
.screen.fl-title { position: relative; justify-content: flex-end; overflow: hidden; }
.title-art { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; display: block; pointer-events: none; }
.fl-title > :not(.title-art) { position: relative; z-index: 1; }
.fl-title .fl-gap { flex: 1 1 auto; }
.fl-title .tagline {
  margin: 0; padding: 4px 12px; border-radius: 999px; font-size: 0.85rem; color: #f0eaff; opacity: 1;
  background: rgba(14, 10, 28, 0.72); border: 1px solid rgba(62, 198, 193, 0.4);
  box-shadow: 0 0 8px rgba(62, 198, 193, 0.2);
}
.fl-title .fl-stack { margin-top: 0; }
/* Result stars (T944): a reveal one after another; static under reduced motion */
.fl-star { border: 1px solid rgba(255, 255, 255, 0.08); }
.fl-star.lit { border-color: rgba(255, 211, 107, 0.55); }
@media (prefers-reduced-motion: no-preference) {
  .fl-stars:not(.rm) .fl-star.lit .fl-star-g { animation: fl-star-pop 0.5s ease-out both; }
  .fl-stars:not(.rm) .fl-star:nth-child(1) .fl-star-g { animation-delay: 0.15s; }
  .fl-stars:not(.rm) .fl-star:nth-child(2) .fl-star-g { animation-delay: 0.55s; }
  .fl-stars:not(.rm) .fl-star:nth-child(3) .fl-star-g { animation-delay: 0.95s; }
  .fl-stars:not(.rm) .fl-star.lit { animation: fl-star-glow 0.6s ease-out both; }
  .fl-stars:not(.rm) .fl-star:nth-child(1) { animation-delay: 0.15s; }
  .fl-stars:not(.rm) .fl-star:nth-child(2) { animation-delay: 0.55s; }
  .fl-stars:not(.rm) .fl-star:nth-child(3) { animation-delay: 0.95s; }
}
@keyframes fl-star-glow { 0% { box-shadow: 0 0 0 rgba(255, 211, 107, 0); } 60% { box-shadow: 0 0 16px rgba(255, 211, 107, 0.8); } 100% { box-shadow: 0 0 6px rgba(255, 211, 107, 0.3); } }
/* The result stays compact on every phone (the selftest sizes the stage, not the window): it keeps its stars, unlocks and four buttons in view (T944). */
#result.screen { gap: 6px; padding-top: 8px; padding-bottom: calc(8px + var(--rr-inset-bottom)); }
#result .fl-h.fl-big { font-size: 1.5rem; }
#result .fl-lines { padding: 5px 10px; gap: 2px 10px; font-size: 0.85rem; }
#result .fl-stars { padding: 5px 6px; gap: 2px; }
#result .fl-star { min-height: 54px; padding: 3px 3px 4px; }
#result .fl-star-g { font-size: 1.35rem; }
#result .fl-stack { gap: 6px; }
#result .fl-btn { min-height: 44px; }
