/* ==================== ОСНОВНЫЕ ПЕРЕМЕННЫЕ И СБРОС ==================== */
:root {
  --bg-dark: #070913;
  --bg-card: rgba(18, 22, 41, 0.65);
  --border-color: rgba(110, 86, 207, 0.25);
  --accent-cyan: #00f0ff;
  --accent-pink: #ff2a85;
  --accent-purple: #8b5cf6;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --glow-purple: rgba(139, 92, 246, 0.4);
  --font-title: 'Cinzel', serif;
  --font-cyber: 'Orbitron', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  line-height: 1.6;
  cursor: default;
}

/* Background Canvas */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Кнопка звука */
.audio-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999;
  background: rgba(15, 18, 35, 0.8);
  border: 1px solid var(--accent-purple);
  color: #fff;
  padding: 10px 18px;
  border-radius: 30px;
  backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}
.audio-btn:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
  transform: translateY(-2px);
}
.audio-waves {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}
.audio-waves span {
  width: 3px;
  height: 100%;
  background: var(--accent-cyan);
  border-radius: 3px;
  animation: wave 1.2s infinite ease-in-out alternate;
}
.audio-waves.paused span {
  animation: none;
  height: 4px;
  background: var(--text-muted);
}
.audio-waves span:nth-child(2) { animation-delay: 0.2s; }
.audio-waves span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wave {
  0% { height: 4px; }
  100% { height: 16px; }
}

/* Контейнер */
.container {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Стилизованные кнопки */
.btn-glow {
  display: inline-block;
  padding: 14px 32px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(0, 240, 255, 0.2));
  border: 1px solid var(--accent-cyan);
  color: #fff;
  font-family: var(--font-cyber);
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
  text-decoration: none;
}
.btn-glow:hover {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.6);
  transform: translateY(-3px) scale(1.02);
  color: #000;
  font-weight: 700;
}

/* Секции */
section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 100px 0;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
}
section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  font-family: var(--font-cyber);
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 12px;
  text-align: center;
  background: linear-gradient(90deg, #fff, var(--accent-cyan));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 48px;
  text-align: center;
  max-width: 600px;
}

/* Стеклянные карточки */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: all 0.3s ease;
}
.glass-card:hover {
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 15px 40px rgba(139, 92, 246, 0.2);
}

/* ==================== 1. LOADER ==================== */
#loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #05060d;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 1s ease, visibility 1s ease;
}
#loader.hidden {
  opacity: 0;
  visibility: hidden;
}
.loader-title {
  font-family: var(--font-cyber);
  font-size: 1.2rem;
  letter-spacing: 3px;
  margin-bottom: 20px;
  color: var(--accent-cyan);
}
.progress-bar-wrap {
  width: 280px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
}
.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
  box-shadow: 0 0 12px var(--accent-cyan);
  transition: width 0.2s ease;
}
.loader-phrase {
  font-size: 0.85rem;
  color: var(--text-muted);
  height: 20px;
  text-align: center;
}

/* ==================== 2. HERO ==================== */
#hero {
  text-align: center;
  min-height: 100vh;
  justify-content: center;
}
.hero-date-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--accent-cyan);
  font-family: var(--font-cyber);
  font-size: 0.8rem;
  letter-spacing: 2px;
  margin-bottom: 24px;
}
.hero-name {
  font-family: var(--font-title);
  font-size: 5rem;
  font-weight: 900;
  letter-spacing: 12px;
  background: linear-gradient(180deg, #ffffff 30%, #a78bfa 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 50px rgba(139, 92, 246, 0.5);
  margin-bottom: 16px;
}
.hero-tagline {
  font-size: 1.3rem;
  font-weight: 300;
  color: #e5e7eb;
  margin-bottom: 12px;
}
.hero-desc {
  color: var(--text-muted);
  max-width: 550px;
  margin: 0 auto 40px auto;
  font-size: 0.95rem;
}

/* ==================== 3. BEFORE YOU ==================== */
.grid-ordinary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  width: 100%;
  margin-bottom: 40px;
}
.ordinary-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
}
.ordinary-card:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}
.quote-box {
  border-left: 3px solid var(--accent-pink);
  padding-left: 20px;
  font-size: 1.1rem;
  color: #f3f4f6;
  max-width: 700px;
  text-align: left;
}

/* ==================== 4. MATCH SCREEN ==================== */
.game-ui-container {
  width: 100%;
  max-width: 750px;
  background: rgba(10, 12, 26, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 16px;
  padding: 30px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.1);
}
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 15px;
  margin-bottom: 30px;
  font-family: var(--font-cyber);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.match-found-banner {
  background: rgba(255, 42, 133, 0.15);
  border: 1px solid var(--accent-pink);
  color: var(--accent-pink);
  padding: 8px 20px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 30px;
  animation: pulseGlow 2s infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 42, 133, 0.2); }
  50% { box-shadow: 0 0 25px rgba(255, 42, 133, 0.6); }
}
.players-vs {
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: relative;
  margin: 40px 0;
}
.player-card {
  text-align: center;
  z-index: 2;
}
.player-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #1e1b4b;
  border: 2px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 12px auto;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}
.player-avatar.alina {
  border-color: var(--accent-pink);
  box-shadow: 0 0 20px rgba(255, 42, 133, 0.4);
}
.player-name {
  font-family: var(--font-cyber);
  font-size: 1rem;
}
.laser-line {
  position: absolute;
  top: 40px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-pink));
  box-shadow: 0 0 10px #fff;
  z-index: 1;
}

#matchModal {
  display: none;
  margin-top: 20px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px dashed var(--accent-cyan);
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.9rem;
  animation: fadeIn 0.5s ease forwards;
}

/* ==================== 5. TIMELINE ==================== */
.timeline {
  position: relative;
  max-width: 700px;
  width: 100%;
  padding: 20px 0;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 24px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-purple), var(--accent-pink));
}
.timeline-item {
  position: relative;
  padding-left: 64px;
  margin-bottom: 40px;
}
.timeline-dot {
  position: absolute;
  left: 17px;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}
.timeline-tag {
  font-family: var(--font-cyber);
  color: var(--accent-cyan);
  font-size: 0.85rem;
  margin-bottom: 6px;
}
.timeline-content {
  background: rgba(18, 22, 41, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 24px;
  border-radius: 12px;
}

/* ==================== 6. ALTERNATIVE REALITY ==================== */
#altRealityBox {
  width: 100%;
  max-width: 700px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all 0.8s ease;
}
#altRealityBox.darkened {
  background: #000;
  border-color: #333;
  box-shadow: none;
}
.alt-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.6s ease;
  margin-bottom: 12px;
}
.alt-text.show {
  opacity: 1;
  transform: translateY(0);
}
.alt-highlight {
  color: var(--accent-cyan);
  font-size: 1.25rem;
  font-weight: 700;
}

/* ==================== 7. ALINA SYSTEM PROFILE ==================== */
.system-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  max-width: 750px;
}
@media (max-width: 600px) {
  .system-grid { grid-template-columns: 1fr; }
}
.system-stat {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px;
  border-radius: 8px;
}
.system-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-cyber);
  margin-bottom: 4px;
}
.system-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.system-val.legendary {
  color: var(--accent-pink);
  text-shadow: 0 0 10px rgba(255, 42, 133, 0.5);
}

.scanner-box {
  margin-top: 24px;
  width: 100%;
  max-width: 750px;
  text-align: center;
}
.scanner-result {
  margin-top: 16px;
  font-family: var(--font-cyber);
  color: var(--accent-cyan);
  font-size: 1rem;
  min-height: 24px;
}

/* ==================== 8. MEMORY GALLERY ==================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  width: 100%;
  margin-top: 20px;
}
.polaroid-card {
  background: #0d1021;
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
}
.polaroid-card:hover {
  transform: translateY(-8px) rotate(1deg);
  border-color: var(--accent-purple);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.3);
}
.polaroid-img-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #13172d, #1f1a3a);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  gap: 8px;
}
.polaroid-caption {
  margin-top: 12px;
  font-size: 0.85rem;
  text-align: center;
  color: #e5e7eb;
}
.polaroid-date {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  text-align: center;
  font-family: var(--font-cyber);
}

/* Lightbox Modal */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 13, 0.9);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 24px;
  backdrop-filter: blur(10px);
}
#lightbox.active { display: flex; }
.lightbox-content {
  background: var(--bg-card);
  border: 1px solid var(--accent-cyan);
  padding: 30px;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  position: relative;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
}

/* ==================== 9. YOU ==================== */
.quotes-reveal {
  max-width: 650px;
  text-align: center;
}
.reveal-line {
  font-size: 1.2rem;
  color: #e5e7eb;
  margin-bottom: 20px;
  opacity: 0.3;
  transform: scale(0.98);
  transition: all 0.6s ease;
}
.reveal-line.active {
  opacity: 1;
  transform: scale(1);
  color: #fff;
  text-shadow: 0 0 15px rgba(255,255,255,0.4);
}

/* ==================== 10. CONSTELLATION MAP ==================== */
.constellation-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 400px;
  background: rgba(10, 12, 26, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  margin-bottom: 24px;
}
#constellationCanvas {
  width: 100%;
  height: 100%;
  border-radius: 16px;
}
.star-node {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-purple);
  border: 2px solid #fff;
  box-shadow: 0 0 15px var(--accent-purple);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
}
.star-node:hover, .star-node.active {
  background: var(--accent-cyan);
  box-shadow: 0 0 25px var(--accent-cyan);
  transform: translate(-50%, -50%) scale(1.3);
}
.node-card {
  min-height: 60px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--accent-cyan);
}

/* ==================== 11. FINAL ==================== */
#final {
  text-align: center;
}
.final-text {
  font-size: 1.3rem;
  color: #e5e7eb;
  max-width: 650px;
  margin-bottom: 24px;
  line-height: 1.8;
}
.final-highlight {
  font-family: var(--font-title);
  font-size: 2.5rem;
  margin: 30px 0;
  background: linear-gradient(90deg, #fff, var(--accent-pink));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.signature {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}