/* =========================================================================
   SPTG Pilot Aptitude Platform — Perceptual Speed Module Styling
   Number -> Adjacent Letter Visual Search under High Geometric Clutter
   ========================================================================= */

.perceptual-workspace {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 1100px) {
  .perceptual-workspace {
    grid-template-columns: 1fr;
  }
}

/* Play Column */
.perceptual-play-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.perceptual-stage-card {
  background: var(--bg-surface, #121926);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  padding: 0.85rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

/* Stage HUD Header */
.perceptual-stage-hud {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(10, 15, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.perceptual-hud-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.perceptual-hud-stat span {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #7c8ba1);
}

.perceptual-hud-stat strong {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
}

.perceptual-hud-spacer {
  flex: 1;
}

.perceptual-target-mission,
.perceptual-timer-mission {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.perceptual-target-mission span,
.perceptual-timer-mission span {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #7c8ba1);
}

.perceptual-target-badge {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 1.3rem;
  font-weight: 800;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.15);
  padding: 0.1rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  letter-spacing: 0.08em;
  animation: pulse-glow 2s infinite ease-in-out;
}

.perceptual-timer-mission strong {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 1.25rem;
  font-weight: 700;
  color: #f7bf2a;
}

/* Prompt Banner */
.perceptual-prompt-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(16, 26, 46, 0.95), rgba(22, 38, 68, 0.95));
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  margin-bottom: 0.75rem;
}

.perceptual-prompt-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.perceptual-prompt-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted, #7c8ba1);
}

.perceptual-prompt-target-box {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.2rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 229, 255, 0.5);
}

.perceptual-prompt-target-box .label {
  font-size: 0.75rem;
  color: var(--text-secondary, #a0aec0);
  text-transform: uppercase;
}

.perceptual-prompt-target-box .val {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.05em;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}

.perceptual-prompt-instruction {
  font-size: 0.8rem;
  color: var(--text-secondary, #94a3b8);
}

/* Canvas Wrap & SVG Field */
.perceptual-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1180 / 700;
  background: radial-gradient(circle at center, #0f172a 0%, #080c14 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

.perceptual-svg-field {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  cursor: crosshair;
}

/* SVG Shape Aesthetics */
.perceptual-shape-item {
  transition: opacity 0.2s ease, filter 0.2s ease;
  cursor: pointer;
}

.perceptual-shape-item:hover .shape-bg {
  stroke-width: 2.5;
  stroke: #00e5ff;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.5));
}

.shape-bg {
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 1.5;
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.shape-circle { fill: rgba(30, 41, 59, 0.78); stroke: rgba(148, 163, 184, 0.55); }
.shape-square { fill: rgba(24, 39, 66, 0.78); stroke: rgba(56, 189, 248, 0.55); }
.shape-triangle { fill: rgba(43, 30, 60, 0.78); stroke: rgba(192, 132, 252, 0.55); }
.shape-pentagon { fill: rgba(19, 42, 40, 0.78); stroke: rgba(52, 211, 153, 0.55); }
.shape-hexagon { fill: rgba(44, 38, 22, 0.78); stroke: rgba(251, 191, 36, 0.55); }

.shape-badge-bg {
  fill: rgba(0, 0, 0, 0.75);
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 0.75;
}

.shape-text-number {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 15px;
  font-weight: 700;
  fill: #ffffff;
  text-anchor: middle;
  dominant-baseline: central;
}

.shape-text-letter {
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 17px;
  font-weight: 800;
  fill: #00e5ff;
  text-anchor: middle;
  dominant-baseline: central;
}

/* Hint highlight pulse */
.perceptual-hint-ring {
  fill: none;
  stroke: #f7bf2a;
  stroke-width: 3.5;
  stroke-dasharray: 6 4;
  animation: rotate-hint 4s linear infinite, pulse-hint 1.2s ease-in-out infinite alternate;
}

@keyframes rotate-hint {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse-hint {
  from { opacity: 0.4; stroke-width: 2.5; }
  to { opacity: 1.0; stroke-width: 5; }
}

/* Answer Bar */
.perceptual-answer-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.perceptual-choice-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 52px;
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary, #1a2333);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--text-primary, #ffffff);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.perceptual-choice-btn .letter {
  font-family: var(--font-display, 'Orbitron', var(--font-sans), sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #00e5ff;
}

.perceptual-choice-btn .shortcut {
  font-size: 0.65rem;
  color: var(--text-muted, #7c8ba1);
}

.perceptual-choice-btn:hover:not(:disabled) {
  background: rgba(0, 229, 255, 0.18);
  border-color: #00e5ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 229, 255, 0.25);
}

.perceptual-choice-btn:active:not(:disabled) {
  transform: translateY(0);
}

.perceptual-choice-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Feedback flashes */
.perceptual-choice-btn.flash-correct {
  background: rgba(32, 197, 109, 0.4) !important;
  border-color: #20c56d !important;
  box-shadow: 0 0 18px rgba(32, 197, 109, 0.6) !important;
}

.perceptual-choice-btn.flash-wrong {
  background: rgba(255, 77, 79, 0.4) !important;
  border-color: #ff4d4f !important;
  box-shadow: 0 0 18px rgba(255, 77, 79, 0.6) !important;
}

/* Footer & Hints */
.perceptual-stage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding: 0 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted, #7c8ba1);
}

.perceptual-feedback {
  font-style: italic;
}

.perceptual-hotkey-strip {
  display: flex;
  gap: 0.6rem;
}

.perceptual-hotkey-strip kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
}

/* Sidebar Styling */
.perceptual-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.perceptual-side-card {
  background: var(--bg-surface, #121926);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  padding: 1rem;
}

.perceptual-side-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.perceptual-side-card-head h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.perceptual-section-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #00e5ff;
  display: block;
}

.perceptual-state-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.perceptual-state-badge[data-state="active"] {
  background: rgba(32, 197, 109, 0.2);
  color: #20c56d;
  border-color: rgba(32, 197, 109, 0.4);
}

.perceptual-state-badge[data-state="paused"] {
  background: rgba(247, 191, 42, 0.2);
  color: #f7bf2a;
  border-color: rgba(247, 191, 42, 0.4);
}

.perceptual-preset-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
  color: var(--text-muted, #7c8ba1);
}

.perceptual-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.perceptual-preset-btn {
  background: var(--bg-tertiary, #1a2333);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #cbd5e1);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.perceptual-preset-btn small {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-muted, #7c8ba1);
}

.perceptual-preset-btn:hover {
  border-color: rgba(0, 229, 255, 0.4);
  color: #ffffff;
}

.perceptual-preset-btn.active {
  background: rgba(0, 229, 255, 0.15);
  border-color: #00e5ff;
  color: #ffffff;
}

.perceptual-control-block {
  margin-bottom: 0.65rem;
}

.perceptual-control-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  color: var(--text-secondary, #cbd5e1);
}

.perceptual-control-label output {
  font-family: var(--font-mono, monospace);
  color: #00e5ff;
}

/* Disclosure dropdowns */
.perceptual-disclosure {
  background: var(--bg-surface, #121926);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  overflow: hidden;
}

.perceptual-disclosure summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  font-size: 0.8rem;
  user-select: none;
}

.perceptual-disclosure summary::-webkit-details-marker {
  display: none;
}

.perceptual-disclosure-icon {
  font-size: 0.9rem;
}

.perceptual-disclosure summary span:nth-child(2) {
  flex: 1;
}

.perceptual-disclosure summary small {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted, #7c8ba1);
}

.perceptual-disclosure-chevron {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.perceptual-disclosure[open] .perceptual-disclosure-chevron {
  transform: rotate(180deg);
}

.perceptual-disclosure-body {
  padding: 0.75rem 0.85rem 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.perceptual-help-list {
  padding-left: 1.1rem;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-secondary, #cbd5e1);
}

.perceptual-help-list li {
  margin-bottom: 0.35rem;
}

/* Action Dock */
.perceptual-action-dock {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Results & Countdown Overlays */
.perceptual-countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 26, 0.88);
  backdrop-filter: blur(4px);
  z-index: 50;
  font-family: var(--font-display, 'Orbitron', monospace);
  font-size: 5rem;
  font-weight: 900;
  color: #00e5ff;
  text-shadow: 0 0 30px rgba(0, 229, 255, 0.8);
}

.perceptual-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(6px);
  z-index: 40;
  padding: 1rem;
}

.perceptual-modal-card {
  background: var(--bg-surface, #121926);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.perceptual-modal-card h2 {
  font-size: 1.35rem;
  margin: 0.25rem 0 0.75rem;
}

.perceptual-result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin: 1rem 0;
  text-align: left;
}

.perceptual-result-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}

.perceptual-result-item span {
  font-size: 0.68rem;
  color: var(--text-muted, #7c8ba1);
  text-transform: uppercase;
}

.perceptual-result-item strong {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 1.15rem;
  color: #00e5ff;
}

.perceptual-letter-breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
