html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* Public (audience) layout */
.public-body {
  margin-bottom: 0;
  min-height: 100vh;
  --sb-r1-pos: 20% 10%;
  --sb-r2-pos: 80% 15%;
  --sb-r3-pos: 50% 90%;
  --sb-r1: hsl(310 90% 92% / 0.55);
  --sb-r2: hsl(175 80% 90% / 0.45);
  --sb-r3: hsl(48 90% 90% / 0.60);
  --sb-l-angle: 180deg;
  --sb-l1: #fff7fb;
  --sb-l2: #f6fbff;
  --sb-l3: #fffaf0;
  background:
    radial-gradient(1200px 600px at var(--sb-r1-pos), var(--sb-r1), transparent 60%),
    radial-gradient(1200px 700px at var(--sb-r2-pos), var(--sb-r2), transparent 60%),
    radial-gradient(900px 700px at var(--sb-r3-pos), var(--sb-r3), transparent 55%),
    linear-gradient(var(--sb-l-angle), var(--sb-l1) 0%, var(--sb-l2) 40%, var(--sb-l3) 100%);
}

.spotlight-storybook {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: clamp(12px, 2vw, 28px);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 20px 60px rgba(50, 60, 90, 0.15);
  position: relative;
  overflow: hidden;
}

.spotlight-storybook::before {
  content: "";
  position: absolute;
  inset: -40px;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 120, 190, 0.14) 0 12px, transparent 13px 100%),
    radial-gradient(circle at 72% 22%, rgba(65, 195, 255, 0.12) 0 10px, transparent 11px 100%),
    radial-gradient(circle at 36% 70%, rgba(255, 200, 70, 0.12) 0 11px, transparent 12px 100%),
    radial-gradient(circle at 88% 78%, rgba(130, 240, 170, 0.10) 0 9px, transparent 10px 100%);
  filter: blur(0.2px);
  opacity: 0.9;
  pointer-events: none;
}

.spotlight-storybook > * {
  position: relative;
}

.storybook-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

.storybook-title {
  font-weight: 900;
  font-size: clamp(40px, 4.5vw, 72px);
  line-height: 1.05;
  margin-top: 10px;
  margin-bottom: 6px;
  display: inline-block;
  position: relative;
  padding: 0;
  isolation: isolate;
}

.storybook-title-text {
  display: inline-block;
  padding: 6px 18px;
  position: relative;
  z-index: 1;
  isolation: isolate;
  background: linear-gradient(90deg, #ff4fb7, #5b6cff, #16c7b7, #ffb340);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* Keep edges crisp for TV readability */
  -webkit-text-stroke: 1px rgba(20, 30, 50, 0.25);
  text-shadow: none;
}

/* One-shot flare when the name is revealed */
.storybook-title.reveal-flare {
  animation: titlePop 900ms cubic-bezier(.15, 1.2, .2, 1);
  filter: none;
}

/* Golden ribbon banner behind the revealed name */
.storybook-title.revealed-name .storybook-title-text {
  padding: 10px 26px;
  color: #1b2440;
  background: linear-gradient(180deg, rgba(255, 230, 140, 0.98), rgba(255, 184, 78, 0.96));
  border-radius: 18px;
  border: 3px solid rgba(20, 30, 50, 0.32);
  outline: 2px dashed rgba(27, 36, 64, 0.35);
  outline-offset: -8px;
  box-shadow:
    0 18px 34px rgba(40, 60, 90, 0.20),
    0 2px 0 rgba(255, 255, 255, 0.70) inset,
    0 0 0 6px rgba(255, 255, 255, 0.78);
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-stroke: 0;
}

/* Corner sparkles (only on reveal moment) */
.storybook-title.reveal-flare::after {
  content: "";
  position: absolute;
  inset: -18px;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 6% 12%, rgba(255,255,255,0.98) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 10% 22%, rgba(255,255,255,0.92) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 92% 14%, rgba(255,255,255,0.98) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 86% 24%, rgba(255,255,255,0.92) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 8% 86%, rgba(255,255,255,0.96) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 16% 78%, rgba(255,255,255,0.90) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 94% 88%, rgba(255,255,255,0.96) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 84% 78%, rgba(255,255,255,0.90) 0 2px, transparent 3px 100%);
  filter:
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.8))
    drop-shadow(0 0 14px rgba(255, 207, 255, 0.55))
    drop-shadow(0 0 16px rgba(180, 255, 245, 0.45));
  animation: titleCornerSparkles 1100ms ease-out;
}

@keyframes titlePop {
  0% { transform: translateY(8px) scale(0.92); }
  55% { transform: translateY(-2px) scale(1.05); }
  78% { transform: translateY(1px) scale(0.99); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes titleCornerSparkles {
  0% { opacity: 0; transform: scale(0.98); }
  18% { opacity: 1; }
  55% { opacity: 0.95; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1.03); }
}

.storybook-subtitle {
  font-size: clamp(16px, 1.5vw, 22px);
}

.storybook-card {
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.82);
}

.storybook-section-title {
  font-weight: 800;
}

.storybook-wait {
  padding: 18px 20px;
  border-radius: 18px;
  border: 2px dashed rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.75);
  text-align: center;
  animation: storybookPulse 2.2s ease-in-out infinite;
}

.storybook-wait-title {
  font-weight: 900;
  font-size: 28px;
}

.storybook-wait-text {
  font-size: 18px;
  color: rgba(0, 0, 0, 0.65);
}

@keyframes storybookPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 10px 25px rgba(0,0,0,0.06); }
  50% { transform: translateY(-2px); box-shadow: 0 18px 35px rgba(0,0,0,0.10); }
}

.spotlight .photo-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f8f9fa;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.storybook-photo-frame {
  border-radius: 18px;
  border: 3px solid rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 16px 30px rgba(40, 60, 90, 0.18);
  position: relative;
}

.storybook-name {
  font-weight: 900;
  font-size: clamp(26px, 2.6vw, 40px);
}

/* Sparkle border on reveal */
.storybook-photo-frame.sparkle {
  animation: sparkleGlow 1.6s cubic-bezier(.2,.9,.2,1);
}

.storybook-photo-frame.sparkle::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 28px;
  pointer-events: none;
  opacity: 0;
  background: conic-gradient(from 0deg,
    rgba(255, 79, 183, 0.95),
    rgba(91, 108, 255, 0.95),
    rgba(22, 199, 183, 0.95),
    rgba(255, 179, 64, 0.95),
    rgba(255, 79, 183, 0.95));
  filter: blur(0.6px);
  animation: sparkleRing 1.4s ease-out;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 10px;
}

.storybook-photo-frame.sparkle::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 26px;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 10% 18%, rgba(255,255,255,0.98) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 18% 75%, rgba(255,255,255,0.90) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 28% 35%, rgba(255,255,255,0.92) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 42% 12%, rgba(255,255,255,0.96) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 55% 58%, rgba(255,255,255,0.90) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 62% 20%, rgba(255,255,255,0.96) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 74% 78%, rgba(255,255,255,0.90) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 82% 34%, rgba(255,255,255,0.94) 0 2px, transparent 3px 100%),
    radial-gradient(circle at 92% 62%, rgba(255,255,255,0.88) 0 2px, transparent 3px 100%);
  animation: sparkleTwinkle 1.5s ease-out;
}

@keyframes sparkleGlow {
  0% {
    box-shadow: 0 16px 30px rgba(40, 60, 90, 0.18);
    transform: translateY(0) scale(1);
  }
  35% {
    box-shadow:
      0 18px 34px rgba(40, 60, 90, 0.22),
      0 0 1.2rem rgba(255, 79, 183, 0.55),
      0 0 1.8rem rgba(91, 108, 255, 0.48),
      0 0 2.4rem rgba(22, 199, 183, 0.40),
      0 0 3.0rem rgba(255, 179, 64, 0.35);
    transform: translateY(-3px) scale(1.02);
  }
  100% {
    box-shadow: 0 16px 30px rgba(40, 60, 90, 0.18);
    transform: translateY(0) scale(1);
  }
}

@keyframes sparkleRing {
  0% { opacity: 0; transform: rotate(0deg) scale(0.98); }
  12% { opacity: 0.95; }
  60% { opacity: 0.85; }
  100% { opacity: 0; transform: rotate(240deg) scale(1.02); }
}

@keyframes sparkleTwinkle {
  0% { opacity: 0; transform: scale(0.98); }
  15% { opacity: 1; }
  55% { opacity: 0.9; }
  100% { opacity: 0; transform: scale(1.02); }
}

.spotlight-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spotlight-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spotlight-placeholder-inner {
  text-align: center;
}

.spotlight-qmark {
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  color: rgba(0, 0, 0, 0.25);
}

/* Facts as big, fun cards */
.facts-grid {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .facts-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.fact-card {
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.9);
  padding: 14px 14px;
  box-shadow: 0 14px 26px rgba(40, 60, 90, 0.10);
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
  opacity: 1;
}

.fact-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,79,183,0.9), rgba(91,108,255,0.9), rgba(22,199,183,0.9));
  box-shadow: 0 8px 14px rgba(0,0,0,0.12);
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.98);
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
}

.fact-icon--1 {
  background: linear-gradient(135deg, rgba(255,79,183,0.95), rgba(255,179,64,0.92));
}

.fact-icon--2 {
  background: linear-gradient(135deg, rgba(91,108,255,0.95), rgba(22,199,183,0.92));
}

.fact-icon--3 {
  background: linear-gradient(135deg, rgba(22,199,183,0.95), rgba(255,207,255,0.92));
}

.fact-text {
  font-weight: 800;
  font-size: clamp(16px, 1.5vw, 22px);
  line-height: 1.25;
}

.fact-card.fact-pop {
  opacity: 0;
  transform: translateY(26px) scale(0.88) rotate(-0.8deg);
  animation: factPop 1100ms cubic-bezier(.15,1.05,.25,1) forwards;
  animation-delay: var(--pop-delay, 0ms);
}

@keyframes factPop {
  0% {
    opacity: 0;
    transform: translateY(26px) scale(0.88) rotate(-0.8deg);
  }
  55% {
    opacity: 1;
    transform: translateY(-4px) scale(1.04) rotate(0.4deg);
  }
  78% {
    transform: translateY(2px) scale(0.99) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

/* Admin child picker (Bootstrap dropdown) */
.admin-child-item {
  white-space: normal;
}

.admin-child-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-child-item-text {
  flex: 1 1 auto;
}

.admin-child-item-check {
  flex: 0 0 auto;
  font-weight: 700;
  opacity: 0.75;
}

.admin-thumb-frame {
  width: 100%;
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 4 / 3;
  background: #f8f9fa;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.admin-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}