/* 🎮 Ability Timing Stylesheet (style.css) */

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


/* ── CRISP WHITE AIM CURSOR ── */
.timing-arena,
.timing-arena canvas,
.timing-arena *,
body:has(#panelTask.active),
body:has(#panelTask.active) * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='%23ffffff' stroke='%23000000' stroke-width='1.2'/%3E%3C/svg%3E") 12 12, 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;
  display: flex !important;
  flex-direction: column !important;
}

body:has(#panelTask.active) #panelTask {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

body:has(#panelTask.active) .timing-arena {
  width: 100vw !important;
  height: calc(100vh - 48px) !important;
  min-height: calc(100vh - 48px) !important;
  max-height: calc(100vh - 48px) !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

.timing-arena {
  position: relative;
  width: 100%;
  min-height: 480px;
  height: 60vh;
  max-height: 650px;
  background-color: var(--arena-bg);
  border: 1px solid var(--arena-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.05);
}

@media (max-width: 640px) {
  .timing-arena {
    min-height: 320px;
    height: 50vh;
  }
}

#webgl-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ════ MODERN SCI-FI TACTICAL RADIAL HUD ════ */
.tactical-hud-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  width: 500px;
  height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 15;
  user-select: none;
}

@media (max-width: 540px) {
  .tactical-hud-container {
    transform: translate(-50%, -50%) scale(0.85);
  }
}

@media (max-width: 440px) {
  .tactical-hud-container {
    transform: translate(-50%, -50%) scale(0.72);
  }
}

@media (max-width: 360px) {
  .tactical-hud-container {
    transform: translate(-50%, -50%) scale(0.62);
  }
}

/* Outer Telemetry Brackets */
.thud-corner {
  position: absolute;
  font-family: var(--font-mono, monospace);
  font-size: 0.65rem;
  color: rgba(0, 220, 255, 0.75);
  display: flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.thud-corner-tl { top: 0; left: 0; }
.thud-corner-tr { top: 0; right: 0; }
.thud-corner-bl { bottom: 0; left: 0; }
.thud-corner-br { bottom: 0; right: 0; }

.thud-bracket-decor {
  color: #00e5ff;
  font-weight: 800;
  font-size: 0.95rem;
}

.thud-corner-tag {
  opacity: 0.9;
}

/* Main Tactical SVG */
.tactical-hud-svg {
  width: 460px;
  height: 460px;
  overflow: visible;
}

/* 1. Compass Rings & Frames */
.thud-outer-dashed {
  fill: none;
  stroke: rgba(0, 220, 255, 0.22);
  stroke-width: 1;
  stroke-dasharray: 6 4 2 4;
}

.thud-compass-ring {
  fill: none;
  stroke: rgba(0, 220, 255, 0.32);
  stroke-width: 1.2;
}

.thud-cardinal-label {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  fill: rgba(0, 220, 255, 0.85);
  letter-spacing: 0.08em;
}

.thud-compass-tick {
  stroke: rgba(0, 220, 255, 0.4);
  stroke-width: 1;
  stroke-linecap: butt;
}

.thud-compass-tick.major {
  stroke: rgba(0, 220, 255, 0.85);
  stroke-width: 1.5;
}

/* 2. Track Channel Rails */
.thud-channel-rail {
  fill: none;
  stroke: rgba(0, 220, 255, 0.38);
  stroke-width: 1.2;
  transition: stroke 0.15s ease;
}

.thud-track-bg {
  stroke: rgba(4, 10, 22, 0.85);
  fill: none;
}

/* 3. Target Zone */
.thud-target-track {
  stroke: #ffffff;
  fill: none;
  stroke-linecap: butt;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
}

.thud-zone-caliper {
  stroke: #ffffff;
  stroke-width: 2.5;
  stroke-linecap: butt;
}

/* 4. Electric Cyan Sweep */
.thud-sweep-fill {
  stroke: #00d4ff;
  fill: none;
  stroke-linecap: butt;
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.7));
}

/* 5. Origin Notch */
.thud-zero-notch {
  stroke: #ffffff;
  stroke-width: 2.5;
  stroke-linecap: butt;
}

.thud-reticle-line {
  stroke: rgba(0, 220, 255, 0.35);
  stroke-width: 1;
}

/* 6. Center Digital Telemetry Overlay */
.thud-center-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.thud-tagline {
  font-family: var(--font-mono, monospace);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: rgba(0, 220, 255, 0.7);
  margin-bottom: 2px;
  text-transform: uppercase;
}

.thud-main-readout {
  font-family: var(--font-mono, monospace);
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.05em;
  line-height: 1;
  transition: all 0.12s ease;
}

.thud-status-readout {
  font-family: var(--font-display, sans-serif);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #00d4ff;
  text-transform: uppercase;
  margin-top: 4px;
  transition: color 0.15s ease;
}

/* 7. Keycap Prompt */
.thud-prompt-pill {
  position: absolute;
  bottom: -48px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(5, 12, 24, 0.95);
  border: 1px solid rgba(0, 220, 255, 0.35);
  border-radius: 6px;
  padding: 8px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
}

.thud-key-bracket {
  font-family: var(--font-mono, monospace);
  color: #00e5ff;
  font-weight: 700;
  font-size: 0.8rem;
}

.thud-key-cap {
  font-family: var(--font-mono, monospace);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0 2px;
}

.thud-prompt-action {
  font-family: var(--font-display, sans-serif);
  color: rgba(200, 225, 250, 0.9);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-left: 4px;
}

/* ── Flash & Feedback Animations ── */
.tactical-hud-container.flash-great {
  animation: thudPop 0.22s cubic-bezier(0.25, 1, 0.5, 1);
}

.tactical-hud-container.flash-great .thud-channel-rail {
  stroke: #00e676;
}

.tactical-hud-container.flash-great .thud-status-readout,
.tactical-hud-container.flash-great .thud-main-readout {
  color: #00e676;
  text-shadow: 0 0 12px rgba(0, 230, 118, 0.8);
}

.tactical-hud-container.flash-miss {
  animation: thudShake 0.28s cubic-bezier(0.25, 1, 0.5, 1);
}

.tactical-hud-container.flash-miss .thud-channel-rail {
  stroke: #ff1744;
}

.tactical-hud-container.flash-miss .thud-status-readout,
.tactical-hud-container.flash-miss .thud-main-readout {
  color: #ff1744;
  text-shadow: 0 0 12px rgba(255, 23, 68, 0.8);
}

@keyframes thudPop {
  0%   { transform: translate(-50%, -50%) scale(1); }
  45%  { transform: translate(-50%, -50%) scale(1.04); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes thudShake {
  0%, 100% { transform: translate(-50%, -50%); }
  20%  { transform: translate(calc(-50% + 7px), -50%); }
  60%  { transform: translate(calc(-50% - 7px), -50%); }
}

/* Minimalist Top HUD Bar */
.top-header {
  position: absolute;
  top: 14px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
  pointer-events: none;
}

.round-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 16, 30, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  padding: 6px 14px;
  font-family: var(--font-display, inherit);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  backdrop-filter: blur(8px);
}

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

.restart-pill,
.wm-restart-btn {
  pointer-events: auto;
  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;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display, inherit);
  backdrop-filter: blur(12px);
  transition: all 0.15s ease;
}

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

/* Floating Feedback Text */
.floating-text {
  position: absolute;
  pointer-events: none;
  font-family: var(--font-display, sans-serif);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  transform: translate(-50%, -50%);
  animation: floatUpFade 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 100;
}

@keyframes floatUpFade {
  0% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -45px) scale(0.95); }
}

/* ════ INTRO PREVIEW DIAL (ANIMATED & CALIBRATED) ════ */
.timing-preview-box {
  width: 340px;
  max-width: 100%;
  height: 140px;
  margin: 32px auto 0;
  background: radial-gradient(ellipse at center, rgba(10, 24, 48, 0.8) 0%, rgba(6, 12, 24, 0.98) 100%);
  border: 1.5px solid var(--color-outline);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(0, 240, 255, 0.06);
}

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

.timing-preview-box::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%; height: 1px;
  background: rgba(0, 240, 255, 0.15);
}

.timing-preview-box::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 50%; width: 1px;
  background: rgba(0, 240, 255, 0.15);
}

.preview-tactical-hud {
  width: 120px;
  height: 120px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.preview-hud-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.thud-outer-rail { fill: none; stroke: rgba(0, 240, 255, 0.25); stroke-width: 1; stroke-dasharray: 4 3; }
.thud-inner-rail { fill: none; stroke: rgba(0, 240, 255, 0.25); stroke-width: 1; }

.preview-target-track {
  stroke: #ffffff;
  fill: none;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
  animation: previewTargetPulse 4.8s infinite linear;
}

.preview-sweep-fill {
  stroke: #00f0ff;
  fill: none;
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.9));
  animation: previewSweepLine 4.8s infinite linear;
}

.preview-hud-center-text {
  position: absolute;
  font-family: var(--font-mono, monospace);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #00f0ff;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
  animation: previewCenterText 4.8s infinite linear;
}

/* Rigid standardized click cursor bounding box per AGENTS.md */
.timing-preview-cursor {
  position: absolute;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  color: #ffffff;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.9));
  /* Start near center-right target zone (R=70 on 200x200 canvas -> center 100 + 70*sin(120°)=160, 100 - 70*cos(120°)=135) */
  left: 60%;
  top: 55%;
  animation: previewCursorTap 4.8s infinite linear;
}

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

/* Synchronized 4.8s loop keyframes */
@keyframes previewSweepLine {
  0% {
    stroke-dasharray: 0 439.8;
  }
  15% {
    stroke-dasharray: 0 439.8;
  }
  55% {
    /* Sweeps clockwise to 120° (target center) ~ 146.6 on 439.8 circum */
    stroke-dasharray: 147 439.8;
  }
  75% {
    stroke-dasharray: 147 439.8;
  }
  85% {
    stroke-dasharray: 0 439.8;
  }
  100% {
    stroke-dasharray: 0 439.8;
  }
}

@keyframes previewTargetPulse {
  0%, 50% {
    stroke: #ffffff;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
  }
  55%, 70% {
    stroke: #00f0ff;
    filter: drop-shadow(0 0 12px #00f0ff);
  }
  75%, 100% {
    stroke: #ffffff;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
  }
}

@keyframes previewCursorTap {
  0%, 35% {
    left: 66%;
    top: 68%;
    transform: translate(-35%, -15%) scale(1);
    opacity: 0.7;
  }
  50% {
    left: 60%;
    top: 58%;
    transform: translate(-35%, -15%) scale(1);
    opacity: 1;
  }
  55% {
    /* Exact moment needle hits green target */
    left: 60%;
    top: 58%;
    transform: translate(-35%, -15%) scale(0.82);
    opacity: 1;
  }
  65% {
    left: 60%;
    top: 58%;
    transform: translate(-35%, -15%) scale(1);
    opacity: 1;
  }
  80%, 100% {
    left: 66%;
    top: 68%;
    transform: translate(-35%, -15%) scale(1);
    opacity: 0.7;
  }
}

@keyframes previewCenterText {
  0%, 50% {
    color: #00f0ff;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
  }
  55%, 72% {
    color: #00e676;
    text-shadow: 0 0 12px rgba(0, 230, 118, 0.9);
  }
  78%, 100% {
    color: #00f0ff;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
  }
}

.timing-preview-caption {
  font-size: 0.85rem;
  color: var(--text-muted, #94a3b8);
  text-align: center;
  max-width: 440px;
  margin: 0 auto 16px;
  line-height: 1.5;
}

/* ════ RESULT HERO & BALANCED 4-STAT GRID ════ */
.t-score-big .t-score-unit {
  color: inherit !important;
  font-size: 0.45em;
  margin-left: 4px;
}

.t-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  margin: 20px 0;
}

@media (max-width: 640px) {
  .t-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.t-stat {
  background: var(--color-surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--color-outline, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}

.t-stat-val {
  font-family: var(--font-h, 'Manrope', sans-serif);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text, #fff);
  line-height: 1.1;
  margin-bottom: 4px;
}

.t-stat-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #94a3b8);
}
