/* Task Switching — only test-specific overrides */
:root { --test-accent: #e76f51; }

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

.ts-rule-badge {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: var(--text-muted) !important;
  font-family: 'Lexend', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  transition: opacity 0.2s;
  white-space: nowrap;
}

/* ── INTRO VISUAL MAPPING ── */
.ts-intro-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--test-accent-soft);
  border: 2px dashed var(--test-accent-border);
  border-radius: 16px;
  padding: 16px 8px;
  margin-bottom: 24px;
  box-sizing: border-box;
}

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

.ts-intro-shape {
  width: 44px;
  height: 44px;
  fill: var(--test-accent);
}

.ts-intro-text {
  font-family: 'Lexend', sans-serif;
  font-size: 12.5px;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
}

.ts-intro-divider {
  width: 2px;
  height: 60px;
  background: var(--test-accent-border);
}

/* Keyboard Hint */
.ts-keyboard-hint {
  font-family: 'Lexend', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
  opacity: 0.85;
}

/* ── SCORE RANGE TABLE ── */

.ts-box {
  border-radius: 18px;
  min-height: 280px !important;
  background: var(--color-surface-container-low);
  border: 2.5px dashed var(--color-outline-variant);
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.ts-shape-container {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ts-box[data-state="hit"]  { background: #edfaf4; border: 2.5px solid #2ecc71; }
.ts-box[data-state="miss"] { background: #fef2f1; border: 2.5px solid #e74c3c; }

/* SVGs for shapes instead of CSS borders */
.ts-shape {
  width: 120px;
  height: 120px;
  aspect-ratio: 1 / 1;
  display: block;
  fill: var(--test-accent);
  transition: transform 0.1s;
}
.ts-box[data-state="hit"] .ts-shape { fill: #2ecc71; transform: scale(1.1); }
.ts-box[data-state="miss"] .ts-shape { fill: #e74c3c; }

/* Switch Overlay */
.ts-overlay {
  position: absolute;
  inset: 0;
  background: rgba(231,111,81, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Manrope', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  letter-spacing: -0.02em;
}
.ts-box[data-state="switch"] .ts-overlay { opacity: 1; }

/* ── CONTROLS ── */
.ts-controls-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ts-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.ts-btn {
  width: 160px;
  height: 56px;
  background: #fff;
  border: 2px solid var(--color-outline-variant);
  border-bottom-width: 4px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: 'Lexend', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.1s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ts-btn:hover {
  border-color: var(--test-accent);
  background: var(--test-accent-soft);
  transform: translateY(-1px);
}

.ts-btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.ts-btn-shape {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ts-btn-shape svg { width: 100%; height: 100%; fill: var(--test-accent); }

/* ── DARK MODE OVERRIDES ── */
html.dark .ts-btn {
  background: var(--color-surface-container-high) !important;
  border-color: var(--color-outline) !important;
  color: var(--text) !important;
}
html.dark .ts-btn:hover {
  background: var(--test-accent-soft) !important;
  border-color: var(--test-accent) !important;
}
html.dark .ts-btn-shape svg {
  fill: var(--test-accent) !important;
}

/* ── KEYBOARD KEYS & ARROW STYLES ── */
.ts-arrow-connector {
  font-weight: 800;
  font-size: 15px;
  margin: 0 3px;
  color: var(--test-accent);
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

.t-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  background: var(--color-surface-container-high);
  border: 1.5px solid var(--color-outline);
  border-bottom-width: 3.5px;
  border-radius: 6px;
  margin: 0 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  vertical-align: middle;
  line-height: 1;
}

html.dark .t-kbd {
  background: var(--color-surface-container);
  border-color: var(--color-outline-variant);
  color: var(--text);
}

@media (max-width: 480px) {
  .ts-box {
    min-height: 200px !important;
  }
  .ts-shape {
    width: 90px;
    height: 90px;
  }
  .ts-btn {
    width: 130px;
    height: 48px;
    font-size: 13px;
    border-radius: 12px;
    gap: 8px;
  }
  .ts-btn-shape {
    width: 16px;
    height: 16px;
  }
  .t-kbd {
    min-width: 20px;
    height: 20px;
    font-size: 12px;
    border-radius: 4px;
    border-bottom-width: 2.5px;
    margin: 0 1px;
    padding: 0 3px;
  }
  .ts-arrow-connector {
    font-size: 16px;
    margin: 0 4px;
  }
  .ts-intro-visual {
    gap: 16px;
    padding: 16px 12px;
  }
  .ts-intro-text {
    font-size: 12px;
  }
  .ts-intro-shape {
    width: 44px;
    height: 44px;
  }
}
