/* Attune™ Supercomputer — live scan HUD & analysis effects */

.attune-theater-section {
  background: rgba(0, 0, 0, 0.35);
}

.attune-theater-status {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.attune-theater-status.loading,
.attune-theater-status.live {
  color: #34d399;
  animation: attune-status-pulse 1.5s ease infinite;
}

@keyframes attune-status-pulse {
  0%, 100% { border-color: rgba(52, 211, 153, 0.25); }
  50% { border-color: rgba(52, 211, 153, 0.55); }
}

.attune-theater-screen {
  aspect-ratio: 16 / 9;
  min-height: 320px;
  max-height: 72vh;
  border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 0 60px rgba(52, 211, 153, 0.08);
}

.attune-theater-placeholder {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  margin: 0;
}

.attune-theater-placeholder[hidden] {
  display: none !important;
}

#overlay-canvas {
  z-index: 3;
}

#media-preview-video:not([hidden]) {
  z-index: 1;
}

.attune-scan-stage {
  position: relative;
}

.attune-scan-stage.analyzing {
  box-shadow:
    0 0 0 1px rgba(52, 211, 153, 0.35),
    0 0 40px rgba(52, 211, 153, 0.12);
}

.attune-scan-stage.analyzing::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(52, 211, 153, 0.03) 2px,
    rgba(52, 211, 153, 0.03) 4px
  );
  animation: attune-flicker 0.15s steps(2) infinite;
}

@keyframes attune-flicker {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

.attune-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.attune-hud-top,
.attune-hud-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgba(4, 12, 20, 0.72);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  backdrop-filter: blur(6px);
}

.attune-hud-live {
  color: #34d399;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.attune-hud-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  animation: attune-pulse 1.2s ease infinite;
}

#hud-frame,
#hud-phase {
  color: #9fb3cd;
}

.attune-hud-progress {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-right: 0.5rem;
}

.attune-hud-progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #34d399, #22d3ee);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.attune-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #34d399, #22d3ee, transparent);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.8);
  animation: attune-scan-sweep 2.2s ease-in-out infinite;
  opacity: 0.85;
}

@keyframes attune-scan-sweep {
  0% { top: 8%; opacity: 0; }
  10% { opacity: 0.9; }
  90% { opacity: 0.9; }
  100% { top: 92%; opacity: 0; }
}

.attune-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: rgba(52, 211, 153, 0.7);
  border-style: solid;
  pointer-events: none;
  z-index: 3;
}

.attune-corner.tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.attune-corner.tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; }
.attune-corner.bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; }
.attune-corner.br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

.attune-dim-panel {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
}

.attune-dim-panel h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.attune-dim-row {
  display: grid;
  grid-template-columns: 130px 1fr 52px 72px;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
}

.attune-dim-row span:first-child {
  color: #c5d4e8;
}

.attune-dim-bar {
  height: 7px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.attune-dim-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.attune-dim-bar i.low { background: linear-gradient(90deg, #34d399, #22c55e); }
.attune-dim-bar i.mid { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.attune-dim-bar i.high { background: linear-gradient(90deg, #f87171, #ef4444); }

.attune-dim-pct {
  text-align: right;
  font-weight: 700;
  color: var(--orange-2);
  font-variant-numeric: tabular-nums;
}

.attune-dim-level {
  text-align: right;
  color: var(--muted);
  font-size: 0.7rem;
}

.attune-dist-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.attune-dist-panel h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

.attune-dist-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.82rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.attune-dist-row em {
  font-style: normal;
  font-weight: 800;
  color: var(--attune-accent, #34d399);
  text-align: right;
}

.attune-ai-report {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(63, 142, 252, 0.08), rgba(52, 211, 153, 0.06));
  border: 1px solid rgba(63, 142, 252, 0.22);
}

.attune-ai-report-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.attune-ai-report-header h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.attune-ai-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.attune-ai-report ul {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.attune-ai-report li {
  padding: 0.25rem 0;
  font-size: 0.86rem;
  color: #c5d4e8;
}

.attune-ai-report li::before {
  content: "▸ ";
  color: #34d399;
}

.attune-ai-report p {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

.attune-ai-action {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  font-size: 0.86rem;
}

.attune-video-desc {
  margin: 0.75rem 0 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.22);
}

.attune-video-desc p {
  margin: 0.35rem 0 0 !important;
  color: #d8e8f8 !important;
  font-size: 0.92rem !important;
  line-height: 1.65 !important;
}

.attune-super-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #34d399;
  margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
  .attune-dim-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .attune-dim-pct,
  .attune-dim-level { text-align: left; }
}
