/* /attention-test: the Clarus Attention Test game, in the landing pages' grey card style (landing.css).
   Mobile first; works at 360 px. Light only, like the rest of the site. */

.at-game { --at-ink: #1d1d1f; --at-muted: #6e6e73; --at-line: #dcdce1; --at-blue: #0071e3;
  --at-pad: #C4C4C7; --at-green: #34C759; --at-green-ink: #248A3D; --at-orange-ink: #C93400; --at-answer: #0081FF;
  min-height: 560px; }
.at-game :where(h1, h2)[tabindex="-1"]:focus { outline: none; }

.at-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.at-screen { max-width: 600px; margin: 0 auto; }
.at-screen[hidden] { display: none; }
.at-intro { max-width: 820px; }

.at-game h2 {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: clamp(26px, 2.2vw + 16px, 34px); font-weight: 600; line-height: 1.15; letter-spacing: -0.5px;
  color: var(--at-ink); margin: 0 0 12px;
}

/* ---------- Buttons ---------- */
.at-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 28px; border: 0; border-radius: 980px; cursor: pointer;
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 17px; font-weight: 600; line-height: 1.2;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
.at-btn:focus-visible, .at-key:focus-visible, .at-pad:focus-visible { outline: 3px solid var(--at-blue); outline-offset: 3px; }
.at-btn-primary { background: var(--at-blue); color: #fff; }
.at-btn-primary:hover { background: #0064cc; }
.at-btn-secondary { background: transparent; color: var(--at-blue); box-shadow: inset 0 0 0 1.5px var(--at-blue); }
.at-btn-secondary:hover { background: rgba(0, 113, 227, 0.06); }
.at-btn-big { min-height: 54px; min-width: 220px; font-size: 18px; margin-top: 28px; }

/* ---------- Intro ---------- */
.at-challenge {
  display: inline-block; margin: 24px auto 0; padding: 10px 18px; border-radius: 980px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--at-line);
  font-size: 16px; font-weight: 600; color: var(--at-ink); line-height: 1.4; max-width: 100%; overflow-wrap: anywhere;
}
.at-challenge[hidden] { display: none; }
.at-parts {
  list-style: none; margin: 28px auto 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: minmax(0, 1fr); max-width: 760px; text-align: left;
}
.at-parts li {
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center;
  border: 1px solid var(--at-line); border-radius: 16px; padding: 14px 16px; background: transparent;
}
.at-part-num {
  grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; background: #fff;
  box-shadow: inset 0 0 0 1px var(--at-line); display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 16px; color: var(--at-ink); font-variant-numeric: tabular-nums;
}
.at-parts strong { font-size: 17px; font-weight: 600; color: var(--at-ink); }
.at-parts li > span:last-child { font-size: 15px; color: var(--at-muted); line-height: 1.4; }
/* Level picker: a segmented control (a radio group of three buttons). */
.at-level { margin: 24px auto 0; max-width: 420px; }
.at-level-label { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--at-muted); letter-spacing: 0.02em; }
.at-levels {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px;
  border-radius: 980px; background: #e8e8ed;
}
.at-level-btn {
  min-height: 44px; padding: 8px 10px; border: 0; border-radius: 980px; background: transparent; cursor: pointer;
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px; font-weight: 600; color: var(--at-muted);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background-color 0.15s ease, color 0.15s ease;
}
.at-level-btn:hover { color: var(--at-ink); }
.at-level-btn[aria-checked="true"] { background: #fff; color: var(--at-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.at-level-btn:focus-visible { outline: 3px solid var(--at-blue); outline-offset: 2px; }
.at-level-hint { margin: 10px auto 0; min-height: 2.8em; font-size: 15px; line-height: 1.4; color: var(--at-muted); }
.at-level + .at-btn-big { margin-top: 16px; }
/* The best (and last) score saved on this device, under the Start button. */
.at-stored {
  margin: 20px auto 0; max-width: 420px; padding: 14px 12px 10px; border-radius: 16px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--at-line); text-align: center;
}
.at-stored[hidden] { display: none; }
.at-stored-best { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 8px; }
.at-stored-label { font-size: 14px; font-weight: 600; color: var(--at-muted); letter-spacing: 0.02em; }
.at-stored-score { font-size: 20px; font-weight: 600; color: var(--at-ink); font-variant-numeric: tabular-nums; }
.at-stored-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.at-stored-actions .at-btn { flex: 1 1 auto; padding: 8px 14px; }
.at-btn-small { min-height: 40px; padding: 8px 16px; font-size: 15px; }
.at-stored-last { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--at-muted); }
.at-nowrap { white-space: nowrap; }
.at-link-btn {
  display: inline; min-height: 0; padding: 4px 2px; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--at-blue); text-decoration: underline; text-underline-offset: 2px;
  -webkit-tap-highlight-color: transparent;
}
.at-link-btn:hover { color: #0064cc; }
.at-link-btn:focus-visible { outline: 3px solid var(--at-blue); outline-offset: 2px; border-radius: 4px; }
.at-stored-forget { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 500; color: var(--at-muted); }
.at-disclaimer { margin: 20px auto 0; font-size: 13px; line-height: 1.4; color: var(--at-muted); }
.at-noscript-note { margin: 16px auto 0; font-size: 15px; color: var(--at-orange-ink); }

/* ---------- Between parts ---------- */
.at-kicker { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--at-muted); letter-spacing: 0.02em; }
.at-inter, .at-invalid { padding: 24px 0 8px; }
.at-inter-text { margin: 0 auto; max-width: 52ch; font-size: 18px; line-height: 1.5; color: var(--at-muted); }
.at-inter-note {
  margin: 16px auto 0; max-width: 52ch; padding: 10px 14px; border-radius: 12px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--at-line); font-size: 15px; color: var(--at-ink);
}

/* ---------- Playing ---------- */
.at-play-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.at-game .at-play-title { font-size: 20px; letter-spacing: -0.2px; margin: 0; text-align: left; }
.at-clock {
  flex: none; min-width: 64px; padding: 6px 14px; border-radius: 980px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--at-line); font-size: 17px; font-weight: 600; color: var(--at-ink);
  font-variant-numeric: tabular-nums; text-align: center;
}

/* Reaction pad: the whole panel is the target; it never selects text, zooms or scrolls the page. */
.at-pad {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  width: 100%; height: clamp(300px, 52vh, 440px); padding: 16px; margin: 0;
  border: 1px solid var(--at-line); border-radius: 22px; background: #fff; color: var(--at-ink); cursor: pointer;
  font: inherit; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: contain;
}
/* The dot: game.js sets its size and place per level (reaction.js dotLayout), above the label band at the bottom. */
.at-pad-circle {
  position: absolute; left: calc(50% - 70px); top: calc(50% - 102px); display: block; width: 140px; height: 140px;
  border-radius: 50%; background: var(--at-pad); pointer-events: none;
}
/* A moving dot (Normal, Hard) shows only while it is up; there is no grey spot that gives the next place away. */
.at-pad[data-dot="random"]:not([data-state="dot"]) .at-pad-circle { visibility: hidden; }
/* No transition on the dot: it must be fully green on the frame it is timed from. */
.at-pad[data-state="dot"] .at-pad-circle { background: var(--at-green); }
.at-pad[data-state="result"] .at-pad-circle,
.at-pad[data-state="tooEarly"] .at-pad-circle,
.at-pad[data-state="missed"] .at-pad-circle { background: #E3E3E6; }
.at-pad-label {
  position: absolute; left: 12px; right: 12px; bottom: 16px;
  display: block; min-height: 1.3em; font-size: 24px; font-weight: 600; line-height: 1.3;
  font-variant-numeric: tabular-nums; color: var(--at-ink);
}
.at-pad[data-state="wait"] .at-pad-label { color: var(--at-muted); font-weight: 500; }
.at-pad[data-state="dot"] .at-pad-label { color: var(--at-green-ink); }
.at-pad[data-state="tooEarly"] .at-pad-label,
.at-pad[data-state="missed"] .at-pad-label { color: var(--at-orange-ink); }

.at-last { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 14px; }
.at-last-head { font-size: 14px; color: var(--at-muted); }
.at-last-list { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.at-last-list li {
  min-width: 70px; padding: 5px 10px; border-radius: 980px; background: #fff; box-shadow: inset 0 0 0 1px var(--at-line);
  font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--at-ink); text-align: center;
}

/* Digit memory */
.at-mem-board {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  min-height: 170px; padding: 20px 10px; border: 1px solid var(--at-line); border-radius: 22px; background: #fff;
}
.at-mem-row { display: flex; justify-content: center; gap: 6px; width: 100%; min-height: 56px; margin: 0; }
.at-slot {
  flex: 0 1 44px; min-width: 0; height: 56px; display: flex; align-items: center; justify-content: center;
  font-size: clamp(26px, 7.5vw, 40px); font-weight: 500; line-height: 1; color: var(--at-ink);
  font-variant-numeric: tabular-nums; border-bottom: 2px solid transparent;
}
.at-mem-board[data-state="entering"] .at-slot { border-bottom-color: var(--at-pad); }
.at-mem-board[data-state="entering"] .at-slot:not(.is-empty) { border-bottom-color: var(--at-ink); }
.at-mem-caption { margin: 0; font-size: 16px; color: var(--at-muted); font-weight: 500; }
.at-mem-board[data-state="right"] .at-slot, .at-mem-board[data-state="right"] .at-mem-caption { color: var(--at-green-ink); }
.at-mem-board[data-state="wrong"] .at-slot, .at-mem-board[data-state="wrong"] .at-mem-caption { color: var(--at-orange-ink); }
.at-mem-board[data-state="right"] .at-mem-caption, .at-mem-board[data-state="wrong"] .at-mem-caption { font-weight: 700; font-size: 18px; }

.at-keypad {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 360px; margin: 16px auto 0;
}
.at-key {
  height: 58px; border: 1px solid var(--at-line); border-radius: 14px; background: #fff; color: var(--at-ink);
  font-family: inherit; font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color 0.1s ease, opacity 0.15s ease;
}
.at-key:active { background: #e8e8ed; }
.at-key-del { font-size: 22px; }
.at-keypad.is-idle .at-key { opacity: 0.4; cursor: default; pointer-events: none; }

/* Rule switch */
.at-rule-board {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 230px; padding: 20px 12px; border: 1px solid var(--at-line); border-radius: 22px; background: #fff;
}
.at-rule-question { margin: 0; min-height: 1.4em; font-size: 20px; font-weight: 500; color: var(--at-muted); line-height: 1.4; }
.at-rule-digit {
  margin: 0; min-height: 1em; font-size: clamp(88px, 22vw, 120px); font-weight: 600; line-height: 1;
  color: var(--at-ink); font-variant-numeric: tabular-nums;
}
.at-rule-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.at-btn-answer {
  min-height: 64px; padding: 12px; border-radius: 18px; background: var(--at-answer); color: #fff; font-size: 20px;
}
.at-btn-answer:hover { background: #0072e0; }
.at-btn-answer.is-pressed { background: #0062c4; }
.at-btn-answer.is-idle { opacity: 0.4; cursor: default; }
.at-kbd {
  display: inline-block; min-width: 26px; padding: 2px 7px; border-radius: 7px; background: rgba(255, 255, 255, 0.22);
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.4;
}
.at-is-phone .at-kbd { display: none; }

/* ---------- Result ---------- */
.at-result { max-width: 760px; }
.at-game .at-score {
  font-size: clamp(44px, 6vw + 20px, 76px); font-weight: 700; letter-spacing: -1px; line-height: 1.05; margin: 0 0 6px;
}
.at-score span { font-variant-numeric: tabular-nums; }
.at-game .at-score .at-score-level { font-size: 0.42em; font-weight: 600; letter-spacing: -0.2px; color: var(--at-muted); white-space: nowrap; }
.at-bonus {
  display: block; width: fit-content; margin: 10px auto 0; padding: 4px 12px; border-radius: 980px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--at-line); font-size: 15px; font-weight: 600; color: var(--at-ink);
}
.at-bonus[hidden] { display: none; }
.at-band { margin: 0; font-size: 21px; font-weight: 600; color: var(--at-muted); }
.at-vs {
  display: inline-block; margin: 16px auto 0; padding: 8px 16px; border-radius: 980px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--at-line); font-size: 16px; font-weight: 600; color: var(--at-ink); overflow-wrap: anywhere;
}
.at-vs[hidden] { display: none; }
.at-tiles { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); text-align: left; }
.at-tiles li {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 12px; row-gap: 4px;
  border: 1px solid var(--at-line); border-radius: 16px; padding: 14px 18px;
}
.at-tile-name { font-size: 17px; font-weight: 600; color: var(--at-ink); }
.at-tile-score { font-size: 28px; font-weight: 700; color: var(--at-ink); font-variant-numeric: tabular-nums; }
.at-tile-raw { grid-column: 1 / -1; font-size: 14px; line-height: 1.4; color: var(--at-muted); font-variant-numeric: tabular-nums; }
.at-pct { margin: 20px auto 0; font-size: 17px; color: var(--at-ink); }
.at-beta { font-size: 13px; color: var(--at-muted); }
.at-share { margin: 24px auto 0; }
.at-share:empty { display: none; }
.at-result > .at-btn-secondary { margin-top: 24px; }
.at-cta {
  margin: 28px auto 0; padding: 22px 20px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--at-line);
}
.at-cta-text { margin: 0 0 14px; font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--at-ink); }

/* The leaderboard: board.js draws its own grey cards inside; the section only spaces it like a card. */
.at-board-section { max-width: 1100px; width: calc(100% - 24px); margin: var(--lp-gap) auto 0; }
.at-board-section:has(#at-board:empty) { display: none; }
@media (max-width: 768px) { .at-board-section { width: calc(100% - 64px); } }
@media (max-width: 480px) { .at-board-section { width: calc(100% - 48px); } }

@media (min-width: 640px) {
  .at-parts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .at-parts li { grid-template-columns: 1fr; row-gap: 6px; padding: 18px 18px 16px; align-content: start; }
  .at-part-num { grid-row: auto; margin-bottom: 4px; }
  .at-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .at-tiles li { grid-template-columns: 1fr; text-align: center; padding: 18px 14px; }
  .at-tile-score { font-size: 34px; }
}

@media (max-width: 480px) {
  .at-game { min-height: 0; }
  .at-game.lp-hero { padding-left: 16px; padding-right: 16px; }
  .at-pad { height: clamp(260px, 48vh, 380px); }
  .at-last-list li { min-width: 60px; font-size: 14px; }
  .at-key { height: 54px; }
  .at-rule-board { min-height: 200px; }
  .at-btn-big { width: 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .at-game *, .at-game *::before, .at-game *::after { transition: none !important; animation: none !important; }
}
