/* CRT BOOT OVERLAY */
#crt-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--bg);
  display: flex; flex-direction: column;
  justify-content: flex-start; align-items: stretch;
  padding: 92px 48px 40px;
  font-family: var(--font-term); font-size: 0.72rem;
  line-height: 1.7; color: var(--text);
  overflow: hidden;
  opacity: 1;
}

#crt-notice {
  position: absolute; top: 0; left: 0; right: 0;
  min-height: 88px;
  padding: 18px 48px 16px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  font-size: 1.02rem; letter-spacing: .12em; color: var(--text);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  text-transform: uppercase;
  flex-shrink: 0;
}

#crt-notice-text {
  text-align: center;
  font-weight: 700;
  line-height: 1.5;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.crt-notice-dot {
  display: inline-block; width: 10px; height: 10px;
  background: #4caf50; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 10px rgba(76,175,80,0.45);
  animation: blink 1.6s step-end infinite;
}

#crt-failover {
  width: 100%;
  padding-top: 12px; margin-top: auto;
  border-top: 1px solid var(--border);
  flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 7px;
}

#crt-boot-text {
  display: flex; flex-direction: column; gap: 7px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.crt-line     {
  display: block;
  flex: 0 0 auto;
  min-height: 0;
  width: 100%;
  line-height: 1.7;
  letter-spacing: .08em;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.crt-line.err { color: #ff4444; }
.crt-line.dim { color: var(--muted); }
.crt-line.hi  { color: var(--accent); letter-spacing: .13em; }

#crt-bar-wrap  { margin-top: 20px; width: 100%; display: none; flex-shrink: 0; }
#crt-bar-label { font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
#crt-bar-track { width: 100%; height: 3px; background: var(--border); }
#crt-bar-fill  { height: 3px; width: 0%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
#crt-bar-pct   { font-size: 11px; color: var(--accent); letter-spacing: .1em; margin-top: 7px; }

#crt-logo { flex-shrink: 0; }

@media (max-width: 700px) {
  #crt-overlay {
    justify-content: flex-start;
    padding: 84px 24px 24px;
    overflow: hidden;
  }
  #crt-notice    { min-height: 56px; padding: 16px 24px; font-size: 12px; gap: 10px; }
  .crt-notice-dot { width: 8px; height: 8px; }
  #crt-boot-text {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
}



#crt-notice-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

#crt-notice-sub {
  font-size: 0.68rem;
  letter-spacing: .14em;
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 700px) {
  #crt-notice {
    min-height: 76px;
    padding: 15px 24px 13px;
    font-size: 0.92rem;
    gap: 10px;
  }

  #crt-notice-sub {
    font-size: 0.58rem;
    letter-spacing: .12em;
  }
}


/* Boot overlay should never select text; taps should behave like skip */
#crt-overlay,
#crt-overlay * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

#crt-overlay {
  touch-action: manipulation;
  cursor: pointer;
}

#crt-notice-text,
#crt-notice-copy,
#crt-notice-sub,
#crt-boot-text,
#crt-failover,
#crt-bar-wrap {
  pointer-events: none !important;
}


/* v109 light mode boot overlay */
:root.light #crt-overlay {
  background:
    radial-gradient(circle at top, rgba(160,126,216,0.10), transparent 44%),
    linear-gradient(180deg, #f6f1fb 0%, #efe7f8 100%);
  color: #241537;
}

:root.light #crt-notice {
  background: linear-gradient(180deg, rgba(247,242,252,0.97), rgba(239,230,249,0.97));
  border-bottom-color: rgba(78,51,118,0.14);
  box-shadow: 0 6px 24px rgba(81,52,122,0.08);
}

:root.light #crt-notice-sub,
:root.light .crt-line.dim,
:root.light #crt-bar-label {
  color: rgba(56,34,86,0.72);
}

:root.light #crt-bar-track {
  background: rgba(78,51,118,0.14);
}

:root.light #crt-bar-fill {
  background: #7d56bb;
  box-shadow: 0 0 10px rgba(125,86,187,0.18);
}

:root.light .crt-notice-dot {
  background: #31b96d;
  box-shadow: 0 0 10px rgba(49,185,109,0.30);
}
