/* ═══════════════════════════════════════════════════════
   DNA SCAN V2 — TIME MACHINE THEME
   ═══════════════════════════════════════════════════════ */

body { font-family: 'Outfit', sans-serif; }

/* Loader */
.dna-page-loader{position:fixed;inset:0;z-index:99999;background:#07090d;display:flex;flex-direction:column;align-items:center;justify-content:center;transition:opacity .8s,visibility .8s}
.dna-page-loader.loaded{opacity:0;visibility:hidden;pointer-events:none}
.dna-loader-helix{width:60px;height:160px;position:relative}
.dna-loader-helix span{position:absolute;width:10px;height:10px;border-radius:50%;left:50%}
.dna-loader-helix span:nth-child(odd){background:rgba(0,200,255,.9)}
.dna-loader-helix span:nth-child(even){background:rgba(160,80,255,.85)}
.dna-loader-helix span:nth-child(1){top:0;animation:hBob 1.4s ease-in-out infinite 0s}
.dna-loader-helix span:nth-child(2){top:0;animation:hBob 1.4s ease-in-out infinite .7s}
.dna-loader-helix span:nth-child(3){top:32px;animation:hBob 1.4s ease-in-out infinite .2s}
.dna-loader-helix span:nth-child(4){top:32px;animation:hBob 1.4s ease-in-out infinite .9s}
.dna-loader-helix span:nth-child(5){top:64px;animation:hBob 1.4s ease-in-out infinite .4s}
.dna-loader-helix span:nth-child(6){top:64px;animation:hBob 1.4s ease-in-out infinite 1.1s}
.dna-loader-helix span:nth-child(7){top:96px;animation:hBob 1.4s ease-in-out infinite .6s}
.dna-loader-helix span:nth-child(8){top:96px;animation:hBob 1.4s ease-in-out infinite 1.3s}
.dna-loader-helix span:nth-child(9){top:128px;animation:hBob 1.4s ease-in-out infinite .8s}
.dna-loader-helix span:nth-child(10){top:128px;animation:hBob 1.4s ease-in-out infinite .1s}
@keyframes hBob{0%,100%{transform:translateX(-22px)}50%{transform:translateX(22px)}}
.dna-loader-text{margin-top:32px;font-family:'Cinzel',serif;font-size:14px;letter-spacing:4px;color:rgba(0,200,255,.7);text-transform:uppercase;animation:ldPulse 2s ease-in-out infinite}
@keyframes ldPulse{0%,100%{opacity:.5}50%{opacity:1}}

/* Transition */
.dna-transition{position:fixed;inset:0;z-index:99998;pointer-events:none;display:flex}
.dna-transition .strand{flex:1;background:#07090d;transform:scaleY(0);transform-origin:top;transition:transform .5s cubic-bezier(.76,0,.24,1)}
.dna-transition.out .strand{transform:scaleY(1)}
.dna-transition .strand:nth-child(1){transition-delay:0s}
.dna-transition .strand:nth-child(2){transition-delay:.06s}
.dna-transition .strand:nth-child(3){transition-delay:.12s}
.dna-transition .strand:nth-child(4){transition-delay:.18s}
.dna-transition .strand:nth-child(5){transition-delay:.24s}

/* ── Main Layout ── */
.tm-main { min-height: 100vh; }

/* ── Portal Section ── */
.tm-portal-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 40px 24px;
}
.tm-portal {
  position: relative;
  width: min(580px, 92vw);
  text-align: center;
}

/* Rings */
.tm-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.tm-ring-1 {
  inset: -50px;
  border: 2px solid rgba(0, 200, 255, 0.1);
  animation: ringRotate 25s linear infinite;
}
.tm-ring-1::before, .tm-ring-2::before, .tm-ring-3::before {
  content: '';
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  top: -4px; left: 50%;
  transform: translateX(-50%);
}
.tm-ring-1::before { background: rgba(0, 200, 255, 0.7); box-shadow: 0 0 15px rgba(0, 200, 255, 0.5); }
.tm-ring-2 {
  inset: -30px;
  border: 1px solid rgba(160, 80, 255, 0.08);
  animation: ringRotate 18s linear infinite reverse;
}
.tm-ring-2::before { background: rgba(160, 80, 255, 0.6); box-shadow: 0 0 12px rgba(160, 80, 255, 0.4); }
.tm-ring-3 {
  inset: -70px;
  border: 1px dashed rgba(0, 200, 255, 0.06);
  animation: ringRotate 35s linear infinite;
}
.tm-ring-3::before { background: rgba(0, 200, 255, 0.4); box-shadow: 0 0 10px rgba(0, 200, 255, 0.3); width: 5px; height: 5px; }
@keyframes ringRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Camera box */
.tm-camera-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  border: 2px solid rgba(0, 200, 255, 0.2);
  box-shadow:
    0 0 60px rgba(0, 200, 255, 0.08),
    0 0 120px rgba(0, 200, 255, 0.04),
    0 30px 70px rgba(0, 0, 0, 0.5),
    inset 0 0 40px rgba(0, 200, 255, 0.02);
  z-index: 2;
}
.tm-camera-box video {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transform: scaleX(-1);
}
.tm-preview-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
}

/* Upload zone */
.tm-upload-zone {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(0, 8, 20, 0.85);
  z-index: 5;
  transition: all 0.5s;
}
.tm-upload-zone.hidden { opacity: 0; pointer-events: none; z-index: -1; }

.tm-upload-icon {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(0, 200, 255, 0.06);
  border: 2px dashed rgba(0, 200, 255, 0.25);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  animation: uploadPulse 3s ease-in-out infinite;
  color: rgba(0, 200, 255, 0.7);
}
@keyframes uploadPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 200, 255, 0.15); }
  50% { box-shadow: 0 0 0 20px rgba(0, 200, 255, 0); }
}
.tm-upload-zone:hover .tm-upload-icon {
  border-color: rgba(0, 200, 255, 0.5);
  background: rgba(0, 200, 255, 0.1);
}

.tm-upload-title {
  font-family: 'Cinzel', serif;
  font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 8px;
}
.tm-upload-desc {
  font-size: 14px; color: rgba(255, 255, 255, 0.45); margin-bottom: 24px;
}
.tm-upload-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 32px;
  background: linear-gradient(135deg, rgba(0, 200, 255, 0.15), rgba(160, 80, 255, 0.1));
  border: 1px solid rgba(0, 200, 255, 0.3);
  border-radius: 14px;
  color: rgba(0, 220, 255, 0.95);
  font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.3s;
  font-family: inherit;
}
.tm-upload-btn:hover {
  background: linear-gradient(135deg, rgba(0, 200, 255, 0.25), rgba(160, 80, 255, 0.15));
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 200, 255, 0.15);
}
.tm-upload-or {
  margin: 14px 0; font-size: 12px;
  color: rgba(255, 255, 255, 0.25);
  text-transform: uppercase; letter-spacing: 2px;
}
.tm-camera-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.3s;
  font-family: inherit;
}
.tm-camera-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* Scan overlay */
.tm-scan-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.tm-scan-corners {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52%; aspect-ratio: 3/4;
}
.tm-corner {
  position: absolute; width: 28px; height: 28px;
  border: 3px solid rgba(0, 200, 255, 0.7);
  box-shadow: 0 0 12px rgba(0, 200, 255, 0.3);
}
.tm-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; border-top-left-radius: 10px; }
.tm-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; border-top-right-radius: 10px; }
.tm-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; border-bottom-left-radius: 10px; }
.tm-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; border-bottom-right-radius: 10px; }

.tm-scan-line {
  position: absolute; left: 15%; right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 200, 255, 0.6), rgba(0, 200, 255, 0.9), rgba(0, 200, 255, 0.6), transparent);
  box-shadow: 0 0 20px rgba(0, 200, 255, 0.4);
  opacity: 0;
}
.tm-scan-line.active {
  opacity: 1;
  animation: scanSweep 2.5s ease-in-out infinite;
}
@keyframes scanSweep { 0% { top: 15%; } 50% { top: 85%; } 100% { top: 15%; } }

.tm-scan-label {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  padding: 8px 20px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(0, 200, 255, 0.25);
  border-radius: 20px;
  font-size: 13px; font-weight: 600;
  color: rgba(0, 200, 255, 0.9);
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

/* Portal info */
.tm-portal-info {
  display: flex; justify-content: center; gap: 32px;
  margin-top: 24px;
  position: relative; z-index: 2;
}
.tm-portal-stat {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
}
.tm-stat-icon { font-size: 20px; }
.tm-portal-stat strong {
  display: block; font-size: 16px; font-weight: 700;
  color: rgba(0, 200, 255, 0.9);
}
.tm-portal-stat span { font-size: 11px; color: rgba(255, 255, 255, 0.45); }

/* Controls */
.tm-controls {
  display: flex; gap: 14px; justify-content: center;
  margin-top: 24px; position: relative; z-index: 2;
  flex-wrap: wrap;
}
.tm-ctrl-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.3s;
  text-decoration: none;
  font-family: inherit;
  border: none;
}
.tm-ctrl-btn.primary {
  background: linear-gradient(135deg, #4f8fff, #5b5eff);
  color: #fff;
  box-shadow: 0 8px 28px rgba(80, 120, 255, 0.35);
}
.tm-ctrl-btn.primary:hover {
  background: linear-gradient(135deg, #6fa3ff, #7475ff);
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(80, 120, 255, 0.5);
}
.tm-ctrl-btn.ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.75);
}
.tm-ctrl-btn.ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.tm-process-btn {
  background: linear-gradient(135deg, rgba(0, 200, 255, 0.8), rgba(160, 80, 255, 0.7)) !important;
  box-shadow: 0 8px 32px rgba(0, 200, 255, 0.25), 0 0 60px rgba(0, 200, 255, 0.1) !important;
  animation: processPulse 2s ease-in-out infinite;
}
@keyframes processPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(0, 200, 255, 0.25), 0 0 60px rgba(0, 200, 255, 0.1); }
  50% { box-shadow: 0 8px 40px rgba(0, 200, 255, 0.4), 0 0 80px rgba(0, 200, 255, 0.2); }
}

/* ── Processing Section ── */
.tm-processing {
  position: relative;
  min-height: calc(100vh - 120px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  overflow: hidden;
}
.tm-warp-bg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.tm-warp-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(0, 200, 255, 0.1);
  animation: warpExpand 3s ease-out infinite;
}
.tm-warp-ring.r1 { width: 200px; height: 200px; animation-delay: 0s; }
.tm-warp-ring.r2 { width: 200px; height: 200px; animation-delay: 0.75s; }
.tm-warp-ring.r3 { width: 200px; height: 200px; animation-delay: 1.5s; }
.tm-warp-ring.r4 { width: 200px; height: 200px; animation-delay: 2.25s; }
@keyframes warpExpand {
  0% { transform: scale(1); opacity: 0.8; border-color: rgba(0, 200, 255, 0.3); }
  100% { transform: scale(6); opacity: 0; border-color: rgba(160, 80, 255, 0.1); }
}

.tm-processing-content {
  position: relative; z-index: 2;
  text-align: center;
  width: min(500px, 90vw);
}
.tm-user-photo {
  width: 140px; height: 140px;
  border-radius: 50%;
  margin: 0 auto 32px;
  overflow: hidden;
  border: 3px solid rgba(0, 200, 255, 0.4);
  box-shadow: 0 0 40px rgba(0, 200, 255, 0.2);
  animation: photoGlow 2s ease-in-out infinite;
}
.tm-user-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
@keyframes photoGlow {
  0%, 100% { box-shadow: 0 0 40px rgba(0, 200, 255, 0.2); }
  50% { box-shadow: 0 0 60px rgba(0, 200, 255, 0.4), 0 0 100px rgba(160, 80, 255, 0.15); }
}

.tm-warp-text h2 {
  font-family: 'Cinzel', serif;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800; color: #fff;
  margin: 0 0 20px;
}
.tm-era-counter {
  margin-bottom: 28px;
}
.tm-era-year {
  font-family: 'Orbitron', monospace;
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 900;
  background: linear-gradient(135deg, #00d4ff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
}
.tm-warp-bar {
  width: 100%; height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px; overflow: hidden;
  margin-bottom: 16px;
}
.tm-warp-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, rgba(0, 200, 255, 0.8), rgba(160, 80, 255, 0.8));
  border-radius: 10px;
  transition: width 0.4s ease;
}
.tm-warp-step {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}

/* ── Results Section ── */
.tm-results {
  min-height: calc(100vh - 120px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
}
.tm-results-content { width: min(800px, 100%); }
.tm-results-header { text-align: center; margin-bottom: 40px; }
.tm-success-icon {
  width: 80px; height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(80, 220, 100, 0.1);
  border: 2px solid rgba(80, 220, 100, 0.3);
  display: flex; align-items: center; justify-content: center;
  color: rgba(80, 220, 100, 0.9);
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes successPop { from { transform: scale(0); } to { transform: scale(1); } }

.tm-results-header h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800; color: #fff;
  margin: 0 0 12px;
}
.tm-results-header p {
  font-size: 16px; color: rgba(255, 255, 255, 0.6);
  margin: 0;
}
.tm-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px; margin-bottom: 40px;
}
.tm-result-card {
  padding: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
}
.tm-result-photo {
  width: 100%; aspect-ratio: 3/4;
  object-fit: cover; border-radius: 14px;
  border: 2px solid rgba(0, 200, 255, 0.2);
}
.tm-result-stats { display: flex; flex-direction: column; gap: 16px; }
.tm-rstat {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
}
.tm-rstat-icon { font-size: 28px; }
.tm-rstat-title { font-size: 12px; color: rgba(255, 255, 255, 0.5); margin-bottom: 3px; }
.tm-rstat-val { font-size: 15px; font-weight: 700; color: rgba(0, 200, 255, 0.9); }

.tm-results-actions {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .tm-portal-info { gap: 12px; flex-wrap: wrap; }
  .tm-portal-stat { padding: 8px 12px; }
  .tm-results-grid { grid-template-columns: 1fr; }
  .tm-results-actions { flex-direction: column; align-items: center; }
}
