#tar-intro-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0; /* ✅ canvas อยู่หลัง text */
}

/* ── text center ── */
#tar-intro-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: 3; /* ✅ text อยู่หน้า canvas */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  /* ✅ backdrop blur ทำให้ text อ่านง่ายขึ้น แม้มี node อยู่ด้านหลัง */
  padding: 2.5rem 3.5rem;
  background: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0,0,0,0.5) 60%,
    transparent 100%);
  border-radius: 12px;
}

#tar-intro-text.visible { opacity: 1; }

/* ── label บน ── */
.tar-intro-label {
  font-family: 'Rajdhani', 'JetBrains Mono', monospace;
  font-size: clamp(0.5rem, 1.3vw, 0.65rem);
  font-weight: 600;
  letter-spacing: 7px;
  color: rgba(220,38,38,0.45);
  text-transform: uppercase;
}

/* ── TAR-01 ── */
.tar-intro-unit {
  display: block;
  font-family: 'Orbitron', 'JetBrains Mono', monospace; /* ✅ font ใหม่ */
  font-size: clamp(3.5rem, 11vw, 8rem);
  font-weight: 900;
  letter-spacing: 16px;
  color: transparent;
  -webkit-text-stroke: 1.8px rgba(220,38,38,0.9);
  text-transform: uppercase;
  animation: tarIntroUnitPulse 2.5s ease infinite;
  position: relative;
  line-height: 1;
}

.tar-intro-unit::before,
.tar-intro-unit::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
}
.tar-intro-unit::before {
  -webkit-text-stroke: 1.8px rgba(0,200,255,0.2);
  animation: tarGlitchA 4.5s steps(1) infinite;
}
.tar-intro-unit::after {
  -webkit-text-stroke: 1.8px rgba(220,38,38,0.15);
  animation: tarGlitchB 3.9s steps(1) infinite;
}

/* ── subtitle ── */
.tar-intro-sub {
  font-family: 'Rajdhani', 'JetBrains Mono', monospace;
  font-size: clamp(0.5rem, 1.5vw, 0.7rem);
  font-weight: 500;
  letter-spacing: 5px;
  color: rgba(220,38,38,0.38);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

/* ── loading bars ── */
.tar-intro-bars {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: clamp(220px, 32vw, 360px);
  margin: 0.2rem 0 0.7rem;
}

.tar-intro-bar-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tar-intro-bar-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.42rem;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.2);
  width: 76px;
  text-align: right;
  flex-shrink: 0;
}

.tar-intro-bar-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.42rem;
  letter-spacing: 1px;
  color: rgba(220,38,38,0.45);
  flex-shrink: 0;
  width: 28px;
}

.tar-intro-bar-track {
  flex: 1;
  height: 2px;
  background: rgba(220,38,38,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.tar-intro-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7f1d1d, #dc2626, #ff6060);
  box-shadow: 0 0 8px rgba(220,38,38,0.6);
  border-radius: 2px;
  animation: tarBarFill 1.4s cubic-bezier(0.16,1,0.3,1) forwards;
}

/* ── status ── */
.tar-intro-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Rajdhani', 'JetBrains Mono', monospace;
  font-size: clamp(0.5rem, 1.2vw, 0.62rem);
  font-weight: 600;
  letter-spacing: 4px;
  color: rgba(34,197,94,0.55);
  text-transform: uppercase;
}

.tar-intro-status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e, 0 0 16px rgba(34,197,94,0.4);
  animation: tarStatusBlink 1.4s ease infinite;
  flex-shrink: 0;
}

/* ── skip ── */
#tar-intro-skip {
  position: absolute;
  bottom: 2rem; right: 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.52rem;
  letter-spacing: 2.5px;
  color: rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 0.4rem 1rem;
  border-radius: 3px;
  cursor: pointer;
  z-index: 10;
  transition: color 0.25s, border-color 0.25s;
}
#tar-intro-skip:hover {
  color: rgba(220,38,38,0.7);
  border-color: rgba(220,38,38,0.3);
}

/* ── progress ── */
#tar-intro-prog {
  position: absolute;
  bottom: 0; left: 0;
  height: 1px; width: 0%;
  background: linear-gradient(90deg,
    transparent,
    rgba(220,38,38,0.5),
    rgba(255,80,80,1));
  box-shadow: 0 0 8px rgba(220,38,38,0.6);
  transition: width 0.2s linear;
  z-index: 5;
}

/* ── keyframes ── */
@keyframes tarIntroUnitPulse {
  0%,100% { -webkit-text-stroke-color: rgba(220,38,38,0.75); }
  50% {
    -webkit-text-stroke-color: rgba(220,38,38,1);
    filter: drop-shadow(0 0 28px rgba(220,38,38,0.55));
  }
}

@keyframes tarGlitchA {
  0%,93%,100% { transform:translate(0); opacity:0; }
  94%  { transform:translate(-4px, 1px); opacity:1; }
  96%  { transform:translate(3px, -1px); opacity:0.7; }
  98%  { transform:translate(-2px, 2px); opacity:1; }
}

@keyframes tarGlitchB {
  0%,90%,100% { transform:translate(0); opacity:0; }
  91%  { transform:translate(4px, -2px); opacity:1; }
  93%  { transform:translate(-3px, 1px); opacity:0.6; }
  95%  { transform:translate(2px, -1px); opacity:1; }
}

@keyframes tarBarFill {
  from { width:0%; }
  to   { width:100%; }
}

@keyframes tarStatusBlink {
  0%,100% { opacity:1; box-shadow:0 0 8px #22c55e; }
  50%     { opacity:0.25; box-shadow:none; }
}