/* Code Attention responsive overrides. */

@media (min-width: 721px) and (max-width: 900px) {
  .site-header {
    grid-template-columns: 48px 1fr 48px !important;
    gap: 0 !important;
    min-height: 64px !important;
    padding: 8px 12px !important;
  }

  .mobile-menu-toggle {
    grid-column: 1;
    display: flex;
    width: 48px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 0;
    box-shadow: 0 3px 10px rgba(16, 19, 24, 0.04);
  }

  .mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
    margin: 3px 0;
    transition:
      transform 0.18s ease,
      opacity 0.18s ease;
  }

  .mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .site-header .brand {
    grid-column: 2;
    justify-self: center;
    gap: 8px;
    font-size: 1.12rem;
  }

  .site-header .brand-mark {
    width: 34px;
    height: 34px;
  }

  .site-header nav,
  .site-header .user-chip,
  .site-header .header-login {
    display: none;
  }

  .mobile-menu-panel {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 64px;
    z-index: 50;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(16, 19, 24, 0.16);
  }

  .mobile-menu-links {
    display: grid;
    gap: 6px;
  }

  .mobile-menu-panel button {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    font-size: 0.98rem;
    font-weight: 850;
    padding: 0 14px;
  }

  .mobile-menu-panel .danger {
    color: var(--coral);
  }

  .mobile-menu-user {
    display: grid;
    align-content: center;
    justify-items: end;
    min-width: 118px;
    border-left: 1px solid var(--line);
    padding-left: 12px;
    color: var(--muted);
    text-align: right;
  }

  .mobile-menu-user span {
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .mobile-menu-user strong {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
    font-size: 0.98rem;
    font-weight: 900;
  }
}

/* Code Attention in-game controls: pause/play plus compact exit. */
.switching-game-actions {
  position: fixed;
  top: max(8px, calc(env(safe-area-inset-top) + 8px));
  right: max(8px, calc((100vw - 366px) / 2));
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.switching-game-actions .switching-action-button {
  appearance: none;
  box-sizing: border-box;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  position: relative;
  flex: 0 0 34px;
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  margin: 0 !important;
  padding: 0 !important;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 9px 20px rgba(17, 24, 39, 0.14);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.switching-game-actions .switching-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.18);
}

.switching-game-actions .switching-action-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.14);
}

.switching-game-actions .switching-action-button:focus-visible {
  outline: 3px solid rgba(21, 196, 180, 0.26);
  outline-offset: 2px;
}

.switching-game-actions .switching-action-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.switching-game-actions .switching-exit-button {
  background: rgba(255, 255, 255, 0.96);
  color: #ef5b49;
}

.switching-game-actions .switching-exit-button:hover {
  border-color: rgba(239, 91, 73, 0.34);
  background: #fff5f3;
}

.switching-game-actions .switching-exit-button .switching-action-icon::before,
.switching-game-actions .switching-exit-button .switching-action-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 2px;
  width: 2.5px;
  height: 14px;
  border-radius: 999px;
  background: currentColor;
}

.switching-game-actions .switching-exit-button .switching-action-icon::before {
  transform: rotate(45deg);
}

.switching-game-actions .switching-exit-button .switching-action-icon::after {
  transform: rotate(-45deg);
}

.switching-game-actions .switching-pause-button {
  border-color: rgba(219, 158, 14, 0.28);
  background: linear-gradient(135deg, #ffe084, #ffbd38);
  color: #5b3b00;
}

.switching-game-actions .switching-pause-button:hover {
  border-color: rgba(219, 158, 14, 0.42);
  background: linear-gradient(135deg, #ffe69a, #ffc64c);
}

.switching-game-actions .switching-pause-button .switching-action-icon::before,
.switching-game-actions .switching-pause-button .switching-action-icon::after {
  content: "";
  position: absolute;
  top: 3px;
  width: 5px;
  height: 12px;
  border-radius: 4px;
  background: currentColor;
}

.switching-game-actions .switching-pause-button .switching-action-icon::before {
  left: 3px;
}

.switching-game-actions .switching-pause-button .switching-action-icon::after {
  right: 3px;
}

.switching-game-actions .switching-pause-button.is-paused {
  border-color: rgba(16, 175, 119, 0.34);
  background: linear-gradient(135deg, #26cf98, #11b878);
  color: #fff;
}

.switching-game-actions
  .switching-pause-button.is-paused
  .switching-action-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
  border-radius: 2px;
  background: transparent;
}

.switching-game-actions
  .switching-pause-button.is-paused
  .switching-action-icon::after {
  content: none;
}

body.switching-game-paused .trainer-play .play-grid,
body.switching-game-paused .trainer-play .play-answer-row,
body.switching-game-paused .trainer-play .switching-current-question {
  opacity: 0.88;
  filter: saturate(0.9);
}

body.switching-game-paused .trainer-play .answer {
  pointer-events: none;
}

body.trainer-play-mode .trainer-play .play-zone > span,
body.trainer-play-mode .trainer-play .play-zone > small {
  display: none !important;
}

body.trainer-play-mode .trainer-play .play-zone b.stimulus.top-left {
  top: clamp(10px, 1.6vw, 14px) !important;
  left: clamp(10px, 1.6vw, 14px) !important;
  transform: none !important;
}

body.trainer-play-mode .trainer-play .play-zone b.stimulus.top-right {
  top: clamp(10px, 1.6vw, 14px) !important;
  right: clamp(30px, 3.6vw, 38px) !important;
  transform: none !important;
}

body.trainer-play-mode .trainer-play .play-zone b.stimulus.top-center {
  top: clamp(10px, 1.6vw, 14px) !important;
}

main.view-spatial-memory
  > :not(.site-header):not(#spatial-memory-trainer-screen) {
  display: none !important;
}

main.view-spatial-memory {
  min-height: 100vh;
  background: #fff;
}

body.spatial-memory-play-mode .site-header,
body.spatial-memory-play-mode .install-app-banner {
  display: none !important;
}

.trainer-tile-spatial-memory .trainer-tile-art {
  background:
    radial-gradient(
      circle at 80% 18%,
      rgba(255, 255, 255, 0.34) 0 8px,
      transparent 9px
    ),
    linear-gradient(135deg, #061237 0%, #259df2 52%, #05c8bd 100%);
}

.trainer-tile-spatial-memory .trainer-tile-art:before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 48%),
    radial-gradient(
      circle at 20% 78%,
      rgba(255, 224, 132, 0.48) 0 8px,
      transparent 9px
    );
}

.trainer-tile-spatial-memory .trainer-tile-art:after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -34px;
  width: 136px;
  height: 136px;
  border: 18px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.spatial-tile-grid {
  position: absolute;
  left: 18px;
  top: 18px;
  display: grid;
  width: 146px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  transform: rotate(-5deg);
}

.spatial-tile-grid i {
  display: block;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.spatial-tile-grid i.flash {
  background: #ffe084;
  box-shadow:
    0 0 0 4px rgba(255, 224, 132, 0.2),
    0 12px 26px rgba(255, 189, 56, 0.28);
}

.spatial-tile-path {
  position: absolute;
  right: 18px;
  bottom: 15px;
  z-index: 1;
  display: flex;
  gap: 6px;
}

.spatial-tile-path b {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #071238;
  font-size: 0.9rem;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(7, 18, 56, 0.22);
}

#spatial-memory-trainer-screen {
  color: #071238;
}

#spatial-memory-trainer-screen .switch-screen {
  box-sizing: border-box;
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(14px, 2.2vh, 22px) 0 clamp(24px, 4vh, 40px);
  display: grid;
  gap: 12px;
}

#spatial-memory-trainer-screen .switch-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  align-items: center;
  gap: 12px;
  min-height: 0;
  margin: 0;
}

#spatial-memory-trainer-screen .switch-hero-copy {
  display: grid;
  justify-items: start;
  gap: 10px;
}

#spatial-memory-trainer-screen .switch-kicker {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid #dce6f6;
  border-radius: 999px;
  background: #fff;
  padding: 0 13px;
  color: #04a99f;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: 0 12px 28px rgba(42, 76, 145, 0.1);
}

#spatial-memory-trainer-screen .sw-icon {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
}

#spatial-memory-trainer-screen .spatial-sw-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
}

#spatial-memory-trainer-screen .spatial-sw-grid i {
  display: block;
  border-radius: 4px;
  background: currentColor;
}

#spatial-memory-trainer-screen .switch-hero h1 {
  margin: 0;
  color: #071238;
  font-size: clamp(2.35rem, 5.4vw, 3.15rem);
  line-height: 0.94;
  font-weight: 950;
  letter-spacing: 0;
}

#spatial-memory-trainer-screen .switch-rainbow {
  display: block;
  width: min(300px, 100%);
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #12c7bf 0%,
    #37a2f5 40%,
    #8954ee 68%,
    #f6b24a 100%
  );
}

#spatial-memory-trainer-screen .switch-hero p {
  max-width: 410px;
  margin: 0;
  color: #4f6389;
  font-size: clamp(0.92rem, 1.35vw, 1.04rem);
  line-height: 1.38;
  font-weight: 560;
}

#spatial-memory-trainer-screen .switch-brain {
  justify-self: end;
  width: clamp(190px, 29vw, 240px);
  max-width: 100%;
  filter: drop-shadow(0 24px 36px rgba(96, 77, 220, 0.16));
}

#spatial-memory-trainer-screen .switch-card,
#spatial-memory-trainer-screen .switch-about {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(52, 81, 145, 0.08);
}

#spatial-memory-trainer-screen .switch-card {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

#spatial-memory-trainer-screen .switch-card h2,
#spatial-memory-trainer-screen .switch-about h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #071238;
  font-size: 1.06rem;
  line-height: 1.16;
  font-weight: 920;
  letter-spacing: 0;
}

#spatial-memory-trainer-screen .switch-about h2 span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 2px solid #75aef7;
  border-radius: 50%;
  background: #f4f9ff;
  color: #4d9af0;
  font-size: 0.82rem;
  font-weight: 880;
}

#spatial-memory-trainer-screen .switch-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#spatial-memory-trainer-screen .switch-options button {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 52px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d9e3f1;
  border-radius: 8px;
  background: #fff;
  color: #071238;
  padding: 7px 8px;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(52, 81, 145, 0.05);
}

#spatial-memory-trainer-screen .switch-options button span {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: inherit;
  font-size: 0.96rem;
  line-height: 1;
  white-space: nowrap;
}

#spatial-memory-trainer-screen .switch-options button span strong {
  color: inherit;
  font-size: 1.28rem;
  line-height: 1;
  font-weight: 950;
}

#spatial-memory-trainer-screen .switch-options-mode button strong {
  color: inherit;
  font-size: 1.03rem;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

#spatial-memory-trainer-screen .switch-options button.selected {
  border-color: #10bab2;
  background: linear-gradient(135deg, #dffbf4, #fbfffe 72%);
  color: #079e96;
  box-shadow: 0 15px 32px rgba(16, 186, 178, 0.16);
}

#spatial-memory-trainer-screen .switch-options button em {
  position: absolute;
  right: 8px;
  top: 8px;
  display: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #12c7bf, #089a94);
  box-shadow: 0 10px 22px rgba(10, 166, 158, 0.24);
}

#spatial-memory-trainer-screen .switch-options button em:after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

#spatial-memory-trainer-screen .switch-options button.selected em {
  display: block;
}

#spatial-memory-trainer-screen .spatial-setup-note {
  margin: 0;
  color: #4f6389;
  font-size: 0.88rem;
  line-height: 1.35;
  font-weight: 650;
}

#spatial-memory-trainer-screen .switch-start {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(100deg, #05c8bd 0%, #259df2 52%, #792cef 100%);
  color: #fff;
  font: inherit;
  font-size: 1.28rem;
  font-weight: 920;
  letter-spacing: 0;
  box-shadow: 0 18px 42px rgba(83, 80, 222, 0.2);
  cursor: pointer;
}

#spatial-memory-trainer-screen .switch-start .sw-icon {
  justify-self: end;
  width: 26px;
  height: 26px;
  background: currentColor;
  clip-path: polygon(
    52% 0,
    78% 20%,
    88% 45%,
    72% 45%,
    58% 73%,
    36% 95%,
    31% 68%,
    5% 63%,
    28% 42%,
    55% 28%
  );
}

#spatial-memory-trainer-screen .switch-start b {
  justify-self: end;
  width: 12px;
  height: 12px;
  margin-right: 18px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
  transform: rotate(45deg);
}

#spatial-memory-trainer-screen .switch-about {
  display: grid;
  gap: 8px;
  padding: 15px 16px;
}

#spatial-memory-trainer-screen .switch-about p {
  margin: 0;
  color: #4f6389;
  font-size: 0.92rem;
  line-height: 1.38;
  font-weight: 650;
}

#spatial-memory-trainer-screen .switch-about strong {
  color: #071238;
}

.spatial-memory-play {
  box-sizing: border-box;
  display: grid;
  width: min(760px, calc(100% - 20px));
  min-height: 100dvh;
  align-content: start;
  gap: 10px;
  margin: 0 auto;
  padding: 10px 0 14px;
  color: #071238;
}

.spatial-play-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
  gap: 8px;
}

.spatial-session,
.spatial-round {
  border: 1px solid #dfe8f5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 19, 24, 0.06);
}

.spatial-session {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
}

.spatial-session div,
.spatial-answer-timer {
  display: grid;
  gap: 5px;
}

.spatial-session span,
.spatial-round span,
.spatial-answer-timer span,
.spatial-board-head span {
  color: #4f6389;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.spatial-session strong,
.spatial-round strong,
.spatial-answer-timer strong {
  color: #071238;
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 950;
}

.spatial-session i,
.spatial-answer-timer i {
  display: block;
  height: 9px;
  border-radius: 999px;
}

.spatial-session i {
  background: linear-gradient(
    90deg,
    #17b6a6 0 var(--session-progress),
    #dfe8f5 var(--session-progress) 100%
  );
}

.spatial-round {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.spatial-round div {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: #fff;
}

.spatial-board-card {
  display: grid;
  gap: 10px;
  min-height: 0;
  border: 1px solid rgba(23, 182, 166, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(
      circle at 78% 20%,
      rgba(246, 178, 61, 0.14),
      transparent 32%
    ),
    linear-gradient(180deg, #fff, #f5fffd);
  box-shadow: 0 14px 42px rgba(16, 19, 24, 0.08);
  padding: 14px;
}

.spatial-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.spatial-board-head strong {
  color: #071238;
  font-size: 1.04rem;
  line-height: 1.1;
  font-weight: 950;
  text-align: right;
}

.spatial-answer-timer {
  border: 1px solid #dfe8f5;
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}

.spatial-answer-timer i {
  background: linear-gradient(
    90deg,
    #f6b23d 0 var(--round-progress),
    #dfe8f5 var(--round-progress) 100%
  );
}

.spatial-answer-timer:not(.active) {
  opacity: 0.72;
}

.spatial-grid {
  display: grid;
  width: min(520px, 100%);
  max-width: min(72vh, 100%);
  aspect-ratio: 1;
  grid-template-columns: repeat(var(--spatial-columns), minmax(0, 1fr));
  gap: clamp(6px, 1.2vw, 10px);
  justify-self: center;
}

.spatial-cell {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow:
    0 8px 18px rgba(16, 19, 24, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.spatial-cell span {
  display: grid;
  width: 34%;
  min-width: 24px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: clamp(0.82rem, 2.2vw, 1.1rem);
  font-weight: 950;
}

.spatial-cell:disabled {
  cursor: default;
}

.spatial-cell.is-flashing {
  border-color: #ffbd38;
  background: radial-gradient(circle at 50% 38%, #fff4c0, #ffd25c 64%, #ffbd38);
  box-shadow:
    0 0 0 5px rgba(255, 189, 56, 0.18),
    0 20px 44px rgba(255, 189, 56, 0.32);
  transform: translateY(-2px);
}

.spatial-cell.is-selected {
  border-color: #10bab2;
  background: linear-gradient(135deg, #14cabf, #259df2);
  box-shadow: 0 14px 30px rgba(37, 157, 242, 0.2);
}

.spatial-cell.is-selected span {
  background: rgba(7, 18, 56, 0.32);
}

.spatial-cell.is-solution {
  border-color: #10bab2;
  background: linear-gradient(135deg, #d8fff4, #a9e9ff);
  box-shadow:
    0 0 0 4px rgba(16, 186, 178, 0.16),
    0 14px 30px rgba(37, 157, 242, 0.18);
}

.spatial-cell.is-wrong {
  border-color: #ef5b45;
  background: linear-gradient(135deg, #ffe0da, #ffaca0);
  box-shadow:
    0 0 0 4px rgba(239, 91, 69, 0.16),
    0 14px 30px rgba(239, 91, 69, 0.18);
  transform: translateY(-2px);
}

.spatial-feedback {
  min-height: 22px;
  color: #4f6389;
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
}

.spatial-feedback.show {
  color: #079e96;
}

.spatial-play-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.spatial-play-stats span {
  display: grid;
  gap: 3px;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  color: #4f6389;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(16, 19, 24, 0.05);
}

.spatial-play-stats strong {
  color: #071238;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 950;
}

.spatial-memory-results {
  display: grid;
  width: min(860px, calc(100% - 24px));
  min-height: 100vh;
  align-content: center;
  gap: 12px;
  margin: 0 auto;
  padding: 18px 0 24px;
  color: #071238;
}

.spatial-results-head,
.spatial-result-grid article,
.spatial-round-history {
  border: 1px solid #dfe8f5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(52, 81, 145, 0.08);
}

.spatial-results-head {
  display: grid;
  gap: 8px;
  padding: 18px;
  text-align: center;
}

.spatial-results-head > span,
.spatial-result-grid span {
  color: #079e96;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.spatial-results-head h1 {
  margin: 0;
  color: #071238;
  font-size: clamp(1.9rem, 6vw, 3.2rem);
  line-height: 1;
  font-weight: 950;
}

.spatial-results-head p {
  max-width: 640px;
  margin: 0 auto;
  color: #4f6389;
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 650;
}

.spatial-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.spatial-result-grid article {
  display: grid;
  gap: 5px;
  min-height: 88px;
  padding: 13px;
}

.spatial-result-grid strong {
  min-width: 0;
  color: #071238;
  font-size: 1.42rem;
  line-height: 1;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.spatial-result-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.spatial-result-actions button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(100deg, #05c8bd 0%, #259df2 52%, #792cef 100%);
  color: #fff;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(83, 80, 222, 0.16);
}

.spatial-result-actions button:nth-child(2) {
  border: 1px solid rgba(23, 182, 166, 0.25);
  background: #fff;
  color: #147a71;
}

.spatial-result-actions button:nth-child(3) {
  border: 1px solid rgba(239, 91, 69, 0.25);
  background: #fff4f2;
  color: #d83a2e;
}

.spatial-round-history {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.spatial-round-history h2 {
  margin: 0;
  color: #071238;
  font-size: 1.12rem;
  line-height: 1.15;
  font-weight: 950;
}

.spatial-round-history p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  border-top: 1px solid #e7eef7;
  padding-top: 8px;
  color: #4f6389;
  font-size: 0.88rem;
  line-height: 1.25;
  font-weight: 760;
}

.spatial-round-history b {
  color: #071238;
}

@media (min-width: 721px) and (max-width: 900px) {
  #spatial-memory-trainer-screen .switch-screen {
    width: min(760px, calc(100% - 28px));
    gap: 10px;
    padding-top: 12px;
  }

  #spatial-memory-trainer-screen .switch-hero {
    grid-template-columns: minmax(0, 1fr) 186px;
  }

  #spatial-memory-trainer-screen .switch-brain {
    width: 186px;
  }

  #spatial-memory-trainer-screen .switch-hero h1 {
    font-size: 2.45rem;
  }

  #spatial-memory-trainer-screen .switch-hero p {
    font-size: 0.9rem;
  }

  #spatial-memory-trainer-screen .switch-card {
    padding: 12px 14px;
  }

  #spatial-memory-trainer-screen .switch-options button {
    min-height: 48px;
  }

  .spatial-grid {
    width: min(480px, 100%);
  }
}

@media (max-width: 720px) {
  .trainer-tile-spatial-memory .spatial-tile-grid {
    left: 20px;
    top: 2px;
    width: 152px;
    gap: 7px;
    transform: rotate(-4deg);
    filter: drop-shadow(0 12px 22px rgba(4, 27, 78, 0.24));
  }

  .trainer-tile-spatial-memory .spatial-tile-grid i {
    border-color: rgba(255, 255, 255, 0.58);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
  }

  .trainer-tile-spatial-memory .spatial-tile-grid i.flash {
    border-color: rgba(255, 246, 193, 0.92);
    background: linear-gradient(135deg, #fff2ad, #ffd15c);
    box-shadow:
      0 0 0 4px rgba(255, 224, 132, 0.24),
      0 14px 28px rgba(255, 189, 56, 0.38);
  }

  .trainer-tile-spatial-memory .spatial-tile-path {
    display: none;
  }

  .trainer-tile-spatial-memory .spatial-tile-path b {
    width: 27px;
    height: 27px;
    font-size: 0.82rem;
  }

  #spatial-memory-trainer-screen .switch-screen {
    width: min(390px, 100% - 20px);
    gap: 8px;
    padding: 10px 0 20px;
    overflow: hidden;
  }

  #spatial-memory-trainer-screen .switch-hero {
    grid-template-columns: minmax(0, 1fr) 101px;
    gap: 4px;
  }

  #spatial-memory-trainer-screen .switch-hero-copy {
    gap: 6px;
  }

  #spatial-memory-trainer-screen .switch-kicker {
    min-height: 28px;
    gap: 6px;
    padding: 0 9px;
    font-size: 0.66rem;
  }

  #spatial-memory-trainer-screen .sw-icon {
    width: 16px;
    height: 16px;
  }

  #spatial-memory-trainer-screen .switch-hero h1 {
    font-size: clamp(1.68rem, 7.8vw, 2.05rem);
    line-height: 0.98;
  }

  #spatial-memory-trainer-screen .switch-rainbow {
    width: min(220px, 58vw);
    height: 4px;
  }

  #spatial-memory-trainer-screen .switch-hero p {
    max-width: 232px;
    font-size: 0.72rem;
    line-height: 1.24;
  }

  #spatial-memory-trainer-screen .switch-brain {
    width: 101px;
  }

  #spatial-memory-trainer-screen .switch-card {
    gap: 8px;
    padding: 10px;
  }

  #spatial-memory-trainer-screen .switch-card h2,
  #spatial-memory-trainer-screen .switch-about h2 {
    gap: 8px;
    font-size: 0.96rem;
  }

  #spatial-memory-trainer-screen .switch-options {
    gap: 7px;
  }

  #spatial-memory-trainer-screen .switch-options button {
    min-height: 44px;
    padding: 4px;
    gap: 3px;
  }

  #spatial-memory-trainer-screen .switch-options button span {
    gap: 3px;
    font-size: 0.74rem;
  }

  #spatial-memory-trainer-screen .switch-options button span strong {
    font-size: 1.04rem;
  }

  #spatial-memory-trainer-screen .switch-options-mode button strong {
    font-size: 0.86rem;
  }

  #spatial-memory-trainer-screen .switch-options button em {
    right: 5px;
    top: 5px;
    width: 18px;
    height: 18px;
  }

  #spatial-memory-trainer-screen .switch-options button em:after {
    left: 6px;
    top: 3px;
    width: 4px;
    height: 8px;
  }

  #spatial-memory-trainer-screen .spatial-setup-note {
    font-size: 0.76rem;
    line-height: 1.28;
  }

  #spatial-memory-trainer-screen .switch-start {
    min-height: 50px;
    gap: 10px;
    font-size: 1.08rem;
  }

  #spatial-memory-trainer-screen .switch-start .sw-icon {
    width: 22px;
    height: 22px;
  }

  #spatial-memory-trainer-screen .switch-start b {
    width: 10px;
    height: 10px;
    margin-right: 13px;
    border-width: 3px;
  }

  #spatial-memory-trainer-screen .switch-about {
    padding: 11px 12px;
  }

  #spatial-memory-trainer-screen .switch-about p {
    font-size: 0.78rem;
    line-height: 1.32;
  }

  .spatial-memory-play {
    width: calc(100% - 18px);
    gap: 8px;
    padding: 8px 0 10px;
  }

  .spatial-play-top {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .spatial-session,
  .spatial-round div {
    padding: 8px 9px;
  }

  .spatial-session span,
  .spatial-round span,
  .spatial-answer-timer span,
  .spatial-board-head span {
    font-size: 0.64rem;
  }

  .spatial-session strong,
  .spatial-round strong,
  .spatial-answer-timer strong {
    font-size: 1rem;
  }

  .spatial-board-card {
    padding: 10px;
    gap: 8px;
  }

  .spatial-board-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .spatial-board-head strong {
    font-size: 0.98rem;
    text-align: left;
  }

  .spatial-answer-timer {
    padding: 8px;
  }

  .spatial-grid {
    width: min(342px, 100%);
    max-width: 100%;
    gap: 6px;
  }

  .spatial-cell {
    border-radius: 8px;
  }

  .spatial-feedback {
    min-height: 19px;
    font-size: 0.8rem;
  }

  .spatial-play-stats {
    gap: 6px;
  }

  .spatial-play-stats span {
    padding: 8px;
    font-size: 0.66rem;
  }

  .spatial-play-stats strong {
    font-size: 0.98rem;
  }

  .spatial-memory-results {
    width: calc(100% - 20px);
    align-content: start;
    gap: 10px;
    padding: 12px 0 18px;
  }

  .spatial-results-head {
    padding: 14px;
  }

  .spatial-results-head h1 {
    font-size: 2rem;
  }

  .spatial-results-head p {
    font-size: 0.84rem;
  }

  .spatial-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .spatial-result-grid article {
    min-height: 78px;
    padding: 11px;
  }

  .spatial-result-grid strong {
    font-size: 1.15rem;
  }

  .spatial-result-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .spatial-result-actions button {
    min-height: 48px;
  }

  .spatial-round-history {
    padding: 12px;
  }

  .spatial-round-history p {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    font-size: 0.82rem;
  }
}

@media (max-width: 380px) {
  #spatial-memory-trainer-screen .switch-screen {
    width: min(360px, 100% - 18px);
  }

  #spatial-memory-trainer-screen .switch-hero {
    grid-template-columns: minmax(0, 1fr) 86px;
  }

  #spatial-memory-trainer-screen .switch-brain {
    width: 86px;
  }

  #spatial-memory-trainer-screen .switch-hero h1 {
    font-size: 1.55rem;
  }

  #spatial-memory-trainer-screen .switch-hero p {
    max-width: 205px;
    font-size: 0.68rem;
  }

  #spatial-memory-trainer-screen .switch-options button {
    min-height: 40px;
  }

  #spatial-memory-trainer-screen .switch-options-mode button strong {
    font-size: 0.8rem;
  }

  .spatial-grid {
    width: min(300px, 100%);
    gap: 5px;
  }
}

/* Code Attention overlay: mode-specific player leaderboard. */
#switching-pro-overlay .switch-leaderboard {
  display: grid;
  gap: 10px;
  border-color: rgba(23, 182, 166, 0.28);
  background:
    radial-gradient(
      circle at 100% 0,
      rgba(23, 182, 166, 0.12),
      transparent 42%
    ),
    #fff;
}

#switching-pro-overlay .switch-leaderboard-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

#switching-pro-overlay .switch-leaderboard-head > div {
  display: grid;
  gap: 3px;
}

#switching-pro-overlay .switch-leaderboard-head span {
  color: #168f84;
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

#switching-pro-overlay .switch-leaderboard-head h2 {
  margin: 0;
  color: #071238;
  font-size: 1.2rem;
  line-height: 1.12;
}

#switching-pro-overlay .switch-leaderboard-head > strong {
  border: 1px solid rgba(23, 182, 166, 0.24);
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(23, 182, 166, 0.08);
  color: #147b73;
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

#switching-pro-overlay .switch-leaderboard-list {
  display: grid;
  gap: 7px;
}

#switching-pro-overlay .switch-leaderboard-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid #e1eaee;
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.94);
}

#switching-pro-overlay .switch-leaderboard-row:first-child {
  border-color: rgba(241, 181, 54, 0.42);
  background: linear-gradient(
    90deg,
    rgba(255, 247, 220, 0.85),
    rgba(255, 255, 255, 0.96)
  );
}

#switching-pro-overlay .switch-leaderboard-rank {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #eef5f6;
  color: #071238;
  font-size: 0.82rem;
  font-weight: 950;
}

#switching-pro-overlay
  .switch-leaderboard-row:first-child
  .switch-leaderboard-rank {
  background: #f4c95f;
  color: #513d08;
}

#switching-pro-overlay .switch-leaderboard-player {
  display: grid;
  min-width: 0;
  gap: 2px;
}

#switching-pro-overlay .switch-leaderboard-player strong,
#switching-pro-overlay .switch-leaderboard-player small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#switching-pro-overlay .switch-leaderboard-player strong {
  color: #071238;
  font-size: 0.9rem;
  font-weight: 900;
}

#switching-pro-overlay .switch-leaderboard-player small,
#switching-pro-overlay .switch-leaderboard-state,
#switching-pro-overlay .switch-leaderboard-total {
  color: #65728a;
  font-size: 0.7rem;
  font-weight: 760;
}

#switching-pro-overlay .switch-leaderboard-score {
  color: #071238;
  font-size: 0.8rem;
  font-weight: 950;
  white-space: nowrap;
}

#switching-pro-overlay .switch-leaderboard-state {
  margin: 0;
  border: 1px dashed #d8e5e7;
  border-radius: 9px;
  padding: 14px 12px;
  text-align: center;
}

#switching-pro-overlay .switch-leaderboard-total {
  margin: 0;
  text-align: right;
}

@media (max-width: 520px) {
  #switching-pro-overlay .switch-leaderboard-head {
    display: grid;
    align-items: start;
    gap: 7px;
  }

  #switching-pro-overlay .switch-leaderboard-head > strong {
    justify-self: start;
    white-space: normal;
  }

  #switching-pro-overlay .switch-leaderboard-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 8px 7px;
  }

  #switching-pro-overlay .switch-leaderboard-rank {
    width: 28px;
    height: 28px;
  }

  #switching-pro-overlay .switch-leaderboard-player strong {
    font-size: 0.82rem;
  }

  #switching-pro-overlay .switch-leaderboard-player small {
    font-size: 0.62rem;
  }

  #switching-pro-overlay .switch-leaderboard-score {
    font-size: 0.7rem;
  }
}

@media (max-width: 370px) {
  #switching-pro-overlay .switch-leaderboard-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  #switching-pro-overlay .switch-leaderboard-score {
    grid-column: 2;
    justify-self: start;
  }
}

/* Code Attention results: mode-specific player leaderboard. */
main.view-trainer .attention-leaderboard {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin-top: 4px;
  border: 1px solid rgba(23, 182, 166, 0.24);
  border-radius: 12px;
  padding: 16px;
  background:
    radial-gradient(
      circle at 100% 0,
      rgba(23, 182, 166, 0.12),
      transparent 42%
    ),
    linear-gradient(145deg, #f8fffd 0%, #fff 58%);
  box-shadow: 0 12px 34px rgba(16, 19, 24, 0.07);
}

main.view-trainer .attention-leaderboard-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

main.view-trainer .attention-leaderboard-head > div {
  display: grid;
  gap: 3px;
}

main.view-trainer .attention-leaderboard-head span {
  color: var(--teal-dark);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

main.view-trainer .attention-leaderboard-head h2 {
  margin: 0 !important;
  color: var(--ink);
  font-size: 1.2rem !important;
  line-height: 1.15;
}

main.view-trainer .attention-leaderboard-head > strong {
  flex: 0 0 auto;
  border: 1px solid rgba(23, 182, 166, 0.24);
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(23, 182, 166, 0.08);
  color: var(--teal-dark);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

main.view-trainer .attention-leaderboard-list {
  display: grid;
  gap: 7px;
}

main.view-trainer .attention-leaderboard-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid #e1eaee;
  border-radius: 10px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.92);
}

main.view-trainer
  .attention-leaderboard-list
  .attention-leaderboard-row:first-child {
  border-color: rgba(241, 181, 54, 0.42);
  background: linear-gradient(
    90deg,
    rgba(255, 247, 220, 0.85),
    rgba(255, 255, 255, 0.96)
  );
}

main.view-trainer .attention-leaderboard-row.is-current {
  border-color: rgba(23, 182, 166, 0.52);
  box-shadow: inset 3px 0 0 var(--teal);
}

main.view-trainer .attention-leaderboard-rank {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #eef5f6;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 950;
}

main.view-trainer
  .attention-leaderboard-list
  .attention-leaderboard-row:first-child
  .attention-leaderboard-rank {
  background: #f4c95f;
  color: #513d08;
}

main.view-trainer .attention-leaderboard-player {
  display: grid;
  min-width: 0;
  gap: 3px;
}

main.view-trainer .attention-leaderboard-player > strong {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main.view-trainer .attention-leaderboard-player > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main.view-trainer .attention-leaderboard-you {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 6px;
  background: var(--teal);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

main.view-trainer .attention-leaderboard-score {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 950;
  white-space: nowrap;
}

main.view-trainer .attention-leaderboard-state {
  margin: 0;
  border: 1px dashed #d8e5e7;
  border-radius: 9px;
  padding: 15px 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 720;
  text-align: center;
}

main.view-trainer .attention-leaderboard-current {
  display: grid;
  gap: 6px;
  border-top: 1px dashed #cfdddf;
  padding-top: 10px;
}

main.view-trainer .attention-leaderboard-current > span,
main.view-trainer .attention-leaderboard-total {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

main.view-trainer .attention-leaderboard-total {
  text-align: right;
}

@media (max-width: 520px) {
  main.view-trainer .attention-leaderboard {
    gap: 8px;
    padding: 13px 11px;
  }

  main.view-trainer .attention-leaderboard-head {
    display: grid;
    align-items: start;
    gap: 8px;
  }

  main.view-trainer .attention-leaderboard-head > strong {
    justify-self: start;
  }

  main.view-trainer .attention-leaderboard-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px 8px;
  }

  main.view-trainer .attention-leaderboard-rank {
    width: 29px;
    height: 29px;
    font-size: 0.8rem;
  }

  main.view-trainer .attention-leaderboard-player > strong {
    font-size: 0.86rem;
  }

  main.view-trainer .attention-leaderboard-player > small {
    font-size: 0.64rem;
  }

  main.view-trainer .attention-leaderboard-score {
    font-size: 0.74rem;
  }
}

@media (max-width: 370px) {
  main.view-trainer .attention-leaderboard-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  main.view-trainer .attention-leaderboard-score {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .switching-game-actions {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    gap: 12px;
  }

  .switching-game-actions .switching-action-button {
    flex-basis: 34px;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    border-radius: 9px;
  }

  body.trainer-play-mode .trainer-play {
    padding-top: 8px !important;
  }
}

@media (min-width: 721px) {
  #switching-pro-overlay {
    min-height: calc(100dvh - 76px);
  }

  #switching-pro-overlay .switch-screen {
    display: grid;
    width: min(760px, calc(100% - 32px));
    gap: 12px;
    margin: 0 auto;
    padding: clamp(14px, 2.2vh, 22px) 0 clamp(24px, 4vh, 40px);
  }

  #switching-pro-overlay .switch-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    align-items: center;
    gap: 12px;
    min-height: 0;
    margin: 0;
  }

  #switching-pro-overlay .switch-hero-copy {
    gap: 10px;
  }

  #switching-pro-overlay .switch-kicker {
    min-height: 34px;
    gap: 8px;
    padding: 0 13px;
    font-size: 0.78rem;
  }

  #switching-pro-overlay .switch-kicker .sw-icon {
    width: 20px;
    height: 20px;
  }

  #switching-pro-overlay .switch-hero h1 {
    margin: 0;
    font-size: clamp(2.35rem, 5.4vw, 3.15rem);
    line-height: 0.94;
    letter-spacing: 0;
  }

  #switching-pro-overlay .switch-rainbow {
    width: min(300px, 100%);
    height: 5px;
  }

  #switching-pro-overlay .switch-hero p {
    max-width: 410px;
    margin: 0;
    font-size: clamp(0.92rem, 1.35vw, 1.04rem);
    line-height: 1.38;
  }

  #switching-pro-overlay .switch-brain {
    width: clamp(190px, 29vw, 240px);
    justify-self: end;
  }

  #switching-pro-overlay .switch-card,
  #switching-pro-overlay .switch-about {
    width: 100%;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(52, 81, 145, 0.08);
  }

  #switching-pro-overlay .switch-card {
    gap: 12px;
    padding: 14px 16px;
  }

  #switching-pro-overlay .switch-card h2,
  #switching-pro-overlay .switch-about h2 {
    gap: 10px;
    font-size: 1.06rem;
    line-height: 1.16;
  }

  #switching-pro-overlay .switch-options {
    gap: 10px;
  }

  #switching-pro-overlay .switch-options-time button,
  #switching-pro-overlay .switch-options-answer button,
  #switching-pro-overlay .switch-options-mode button {
    min-height: 58px;
    padding: 8px 10px;
  }

  #switching-pro-overlay .switch-options-time button span,
  #switching-pro-overlay .switch-options-answer button span {
    gap: 5px;
    font-size: 0.92rem;
  }

  #switching-pro-overlay .switch-options-time button span strong,
  #switching-pro-overlay .switch-options-answer button span strong {
    font-size: 1.2rem;
  }

  #switching-pro-overlay .switch-options-time button.selected span strong,
  #switching-pro-overlay .switch-options-answer button.selected span strong {
    font-size: 1.28rem;
  }

  #switching-pro-overlay .switch-options-mode button strong {
    font-size: 1.02rem;
    white-space: nowrap;
  }

  #switching-pro-overlay .switch-options-mode button.selected strong {
    font-size: 1.08rem;
  }

  #switching-pro-overlay .switch-options button em {
    right: -4px;
    top: -7px;
    width: 22px;
    height: 22px;
  }

  #switching-pro-overlay .switch-options button em::after {
    left: 7px;
    top: 4px;
    width: 6px;
    height: 11px;
    border-width: 0 3px 3px 0;
  }

  #switching-pro-overlay .switch-start {
    min-height: 62px;
    margin: 0;
    gap: 14px;
    border-radius: 8px;
    font-size: 1.35rem;
  }

  #switching-pro-overlay .switch-start .sw-icon {
    width: 30px;
    height: 30px;
  }

  #switching-pro-overlay .switch-start b {
    width: 14px;
    height: 14px;
    margin-right: 20px;
    border-width: 4px;
  }

  #switching-pro-overlay .switch-about {
    padding: 13px 16px;
  }

  #switching-pro-overlay .switch-about p {
    margin: 8px 0 0;
    font-size: 0.88rem;
    line-height: 1.38;
  }

  body.trainer-play-mode .trainer-play {
    grid-template-rows: auto auto auto auto auto auto !important;
    align-content: start !important;
    gap: 10px !important;
    min-height: 100dvh !important;
    padding: 12px max(16px, calc((100vw - 1120px) / 2)) 14px !important;
  }

  body.trainer-play-mode .trainer-play .play-grid,
  body.trainer-play-mode .trainer-play .play-history,
  body.trainer-play-mode .trainer-play .play-round,
  body.trainer-play-mode .trainer-play .play-session,
  body.trainer-play-mode .trainer-play .switching-current-question {
    width: 100%;
    max-width: 1120px;
    justify-self: center;
  }

  body.trainer-play-mode .trainer-play .switching-current-question {
    min-height: clamp(86px, 15vh, 148px) !important;
    padding: 16px 20px !important;
  }

  body.trainer-play-mode .trainer-play .switching-current-question strong {
    font-size: clamp(1.55rem, 3vw, 2.25rem) !important;
    line-height: 1.04 !important;
  }

  body.trainer-play-mode .trainer-play .play-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: auto !important;
    align-self: start !important;
    height: auto !important;
    min-height: 0 !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  body.trainer-play-mode .trainer-play .play-zone {
    min-height: 108px !important;
    padding: 14px !important;
    overflow: hidden !important;
  }

  body.trainer-play-mode .trainer-play .play-zone span {
    font-size: 0.92rem !important;
  }

  body.trainer-play-mode .trainer-play .play-zone small {
    font-size: 0.72rem !important;
  }

  body.trainer-play-mode .trainer-play .play-zone b.stimulus {
    max-width: calc(100% - 28px);
    font-size: clamp(2.8rem, 7vw, 4.6rem) !important;
  }

  body.trainer-play-mode .trainer-play .play-zone b.stimulus.top-center {
    top: 48px !important;
  }

  body.trainer-play-mode .play-answer-row {
    position: static !important;
    z-index: auto !important;
    width: 100%;
    max-width: 1120px;
    justify-self: center;
    grid-template-columns: minmax(0, min(520px, calc(50vw - 24px))) minmax(
        0,
        min(520px, calc(50vw - 24px))
      );
    justify-content: center;
    gap: 12px;
    margin: 0 !important;
    border-top: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  body.trainer-play-mode .play-answer-row .answer {
    min-height: 64px;
    font-size: 1.45rem;
  }
}

@media (min-width: 900px) {
  #switching-pro-overlay .switch-screen {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(1080px, calc(100% - 48px));
    gap: 14px;
  }

  #switching-pro-overlay .switch-hero,
  #switching-pro-overlay .switch-start,
  #switching-pro-overlay .switch-about {
    grid-column: 1 / -1;
  }

  #switching-pro-overlay .switch-hero {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    gap: clamp(18px, 3vw, 34px);
  }

  #switching-pro-overlay .switch-hero h1 {
    font-size: clamp(2.75rem, 4vw, 3.75rem);
  }

  #switching-pro-overlay .switch-hero p {
    max-width: 520px;
    font-size: 1.05rem;
  }

  #switching-pro-overlay .switch-brain {
    width: clamp(240px, 24vw, 320px);
  }

  #switching-pro-overlay .switch-card {
    min-height: 138px;
    align-content: start;
  }

  #switching-pro-overlay .switch-options {
    gap: 8px;
  }

  #switching-pro-overlay .switch-options-mode button {
    padding-left: 6px;
    padding-right: 18px;
  }

  #switching-pro-overlay .switch-options-mode button strong,
  #switching-pro-overlay .switch-options-mode button.selected strong {
    font-size: 0.9rem;
  }
}

@media (min-width: 1061px) {
  body.trainer-play-mode .trainer-play .play-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  body.trainer-play-mode .trainer-play .play-zone {
    min-height: 116px !important;
  }

  body.trainer-play-mode .trainer-play .switching-current-question {
    min-height: clamp(104px, 16vh, 150px) !important;
  }
}

@media (min-width: 721px) and (max-height: 820px) {
  #switching-pro-overlay .switch-screen {
    padding-top: 10px;
    padding-bottom: 22px;
  }

  #switching-pro-overlay .switch-hero {
    gap: 10px;
  }

  #switching-pro-overlay .switch-hero h1 {
    font-size: clamp(2.25rem, 4vw, 3rem);
  }

  #switching-pro-overlay .switch-hero p {
    font-size: 0.92rem;
    line-height: 1.32;
  }

  #switching-pro-overlay .switch-brain {
    width: clamp(190px, 22vw, 260px);
  }

  #switching-pro-overlay .switch-card {
    gap: 9px;
    padding: 12px 14px;
  }

  #switching-pro-overlay .switch-options-time button,
  #switching-pro-overlay .switch-options-answer button,
  #switching-pro-overlay .switch-options-mode button {
    min-height: 52px;
  }

  #switching-pro-overlay .switch-start {
    min-height: 58px;
  }

  #switching-pro-overlay .switch-about {
    padding: 11px 14px;
  }

  body.trainer-play-mode .trainer-play {
    gap: 8px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  body.trainer-play-mode .trainer-play .switching-current-question {
    min-height: 76px !important;
    padding: 12px 16px !important;
  }

  body.trainer-play-mode .trainer-play .switching-current-question strong {
    font-size: clamp(1.35rem, 2.6vw, 1.95rem) !important;
  }

  body.trainer-play-mode .trainer-play .play-zone {
    min-height: 100px !important;
    padding: 11px !important;
  }

  body.trainer-play-mode .trainer-play .play-zone b.stimulus {
    font-size: clamp(2.35rem, 5.5vw, 3.75rem) !important;
  }

  body.trainer-play-mode .play-answer-row .answer {
    min-height: 58px;
  }
}

@media (min-width: 1061px) and (max-height: 820px) {
  body.trainer-play-mode .trainer-play .play-zone {
    min-height: 112px !important;
  }
}

/* Code Attention setup: match First Count sizing on tablet and web. */
@media (min-width: 721px) {
  #switching-pro-overlay {
    min-height: calc(100dvh - 76px);
  }

  #switching-pro-overlay .switch-screen {
    box-sizing: border-box !important;
    display: grid !important;
    width: min(1060px, calc(100% - 44px)) !important;
    max-width: 1060px !important;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 410px) !important;
    grid-template-rows: repeat(4, auto) auto !important;
    gap: 14px 18px !important;
    align-items: start !important;
    margin: 0 auto !important;
    padding: 18px 0 34px !important;
    overflow: hidden !important;
  }

  #switching-pro-overlay .switch-card,
  #switching-pro-overlay .switch-start {
    grid-column: 2 !important;
  }

  #switching-pro-overlay .switch-hero {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 180px) !important;
    align-items: center !important;
    gap: 14px !important;
    min-height: 0 !important;
    margin: 0 !important;
  }

  #switching-pro-overlay .switch-hero-copy {
    gap: 9px !important;
  }

  #switching-pro-overlay .switch-kicker {
    min-height: 34px !important;
    padding: 0 13px !important;
    gap: 8px !important;
    font-size: 0.78rem !important;
  }

  #switching-pro-overlay .switch-kicker .sw-icon {
    width: 20px !important;
    height: 20px !important;
  }

  #switching-pro-overlay .switch-hero h1 {
    margin: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    font-size: 3rem !important;
    line-height: 1 !important;
  }

  #switching-pro-overlay .switch-rainbow {
    width: min(300px, 100%) !important;
    height: 5px !important;
  }

  #switching-pro-overlay .switch-hero p {
    max-width: 410px !important;
    margin: 0 !important;
    font-size: 0.95rem !important;
    line-height: 1.42 !important;
  }

  #switching-pro-overlay .switch-brain {
    justify-self: end !important;
    width: min(180px, 100%) !important;
    max-height: 190px !important;
    object-fit: contain !important;
  }

  #switching-pro-overlay .switch-card,
  #switching-pro-overlay .switch-about {
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 14px 42px rgba(16, 19, 24, 0.08) !important;
  }

  #switching-pro-overlay .switch-card {
    display: grid !important;
    gap: 7px !important;
    min-height: 112px !important;
    margin: 0 !important;
    padding: 22px 24px !important;
  }

  #switching-pro-overlay .switch-card:nth-of-type(2) {
    grid-row: 1 !important;
  }

  #switching-pro-overlay .switch-card:nth-of-type(3) {
    grid-row: 2 !important;
  }

  #switching-pro-overlay .switch-card:nth-of-type(4) {
    grid-row: 3 !important;
  }

  #switching-pro-overlay .switch-card:nth-of-type(5) {
    grid-row: 4 !important;
  }

  #switching-pro-overlay .switch-card h2,
  #switching-pro-overlay .switch-about h2 {
    gap: 14px !important;
    font-size: 0.86rem !important;
    line-height: 1.15 !important;
  }

  #switching-pro-overlay .switch-options {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  #switching-pro-overlay .switch-options-time button,
  #switching-pro-overlay .switch-options-answer button,
  #switching-pro-overlay .switch-options-mode button {
    min-height: 44px !important;
    padding: 6px 8px !important;
  }

  #switching-pro-overlay .switch-options-time button span,
  #switching-pro-overlay .switch-options-answer button span {
    gap: 5px !important;
    font-size: 0.96rem !important;
  }

  #switching-pro-overlay .switch-options-time button span strong,
  #switching-pro-overlay .switch-options-answer button span strong {
    font-size: 1.28rem !important;
  }

  #switching-pro-overlay .switch-options-time button.selected span strong,
  #switching-pro-overlay .switch-options-answer button.selected span strong {
    font-size: 1.34rem !important;
  }

  #switching-pro-overlay .switch-options-mode button {
    padding: 6px 10px !important;
  }

  #switching-pro-overlay .switch-options-mode button strong,
  #switching-pro-overlay .switch-options-mode button.selected strong {
    font-size: 0.9rem !important;
    white-space: nowrap !important;
  }

  #switching-pro-overlay .switch-options button em {
    right: -3px !important;
    top: -6px !important;
    width: 20px !important;
    height: 20px !important;
  }

  #switching-pro-overlay .switch-options button em::after {
    left: 6px !important;
    top: 4px !important;
    width: 5px !important;
    height: 9px !important;
    border-width: 0 2px 2px 0 !important;
  }

  #switching-pro-overlay .switch-start {
    display: grid !important;
    grid-row: 5 !important;
    grid-template-columns: 1fr auto 1fr !important;
    width: 100% !important;
    min-height: 50px !important;
    margin: 0 !important;
    gap: 12px !important;
    font-size: 1.08rem !important;
  }

  #switching-pro-overlay .switch-start .sw-icon {
    width: 26px !important;
    height: 26px !important;
  }

  #switching-pro-overlay .switch-start b {
    width: 13px !important;
    height: 13px !important;
    margin-right: 18px !important;
    border-width: 4px !important;
  }

  #switching-pro-overlay .switch-about {
    grid-column: 1 !important;
    grid-row: 3 / span 2 !important;
    display: grid !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 14px 16px !important;
  }

  #switching-pro-overlay .switch-about p {
    margin: 0 !important;
    font-size: 0.88rem !important;
    line-height: 1.38 !important;
  }
}

@media (min-width: 721px) and (max-width: 900px) {
  #switching-pro-overlay .switch-screen {
    width: min(100% - 28px, 820px) !important;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px) !important;
    gap: 12px !important;
  }

  #switching-pro-overlay .switch-hero {
    grid-template-columns: minmax(0, 1fr) 118px !important;
    gap: 12px !important;
  }

  #switching-pro-overlay .switch-hero h1 {
    font-size: 2.35rem !important;
  }

  #switching-pro-overlay .switch-rainbow {
    width: 196px !important;
  }

  #switching-pro-overlay .switch-hero p {
    font-size: 0.86rem !important;
    line-height: 1.34 !important;
  }

  #switching-pro-overlay .switch-brain {
    max-height: 132px !important;
  }

  #switching-pro-overlay .switch-card {
    min-height: 106px !important;
    padding: 20px 22px !important;
  }

  #switching-pro-overlay .switch-options-time button,
  #switching-pro-overlay .switch-options-answer button,
  #switching-pro-overlay .switch-options-mode button {
    min-height: 42px !important;
    padding: 5px 7px !important;
  }
}

@media (min-width: 721px) {
  body.trainer-play-mode {
    background: #f8fbfc !important;
  }

  body.trainer-play-mode .trainer-play {
    width: min(390px, 100vw) !important;
    max-width: 390px !important;
    margin: 0 auto !important;
    grid-template-rows: auto auto auto auto auto !important;
    align-content: start !important;
    gap: 7px !important;
    padding: 8px 12px 12px !important;
  }

  body.trainer-play-mode .trainer-play .play-session,
  body.trainer-play-mode .trainer-play .play-round,
  body.trainer-play-mode .trainer-play .play-history,
  body.trainer-play-mode .trainer-play .switching-current-question,
  body.trainer-play-mode .trainer-play .play-grid,
  body.trainer-play-mode .trainer-play .play-answer-row {
    width: 100% !important;
    max-width: 100% !important;
    justify-self: stretch !important;
  }

  body.trainer-play-mode .trainer-play .switching-current-question {
    min-height: 48px !important;
    padding: 8px 12px !important;
  }

  body.trainer-play-mode .trainer-play .switching-current-question strong {
    font-size: 1.36rem !important;
    line-height: 1.06 !important;
  }

  body.trainer-play-mode .trainer-play .play-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: auto !important;
    height: auto !important;
    min-height: 0 !important;
    gap: 7px !important;
    overflow: visible !important;
  }

  body.trainer-play-mode .trainer-play .play-zone {
    width: 100% !important;
    height: auto !important;
    min-height: 116px !important;
    aspect-ratio: 1 / 0.74 !important;
    padding: 10px !important;
  }

  body.trainer-play-mode .trainer-play .play-zone span {
    max-width: calc(100% - 20px) !important;
    font-size: 0.86rem !important;
    line-height: 1.1 !important;
  }

  body.trainer-play-mode .trainer-play .play-zone small {
    margin-top: 4px !important;
    font-size: 0.68rem !important;
    line-height: 1.15 !important;
  }

  body.trainer-play-mode .trainer-play .play-zone b.stimulus {
    font-size: clamp(2.45rem, 3.35rem, 4.25rem) !important;
  }

  body.trainer-play-mode .play-answer-row {
    position: static !important;
    z-index: auto !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin: 0 !important;
    border-top: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  body.trainer-play-mode .play-answer-row .answer {
    width: 100% !important;
    min-height: 62px !important;
    font-size: 1.2rem !important;
  }
}

/* Color impulse play screen: match Code Attention compact trainer sizing. */
body.color-play-mode {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100dvh !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  background: #f8fbfc !important;
}

body.color-play-mode #root,
body.color-play-mode main.view-color,
body.color-play-mode #color-trainer-screen {
  height: 100dvh !important;
  min-height: 100dvh !important;
  overflow: hidden !important;
}

body.color-play-mode main.view-color {
  display: block !important;
  padding: 0 !important;
}

body.color-play-mode .color-advanced-play.color-play {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto !important;
  align-content: start !important;
  justify-content: stretch !important;
  justify-items: stretch !important;
  width: min(390px, 100vw) !important;
  max-width: 390px !important;
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: 100dvh !important;
  margin: 0 auto !important;
  padding: 8px 12px 12px !important;
  gap: 7px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #f8fbfc !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

body.color-play-mode .color-advanced-play.color-rule-shape {
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto !important;
}

body.color-play-mode .color-advanced-play .color-play-session,
body.color-play-mode .color-advanced-play .color-play-round,
body.color-play-mode .color-advanced-play .color-play-history,
body.color-play-mode .color-advanced-play .color-current-question,
body.color-play-mode .color-advanced-play .color-stimulus-card,
body.color-play-mode .color-advanced-play .color-advanced-options {
  width: 100% !important;
  max-width: 100% !important;
  justify-self: stretch !important;
}

body.color-play-mode .color-advanced-play .color-play-session {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

body.color-play-mode .color-advanced-play .color-play-session span,
body.color-play-mode .color-advanced-play .color-play-round span {
  color: var(--muted) !important;
  font-size: 0.72rem !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
}

body.color-play-mode .color-advanced-play .color-play-session strong {
  color: var(--ink) !important;
  font-size: 1.1rem !important;
  font-weight: 950 !important;
}

body.color-play-mode .color-advanced-play .color-play-round strong {
  color: var(--ink) !important;
  font-size: 0.94rem !important;
  font-weight: 950 !important;
}

body.color-play-mode .color-advanced-play .color-play-session i,
body.color-play-mode .color-advanced-play .color-play-round i {
  display: block !important;
  width: 100% !important;
  height: 9px !important;
  border-radius: 999px !important;
}

body.color-play-mode .color-advanced-play .color-play-session i {
  grid-column: 1 / -1 !important;
  background: linear-gradient(
    90deg,
    var(--teal) var(--session-progress),
    #e4ebf0 0
  ) !important;
}

body.color-play-mode .color-advanced-play .color-play-round {
  display: grid !important;
  gap: 7px !important;
}

body.color-play-mode .color-advanced-play .color-play-round div {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
}

body.color-play-mode .color-advanced-play .color-play-round i {
  background: linear-gradient(
    90deg,
    var(--teal) var(--round-progress),
    #e4ebf0 0
  ) !important;
}

body.color-play-mode .color-advanced-play .color-play-history {
  display: grid !important;
  grid-template-columns: repeat(15, minmax(0, 1fr)) !important;
  gap: 5px !important;
  height: auto !important;
  padding: 0 0 2px !important;
}

body.color-play-mode .color-advanced-play .color-play-history span {
  height: 9px !important;
  border-radius: 999px !important;
}

body.color-play-mode .color-current-question {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 48px !important;
  border: 2px solid rgba(23, 182, 166, 0.24) !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, #fff, #edfffb) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
  padding: 8px 12px !important;
  color: #071238 !important;
  text-align: center !important;
}

body.color-play-mode .color-current-question span {
  display: none !important;
}

body.color-play-mode .color-current-question strong {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  color: #071238 !important;
  font-size: 1.36rem !important;
  font-weight: 950 !important;
  line-height: 1.06 !important;
  letter-spacing: 0 !important;
  text-align: center !important;
}

body.color-play-mode .color-stimulus-card {
  align-self: stretch !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  gap: 6px !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 8px !important;
  background: #fff !important;
  padding: 8px !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07) !important;
  overflow: hidden !important;
}

body.color-play-mode .color-stimulus-stage {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) !important;
  align-content: center !important;
  align-items: center !important;
  justify-items: center !important;
  gap: 8px !important;
  min-height: 0 !important;
  height: 100% !important;
}

body.color-play-mode .color-task-badge {
  display: none !important;
  font-size: clamp(0.95rem, 4.2vw, 1.22rem) !important;
  line-height: 1 !important;
}

body.color-play-mode
  .color-stimulus-stage
  > .color-stimulus-shape.color-reference-figure {
  width: min(252px, 62vw) !important;
  max-width: calc(100% - 10px) !important;
}

body.color-play-mode
  .color-stimulus-stage
  > .color-stimulus-shape.color-reference-figure.rectangle {
  width: min(294px, 72vw) !important;
}

body.color-play-mode
  .color-stimulus-stage
  > .color-stimulus-shape.color-reference-figure.oval {
  width: min(286px, 70vw) !important;
}

body.color-play-mode
  .color-stimulus-stage
  > .color-stimulus-shape.color-reference-figure.hexagon {
  width: min(258px, 64vw) !important;
}

body.color-play-mode
  .color-stimulus-stage
  > .color-reference-figure
  .color-stimulus-word {
  font-size: clamp(1.32rem, 6vw, 2.12rem) !important;
}

body.color-play-mode
  .color-stimulus-stage
  > .color-reference-figure
  .color-stimulus-word.is-short-word {
  font-size: clamp(1.48rem, 6.4vw, 2.36rem) !important;
}

body.color-play-mode
  .color-stimulus-stage
  > .color-reference-figure
  .color-stimulus-word.is-long-word {
  font-size: clamp(1.08rem, 5.2vw, 1.72rem) !important;
}

body.color-play-mode
  .color-stimulus-stage
  > .color-reference-figure
  .color-stimulus-word.is-extra-long-word {
  font-size: clamp(0.92rem, 4.4vw, 1.44rem) !important;
}

body.color-play-mode .color-round-feedback {
  height: 20px !important;
  line-height: 20px !important;
  font-size: 0.72rem !important;
}

body.color-play-mode .color-advanced-options.color-options-grid {
  display: grid !important;
  gap: 7px !important;
  min-height: 0 !important;
}

body.color-play-mode .color-advanced-options.color-mode {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body.color-play-mode .color-advanced-options.shape-mode {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

body.color-play-mode .color-advanced-options.color-mode .color-answer-button,
body.color-play-mode .color-advanced-options.shape-mode .color-answer-button {
  box-sizing: border-box !important;
  height: 50px !important;
  min-height: 50px !important;
  border-radius: 8px !important;
  padding: 0 6px !important;
}

body.color-play-mode .color-advanced-options.color-mode .color-answer-button {
  grid-template-columns: 25px minmax(0, 1fr) !important;
  justify-content: stretch !important;
  justify-items: start !important;
  column-gap: 5px !important;
}

body.color-play-mode
  .color-advanced-options.color-mode
  .color-answer-button
  strong {
  max-width: 100% !important;
  font-size: 0.72rem !important;
  line-height: 1 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.color-play-mode .color-answer-button .color-choice-dot {
  width: 20px !important;
  height: 20px !important;
  flex-basis: 20px !important;
  border-radius: 6px !important;
}

body.color-play-mode .color-advanced-options.shape-mode .color-answer-button {
  grid-template-columns: 1fr !important;
  justify-items: center !important;
  padding: 0 !important;
}

body.color-play-mode .color-advanced-options.shape-mode .shape-choice-icon {
  display: block !important;
  width: 30px !important;
  height: 30px !important;
  flex-basis: 30px !important;
  background: #050505 !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  filter: none !important;
}

body.color-play-mode
  .color-advanced-options.shape-mode
  .shape-choice-icon::before,
body.color-play-mode
  .color-advanced-options.shape-mode
  .shape-choice-icon::after {
  display: none !important;
  content: none !important;
}

body.color-play-mode
  .color-advanced-options.shape-mode
  .shape-choice-icon.circle {
  border-radius: 999px !important;
  clip-path: none !important;
}

body.color-play-mode
  .color-advanced-options.shape-mode
  .shape-choice-icon.square {
  border-radius: 2px !important;
  clip-path: none !important;
}

body.color-play-mode
  .color-advanced-options.shape-mode
  .shape-choice-icon.oval {
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  flex-basis: 42px !important;
  border-radius: 50% !important;
  clip-path: ellipse(50% 50% at 50% 50%) !important;
}

body.color-play-mode
  .color-advanced-options.shape-mode
  .shape-choice-icon.rectangle {
  width: 40px !important;
  height: 24px !important;
  flex-basis: 40px !important;
  border-radius: 2px !important;
  clip-path: none !important;
}

body.color-play-mode
  .color-advanced-options.shape-mode
  .shape-choice-icon.hexagon {
  width: 34px !important;
  height: 30px !important;
  flex-basis: 34px !important;
  border-radius: 0 !important;
  clip-path: polygon(
    25% 0,
    75% 0,
    100% 50%,
    75% 100%,
    25% 100%,
    0 50%
  ) !important;
}

body.color-play-mode .switching-game-actions.color-game-actions {
  top: max(8px, calc(env(safe-area-inset-top) + 8px)) !important;
  right: max(8px, calc((100vw - 366px) / 2)) !important;
  gap: 12px !important;
  z-index: 1400 !important;
}

body.color-play-mode
  .switching-game-actions.color-game-actions
  .switching-action-button {
  flex-basis: 34px !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border-radius: 9px !important;
  font-size: 0 !important;
}

body.color-game-paused .color-stimulus-card,
body.color-game-paused .color-advanced-options {
  filter: saturate(0.9) !important;
  opacity: 0.88 !important;
}

body.color-game-paused .color-answer-button {
  pointer-events: none !important;
}

@media (max-width: 720px) {
  body.color-play-mode .color-advanced-play.color-play {
    width: min(390px, 100vw) !important;
    padding: 8px 12px 12px !important;
  }

  body.color-play-mode .switching-game-actions.color-game-actions {
    top: max(8px, env(safe-area-inset-top)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
  }
}

@media (max-width: 380px) {
  body.color-play-mode .color-advanced-play.color-play {
    padding: 7px 10px 9px !important;
    gap: 6px !important;
  }

  body.color-play-mode .color-task-badge {
    font-size: clamp(0.86rem, 4.1vw, 1.05rem) !important;
  }

  body.color-play-mode
    .color-stimulus-stage
    > .color-stimulus-shape.color-reference-figure {
    width: min(226px, 62vw) !important;
  }

  body.color-play-mode
    .color-stimulus-stage
    > .color-stimulus-shape.color-reference-figure.rectangle {
    width: min(264px, 72vw) !important;
  }

  body.color-play-mode
    .color-stimulus-stage
    > .color-stimulus-shape.color-reference-figure.oval {
    width: min(258px, 70vw) !important;
  }

  body.color-play-mode .color-advanced-options.color-options-grid {
    gap: 6px !important;
  }

  body.color-play-mode .color-advanced-options.color-mode .color-answer-button,
  body.color-play-mode .color-advanced-options.shape-mode .color-answer-button {
    height: 46px !important;
    min-height: 46px !important;
  }

  body.color-play-mode .color-advanced-options.color-mode .color-answer-button {
    grid-template-columns: 22px minmax(0, 1fr) !important;
    column-gap: 4px !important;
  }

  body.color-play-mode
    .color-advanced-options.color-mode
    .color-answer-button
    strong {
    font-size: 0.66rem !important;
  }

  body.color-play-mode .color-answer-button .color-choice-dot {
    width: 18px !important;
    height: 18px !important;
    flex-basis: 18px !important;
  }
}

/* Color impulse: keep the central figure box static across all shape types. */
body.color-play-mode {
  --color-impulse-figure-size: min(252px, 62vw);
}

body.color-play-mode
  .color-stimulus-stage
  > .color-stimulus-shape.color-reference-figure,
body.color-play-mode
  .color-stimulus-stage
  > .color-stimulus-shape.color-reference-figure.circle,
body.color-play-mode
  .color-stimulus-stage
  > .color-stimulus-shape.color-reference-figure.square,
body.color-play-mode
  .color-stimulus-stage
  > .color-stimulus-shape.color-reference-figure.triangle,
body.color-play-mode
  .color-stimulus-stage
  > .color-stimulus-shape.color-reference-figure.rectangle,
body.color-play-mode
  .color-stimulus-stage
  > .color-stimulus-shape.color-reference-figure.oval,
body.color-play-mode
  .color-stimulus-stage
  > .color-stimulus-shape.color-reference-figure.hexagon {
  width: var(--color-impulse-figure-size) !important;
  height: var(--color-impulse-figure-size) !important;
  max-width: calc(100% - 10px) !important;
  max-height: calc(100% - 10px) !important;
  aspect-ratio: 1 / 1 !important;
}

@media (max-width: 380px) {
  body.color-play-mode {
    --color-impulse-figure-size: min(226px, 62vw);
  }
}

/* Code Attention: minimal 3-2-1 intro matching the Number Route hierarchy. */
html.switching-attention-countdown-active,
body.switching-attention-countdown-active {
  overflow: hidden !important;
}

body.switching-attention-countdown-active main.view-trainer {
  box-sizing: border-box;
  min-height: 100dvh !important;
  display: grid !important;
  place-items: center !important;
  margin: 0 !important;
  padding: 4px !important;
  background: #e8edf2 !important;
}

.trainer-countdown.switching-attention-countdown {
  box-sizing: border-box !important;
  width: min(940px, calc(100vw - 8px)) !important;
  height: min(990px, calc(100dvh - 8px)) !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-rows: auto auto !important;
  align-content: center !important;
  justify-items: center !important;
  gap: clamp(22px, 4vh, 44px) !important;
  overflow: hidden !important;
  margin: 0 auto !important;
  padding: clamp(24px, 5vh, 54px) clamp(18px, 5vw, 56px) !important;
  border: 1px solid #edf1f5 !important;
  border-radius: 30px !important;
  background: #fff !important;
  box-shadow: 0 18px 54px rgba(43, 63, 88, 0.08) !important;
  text-align: center !important;
}

.trainer-countdown.switching-attention-countdown > span,
.trainer-countdown.switching-attention-countdown > p {
  display: none !important;
}

.switching-attention-countdown-copy {
  display: grid;
  justify-items: center;
  gap: clamp(7px, 1.2vh, 13px);
  width: 100%;
}

.switching-attention-countdown-copy > span {
  color: #667b94;
  font-size: clamp(0.9rem, 1.6vw, 1.2rem);
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.switching-attention-countdown-copy > h1 {
  margin: 0;
  color: #102642;
  font-size: clamp(3.2rem, 7vw, 5.75rem);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: -0.055em;
  white-space: nowrap;
}

.switching-attention-countdown-copy > img {
  display: block;
  width: clamp(62px, 8vw, 86px);
  height: auto;
  margin-top: 3px;
}

.switching-attention-countdown-copy > p {
  margin: 0;
  color: #667b94;
  font-size: clamp(1.15rem, 2.4vw, 1.65rem);
  font-weight: 850;
}

.trainer-countdown.switching-attention-countdown > strong {
  display: block !important;
  min-width: 1em !important;
  margin: 0 !important;
  color: #102642 !important;
  font-family: Inter, Arial, sans-serif !important;
  font-size: clamp(10rem, 24vw, 15rem) !important;
  font-weight: 900 !important;
  line-height: 0.82 !important;
  letter-spacing: -0.07em !important;
  text-align: center !important;
  text-shadow: 0 16px 34px rgba(33, 70, 114, 0.12) !important;
  animation: number-route-countdown-change 0.34s
    cubic-bezier(0.2, 0.78, 0.24, 1);
}

@media (max-width: 720px) {
  body.switching-attention-countdown-active main.view-trainer {
    padding: 2px !important;
  }

  .trainer-countdown.switching-attention-countdown {
    width: calc(100vw - 4px) !important;
    height: calc(100dvh - 4px) !important;
    gap: clamp(20px, 4vh, 34px) !important;
    padding: 24px 14px !important;
    border-radius: 25px !important;
  }

  .switching-attention-countdown-copy {
    gap: 6px;
  }
  .switching-attention-countdown-copy > span {
    font-size: 0.82rem;
  }

  .switching-attention-countdown-copy > h1 {
    font-size: clamp(2.5rem, 11vw, 3.15rem);
    line-height: 1;
  }

  .switching-attention-countdown-copy > img {
    width: 66px;
  }
  .switching-attention-countdown-copy > p {
    font-size: 1.12rem;
  }

  .trainer-countdown.switching-attention-countdown > strong {
    font-size: clamp(9rem, 47vw, 11.5rem) !important;
  }
}

@media (max-height: 700px) {
  .trainer-countdown.switching-attention-countdown {
    gap: 14px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  .switching-attention-countdown-copy > h1 {
    font-size: clamp(2.35rem, 7vh, 3.2rem);
  }
  .trainer-countdown.switching-attention-countdown > strong {
    font-size: clamp(7rem, 28vh, 9rem) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trainer-countdown.switching-attention-countdown > strong {
    animation: none !important;
  }
}

/* Code Attention countdown v2: isolated overlay, never mounted inside the game DOM. */
body.switching-attention-countdown-active .trainer-countdown {
  visibility: hidden !important;
}

#switching-attention-countdown-overlay {
  position: fixed;
  z-index: 10000;
  inset: 0;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  padding: 4px;
  background: #e8edf2;
}

.switching-attention-countdown-panel {
  box-sizing: border-box;
  width: min(940px, calc(100vw - 8px));
  height: min(990px, calc(100dvh - 8px));
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: center;
  gap: clamp(22px, 4vh, 44px);
  overflow: hidden;
  padding: clamp(24px, 5vh, 54px) clamp(18px, 5vw, 56px);
  border: 1px solid #edf1f5;
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 18px 54px rgba(43, 63, 88, 0.08);
  text-align: center;
}

#switching-attention-countdown-overlay .switching-attention-countdown-copy {
  width: max-content;
  max-width: 100%;
}

#switching-attention-countdown-overlay
  .switching-attention-countdown-copy
  > span {
  display: grid;
  justify-self: start;
  gap: 5px;
  color: #111827;
  font-weight: 950;
}

#switching-attention-countdown-overlay
  .switching-attention-countdown-copy
  > span::after {
  content: "";
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 1;
}

#switching-attention-countdown-overlay [data-switching-countdown-value] {
  display: block;
  min-width: 1em;
  margin: 0;
  color: #102642;
  font-family: Inter, Arial, sans-serif;
  font-size: clamp(10rem, 24vw, 15rem);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.07em;
  text-align: center;
  text-shadow: 0 16px 34px rgba(33, 70, 114, 0.12);
}

#switching-attention-countdown-overlay
  [data-switching-countdown-value].is-changing {
  animation: switching-attention-countdown-pop 0.28s
    cubic-bezier(0.2, 0.78, 0.24, 1);
}

@keyframes switching-attention-countdown-pop {
  0% {
    opacity: 0.2;
    transform: scale(0.84);
  }
  70% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 720px) {
  #switching-attention-countdown-overlay {
    padding: 2px;
  }

  .switching-attention-countdown-panel {
    width: calc(100vw - 4px);
    height: calc(100dvh - 4px);
    gap: clamp(20px, 4vh, 34px);
    padding: 24px 14px;
    border-radius: 25px;
  }

  #switching-attention-countdown-overlay [data-switching-countdown-value] {
    font-size: clamp(9rem, 47vw, 11.5rem);
  }
}

@media (max-height: 700px) {
  .switching-attention-countdown-panel {
    gap: 14px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  #switching-attention-countdown-overlay [data-switching-countdown-value] {
    font-size: clamp(7rem, 28vh, 9rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  #switching-attention-countdown-overlay
    [data-switching-countdown-value].is-changing {
    animation: none;
  }
}

/* Code Attention game viewport: match Focus Matrix on tablet and web. */
@media (min-width: 721px) {
  body.trainer-play-mode .trainer-play {
    box-sizing: border-box !important;
    width: min(760px, calc(100% - 20px)) !important;
    max-width: 760px !important;
    margin: 0 auto !important;
    padding: 10px 0 14px !important;
    grid-template-rows: auto auto auto auto auto auto !important;
  }
}

/* Web: keep the mobile-like 2x2 layout while using the wide game viewport. */
@media (min-width: 1061px) {
  body.trainer-play-mode .trainer-play .play-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: unset !important;
    height: 300px !important;
    min-height: 0 !important;
    align-self: start !important;
  }

  body.trainer-play-mode .trainer-play .play-zone {
    min-height: 0 !important;
    height: 100% !important;
    aspect-ratio: auto !important;
  }
}

/* Short tablet windows keep the four-column fit that prevents vertical overflow. */
@media (min-width: 721px) and (max-width: 1060px) and (max-height: 820px) {
  body.trainer-play-mode .trainer-play .play-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* Mobile Code Attention: match the Color Impulse header without moving the game body. */
@media (max-width: 720px) {
  body.trainer-play-mode .trainer-play .play-round {
    transform: translateY(1px);
  }

  body.trainer-play-mode .trainer-play .play-history {
    align-self: center !important;
    transform: translateY(2px);
  }

  body.trainer-play-mode .trainer-play .play-history span {
    align-self: center !important;
  }
}

/* Tablet and web: keep Code Attention controls at the right edge of the game viewport. */
@media (min-width: 721px) {
  body.trainer-play-mode .switching-game-actions {
    right: max(20px, calc((100vw - 760px) / 2 + 10px)) !important;
  }
}

/* Tablet and web setup: center the check glyph inside the selected badge. */
@media (min-width: 721px) {
  #switching-pro-overlay .switch-options button em::after {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) rotate(42deg) !important;
    transform-origin: center;
  }
}

/* Mobile Code Attention hero: match the Number Route hierarchy. */
@media (max-width: 720px) {
  #switching-pro-overlay .switch-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 122px !important;
    grid-template-rows: auto auto auto !important;
    align-items: center !important;
    column-gap: 10px !important;
    row-gap: 8px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 4px 2px 10px !important;
    overflow: visible !important;
  }

  #switching-pro-overlay .switch-hero-copy {
    display: contents !important;
  }

  #switching-pro-overlay .switch-kicker {
    display: none !important;
  }

  #switching-pro-overlay .switch-hero h1 {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    max-width: none !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    font-size: clamp(1.72rem, 8vw, 2.05rem) !important;
    line-height: 1 !important;
    letter-spacing: -0.035em !important;
  }

  #switching-pro-overlay .switch-rainbow {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    height: 4px !important;
  }

  #switching-pro-overlay .switch-hero p {
    grid-column: 1 !important;
    grid-row: 3 !important;
    align-self: center !important;
    max-width: none !important;
    margin: 0 !important;
    font-size: 0.87rem !important;
    line-height: 1.43 !important;
  }

  #switching-pro-overlay .switch-brain {
    grid-column: 2 !important;
    grid-row: 3 !important;
    justify-self: end !important;
    align-self: center !important;
    width: 122px !important;
    max-width: 122px !important;
    max-height: 126px !important;
    margin: 0 !important;
    object-fit: contain !important;
    filter: drop-shadow(0 13px 17px rgba(18, 39, 78, 0.18)) !important;
  }
}

@media (max-width: 380px) {
  #switching-pro-overlay .switch-hero {
    grid-template-columns: minmax(0, 1fr) 108px !important;
    column-gap: 8px !important;
  }

  #switching-pro-overlay .switch-hero h1 {
    font-size: clamp(1.64rem, 7.8vw, 1.88rem) !important;
  }

  #switching-pro-overlay .switch-hero p {
    font-size: 0.82rem !important;
  }

  #switching-pro-overlay .switch-brain {
    width: 108px !important;
    max-width: 108px !important;
    max-height: 114px !important;
  }
}

/* Code Attention difficulty keeps the same green selected state for every level. */
#switching-pro-overlay
  .switch-options-difficulty
  button[data-switch-difficulty="medium"].selected {
  border-color: #10bab2 !important;
  background: linear-gradient(135deg, #eafffb, #fff) !important;
  color: #079e96 !important;
  box-shadow: 0 15px 32px rgba(16, 186, 178, 0.16) !important;
}

#switching-pro-overlay
  .switch-options-difficulty
  button[data-switch-difficulty="medium"].selected
  em {
  background: linear-gradient(135deg, #12c7bf, #089a94) !important;
  box-shadow: 0 10px 22px rgba(10, 166, 158, 0.24) !important;
}

/* Code Attention about card: use the exact Counting Sprint about-card treatment. */
#switching-pro-overlay .switch-about {
  display: grid !important;
  gap: 8px !important;
  min-height: auto !important;
  margin: 0 !important;
  padding: 14px 16px !important;
  box-shadow: 0 18px 46px rgba(52, 81, 145, 0.1) !important;
}

#switching-pro-overlay .switch-about h2 {
  gap: 14px !important;
  margin: 0 !important;
  font-size: 1.08rem !important;
  line-height: 1.16 !important;
}

#switching-pro-overlay .switch-about h2::before {
  content: "i" !important;
  display: grid !important;
  width: 26px !important;
  height: 26px !important;
  place-items: center !important;
  border: 2px solid #75aef7 !important;
  border-radius: 50% !important;
  background: #f4f9ff !important;
  color: #4d9af0 !important;
  font-size: 0.78rem !important;
  font-weight: 880 !important;
  box-shadow: inset 0 0 0 4px rgba(117, 174, 247, 0.08) !important;
}

#switching-pro-overlay .switch-about p {
  max-width: none !important;
  margin: 0 !important;
  font-size: 0.88rem !important;
  line-height: 1.38 !important;
}

@media (max-width: 720px) {
  #switching-pro-overlay .switch-about {
    margin-top: 10px !important;
    padding: 12px !important;
  }

  #switching-pro-overlay .switch-about h2 {
    gap: 9px !important;
    font-size: 0.98rem !important;
    line-height: 1.1 !important;
  }

  #switching-pro-overlay .switch-about h2::before {
    width: 26px !important;
    height: 26px !important;
    border-width: 2px !important;
    font-size: 0.78rem !important;
  }

  #switching-pro-overlay .switch-about p {
    margin-left: 0 !important;
    font-size: 0.78rem !important;
    line-height: 1.34 !important;
  }
}

@media (max-width: 380px) {
  #switching-pro-overlay .switch-about {
    padding: 10px !important;
  }

  #switching-pro-overlay .switch-about h2 {
    font-size: 0.9rem !important;
  }
}

/* Code Attention about labels: match Counting Sprint's dark emphasis. */
#switching-pro-overlay .switch-about strong {
  color: #071238 !important;
}

/* Code Attention descriptions: one size step larger above and below the settings. */
#switching-pro-overlay .switch-hero p {
  font-size: 1.05rem !important;
}

#switching-pro-overlay .switch-about p {
  font-size: 0.98rem !important;
}

@media (max-width: 720px) {
  #switching-pro-overlay .switch-hero p {
    font-size: 0.97rem !important;
  }

  #switching-pro-overlay .switch-about p {
    font-size: 0.88rem !important;
  }
}

@media (max-width: 380px) {
  #switching-pro-overlay .switch-hero p {
    font-size: 0.92rem !important;
  }
}

/* Code Attention result message: match the setup description size. */
main.view-trainer .trainer-results .result-motivation {
  font-size: 1.05rem !important;
}

@media (max-width: 720px) {
  main.view-trainer .trainer-results .result-motivation {
    font-size: 0.97rem !important;
  }
}

@media (max-width: 380px) {
  main.view-trainer .trainer-results .result-motivation {
    font-size: 0.92rem !important;
  }
}

/* Code Attention result motivation: keep the practical follow-up visible under the score. */
main.view-trainer .trainer-results {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

main.view-trainer .trainer-results .result-life-motivation {
  margin: 2px 0 0;
  border: 1px solid rgba(59, 124, 243, 0.18);
  border-left: 4px solid #3b7cf3;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fc 100%);
  color: #40536a;
  padding: 14px 16px 15px 18px;
  font-size: 0.96rem;
  font-weight: 560;
  line-height: 1.52;
  font-style: italic;
  box-shadow: 0 7px 18px rgba(34, 67, 108, 0.06);
}

main.view-trainer .trainer-results .result-life-motivation::before {
  content: "Практическое применение";
  display: block;
  margin-bottom: 6px;
  color: #3b7cf3;
  font-size: 0.68rem;
  font-weight: 800;
  font-style: normal;
  letter-spacing: 0.11em;
  line-height: 1.2;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  main.view-trainer .trainer-results .result-life-motivation {
    padding: 12px 13px 13px 15px;
    font-size: 0.9rem;
    line-height: 1.42;
  }

  main.view-trainer .trainer-results .result-life-motivation::before {
    margin-bottom: 5px;
    font-size: 0.61rem;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 380px) {
  main.view-trainer .trainer-results .result-life-motivation {
    font-size: 0.86rem;
  }
}

/* Focus Matrix setup hero: use the exact Code Attention hierarchy and brain art. */
#spatial-memory-trainer-screen.spatial-memory-setup {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
}

@media (min-width: 721px) {
  #spatial-memory-trainer-screen .spatial-switch-screen {
    box-sizing: border-box !important;
    display: grid !important;
    width: min(1060px, calc(100vw - 44px)) !important;
    max-width: 1060px !important;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 410px) !important;
    grid-template-rows: repeat(4, auto) auto !important;
    gap: 14px 18px !important;
    align-items: start !important;
    margin: 0 auto !important;
    padding: 18px 0 34px !important;
    overflow: hidden !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen > .switch-hero {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 180px) !important;
    align-items: center !important;
    gap: 14px !important;
    min-height: 0 !important;
    margin: 0 !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-hero-copy {
    gap: 9px !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-kicker {
    min-height: 34px !important;
    gap: 8px !important;
    padding: 0 13px !important;
    font-size: 0.78rem !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-hero h1 {
    max-width: 100% !important;
    margin: 0 !important;
    white-space: normal !important;
    font-size: 3rem !important;
    line-height: 1 !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-rainbow {
    width: min(300px, 100%) !important;
    height: 5px !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-hero p {
    max-width: 410px !important;
    margin: 0 !important;
    font-size: 1.05rem !important;
    line-height: 1.42 !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-brain {
    justify-self: end !important;
    width: min(180px, 100%) !important;
    max-height: 190px !important;
    margin: 0 !important;
    object-fit: contain !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen > .switch-card,
  #spatial-memory-trainer-screen .spatial-switch-screen > .switch-start {
    grid-column: 2 !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen > .switch-card {
    grid-row: 1 !important;
    min-height: 112px !important;
    gap: 7px !important;
    margin: 0 !important;
    padding: 22px 24px !important;
    box-shadow: 0 14px 42px rgba(16, 19, 24, 0.08) !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen > .switch-start {
    grid-row: 2 !important;
    min-height: 50px !important;
    margin: 0 !important;
    gap: 12px !important;
    font-size: 1.08rem !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen > .switch-about {
    grid-column: 1 !important;
    grid-row: 3 / span 2 !important;
    margin: 0 !important;
    padding: 14px 16px !important;
    box-shadow: 0 14px 42px rgba(16, 19, 24, 0.08) !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-about p {
    font-size: 0.98rem !important;
    line-height: 1.38 !important;
  }
}

@media (min-width: 721px) and (max-width: 900px) {
  #spatial-memory-trainer-screen .spatial-switch-screen {
    width: min(100vw - 28px, 820px) !important;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px) !important;
    gap: 12px !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen > .switch-hero {
    grid-template-columns: minmax(0, 1fr) 118px !important;
    gap: 12px !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-hero h1 {
    font-size: 2.25rem !important;
    white-space: nowrap !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-rainbow {
    width: 196px !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-brain {
    max-height: 132px !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen > .switch-card {
    min-height: 106px !important;
    padding: 20px 22px !important;
  }
}

@media (max-width: 720px) {
  #spatial-memory-trainer-screen .spatial-switch-screen {
    width: min(390px, calc(100vw - 28px)) !important;
    margin: 0 auto !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen > .switch-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 122px !important;
    grid-template-rows: auto auto auto !important;
    align-items: center !important;
    column-gap: 10px !important;
    row-gap: 8px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 4px 2px 10px !important;
    overflow: visible !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-hero-copy {
    display: contents !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-kicker {
    display: none !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-hero h1 {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    max-width: none !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    font-size: clamp(1.72rem, 8vw, 2.05rem) !important;
    line-height: 1 !important;
    letter-spacing: -0.035em !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-rainbow {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    height: 4px !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-hero p {
    grid-column: 1 !important;
    grid-row: 3 !important;
    align-self: center !important;
    max-width: none !important;
    margin: 0 !important;
    font-size: 0.97rem !important;
    line-height: 1.43 !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-brain {
    grid-column: 2 !important;
    grid-row: 3 !important;
    justify-self: end !important;
    align-self: center !important;
    width: 122px !important;
    max-width: 122px !important;
    max-height: 126px !important;
    margin: 0 !important;
    object-fit: contain !important;
    filter: drop-shadow(0 13px 17px rgba(18, 39, 78, 0.18)) !important;
  }
}

@media (max-width: 380px) {
  #spatial-memory-trainer-screen .spatial-switch-screen > .switch-hero {
    grid-template-columns: minmax(0, 1fr) 108px !important;
    column-gap: 8px !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-hero h1 {
    font-size: clamp(1.64rem, 7.8vw, 1.88rem) !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-hero p {
    font-size: 0.92rem !important;
  }

  #spatial-memory-trainer-screen .spatial-switch-screen .switch-brain {
    width: 108px !important;
    max-width: 108px !important;
    max-height: 114px !important;
  }
}
