/* ⚡ Reaction + Decision Test Stylesheet (style.css) */

:root {
  --test-accent: #ffe600;
  --test-accent-soft: rgba(255, 230, 0, 0.12);
  --test-accent-border: rgba(255, 230, 0, 0.35);
  --arena-bg: #060912;
  --arena-border: rgba(255, 230, 0, 0.2);
}


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

.top-header .restart-pill,
.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;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !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;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !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;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  overflow: hidden !important;
}

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

.decision-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;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

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

/* Standard Top HUD Header */
.top-header {
  position: absolute !important;
  top: 14px !important;
  left: 16px !important;
  right: 16px !important;
  width: calc(100% - 32px) !important;
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 16px !important;
  z-index: 20 !important;
  pointer-events: none !important;
}

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

.pulse-dot {
  width: 7px;
  height: 7px;
  background: #00f0ff;
  border-radius: 50%;
  box-shadow: 0 0 8px #00f0ff;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

#level {
  margin: 0;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
}

/* Instruction in Left Corner (Clean Floating next to Timer Pill) */
.decision-legend-pill {
  position: static !important;
  transform: none !important;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px 0;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  flex-shrink: 0;
}

.legend-item { display: flex; align-items: center; gap: 7px; color: #94a3b8; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot.green { background: #00ff88; box-shadow: 0 0 10px #00ff88; }
.legend-dot.red { background: #ff0055; box-shadow: 0 0 10px #ff0055; }
.legend-dot.yellow { background: #ffe600; box-shadow: 0 0 10px #ffe600; }

.header-actions {
  display: flex !important;
  align-items: center !important;
  margin-left: auto !important;
  pointer-events: auto !important;
}

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

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

/* ═══════════════════════════════════════════════════════════════
   VISUAL PREVIEW BOX (How It Works Animation)
   ═══════════════════════════════════════════════════════════════ */
.decision-preview-box {
  position: relative;
  width: 340px;
  max-width: 100%;
  height: 140px;
  margin: 32px auto 0;
  background: rgba(6, 9, 18, 0.85);
  border: 1.5px solid var(--color-outline);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 16px;
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(255, 230, 0, 0.05);
}

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

.preview-stimulus {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

.preview-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  display: block;
  transition: all 0.3s ease;
}

.preview-orb.green {
  background: radial-gradient(circle at 32% 28%, #80ffc4 0%, #00e676 40%, #00a84e 75%, #004d24 100%);
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.6), inset -2px -3px 6px rgba(0, 0, 0, 0.45);
  animation: orbGreenGlow 5s infinite;
}

.preview-orb.red {
  background: radial-gradient(circle at 32% 28%, #ff85a0 0%, #f4284b 40%, #b8102e 75%, #520011 100%);
  box-shadow: 0 0 16px rgba(244, 40, 75, 0.6), inset -2px -3px 6px rgba(0, 0, 0, 0.45);
  animation: orbRedGlow 5s infinite;
}

.preview-orb.yellow {
  background: radial-gradient(circle at 32% 28%, #fff59d 0%, #facc15 40%, #c99a07 75%, #524600 100%);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.6), inset -2px -3px 6px rgba(0, 0, 0, 0.45);
  animation: orbYellowGlow 5s infinite;
}

@keyframes orbGreenGlow {
  0%, 30% { transform: scale(1.1); box-shadow: 0 0 22px rgba(0, 255, 136, 0.9); }
  35%, 100% { transform: scale(0.95); opacity: 0.7; box-shadow: none; }
}

@keyframes orbRedGlow {
  0%, 33% { transform: scale(0.95); opacity: 0.7; box-shadow: none; }
  35%, 65% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 22px rgba(255, 0, 85, 0.9); }
  70%, 100% { transform: scale(0.95); opacity: 0.7; box-shadow: none; }
}

@keyframes orbYellowGlow {
  0%, 68% { transform: scale(0.95); opacity: 0.7; box-shadow: none; }
  70%, 98% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 22px rgba(255, 230, 0, 0.9); }
  100% { transform: scale(0.95); opacity: 0.7; box-shadow: none; }
}

.preview-tag {
  font-family: var(--font-m, monospace);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preview-tag.green { color: #00ff88; }
.preview-tag.red { color: #ff0055; }
.preview-tag.yellow { color: #ffe600; }

/* Animated Click Cursor in Preview */
.decision-preview-cursor {
  position: absolute;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #ffffff;
  z-index: 10;
  animation: cursorDecisionCycle 5s infinite cubic-bezier(0.25, 1, 0.5, 1);
}

.decision-preview-cursor span {
  font-size: 20px;
  line-height: 1;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

@keyframes cursorDecisionCycle {
  /* Green target click */
  0% { left: 70px; top: 60px; transform: translate(-35%, -15%) scale(1); }
  12%, 18% { left: 70px; top: 60px; transform: translate(-35%, -15%) scale(0.85); }
  24% { left: 70px; top: 60px; transform: translate(-35%, -15%) scale(1); }
  
  /* Hold on Red (retreat / withhold) */
  35% { left: 210px; top: 60px; transform: translate(-35%, -15%) scale(1); }
  45%, 55% { left: 210px; top: 85px; transform: translate(-35%, -15%) scale(1); opacity: 0.6; }
  
  /* Yellow target click */
  68% { left: 350px; top: 60px; transform: translate(-35%, -15%) scale(1); opacity: 1; }
  80%, 86% { left: 350px; top: 60px; transform: translate(-35%, -15%) scale(0.85); }
  94%, 100% { left: 70px; top: 60px; transform: translate(-35%, -15%) scale(1); }
}

.decision-preview-caption {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
  max-width: 520px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

/* ── MOBILE TOUCH ACTION CONTROLS ── */
.choice-touch-controls {
  display: none;
  position: absolute;
  bottom: max(96px, calc(env(safe-area-inset-bottom, 0px) + 80px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 420px;
  gap: 14px;
  z-index: 20;
  pointer-events: auto;
}

@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  .choice-touch-controls {
    display: flex;
  }
}

.choice-touch-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 12px;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(13, 19, 31, 0.88);
  backdrop-filter: blur(12px);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, background 0.12s ease;
}

.choice-touch-btn:active {
  transform: scale(0.96);
}

.choice-touch-btn.touch-left {
  border-color: rgba(0, 255, 136, 0.4);
  color: #67f9a8;
}
.choice-touch-btn.touch-left:active {
  background: rgba(0, 255, 136, 0.22);
  border-color: #00ff88;
}

.choice-touch-btn.touch-right {
  border-color: rgba(255, 230, 0, 0.4);
  color: #fef08a;
}
.choice-touch-btn.touch-right:active {
  background: rgba(255, 230, 0, 0.22);
  border-color: #ffe600;
}

