/* 🎯 3D Target Reflex Stylesheet (style.css) */

:root {
  --test-accent: #00f0ff;
  --test-accent-soft: rgba(0, 240, 255, 0.12);
  --test-accent-border: rgba(0, 240, 255, 0.3);
  --arena-bg: #060912;
  --arena-border: rgba(0, 240, 255, 0.2);
}


/* ── CRISP WHITE AIM CURSOR ── */
.visual-reflex-arena,
.visual-reflex-arena canvas,
.visual-reflex-arena *,
body:has(#panelTask.active),
body:has(#panelTask.active) * {
  cursor: var(--cursor-fps-crosshair) !important;
}

.top-header .wm-restart-btn,
.top-header button {
  cursor: pointer !important;
}

/* ── FULLSCREEN FIT-TO-SCREEN ARENA DURING GAMEPLAY ── */
body:has(#panelTask.active) {
  overflow: hidden !important;
}

body:has(#panelTask.active) header.panda-header,
body:has(#panelTask.active) .panda-nav,
body:has(#panelTask.active) footer.panda-footer,
body:has(#panelTask.active) .t-ambient-glow,
body:has(#panelTask.active) .t-seo-container,
body:has(#panelTask.active) .t-nav {
  display: none !important;
}

body:has(#panelTask.active) .t-shell {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

body:has(#panelTask.active) .t-card {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: #060912 !important;
  box-shadow: none !important;
  z-index: 9999 !important;
  overflow: hidden !important;
}

body:has(#panelTask.active) #panelTask,
body:has(#panelTask.active) .t-task {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  overflow: hidden !important;
}

/* Arena Container - Fills Entire Viewport */
.visual-reflex-arena {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background-color: #060912;
  box-shadow: none !important;
  overflow: hidden !important;
  user-select: none !important;
  touch-action: none !important;
}

.visual-reflex-arena::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(4, 7, 13, 0.7) 100%);
  pointer-events: none;
  z-index: 2;
}

#webgl-container {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1 !important;
}

#webgl-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

/* Minimalist Top Header (ReflexBench Golden Standard) */
.top-header {
  position: absolute !important;
  top: 14px !important;
  left: 16px !important;
  right: 16px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  z-index: 30 !important;
  pointer-events: none !important;
}

.round-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 18, 28, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: #00f0ff;
  border-radius: 50%;
  box-shadow: 0 0 6px #00f0ff;
}

#trialCount {
  margin: 0;
  font-family: var(--font-m, 'JetBrains Mono', monospace);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
}

.restart-pill,
.wm-restart-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.restart-pill:hover,
.wm-restart-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
}

/* Floating Points & Multiplier Marker */
.floating-text {
  position: absolute;
  pointer-events: none;
  font-family: var(--font-m, 'JetBrains Mono', monospace);
  font-size: 1.15rem;
  font-weight: 700;
  color: #00f0ff;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.9);
  transform: translate(-50%, -50%);
  animation: floatUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 100;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, -20%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -80px) scale(0.9); }
}

/* ── SCORE HERO UNIT COLOR UNIFICATION ── */
.t-score-big {
  transition: color 0.2s ease;
}
.t-score-big .t-score-unit {
  color: inherit !important;
  margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   ACCURATE 3D VISUAL PREVIEW BOX (How It Works Animation)
   ═══════════════════════════════════════════════════════════════ */
.reflex-preview-box {
  position: relative;
  width: 340px;
  max-width: 100%;
  height: 140px;
  margin: 32px auto 0;
  background: radial-gradient(ellipse at center, rgba(10, 25, 45, 0.9) 0%, rgba(6, 9, 18, 0.98) 85%);
  border: 1.5px solid var(--color-outline);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(0, 240, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
  .reflex-preview-box {
    margin-top: 0;
  }
}

/* 3D Perspective Orbital Guide Rings in Background */
.preview-orbit-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 1px dashed rgba(0, 240, 255, 0.18);
  pointer-events: none;
  transform: translate(-50%, -50%) rotateX(68deg) rotateZ(-18deg);
}

.preview-orbit-ring.r1 {
  width: 240px;
  height: 240px;
}

.preview-orbit-ring.r2 {
  width: 150px;
  height: 150px;
  border-color: rgba(255, 0, 102, 0.15);
  transform: translate(-50%, -50%) rotateX(68deg) rotateZ(32deg);
}

/* Center 3D Axis Crosshair */
.preview-center-cross {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* 3D Target Spheres (Clean 24px Spheres with Specular Highlights) */
.preview-target-orbit {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  z-index: 3;
}

/* Ball 1: Neon Magenta / Ruby */
.preview-target-orbit.o1 {
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #ff80ab 25%, #ff0066 65%, #880033 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7), 0 0 8px rgba(255, 0, 102, 0.7);
  animation: orbitMotion1 5.0s linear infinite;
}

/* Ball 2: Electric Aqua Cyan */
.preview-target-orbit.o2 {
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #80f7ff 25%, #00f0ff 65%, #005577 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7), 0 0 8px rgba(0, 240, 255, 0.7);
  animation: orbitMotion2 5.0s linear infinite;
}

/* Ball 3: Laser Lime Green */
.preview-target-orbit.o3 {
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #a3ffc2 25%, #00ff66 65%, #006622 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7), 0 0 8px rgba(0, 255, 102, 0.7);
  animation: orbitMotion3 5.0s linear infinite;
}

/* Ball 1 Orbital Trajectory & Hit Flash at t = 26% */
@keyframes orbitMotion1 {
  0%   { left: 20%; top: 62%; transform: translate(-50%, -50%) scale(0.8); }
  23%  { left: 34%; top: 44%; transform: translate(-50%, -50%) scale(1.05); filter: brightness(1); }
  26%  { left: 35%; top: 42%; transform: translate(-50%, -50%) scale(1.22); filter: brightness(2.2); } /* CLICK HIT! */
  29%  { left: 36%; top: 40%; transform: translate(-50%, -50%) scale(1.0); filter: brightness(1); }
  52%  { left: 74%; top: 38%; transform: translate(-50%, -50%) scale(0.85); }
  78%  { left: 56%; top: 68%; transform: translate(-50%, -50%) scale(0.75); }
  100% { left: 20%; top: 62%; transform: translate(-50%, -50%) scale(0.8); }
}

/* Ball 2 Orbital Trajectory & Hit Flash at t = 60% */
@keyframes orbitMotion2 {
  0%   { left: 76%; top: 34%; transform: translate(-50%, -50%) scale(0.8); }
  28%  { left: 54%; top: 28%; transform: translate(-50%, -50%) scale(0.9); }
  57%  { left: 66%; top: 62%; transform: translate(-50%, -50%) scale(1.08); filter: brightness(1); }
  60%  { left: 67%; top: 64%; transform: translate(-50%, -50%) scale(1.22); filter: brightness(2.2); } /* CLICK HIT! */
  63%  { left: 68%; top: 65%; transform: translate(-50%, -50%) scale(1.0); filter: brightness(1); }
  85%  { left: 82%; top: 50%; transform: translate(-50%, -50%) scale(0.85); }
  100% { left: 76%; top: 34%; transform: translate(-50%, -50%) scale(0.8); }
}

/* Ball 3 Orbital Trajectory & Hit Flash at t = 88% */
@keyframes orbitMotion3 {
  0%   { left: 45%; top: 76%; transform: translate(-50%, -50%) scale(0.85); }
  35%  { left: 26%; top: 40%; transform: translate(-50%, -50%) scale(0.75); }
  65%  { left: 38%; top: 22%; transform: translate(-50%, -50%) scale(0.95); }
  85%  { left: 49%; top: 31%; transform: translate(-50%, -50%) scale(1.08); filter: brightness(1); }
  88%  { left: 50%; top: 32%; transform: translate(-50%, -50%) scale(1.22); filter: brightness(2.2); } /* CLICK HIT! */
  91%  { left: 51%; top: 34%; transform: translate(-50%, -50%) scale(1.0); filter: brightness(1); }
  100% { left: 45%; top: 76%; transform: translate(-50%, -50%) scale(0.85); }
}

/* Standardized Click Cursor Bounding Box & Exact Fingertip Tracking */
.reflex-preview-cursor {
  position: absolute;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
  color: #ffffff;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.8));
  animation: reflexCursorCycle 5.0s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

.reflex-preview-cursor span {
  font-size: 20px;
  line-height: 1;
  display: block;
}

/* Mathematically synchronized with ball hit coordinates (35% 42%, 67% 64%, 50% 32%) */
@keyframes reflexCursorCycle {
  0%   { left: 22%; top: 62%; transform: translate(-35%, -15%) scale(1); }
  
  /* Target 1 Acquisition & Dead-Center Click */
  23%  { left: 35%; top: 42%; transform: translate(-35%, -15%) scale(1); }
  26%  { left: 35%; top: 42%; transform: translate(-35%, -15%) scale(0.8); } /* CLICK! */
  29%  { left: 35%; top: 42%; transform: translate(-35%, -15%) scale(1); }
  
  /* Target 2 Acquisition & Dead-Center Click */
  57%  { left: 67%; top: 64%; transform: translate(-35%, -15%) scale(1); }
  60%  { left: 67%; top: 64%; transform: translate(-35%, -15%) scale(0.8); } /* CLICK! */
  63%  { left: 67%; top: 64%; transform: translate(-35%, -15%) scale(1); }
  
  /* Target 3 Acquisition & Dead-Center Click */
  85%  { left: 50%; top: 32%; transform: translate(-35%, -15%) scale(1); }
  88%  { left: 50%; top: 32%; transform: translate(-35%, -15%) scale(0.8); } /* CLICK! */
  91%  { left: 50%; top: 32%; transform: translate(-35%, -15%) scale(1); }
  
  100% { left: 22%; top: 62%; transform: translate(-35%, -15%) scale(1); }
}

.reflex-preview-caption {
  font-size: 0.84rem;
  color: var(--text-muted, #94a3b8);
  text-align: center;
  margin-bottom: 20px;
}
