/* SCRIPTNIGHT // PUBLIC SYSTEM STATUS */

.system-limited-notice {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9900;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: min(520px, calc(100vw - 36px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  min-height: 54px;
  padding: 10px 11px 10px 15px;
  border: 1px solid rgba(0, 255, 249, 0.28);
  border-radius: 11px;
  color: rgba(220, 255, 244, 0.78);
  background: rgba(0, 12, 9, 0.96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.52), 0 0 24px rgba(0, 255, 249, 0.05);
  backdrop-filter: blur(14px);
}

.system-limited-notice[hidden],
.system-maintenance-screen[hidden] {
  display: none !important;
}

.system-has-channel-launcher .system-limited-notice {
  bottom: max(96px, calc(96px + env(safe-area-inset-bottom)));
}

.channel-open .system-limited-notice {
  display: none !important;
}

.is-intro .system-limited-notice,
.nova-dormant .system-limited-notice {
  display: none !important;
}

.system-limited-notice p {
  margin: 0;
  font: 600 0.59rem/1.55 "Roboto Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.07em;
}

.system-limited-signal {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00fff9;
  box-shadow: 0 0 10px #00fff9;
  animation: systemLimitedPulse 1.8s ease-in-out infinite;
}

.system-limited-notice button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(0, 255, 249, 0.16);
  border-radius: 8px;
  color: rgba(220, 255, 244, 0.58);
  background: rgba(0, 255, 249, 0.025);
  font: 400 1.05rem/1 ui-monospace, monospace;
  cursor: pointer;
}

.system-maintenance-active {
  overflow: hidden !important;
}

.system-maintenance-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding:
    max(22px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  color: #dcfff4;
  background:
    radial-gradient(circle at 50% 40%, rgba(0, 255, 157, 0.1), transparent 30rem),
    repeating-linear-gradient(to bottom, transparent 0 4px, rgba(0, 255, 157, 0.018) 5px),
    #000302;
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

.system-maintenance-atmosphere,
.system-maintenance-atmosphere::before,
.system-maintenance-atmosphere::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.system-maintenance-atmosphere::before,
.system-maintenance-atmosphere::after {
  content: "";
}

.system-maintenance-atmosphere::before {
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(0, 255, 157, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 157, 0.04) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: radial-gradient(circle, black, transparent 72%);
}

.system-maintenance-atmosphere::after {
  background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.72));
}

.system-maintenance-atmosphere i {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(0, 255, 157, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.system-maintenance-atmosphere i:nth-child(1) { width: min(84vw, 780px); aspect-ratio: 1; }
.system-maintenance-atmosphere i:nth-child(2) { width: min(61vw, 560px); aspect-ratio: 1; border-style: dashed; animation: systemOrbit 38s linear infinite; }
.system-maintenance-atmosphere i:nth-child(3) { width: min(39vw, 360px); aspect-ratio: 1; border-color: rgba(0, 255, 249, 0.12); }

.system-maintenance-card {
  position: relative;
  width: min(600px, 100%);
  padding: clamp(30px, 7vw, 56px);
  overflow: hidden;
  border: 1px solid rgba(0, 255, 157, 0.24);
  border-radius: 18px;
  text-align: center;
  background: rgba(1, 15, 11, 0.94);
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.64), inset 0 0 50px rgba(0, 255, 157, 0.025);
}

.system-maintenance-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: rgba(220, 255, 244, 0.48);
  font-size: 0.58rem;
  letter-spacing: 0.11em;
}

.system-maintenance-kicker i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00ff9d;
  box-shadow: 0 0 9px #00ff9d;
}

.system-maintenance-core {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 28px auto;
  border: 1px solid rgba(0, 255, 157, 0.26);
  border-radius: 50%;
  box-shadow: 0 0 36px rgba(0, 255, 157, 0.08);
}

.system-maintenance-core::before,
.system-maintenance-core::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.system-maintenance-core::before { inset: 12px; border: 1px dashed rgba(0, 255, 249, 0.28); animation: systemOrbit 16s linear infinite; }
.system-maintenance-core::after { inset: 26px; border: 1px solid rgba(255, 46, 158, 0.2); }
.system-maintenance-core i { width: 10px; height: 10px; border-radius: 50%; background: #00ff9d; box-shadow: 0 0 12px #00ff9d; }

.system-maintenance-card h1 {
  margin: 0;
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: clamp(1.35rem, 5vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: 0.07em;
}

.system-maintenance-card > p {
  max-width: 470px;
  margin: 19px auto 0;
  color: rgba(220, 255, 244, 0.65);
  font-size: 0.8rem;
  line-height: 1.75;
}

.system-maintenance-card > button {
  min-height: 44px;
  margin-top: 29px;
  padding: 0 18px;
  border: 1px solid rgba(0, 255, 157, 0.46);
  border-radius: 8px;
  color: #00ff9d;
  background: rgba(0, 255, 157, 0.05);
  font: 700 0.61rem/1 "Roboto Mono", ui-monospace, monospace;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.system-maintenance-card > small {
  display: block;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 255, 157, 0.09);
  color: rgba(220, 255, 244, 0.34);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
}

@keyframes systemLimitedPulse {
  50% { opacity: 0.45; transform: scale(0.78); }
}

@keyframes systemOrbit {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (max-width: 600px) {
  .system-limited-notice {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
  }

  .system-has-channel-launcher .system-limited-notice {
    bottom: max(82px, calc(82px + env(safe-area-inset-bottom)));
  }

  .system-limited-notice p { font-size: 0.55rem; }
  .system-maintenance-card { border-radius: 14px; }
  .system-maintenance-atmosphere i:nth-child(2) { width: 88vw; }
  .system-maintenance-atmosphere i:nth-child(3) { width: 60vw; }
}

@media (prefers-reduced-motion: reduce) {
  .system-limited-signal,
  .system-maintenance-atmosphere i,
  .system-maintenance-core::before {
    animation: none !important;
  }
}
