/* ── LOADING ── */
#loadingScreen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg); z-index: 200;
  opacity: 1;
  overflow: hidden;
  transition: opacity 0.45s ease, background 0.4s ease;
}
#loadingScreen.fadeout {
  opacity: 0;
  pointer-events: none;
}

/* Iris — círculo que se expande desde el centro */
#iris-overlay {
  position: absolute;
  border-radius: 50%;
  width: 0; height: 0;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 10;
  pointer-events: none;
}
#iris-overlay.iris-expand {
  animation: iris-grow 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#iris-overlay.iris-fadeout {
  animation: iris-grow 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards,
             iris-fade 0.35s ease 0.65s forwards;
}

@keyframes iris-fade {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes iris-grow {
  0%   { transform: translate(-50%, -50%) scale(0);   opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(40);  opacity: 1; }
}
#loadingScreen h2 { display: none; }
.loading-logo {
  width: 160px; height: 160px;
  border-radius: 0; overflow: visible;
  background: transparent;
}
.loading-logo-img { width: 100%; height: 100%; object-fit: contain; display: none; }

.theme-dark  .logo-dark  { display: block; }
.theme-light .logo-light { display: block; }

@media (prefers-color-scheme: dark) {
  html:not(.theme-light) .logo-dark  { display: block; }
}
@media (prefers-color-scheme: light) {
  html:not(.theme-dark) .logo-light { display: block; }
}
.loading-logo .material-icons { display: none; }

/* ══ DERBY LOADER ══ */
.derby-loader { margin-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.derby-icons { display: flex; align-items: center; justify-content: center; gap: 26px; transition: gap 0.4s cubic-bezier(0.34,1.56,0.64,1); }
.derby-icon {
  font-size: 22px; line-height: 1; user-select: none; display: block;
  opacity: 0.38; transform: scale(0.58);
  transition: transform 0.5s cubic-bezier(0.34,1.7,0.64,1), opacity 0.3s ease, filter 0.3s ease, margin 0.45s cubic-bezier(0.34,1.7,0.64,1);
  filter: none; margin: 0;
}
.derby-icon.di-active {
  opacity: 1; transform: scale(1.6);
  filter: drop-shadow(0 0 7px rgba(255,210,0,0.95)) drop-shadow(0 0 18px rgba(255,140,0,0.55));
  margin-left: -4px; margin-right: -4px;
}
.derby-icon.di-near {
  margin-left: -5px; margin-right: -5px; transform: scale(0.62); opacity: 0.45;
  transition: transform 0.45s cubic-bezier(0.34,1.5,0.64,1), opacity 0.3s ease, filter 0.3s ease, margin 0.45s cubic-bezier(0.34,1.5,0.64,1);
}
.derby-loader-text {
  font-size: 11px !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: 0.12em !important;
  color: var(--text4) !important; -webkit-text-fill-color: var(--text4) !important;
  margin: 0 !important; text-align: center; transition: opacity 0.3s;
  animation: derby-text-pulse 2s ease-in-out infinite;
}
@keyframes derby-text-pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }