/* Sustained Attention — only test-specific overrides */
:root { --test-accent: #2a9d8f; }

.t-intro-icon::before {
  content: 'center_focus_strong';
}

/* ── PROGRESS RING HEADER ── */
.sa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.sa-title {
  font-family: 'Lexend', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.sa-timer {
  position: relative;
  width: 50px;
  height: 50px;
}
.sa-ring { width: 100%; height: 100%; }
.sa-ring-bg { fill: none; stroke: var(--color-outline); stroke-width: 3.5; }
.sa-ring-fill { 
  fill: none; 
  stroke: var(--test-accent); 
  stroke-width: 3.5; 
  stroke-linecap: round;
  transition: stroke-dasharray 1s linear;
}
.sa-time-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--test-accent);
}

/* ── STIMULUS BOX ── */
.sa-box {
  border-radius: 18px;
  min-height: 480px;
  background: var(--color-surface-container-low);
  border: 2.5px solid var(--color-outline-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.1s, border-color 0.1s, transform 0.05s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 12px;
}
.sa-box:active { transform: scale(0.98); }

.sa-box[data-state="idle"] { background: var(--color-surface-container-low); }
.sa-box[data-state="active"] { background: #ffffff; }
.sa-box[data-state="hit"]  { background: #edfaf4; }
.sa-box[data-state="miss"] { background: #fef2f1; }

/* The flashing letter */
.sa-letter {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(80px, 15vw, 130px);
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.sa-box[data-state="hit"] .sa-letter { color: #2ecc71; }
.sa-box[data-state="miss"] .sa-letter { color: #e74c3c; }

/* ── INTRO VISUAL MAPPING ── */
.sa-intro-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: #f2fbfa;
  border: 2px dashed #bfe7e2;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.sa-intro-rule {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sa-intro-shape {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #ffffff;
  border: 2px solid var(--color-outline-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Manrope', sans-serif;
  font-weight: 900;
  font-size: 32px;
  color: var(--text);
}

.sa-intro-text {
  font-family: 'Lexend', sans-serif;
  font-size: 15px;
  color: var(--text);
  text-align: center;
}

.sa-intro-divider {
  color: var(--color-outline-variant);
}

/* ── DARK MODE OVERRIDES ── */
html.dark .sa-intro-shape {
  background: var(--color-surface-container-high) !important;
  border-color: var(--color-outline) !important;
  color: var(--text) !important;
}

@media (max-width: 480px) {
  .sa-box {
    min-height: 320px;
  }
}

/* ── SUSTAINED ATTENTION PREVIEW ANIMATIONS ── */
.sa-preview-arena {
  position: relative;
  width: 280px;
  height: 120px;
  background: color-mix(in srgb, var(--test-accent) 2%, rgba(0,0,0,0.35));
  border: 1.5px solid var(--color-outline);
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

html.light .sa-preview-arena {
  background: color-mix(in srgb, var(--test-accent) 4%, rgba(0,0,0,0.04));
}

.sa-preview-box {
  width: 52px;
  height: 52px;
  background: var(--color-surface-container-high);
  border: 1.5px solid var(--color-outline);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

html.dark .sa-preview-box {
  background: var(--color-surface-container-high) !important;
}

.sa-preview-letter {
  font-family: var(--font-h);
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
  animation: saLetterAnimate 5.2s infinite steps(1);
}

.sa-preview-letter::after {
  content: 'X';
  animation: saLetterTextAnimate 5.2s infinite steps(1);
}

@keyframes saLetterAnimate {
  0%, 9% { opacity: 0; }
  10%, 38% { opacity: 1; }
  39%, 47% { opacity: 0; }
  48%, 84% { opacity: 1; }
  85%, 100% { opacity: 0; }
}

@keyframes saLetterTextAnimate {
  0%, 38% { content: 'X'; }
  39%, 100% { content: 'A'; }
}

.sa-preview-click {
  position: absolute;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  pointer-events: none;
  z-index: 10;
  animation: saClickAnimate 5.2s infinite linear;
}

.sa-preview-click span {
  font-size: 20px;
  line-height: 1;
  display: block;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

@keyframes saClickAnimate {
  0%, 11% { left: 140px; top: 60px; opacity: 0; transform: translate(-35%, -15%) scale(1.2); }
  22% { left: 140px; top: 60px; opacity: 1; transform: translate(-35%, -15%) scale(1.2); }
  24% { left: 140px; top: 60px; opacity: 1; transform: translate(-35%, -15%) scale(0.8); }
  28% { left: 140px; top: 60px; opacity: 1; transform: translate(-35%, -15%) scale(1); }
  34% { left: 140px; top: 60px; opacity: 0; transform: translate(-35%, -15%) scale(1.2); }
  
  47%, 49% { left: 140px; top: 60px; opacity: 0; transform: translate(-35%, -15%) scale(1.2); }
  58% { left: 115px; top: 60px; opacity: 0.5; transform: translate(-35%, -15%) scale(1.2); }
  76% { left: 115px; top: 60px; opacity: 0.5; transform: translate(-35%, -15%) scale(1.2); }
  82%, 100% { left: 140px; top: 60px; opacity: 0; transform: translate(-35%, -15%) scale(1.2); }
}

.sa-preview-status {
  position: absolute;
  bottom: 12px;
  font-family: var(--font-h);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  color: #ffffff;
  animation: saStatusAnimate 5.2s infinite steps(1);
}

@keyframes saStatusAnimate {
  0%, 23% { opacity: 0; }
  24%, 38% {
    opacity: 1;
    background: #10b981;
  }
  39%, 57% { opacity: 0; }
  58%, 84% {
    opacity: 1;
    background: #f59e0b;
  }
  85%, 100% { opacity: 0; }
}

.sa-preview-status::after {
  content: 'Click!';
  animation: saStatusTextAnimate 5.2s infinite steps(1);
}

@keyframes saStatusTextAnimate {
  0%, 38% { content: 'Click!'; }
  39%, 100% { content: 'Ignore!'; }
}

.sa-preview-caption {
  font-family: var(--font-b);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  width: 100%;
  line-height: 1.4;
}

.sa-preview-caption .sa-highlight-go {
  color: #10b981;
  font-weight: 700;
}

.sa-preview-caption .sa-highlight-nogo {
  color: #ef4444;
  font-weight: 700;
}
