/* Sequence Memory — only test-specific overrides */
:root { --test-accent: #3b82f6; --test-accent-soft: #bfdbfe; }
.t-intro-icon::before {
  content: 'apps';
}


/* ── STIMULUS BOX ── */
.sm-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;
  position: relative;
  overflow: hidden;
  transition: background 0.15s, border-color 0.15s;
}

.sm-box[data-state="play"] { background: var(--color-surface-container-low); }
.sm-box[data-state="input"] { background: var(--color-surface-container-low); }
.sm-box[data-state="miss"] { background: #fef2f1; }

/* Countdown Overlay */
.sm-countdown {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Lexend', sans-serif;
  font-size: 80px;
  font-weight: 800;
  color: var(--test-accent);
  background: var(--color-surface-container-low);
  z-index: 10;
}
.sm-box[data-state="countdown"] .sm-countdown {
  display: flex;
}
.sm-box[data-state="countdown"] .sm-grid {
  opacity: 0.15;
  pointer-events: none;
}

/* Grid */
.sm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 3vw, 14px);
  padding: clamp(12px, 4vw, 24px);
  width: 100%;
  max-width: 380px;
}

/* Blocks */
.sm-block {
  aspect-ratio: 1;
  background: var(--color-outline-variant);
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.1s, transform 0.08s, box-shadow 0.1s;
}

/* Play state (engine flashes) */
.sm-box[data-state="play"] .sm-block.flash {
  background: var(--test-accent);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(59,130,246, 0.3);
}

/* Input state (user clicks) */
.sm-box[data-state="input"] .sm-block {
  background: var(--color-outline-variant);
  border: 2px solid var(--color-outline-variant);
  cursor: pointer;
}
.sm-box[data-state="input"] .sm-block:hover {
  background: var(--color-outline-variant);
}
.sm-box[data-state="input"] .sm-block:active,
.sm-box[data-state="input"] .sm-block.active {
  background: var(--test-accent);
  border-color: var(--test-accent);
  transform: scale(0.95);
}

/* Miss state */
.sm-box[data-state="miss"] .sm-block { background: #fde8e8; border-color: #fca5a5; opacity: 0.5; }
.sm-box[data-state="miss"] .sm-block.wrong { background: #e74c3c; border-color: #c0392b; opacity: 1; transform: scale(1.05); }
.sm-box[data-state="miss"] .sm-block.correct-missed { background: #2ecc71; border-color: #27ae60; opacity: 1; }

/* ── INTRO VISUAL EXAMPLE ── */
.sm-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 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.sm-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 78px;
  height: 78px;
}

.sm-preview-tile {
  background: var(--color-surface-container-high);
  border: 1px solid var(--color-outline);
  border-radius: 4px;
  box-sizing: border-box;
}

.sm-preview-tile.t1 { animation: smTile1Flash 5.5s infinite steps(1); }
.sm-preview-tile.t6 { animation: smTile6Flash 5.5s infinite steps(1); }
.sm-preview-tile.t8 { animation: smTile8Flash 5.5s infinite steps(1); }

@keyframes smTile1Flash {
  0%, 7% { background: var(--color-surface-container-high); border-color: var(--color-outline); }
  8%, 16% { background: var(--test-accent); border-color: transparent; }
  17%, 47% { background: var(--color-surface-container-high); border-color: var(--color-outline); }
  48%, 54% { background: var(--test-accent); border-color: transparent; }
  55%, 100% { background: var(--color-surface-container-high); border-color: var(--color-outline); }
}

@keyframes smTile6Flash {
  0%, 17% { background: var(--color-surface-container-high); border-color: var(--color-outline); }
  18%, 26% { background: var(--test-accent); border-color: transparent; }
  27%, 59% { background: var(--color-surface-container-high); border-color: var(--color-outline); }
  60%, 66% { background: var(--test-accent); border-color: transparent; }
  67%, 100% { background: var(--color-surface-container-high); border-color: var(--color-outline); }
}

@keyframes smTile8Flash {
  0%, 27% { background: var(--color-surface-container-high); border-color: var(--color-outline); }
  28%, 36% { background: var(--test-accent); border-color: transparent; }
  37%, 71% { background: var(--color-surface-container-high); border-color: var(--color-outline); }
  72%, 78% { background: var(--test-accent); border-color: transparent; }
  79%, 100% { background: var(--color-surface-container-high); border-color: var(--color-outline); }
}

.sm-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: smClickAnimate 5.5s infinite linear;
}

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

@keyframes smClickAnimate {
  0% { left: 140px; top: 90px; opacity: 0; transform: translate(-35%, -15%) scale(1.2); }
  40% { left: 140px; top: 90px; opacity: 0; transform: translate(-35%, -15%) scale(1.2); }
  
  /* Click Tile 1 (row 1, col 1) - center is x=112, y=32 */
  46% { left: 112px; top: 32px; opacity: 1; transform: translate(-35%, -15%) scale(1.2); }
  47% { left: 112px; top: 32px; opacity: 1; transform: translate(-35%, -15%) scale(1); }
  48% { left: 112px; top: 32px; opacity: 1; transform: translate(-35%, -15%) scale(0.8); }
  50% { left: 112px; top: 32px; opacity: 1; transform: translate(-35%, -15%) scale(1.1); }
  
  /* Click Tile 6 (row 2, col 3) - center is x=168, y=60 */
  58% { left: 168px; top: 60px; opacity: 1; transform: translate(-35%, -15%) scale(1.2); }
  59% { left: 168px; top: 60px; opacity: 1; transform: translate(-35%, -15%) scale(1); }
  60% { left: 168px; top: 60px; opacity: 1; transform: translate(-35%, -15%) scale(0.8); }
  62% { left: 168px; top: 60px; opacity: 1; transform: translate(-35%, -15%) scale(1.1); }
  
  /* Click Tile 8 (row 3, col 2) - center is x=140, y=88 */
  70% { left: 140px; top: 88px; opacity: 1; transform: translate(-35%, -15%) scale(1.2); }
  71% { left: 140px; top: 88px; opacity: 1; transform: translate(-35%, -15%) scale(1); }
  72% { left: 140px; top: 88px; opacity: 1; transform: translate(-35%, -15%) scale(0.8); }
  74% { left: 140px; top: 88px; opacity: 1; transform: translate(-35%, -15%) scale(1.1); }
  
  80% { left: 140px; top: 90px; opacity: 0; transform: translate(-35%, -15%) scale(1.2); }
  100% { left: 140px; top: 90px; opacity: 0; }
}

.sm-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;
  margin-bottom: 16px;
}

.sm-preview-caption .sm-highlight {
  color: var(--test-accent);
  font-weight: 700;
}

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


