/* ==========================================================================
   Zero-Latency Cyberpunk Loading Screen Styles (ArcaWars)
   Self-contained critical styles for instantaneous first contentful paint.
   ========================================================================== */

:root {
  --bg-primary: #07080e;
  --font-title: 'Tektur', monospace;
  --font-ui: 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Tektur', monospace;
  --color-cyan: #00f7ff;
  --color-cyan-light: #54f8ff;
  --color-cyan-dark: #00dce3;
  --color-cyan-glow-md: rgba(0, 247, 255, 0.5);
  --color-cyan-dim-strong: rgba(0, 220, 227, 0.7);
  --color-cyan-tint: rgba(0, 247, 255, 0.25);
  --color-rose-dim: rgba(255, 42, 109, 0.12);
  --color-rose-glow: rgba(255, 42, 109, 0.35);
  --color-rose-logo-glow: rgba(255, 77, 109, 0.8);
  --color-pink-pwa: #ff4d6d;
  --bg-card-highlight: rgba(42, 41, 48, 0.85);
  --border-dim: 1px solid rgba(132, 148, 148, 0.3);
  --text-dim-alpha: rgba(185, 202, 202, 0.5);
  --clip-chamfer-badge: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}

.loading-overlay-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-primary);
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-overlay-fullscreen.fade-out {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.loader-bg-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#loader-shader-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.loader-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 20%, rgba(14, 14, 20, 0.85) 100%);
  z-index: 2;
}

.loader-content-container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  max-width: 420px;
  padding: calc(40px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

.loader-icon-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-glow-halo {
  position: absolute;
  inset: -10px;
  background: var(--color-rose-dim);
  border-radius: 50%;
  filter: blur(25px);
  animation: pulse 2s infinite ease-in-out;
}

.loader-app-icon {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 16px var(--color-rose-glow));
  animation: breathe 3s ease-in-out infinite;
}

.loader-title-container {
  margin-top: 20px;
  text-align: center;
}

.loader-game-title {
  font-family: var(--font-title);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0;
}

.text-arca-red {
  color: var(--color-pink-pwa);
}

.drop-shadow-cyan {
  text-shadow: 0 0 12px var(--color-cyan-glow-md);
}

.drop-shadow-red {
  text-shadow: 0 0 15px var(--color-rose-logo-glow);
}

.loader-status-block {
  width: 100%;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loader-terminal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--color-cyan-dark);
  text-transform: uppercase;
}

.loader-term-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.loader-term-left .term-icon {
  font-size: 16px;
  color: var(--color-cyan-dim-strong);
}

.loader-percent {
  font-family: var(--font-title);
  color: var(--color-cyan-light);
  font-weight: 700;
}

.loader-progress-track {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--bg-card-highlight);
  border-radius: 0;
  clip-path: var(--clip-chamfer-badge);
  overflow: hidden;
  border: var(--border-dim);
}

.loader-progress-glow {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--color-cyan-tint);
  filter: blur(4px);
  transition: width 0.15s ease-out;
}

.loader-progress-fill {
  position: relative;
  height: 100%;
  background: var(--color-cyan);
  box-shadow: 0 0 10px var(--color-cyan-glow-md);
  border-radius: 0;
  transition: width 0.15s ease-out;
}

.loader-leading-edge {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: rgba(255, 255, 255, 0.7);
  filter: blur(2px);
}

.loader-substatus {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-dim-alpha);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 4px 0 0 0;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(0.92);
    opacity: 0.45;
  }
  50% {
    transform: scale(1.18);
    opacity: 0.85;
  }
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 10px var(--color-rose-glow));
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 25px var(--color-rose-logo-glow));
  }
}

@keyframes flicker {
  0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% { opacity: 1; }
  20%, 21.999%, 63%, 63.999%, 65%, 69.999% { opacity: 0.4; }
}

@keyframes cursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.cursor-blink {
  animation: cursorBlink 1s infinite;
}

.pointer-events-none {
  pointer-events: none;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
}
