/**
 * VANTAGE Ultimate Framework — HUD, corruption transition, neon grid, velocity-linked chrome.
 */

:root {
  --vantage-neon: rgba(29, 185, 84, 0.38);
  --vantage-scan: rgba(29, 185, 84, 0.045);
}

.teovt-body.teovt-vantage-framework {
  position: relative;
  isolation: isolate;
}

.teovt-header {
  position: relative;
}

.teovt-data-source-badge {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--teovt-font-mono, monospace);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--vantage-neon);
  background: rgba(0, 24, 8, 0.55);
  color: rgba(200, 255, 220, 0.95);
  text-transform: uppercase;
  z-index: 2;
}

.teovt-data-source-badge__label {
  opacity: 0.75;
}

.teovt-data-source-badge__value {
  color: #fff;
  font-weight: 700;
}

.teovt-layer--bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.teovt-layer--data {
  position: relative;
  z-index: 1;
}

/* Command HUD — corners */
.teovt-hud {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-width: min(42vw, 22rem);
  font-family: var(--teovt-font-mono, monospace);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(232, 232, 232, 0.55);
  font-size: clamp(0.5rem, 0.65vw, 0.62rem);
  pointer-events: none;
}

.teovt-hud__label {
  opacity: 0.65;
  color: var(--veov-vantage-green, #1db954);
}

.teovt-hud__value {
  color: rgba(245, 245, 245, 0.95);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.teovt-hud__value--truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.teovt-hud__meta {
  opacity: 0.45;
  font-size: 0.9em;
}

.teovt-hud--tl {
  top: 0.5rem;
  left: 0.5rem;
}
.teovt-hud--tr {
  top: 0.5rem;
  right: 0.5rem;
  align-items: flex-end;
  text-align: right;
}
.teovt-hud--bl {
  bottom: 0.5rem;
  left: 0.5rem;
}
.teovt-hud--br {
  bottom: 0.5rem;
  right: 0.5rem;
  align-items: flex-end;
  text-align: right;
}

.teovt-body.teovt-vantage-framework::before,
.teovt-body.teovt-vantage-framework::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.teovt-body.teovt-vantage-framework::before {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--vantage-scan) 2px,
    var(--vantage-scan) 3px
  );
  opacity: 0.5;
  mix-blend-mode: screen;
}

.teovt-body.teovt-vantage-framework::after {
  opacity: 0.085;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  /* Higher velocity_score → faster grain drift (subtle “live bus” energy). */
  animation: teovt-noise-drift calc(26s - (var(--teovt-velocity-score, 50) * 0.16s)) linear infinite;
  mix-blend-mode: overlay;
}

@keyframes teovt-noise-drift {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-12%, -8%);
  }
}

.teovt-vantage-framework .teovt-grid--asymmetric {
  gap: 0;
  outline: 1px solid var(--vantage-neon);
  outline-offset: -1px;
}

.teovt-vantage-framework .teovt-panel {
  border-color: var(--veov-grid-line, rgba(29, 185, 84, 0.42));
  border-width: 1px;
}

@keyframes teovt-grid-line-flicker {
  0%,
  100% {
    border-color: rgba(29, 185, 84, 0.32);
    box-shadow: inset 0 0 0 1px rgba(29, 185, 84, 0.08);
  }
  40% {
    border-color: rgba(29, 185, 84, 0.55);
    box-shadow: inset 0 0 12px rgba(29, 185, 84, 0.12);
  }
  41% {
    border-color: rgba(29, 185, 84, 0.85);
    box-shadow: inset 0 0 22px rgba(29, 185, 84, 0.22);
  }
  55% {
    border-color: rgba(29, 185, 84, 0.4);
  }
}

.teovt-cell-flicker {
  animation: teovt-grid-line-flicker 4.2s ease-in-out infinite;
}

.teovt-cell-flicker:nth-child(2) {
  animation-delay: 0.4s;
}
.teovt-cell-flicker:nth-child(3) {
  animation-delay: 0.8s;
}
.teovt-cell-flicker:nth-child(4) {
  animation-delay: 1.1s;
}
.teovt-cell-flicker:nth-child(5) {
  animation-delay: 1.5s;
}

/* Neon pulse — bright core + layered glow */
@keyframes teovt-neon-pulse {
  0%,
  100% {
    color: var(--veov-neon-core, #fff);
    text-shadow:
      0 0 1px var(--veov-neon-core, #fff),
      0 0 10px var(--veov-neon-mid, rgba(255, 255, 255, 0.9)),
      0 0 26px var(--veov-neon-halo-a, rgba(0, 255, 140, 0.45)),
      0 0 52px var(--veov-neon-halo-b, rgba(29, 185, 84, 0.28)),
      0 0 96px var(--veov-neon-halo-c, rgba(0, 255, 200, 0.15));
  }
  50% {
    text-shadow:
      0 0 2px var(--veov-neon-core, #fff),
      0 0 16px var(--veov-neon-mid, rgba(255, 255, 255, 0.98)),
      0 0 36px var(--veov-neon-halo-a, rgba(0, 255, 160, 0.65)),
      0 0 72px var(--veov-neon-halo-b, rgba(29, 185, 84, 0.42)),
      0 0 120px var(--veov-neon-halo-c, rgba(0, 255, 200, 0.22));
  }
}

.teovt-neon-pulse {
  color: #fff;
  animation: teovt-neon-pulse 2.6s ease-in-out infinite;
}

.teovt-asset-integrated {
  mix-blend-mode: normal;
  filter: drop-shadow(0 0 14px rgba(29, 185, 84, 0.4)) drop-shadow(0 0 36px rgba(0, 0, 0, 0.88));
}

/* Breakout 3D — override bridge inline positioning */
#vantage-3d-root.teovt-mascot-float,
#vantage-3d-root.vantage-3d-bridge-root {
  position: fixed !important;
  left: 50% !important;
  top: 44% !important;
  right: auto !important;
  bottom: auto !important;
  width: min(118vw, 168vh) !important;
  height: min(88vh, 124vw) !important;
  max-width: none !important;
  transform: translate(-50%, -50%) !important;
  z-index: var(--veov-mascot-z, 14000) !important;
  overflow: visible !important;
  pointer-events: none !important;
}

.teovt-layer--mascot {
  z-index: var(--veov-mascot-z, 14000);
  pointer-events: none;
}

.teovt-sequence {
  position: relative;
}

.teovt-sequence__nav {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
  padding: 0 1rem 0.45rem;
  list-style: none;
  margin: 0;
}

.teovt-sequence__nav button {
  margin: 0;
  min-width: 2rem;
  height: 1.75rem;
  font-family: var(--teovt-font-mono, monospace);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--vantage-neon);
  background: rgba(0, 20, 0, 0.5);
  color: rgba(232, 232, 232, 0.9);
}

.teovt-sequence__nav button[aria-current="true"] {
  background: rgba(29, 185, 84, 0.22);
  color: #fff;
  box-shadow: 0 0 14px rgba(29, 185, 84, 0.35);
}

.teovt-scene {
  display: none;
  animation: teovt-scene-in 0.45s ease-out both;
}

.teovt-scene.is-active {
  display: block;
}

@keyframes teovt-scene-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.teovt-scene-placeholder {
  min-height: 48vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid var(--vantage-neon);
  margin: 0 1rem 1rem;
  color: rgba(232, 232, 232, 0.65);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-family: var(--teovt-font-mono, monospace);
}

/* Full-screen RGB + data corruption (0.5s) */
.teovt-transition-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: var(--veov-transition-z, 16000);
}

#teovt-glitch-overlay {
  background: linear-gradient(
    90deg,
    rgba(255, 0, 60, 0.14) 0%,
    rgba(0, 255, 255, 0.12) 34%,
    rgba(60, 255, 80, 0.1) 68%,
    rgba(255, 0, 255, 0.12) 100%
  );
  mix-blend-mode: screen;
  transform: translate3d(0, 0, 0);
}

#teovt-glitch-overlay.is-on {
  visibility: visible;
  animation: teovt-glitch-rgb var(--teovt-corruption-ms, 500ms) steps(2, end) both;
}

.teovt-corruption-layer {
  visibility: hidden;
  z-index: calc(var(--veov-transition-z, 16000) - 1);
  background: repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.03) 0 1px,
      transparent 1px 3px
    ),
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.06), transparent 42%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)' opacity='0.35'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0;
}

.teovt-corruption-layer.is-on {
  visibility: visible;
  opacity: 1;
  animation: teovt-corruption-static var(--teovt-corruption-ms, 500ms) steps(3, end) both;
}

@keyframes teovt-glitch-rgb {
  0% {
    opacity: 0;
    clip-path: inset(0 0 0 0);
    transform: translate(0, 0) skewX(0deg);
  }
  12% {
    opacity: 1;
    clip-path: inset(6% 0 18% 0);
    transform: translate(-6px, 2px) skewX(-0.6deg);
  }
  28% {
    opacity: 0.92;
    clip-path: inset(0 8% 22% 0);
    transform: translate(8px, -3px) skewX(0.8deg);
  }
  48% {
    opacity: 0.95;
    clip-path: inset(18% 0 0 0);
    transform: translate(-5px, 4px) skewX(-0.4deg);
  }
  72% {
    opacity: 0.55;
    clip-path: inset(0 0 12% 0);
    transform: translate(3px, -2px);
  }
  100% {
    opacity: 0;
    clip-path: inset(0 0 0 0);
    transform: translate(0, 0) skewX(0deg);
  }
}

@keyframes teovt-corruption-static {
  0% {
    opacity: 0;
    filter: contrast(1) saturate(1);
  }
  15% {
    opacity: 0.85;
    filter: contrast(1.35) saturate(1.4);
  }
  40% {
    opacity: 1;
    filter: contrast(1.6) saturate(1.8) hue-rotate(12deg);
  }
  100% {
    opacity: 0;
    filter: contrast(1) saturate(1);
  }
}

body.teovt-scene-corruption .teovt-display-stage {
  animation: teovt-chromatic-aberration var(--teovt-corruption-ms, 500ms) ease-out both;
}

@keyframes teovt-chromatic-aberration {
  0% {
    filter: none;
  }
  35% {
    filter: drop-shadow(3px 0 0 rgba(255, 0, 80, 0.35)) drop-shadow(-3px 0 0 rgba(0, 255, 255, 0.28));
  }
  100% {
    filter: none;
  }
}

/* —— Data-to-Screen pipeline —— */
:root {
  --vantage-pulse-speed: 1.15s;
}

.teovt-grid--data {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-areas:
    "r r r r a b"
    "r r r r a b";
  min-height: 52vh;
  padding: 0 0.5rem;
  align-items: stretch;
}

.teovt-panel--full.teovt-panel--roster-list {
  grid-area: r;
}

.teovt-grid--data .teovt-panel--a {
  grid-area: a;
}

.teovt-grid--data .teovt-panel--b {
  grid-area: b;
}

.teovt-roster-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: roster;
}

.teovt-roster-list__item {
  display: grid;
  grid-template-columns: 2rem 1fr 3rem;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.25rem;
  border-bottom: 1px solid var(--vantage-neon);
  font-size: 0.82rem;
}

.teovt-roster-list__rank {
  font-weight: 800;
  color: var(--teovt-green, #1db954);
}

.teovt-roster-list__vel {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--teovt-gold, #ffcc00);
}

.teovt-spotlight-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding: 0 1rem 1rem;
  min-height: 58vh;
}

.teovt-spotlight-copy {
  position: relative;
  z-index: 2;
  text-align: center;
}

.teovt-spotlight-kicker {
  margin: 0;
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(232, 232, 232, 0.55);
}

.teovt-spotlight-name {
  margin: 0.35rem 0;
  font-size: clamp(1.25rem, 4vw, 2rem);
  letter-spacing: 0.06em;
}

.teovt-spotlight-stats {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(232, 232, 232, 0.75);
}

.teovt-releases-wrap,
.teovt-genre-wrap,
.teovt-finale {
  padding: 0 1.25rem 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.teovt-releases-week {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.teovt-release-card {
  border: 1px solid var(--vantage-neon);
  padding: 0.75rem;
  background: rgba(0, 30, 10, 0.35);
}

.teovt-release-card__title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.teovt-release-card__date {
  font-size: 0.72rem;
  opacity: 0.75;
}

.teovt-genre-wall__row {
  margin: 0.35rem 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.teovt-finale__leader,
.teovt-finale__src {
  font-size: 1rem;
}

.teovt-debug-log {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 3.25rem;
  z-index: 15000;
  max-height: 6rem;
  overflow: auto;
  padding: 0.35rem 0.75rem;
  background: rgba(0, 0, 0, 0.82);
  border-top: 1px solid rgba(0, 255, 100, 0.35);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: #9f9;
  pointer-events: none;
}

.teovt-debug-log__line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teovt-vantage-framework .teovt-stat__value.teovt-pulse,
.teovt-vantage-framework .teovt-pulse .teovt-stat__value {
  animation-duration: var(--vantage-pulse-speed, 1.15s);
}

@media (max-width: 900px) {
  .teovt-grid--data {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "r r"
      "a b";
  }
}
