/* ═══════════════════════════════════════════════════════
   ORION DRIFT AKINATOR — WELCOME SCREEN & AUDIO CONTROLS
   ═══════════════════════════════════════════════════════ */

/* ── RESET / LAYER ────────────────────────────────────── */
#welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #03050f;
  font-family: 'Space Grotesk', 'Chakra Petch', sans-serif;
  transition: opacity 0.75s ease, visibility 0.75s ease;
}

#welcome-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ── STARFIELD BACKGROUND ─────────────────────────────── */
.stars-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.85) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 60%, rgba(255,255,255,0.70) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 40% 30%, rgba(255,255,255,0.90) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 80%, rgba(255,255,255,0.60) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,0.80) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 80% 55%, rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 40%, rgba(255,255,255,0.65) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 85%, rgba(255,255,255,0.55) 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 10%, rgba(255,255,255,0.80) 0%, transparent 100%),
    radial-gradient(2px 2px at 60% 50%, rgba(200,220,255,0.40) 0%, transparent 100%),
    radial-gradient(1px 1px at 5% 45%, rgba(255,255,255,0.70) 0%, transparent 100%),
    radial-gradient(1px 1px at 95% 70%, rgba(255,255,255,0.60) 0%, transparent 100%),
    radial-gradient(1px 1px at 48% 92%, rgba(255,255,255,0.50) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 72% 8%, rgba(255,255,255,0.85) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 88%, rgba(255,255,255,0.60) 0%, transparent 100%);
  animation: stars-drift 60s linear infinite;
}

@keyframes stars-drift {
  from { transform: translateY(0) translateX(0); }
  to   { transform: translateY(-30px) translateX(15px); }
}

/* ── NEBULA GLOW ──────────────────────────────────────── */
.nebula-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 30%, rgba(76, 0, 180, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 80% 70%, rgba(0, 160, 220, 0.14) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 50% 50%, rgba(30, 10, 60, 0.5) 0%, transparent 80%);
  animation: nebula-pulse 12s ease-in-out infinite alternate;
}

@keyframes nebula-pulse {
  from { opacity: 0.7; }
  to   { opacity: 1.0; }
}

/* ── CONTENT WRAPPER ──────────────────────────────────── */
.welcome-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 520px;
  width: 100%;
}

/* ── LOGO ─────────────────────────────────────────────── */
.welcome-logo {
  width: clamp(200px, 45vw, 340px);
  height: auto;
  cursor: pointer;
  filter:
    drop-shadow(0 0 18px rgba(100, 160, 255, 0.5))
    drop-shadow(0 0 40px rgba(80, 80, 255, 0.25));
  transition: filter 0.2s ease, transform 0.2s ease;
  margin-bottom: 0.5rem;
  user-select: none;
}

.welcome-logo:hover {
  filter:
    drop-shadow(0 0 28px rgba(100, 200, 255, 0.75))
    drop-shadow(0 0 60px rgba(100, 100, 255, 0.4));
  transform: scale(1.03);
}

.welcome-logo.logo-bounce {
  animation: logo-bounce 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes logo-bounce {
  0%   { transform: scale(1); }
  20%  { transform: scale(1.12) rotate(-4deg); }
  40%  { transform: scale(0.96) rotate(3deg); }
  60%  { transform: scale(1.07) rotate(-2deg); }
  80%  { transform: scale(0.98) rotate(1deg); }
  100% { transform: scale(1); }
}

/* ── LOGO FALLBACK ────────────────────────────────────── */
.welcome-logo-fallback {
  width: clamp(200px, 45vw, 340px);
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
  user-select: none;
  border: 2px solid rgba(100, 160, 255, 0.4);
  border-radius: 12px;
  background: rgba(20, 30, 80, 0.5);
  transition: border-color 0.2s, background 0.2s;
}

.welcome-logo-fallback:hover {
  border-color: rgba(100, 200, 255, 0.8);
  background: rgba(30, 50, 120, 0.6);
}

.welcome-logo-fallback.logo-bounce {
  animation: logo-bounce 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.fallback-icon {
  font-size: 2.5rem;
  color: #6ab4ff;
}

.fallback-text {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #a0d4ff;
  text-shadow: 0 0 20px rgba(100, 180, 255, 0.6);
}

/* ── TITLE ────────────────────────────────────────────── */
.welcome-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #e8f4ff;
  text-shadow:
    0 0 20px rgba(100, 180, 255, 0.5),
    0 2px 4px rgba(0,0,0,0.8);
  margin: 0.6rem 0 0.3rem;
  text-transform: uppercase;
}

/* ── SUBTITLE ─────────────────────────────────────────── */
.welcome-sub {
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  color: rgba(180, 210, 255, 0.75);
  line-height: 1.6;
  margin: 0 0 1.8rem;
  letter-spacing: 0.02em;
}

/* ── ENTER BUTTON ─────────────────────────────────────── */
.welcome-enter-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2.2rem;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #3a7fff 0%, #7b3fff 100%);
  color: #fff;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow:
    0 0 20px rgba(80, 120, 255, 0.4),
    0 4px 20px rgba(0,0,0,0.4);
  margin-bottom: 1.4rem;
}

.welcome-enter-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 0 36px rgba(100, 160, 255, 0.6),
    0 8px 30px rgba(0,0,0,0.5);
}

.welcome-enter-btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
  animation: btn-sweep 2.5s linear infinite;
}

@keyframes btn-sweep {
  from { transform: translateX(-100%); }
  to   { transform: translateX(200%); }
}

.btn-label { position: relative; z-index: 1; }
.btn-arrow  { position: relative; z-index: 1; font-size: 1.1rem; transition: transform 0.2s; }
.welcome-enter-btn:hover .btn-arrow { transform: translateX(4px); }

/* ── HINT TEXT ────────────────────────────────────────── */
.welcome-hint {
  font-size: 0.78rem;
  color: rgba(150, 190, 255, 0.55);
  margin: 0 0 0.5rem;
  font-style: normal;
}

.welcome-hint em {
  color: rgba(180, 220, 255, 0.75);
  font-style: italic;
}

/* ── DISCLAIMER ───────────────────────────────────────── */
.welcome-disclaimer {
  font-size: 0.65rem;
  color: rgba(120, 150, 200, 0.40);
  line-height: 1.5;
  margin: 0.5rem 0 0;
  max-width: 380px;
}

/* ═══════════════════════════════════════════════════════
   AUDIO CONTROLS (floating bottom-right)
   ═══════════════════════════════════════════════════════ */
.audio-controls {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 8000;
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
}

.audio-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem 0.45rem 0.55rem;
  border: 1.5px solid rgba(100, 160, 255, 0.35);
  border-radius: 30px;
  background: rgba(5, 12, 40, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(180, 210, 255, 0.85);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.audio-btn:hover {
  border-color: rgba(130, 190, 255, 0.7);
  background: rgba(15, 30, 80, 0.9);
  color: #fff;
  transform: translateY(-2px);
}

.audio-btn:active {
  transform: translateY(0);
}

.audio-btn.muted {
  border-color: rgba(255, 80, 80, 0.35);
  color: rgba(255, 140, 140, 0.7);
  background: rgba(40, 5, 10, 0.80);
}

.audio-btn.muted:hover {
  border-color: rgba(255, 100, 100, 0.65);
  color: #ffaaaa;
}

.gear-icon,
.sfx-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.5s ease;
}

.audio-btn:hover .gear-icon {
  animation: spin-gear 1.2s linear infinite;
}

@keyframes spin-gear {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.audio-label {
  white-space: nowrap;
  font-size: 0.68rem;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE TWEAKS
   ═══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .welcome-content {
    padding: 1.5rem 1rem;
    gap: 0;
  }

  .audio-controls {
    bottom: 0.75rem;
    right: 0.75rem;
    gap: 0.35rem;
  }

  .audio-btn {
    padding: 0.4rem 0.6rem 0.4rem 0.45rem;
    font-size: 0.64rem;
  }
}
