/* styles.css */
@font-face {
  font-family: 'Roboto';
  src: url('fonts/Roboto-Regular.ttf') format('truetype');
  font-weight: 400;
}

@font-face {
  font-family: 'Roboto';
  src: url('fonts/Roboto-Medium.ttf') format('truetype');
  font-weight: 500;
}

@font-face {
  font-family: 'Roboto';
  src: url('fonts/Roboto-Bold.ttf') format('truetype');
  font-weight: 700;
}

body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f7fb;
  color: #172033;
  user-select: none;
}

/* =========================
   Logo Image Sizing
   ========================= */

/* Navigation Logo */
.nav-logo-img {
  height: 28px;
  width: auto;
  vertical-align: middle;
  margin-right: 8px;
}

/* Hero Logo */
.hero-logo-img {
  width: clamp(5rem, 12vw, 8rem);
  height: auto;
  max-height: 120px;
  margin-bottom: 16px;
}

/* Footer Logo */
.footer-logo-img {
  height: 24px;
  width: auto;
  vertical-align: middle;
  margin-right: 8px;
}

/* For dark backgrounds (footer) */
.site-footer .footer-logo-img {
  filter: brightness(0) invert(1);
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .nav-logo-img {
    height: 22px;
  }

  .hero-logo-img {
    width: clamp(4rem, 15vw, 6rem);
    max-height: 80px;
  }

  .footer-logo-img {
    height: 20px;
  }
}

header {
  background-color: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

nav {
  font-family: 'Roboto', sans-serif;
  padding: 0;
}

nav ul {
  width: 92%;
  max-width: 1100px;
  min-height: 44px;
  list-style-type: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
}

nav ul li {
  margin: 0;
  display: flex;
}

.nav-item--right {
  margin-left: auto;
}

.nav-item a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #172033;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.nav-item--active a {
  background-color: #edf5ff;
}

.nav-item:not(.nav-item--active) a:hover {
  background-color: #edf5ff;
}

.nav-logo-icon {
  color: #172033 !important;
  margin-right: 6px;
}

/* =========================
   Responsive Navigation
   ========================= */

/* Hide mobile dropdown on desktop */
.nav-item--mobile-dropdown {
  display: none;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 6px 0;
  list-style: none;
  z-index: 1001;
}

.dropdown-menu li {
  display: block;
  margin: 0;
}

.dropdown-menu li a {
  display: block;
  padding: 8px 18px;
  color: #172033;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  transition: background-color 0.15s ease;
}

.dropdown-menu li a:hover {
  background-color: #edf5ff;
}

/* Show dropdown when active */
.dropdown-menu.open {
  display: block;
}

/* =========================
   Mobile Styles
   ========================= */

@media (max-width: 768px) {

  /* Hide desktop test links */
  .nav-item--desktop {
    display: none;
  }

  /* Show mobile dropdown */
  .nav-item--mobile-dropdown {
    display: flex;
    position: relative;
  }

  .nav-item--mobile-dropdown>a {
    cursor: pointer;
  }

  /* Mobile dropdown - full width */
  .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
    padding: 6px 0;
    z-index: 1001;
  }

  .dropdown-menu.open {
    display: block;
  }

  .dropdown-menu li a {
    padding: 10px 20px;
    font-size: 0.95rem;
  }

  /* Keep site name and right items visible */
  .nav-item--active {
    display: flex;
  }

  .nav-item--right {
    display: flex;
  }

  /* Adjust nav for mobile */
  nav ul {
    flex-wrap: wrap;
    gap: 0;
  }

  nav ul li {
    flex: 0 0 auto;
  }
}

.hero {
  align-items: center;
  background-color: #3b7ea5;
  display: flex;
  color: #fff;
  padding: 12px 12px;
  text-align: center;
  height: 550px;
}

.hero__content {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  animation: heroFadeIn 0.7s ease-out forwards;
}

.hero--red {
  background-color: #d64545;
}

.hero--green {
  background-color: #22a06b;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__content>.fa-lightbulb {
  font-size: clamp(3.5rem, 8vw, 6rem);
  margin-bottom: 18px;
}

.hero__content>.fa-bolt {
  font-size: clamp(3.5rem, 8vw, 6rem);
  margin-bottom: 18px;
  color: #FED41D;
}

.hero__content>.fa-keyboard {
  font-size: clamp(3.5rem, 8vw, 6rem);
  margin-bottom: 18px;
  color: #FED41D;
}

.hero__content>.fa-brain {
  font-size: clamp(3.5rem, 8vw, 6rem);
  margin-bottom: 18px;
  color: #FED41D;
}

.hero__content>.fa-eye {
  font-size: clamp(3.5rem, 8vw, 6rem);
  margin-bottom: 18px;
  color: #FED41D;
}

.hero__content>.fa-computer-mouse {
  font-size: clamp(3.5rem, 8vw, 6rem);
  margin-bottom: 18px;
  color: #FED41D;
}

.hero__content>.fa-crosshairs {
  font-size: clamp(3.5rem, 8vw, 6rem);
  margin-bottom: 18px;
  color: #FED41D;
}

.hero__content>.fa-key {
  font-size: clamp(3.5rem, 8vw, 6rem);
  margin-bottom: 18px;
  color: #FED41D;
}

.hero__content>.fa-table-cells-large {
  font-size: clamp(3.5rem, 8vw, 6rem);
  margin-bottom: 18px;
  color: #FED41D;
}

.hero__content>.fa-hashtag {
  font-size: clamp(3.5rem, 8vw, 6rem);
  margin-bottom: 18px;
  color: #FED41D;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  margin: 0;
}

.hero h2 {
  color: #e9eef5;
  font-size: 1.15rem;
  line-height: 1.6;
  margin: 18px auto 28px;
}

.hero p {
  color: #e9eef5;
  font-size: 1.15rem;
  line-height: 1.6;
  margin: 18px auto 28px;
}

.hero__button {
  align-items: center;
  background-color: #FED41D;
  color: #0f2b4d;
  display: inline-flex;
  font-weight: 700;
  gap: 10px;
  padding: 13px 22px;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.hero__button:hover {
  background-color: #ffffff;
  transform: scale(1.03);
}

.start-message {
  display: block;
  color: #FED41D;
  text-align: center;
  font-weight: 500;
  margin-top: 0px;
}

main {
  width: 92%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 0;
}

.card-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.card {
  background-color: #fff;
  border: 1px solid #e4e9f2;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
  padding: 24px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  transform: scale(1.03);
  cursor: pointer;
}

.card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: #568fb1;
  font-size: 1.35rem;
}

.card h3 {
  margin-top: 0;
}

.card p {
  color: #363b42;
  line-height: 1.5;
  margin-bottom: 10px;
}

/* Start Button */
.start-btn {
  background-color: #FED41D;
  border: none;
  color: #0f2b4d;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  /* font-weight: 700; */
  font-size: 1.2rem;
  padding: 14px 40px;
  margin-top: 10px;
}

.start-btn:hover {
  background-color: #ffffff;
}

/* Dashboard */

.dashboard-header {
  margin-bottom: 28px;
}

.dashboard-header h1 {
  margin: 0 0 8px;
}

.dashboard-header p {
  color: #5f6875;
  margin: 0;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.dashboard-stat {
  background-color: #fff;
  border: 1px solid #e4e9f2;
  padding: 22px;
}

.dashboard-stat__label {
  color: #687384;
  display: block;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.dashboard-stat strong {
  font-size: 1.8rem;
}

.dashboard-challenge {
  align-items: center;
  background-color: #3b7ea5;
  color: #fff;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  padding: 28px;
}

.dashboard-eyebrow {
  color: #FED41D;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.dashboard-challenge h2 {
  margin: 8px 0;
}

.dashboard-challenge p {
  color: #e9eef5;
  margin: 0;
}

.dashboard-button {
  background-color: #FED41D;
  color: #0f2b4d;
  font-weight: 700;
  padding: 13px 20px;
  text-decoration: none;
  white-space: nowrap;
}

.dashboard-button:hover {
  background-color: #fff;
}

.dashboard-section {
  margin-bottom: 48px;
}

.dashboard-section__heading {
  margin-bottom: 18px;
}

.dashboard-section__heading h2 {
  margin: 0 0 6px;
}

.dashboard-section__heading p {
  color: #687384;
  margin: 0;
}

.test-list {
  display: grid;
  gap: 12px;
}

.test-card {
  align-items: center;
  background-color: #fff;
  border: 1px solid #e4e9f2;
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  gap: 18px;
  padding: 18px 20px;
}

.test-card__icon {
  align-items: center;
  background-color: #edf5ff;
  color: #3b7ea5;
  display: flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.test-card__info h3 {
  margin: 0 0 4px;
}

.test-card__info p {
  color: #687384;
  margin: 0;
}

.test-card__score {
  text-align: right;
}

.test-card__score strong,
.test-card__score span {
  display: block;
}

.test-card__score span {
  color: #687384;
  font-size: 0.85rem;
  margin-top: 3px;
}

.test-card>a {
  color: #3b7ea5;
  font-weight: 500;
  text-decoration: none;
}

.test-card>a:hover {
  text-decoration: underline;
}

/* =========================
   Dashboard
   ========================= */

.dashboard-header {
  margin-bottom: 28px;
}

.dashboard-header h1 {
  margin: 0 0 8px;
}

.dashboard-header p {
  color: #5f6875;
  margin: 0;
}


/* Overall Brain Health */

.brain-health-card {
  align-items: center;
  background-color: #fff;
  border: 1px solid #e4e9f2;
  display: flex;
  gap: 42px;
  margin-bottom: 48px;
  padding: 34px;
}

.brain-health-info {
  max-width: 520px;
}

.brain-health-info h2 {
  margin: 8px 0;
}

.brain-health-info p {
  color: #687384;
  line-height: 1.5;
  margin: 0 0 18px;
}

.brain-health-score {
  flex-shrink: 0;
}

.score-circle {
  --score: 50;

  align-items: center;
  background:
    conic-gradient(var(--score-color) calc(var(--score) * 1%),
      #e8edf3 calc(var(--score) * 1%));
  border-radius: 50%;
  display: flex;
  height: 150px;
  justify-content: center;
  position: relative;
  width: 150px;
}

.score-circle--green {
  --score-color: #14ce80;
}

.score-circle--yellow {
  --score-color: #fedc1d;
}

.score-circle--orange {
  --score-color: #ff9b04;
}

.score-circle--red {
  --score-color: #d64545;
}

.score-circle::before {
  background-color: #fff;
  border-radius: 50%;
  content: "";
  inset: 10px;
  position: absolute;
}

.score-circle__content {
  align-items: baseline;
  display: flex;
  position: relative;
  z-index: 1;
}

.score-circle__content strong {
  font-size: 2rem;
}

.score-circle__content span {
  color: #687384;
  font-size: 0.8rem;
  margin-left: 2px;
}

.score-circle--large {
  height: 190px;
  width: 190px;
}

.score-circle--large::before {
  inset: 12px;
}

.score-circle--large .score-circle__content strong {
  font-size: 2.8rem;
}

.score-comparison {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.score-comparison strong {
  font-size: 1.2rem;
}

.score-comparison span {
  color: #687384;
  font-size: 0.9rem;
}


/* Performance */

.dashboard-section {
  margin-bottom: 48px;
}

.dashboard-section__heading {
  margin-bottom: 18px;
}

.dashboard-section__heading h2 {
  margin: 0 0 6px;
}

.dashboard-section__heading p {
  color: #687384;
  margin: 0;
}

/* Performance grid */
.brain-performance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* Hidden cards for Show More */
.hidden-card {
  display: none;
}

/* Keep card layout consistent */
.performance-card {
  align-items: center;
  background-color: #fff;
  border: 1px solid #e4e9f2;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  text-align: center;
  min-height: 200px;
}

.performance-card .score-circle {
  height: 120px;
  margin-bottom: 16px;
  width: 120px;
  flex-shrink: 0;
}

.performance-card .score-circle::before {
  inset: 9px;
}

.performance-card h3 {
  margin: 0 0 5px;
}

.performance-card>span {
  color: #687384;
  font-size: 0.85rem;
}

.performance-card a {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #3b7ea5;
  text-decoration: none;
}

.performance-card a:hover {
  text-decoration: underline;
}

.show-more-btn {
  background-color: #FED41D;
  border: none;
  color: #0f2b4d;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  padding: 10px 24px;
  font-size: 0.95rem;
}

.show-more-btn:hover {
  background-color: #fff;
}


/* Chart */

.performance-chart-card {
  background-color: #fff;
  border: 1px solid #e4e9f2;
  padding: 24px;
}

.chart-top {
  display: flex;
  gap: 48px;
  margin-bottom: 24px;
}

.chart-top>div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chart-label {
  color: #687384;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.chart-top strong {
  font-size: 1.6rem;
}

.chart-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.chart-tab {
  background-color: #fff;
  border: 1px solid #d9e0e8;
  color: #4d5867;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-size: 0.9rem;
  padding: 9px 14px;
}

.chart-tab:hover {
  background-color: #edf5ff;
}

.chart-tab--active {
  background-color: #edf5ff;
  border-color: #3b7ea5;
  color: #0f2b4d;
  font-weight: 500;
}

.chart-wrapper {
  width: 100%;
  height: clamp(260px, 30vw, 320px);
}

#performanceChart {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-axis-label {
  fill: #687384;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
}

.chart-user-line {
  fill: none;
  stroke: #3b7ea5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.chart-user-point {
  fill: #3b7ea5;
  vector-effect: non-scaling-stroke;
}

.chart-month-label {
  fill: #687384;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  text-anchor: middle;
}


/* Today's Challenge */

.dashboard-challenge {
  align-items: center;
  background-color: #3b7ea5;
  color: #fff;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  padding: 28px;
}

.dashboard-eyebrow {
  color: #fec21d;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.dashboard-challenge h2 {
  margin: 8px 0;
}

.dashboard-challenge p {
  color: #e9eef5;
  margin: 0;
}

.dashboard-button {
  background-color: #FED41D;
  color: #0f2b4d;
  font-weight: 700;
  padding: 13px 20px;
  text-decoration: none;
  white-space: nowrap;
}

.dashboard-button:hover {
  background-color: #fff;
}

/* About This Test */

.about-test {
  background-color: #fff;
  border: 1px solid #e4e9f2;
  margin: 20px auto 48px;
  max-width: 1100px;
  padding: 28px 32px;
}

.about-test__heading {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.about-test__heading>i {
  color: #3b7ea5;
  font-size: 1.2rem;
}

.about-test__heading h2 {
  margin: 0 0 4px;
  color: #2b5ba3;
}

.about-test__heading p {
  color: #687384;
  margin: 0;
}

.about-test__content {
  color: #4d5867;
  line-height: 1.6;
  max-width: 850px;
}

.about-test__content p {
  margin: 0 0 14px;
}

.about-test__content p:last-child {
  margin-bottom: 0;
}

.about-test__content h3 {
  color: #17345e;
  margin: 20px 0 0px;
}

.about-test__content a{
  text-decoration: none;
}

/* Typing Test */

.typing-hero {
  background-color: #c4c4c4;
  min-height: 600px;
  height: auto;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  /* changed from flex-start */
  justify-content: center;
  /* added */
  position: relative;
  padding-top: 0;
  /* changed from 40px */
}

#typing-title {
  color: #000000;
}

.typing-test-ui {
  display: none;
  width: 100%;
}

.typing-live-stats {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-bottom: 24px;
}

.typing-live-stats>div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#typingMessage {
  color: #0a0a0a;
}

#typingTimer {
  color: #5ca555;
}

.typing-live-stats span {
  color: #383838;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.typing-live-stats strong {
  font-size: 1.6rem;
}

.typing-passage {
  /* background-color: rgba(255, 255, 255, 0.12); */
  overflow: hidden;
  white-space: normal;
  color: #242424;
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  line-height: 1.8;
  padding: 24px;
  text-align: left;
}

.typing-passage span.correct {
  color: #5ca555;
}

.typing-passage span.incorrect {
  color: #ff7373;
  text-decoration: underline;
}

.typing-passage span.current {
  text-decoration: underline;
  text-decoration-color: #5ca555;
  text-decoration-thickness: 2px;
}

.typing-input {
  position: fixed;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.typing-input:focus {
  outline: 3px solid rgba(255, 255, 255, 0.35);
}

.typing-result {
  margin-top: 20px;
}

.typing-result strong {
  font-size: 2rem;
}

/* Color Surge */

.color-surge-hero {
  overflow: hidden;
  position: relative;
}

.color-surge-hero .hero__content {
  position: relative;
  z-index: 2;
}

.color-fill {
  background-color: #FED41D;
  bottom: 0;
  height: 0%;
  left: 0;
  position: absolute;
  transition: height 0.08s linear;
  width: 100%;
  z-index: 1;
}

.color-surge-hero .hero__content,
.color-surge-hero .hero__content p,
.color-surge-hero .hero__content h1,
.color-surge-hero .hero__content span {
  transition: color 0.15s ease;
}

.color-surge-hero.fill-complete {
  background-color: #5ca555;
}

.color-surge-hero.fill-complete .color-fill {
  background-color: #5ca555;
}

.color-surge-hero.fill-complete .hero__content {
  color: #fff;
}

/* Color Blind Test */

.color-blind-hero {
  background-color: #4a4a5a;
  min-height: 600px;
  height: auto;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.color-blind-hero .hero__content {
  color: #fdfdfd;
}

.color-blind-hero .hero__content p {
  color: #ffffff;
}

.color-blind-hero .start-message {
  color: #3b7ea5;
}

.color-game {
  display: none;
  width: 450px;
  max-width: 100%;
  margin: 10px auto 0;
  padding: 0 20px;
  box-sizing: border-box;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 20px auto 0;
  width: 100%;
  max-width: 450px;
}

.color-circle {
  aspect-ratio: 1;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  background-color: #e2e8f0;
}

.color-circle.shake {
  animation: shake 0.1s ease;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-7px);
  }

  75% {
    transform: translateX(7px);
  }
}

.color-game__top {
  display: flex;
  justify-content: space-between;
  margin: 0 auto 12px;
  width: 100%;
}

.color-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.color-stat span {
  color: #fafafa;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.color-stat strong {
  color: #ffffff;
  font-size: 1.3rem;
}

.color-instruction {
  color: #4a5568;
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 8px;
}

.color-button {
  background-color: #FED41D;
  border: 0;
  color: #0f2b4d;
  cursor: pointer;
  display: none;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  margin-top: 20px;
  padding: 13px 24px;
}

.color-button:hover {
  background-color: #fff;
}

@media (max-width: 600px) {
  .color-grid {
    max-width: 320px;
    gap: 14px;
  }

  .color-game__top {
    gap: 40px;
  }
}

/* Attention Test */

.attention-hero {
  overflow: hidden;
}

.attention-game {
  display: none;
  margin-top: 20px;
  width: 100%;
}

.attention-stage {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 24px;
  height: 190px;
}

.attention-box {
  align-items: flex-start;
  background-color: #f1f5f7;
  border: 5px solid #334155;
  display: flex;
  height: 120px;
  justify-content: center;
  position: relative;
  width: 120px;
  cursor: pointer;
  transition:
    transform 0.35s ease,
    background-color 0.2s ease;
}

.attention-ball {
  background-color: #FED41D;
  border-radius: 50%;
  height: 24px;
  left: 50%;
  position: absolute;
  top: 18px;
  transform: translateX(-50%);
  width: 24px;
}

.attention-boxes-hidden .attention-ball {
  opacity: 0;
}

.attention-box.is-lifted {
  transform: translateY(-55px);
}

.attention-box.is-shuffling {
  transition: transform 0.28s ease;
}

.attention-hero.game-active .attention-game {
  display: block;
}

.attention-hero.game-active .attention-hero__content>* {
  visibility: visible;
}

.attention-hero.game-active #attentionIcon,
.attention-hero.game-active #attention-title,
.attention-hero.game-active #attentionMessage,
.attention-hero.game-active #attentionStatus {
  display: none;
}

.attention-button {
  background-color: #FED41D;
  border: 0;
  color: #0f2b4d;
  cursor: pointer;
  display: none;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  margin-top: 20px;
  padding: 13px 22px;
}

.attention-button:hover {
  background-color: #fff;
}

.attention-hero.result .attention-button {
  display: inline-block;
}

.attention-box.correct {
  background-color: #5ca555;
}

.attention-box.wrong {
  background-color: #d64545;
}

@media (max-width: 600px) {

  .attention-stage {
    gap: 10px;
  }

  .attention-box {
    height: 95px;
    width: 95px;
  }

}

/* =========================
   CPS Test
   ========================= */

.cps-hero {
  background-color: #3a5a6a;
  min-height: 600px;
  height: auto;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cps-hero .hero__content {
  color: #fff;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 680px;
  padding: 0 20px;
}

.cps-hero .hero__content p {
  color: #a0aec0;
}

/* Stats at the very top - absolute positioned */
.cps-stats {
  display: none;
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  gap: 60px;
  z-index: 10;
  padding: 0 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 10px 30px;
}

.cps-stats.visible {
  display: flex;
}

.cps-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
}

.cps-stat span {
  color: #a0aec0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cps-stat-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.cps-stat-value strong {
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.cps-stat-value .cps-unit {
  color: #a0aec0;
  font-size: 1rem;
  font-weight: 400;
}

.cps-stat-value strong#cpsTimer {
  color: #60a5fa;
}

.cps-stat-value strong#cpsClicks {
  color: #FED41D;
}

.cps-game {
  display: none;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.cps-result {
  text-align: center;
  padding: 20px;
  margin: 10px auto 0;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 2px solid rgba(92, 165, 85, 0.3);
}

.cps-result-label {
  color: #a0aec0;
  font-size: 1.2rem;
}

.cps-result-value {
  color: #5ca555;
  font-size: 2.5rem;
  font-weight: 700;
}

.cps-result-total {
  color: #a0aec0;
  font-size: 1rem;
  margin-left: 8px;
}

/* Click Ripple Effect */
.ripple-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.ripple-ring {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #14ce80;
  transform: translate(-50%, -50%) scale(0);
  animation: rippleExpand 0.8s ease-out forwards;
  pointer-events: none;
}

.cps-stop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(200, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  animation: stopFade 0.3s ease;
}

.cps-stop-overlay span {
  font-size: 5rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  animation: stopPulse 0.5s ease 2;
}

@keyframes stopFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes stopPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}

@keyframes rippleExpand {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(8);
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .cps-stats {
    gap: 30px;
    padding: 8px 16px;
    top: 15px;
  }

  .cps-stat-value strong {
    font-size: 1.5rem;
  }

  .cps-result-value {
    font-size: 2rem;
  }

  .cps-stats.visible {
    display: flex;
  }
}

/* =========================
   Aim Trainer Test
   ========================= */

.aiming-hero {
  background-color: #3b8a6e;
  min-height: 600px;
  height: auto;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-top: 0;
}

.aiming-hero .hero__content {
  color: #fff;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 680px;
}

.aiming-hero .hero__content p {
  color: #dcdee0;
}

.aiming-stats {
  display: none;
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 10px 30px;
}

.aiming-stats.visible {
  display: flex;
}

.aiming-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
}

.aiming-stat span {
  color: #a0aec0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.aiming-stat strong {
  color: #FED41D;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.aiming-game {
  display: none;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.aiming-target {
  position: absolute;
  border-radius: 50%;
  border: 5px solid #E31020;
  cursor: pointer;
  z-index: 10;
  background: #E31020;
  background-image: radial-gradient(circle at center,
      #E31020 33.33%,
      white 33.34%,
      white 66.66%,
      #E31020 66.67%);
}

.aiming-target.hit {
  animation: targetHit 0.2s ease forwards;
}

@keyframes targetHit {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.aiming-result {
  text-align: center;
  padding: 16px;
  margin: 10px auto 0;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 2px solid rgba(96, 165, 250, 0.3);
}

.aiming-result-label {
  color: #a0aec0;
  font-size: 1.1rem;
}

.aiming-result-value {
  color: #60a5fa;
  font-size: 2rem;
  font-weight: 700;
}

@media (max-width: 600px) {
  .aiming-stats {
    padding: 8px 16px;
    top: 15px;
  }

  .aiming-stat strong {
    font-size: 1.5rem;
  }

  .aiming-result-value {
    font-size: 1.5rem;
  }
}

/* Shulte Table Test  */

.shulte-hero {
  background-color: #b8876a;
  min-height: 600px;
  height: auto;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  /* changed from flex-start */
  justify-content: center;
  /* added */
  position: relative;
  padding-top: 0;
  /* removed 40px */
}

#shulteMessage {
  color: #fafafa;
}

.shulte-hero .hero__content {
  color: #fff;
  position: relative;
  z-index: 2;
  width: 100%;
}

.shulte-hero .hero__content p {
  color: #dee0e2;
}

.shulte-hero .start-message {
  color: #FED41D;
}

.shulte-game {
  display: none;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.shulte-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin: 10px auto 20px;
}

.shulte-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.shulte-stat strong {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
}

.shulte-stat strong#shulteTime {
  color: #fdfdfd;
}

.shulte-stat strong#shulteAvg {
  color: #FED41D;
}

.shulte-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 0 auto;
  max-width: 450px;
}

.shulte-cell {
  aspect-ratio: 1;
  background-color: #4a4f58;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.1s ease;
  user-select: none;
}

.shulte-cell:hover {
  background-color: #4a5568;
  transform: scale(1.05);
}

.shulte-cell.correct {
  background-color: #5ca555;
  border-color: #5ca555;
  cursor: default;
  transform: none;
}

.shulte-cell.correct:hover {
  transform: none;
}

.shulte-result {
  text-align: center;
  padding: 16px;
  margin: 20px auto 0;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 2px solid rgba(96, 165, 250, 0.3);
}

.shulte-result-label {
  color: #ffffff;
  font-size: 1.1rem;
}

.shulte-result-value {
  color: #60a5fa;
  font-size: 2rem;
  font-weight: 700;
}

.shulte-button {
  background-color: #FED41D;
  border: 0;
  color: #0f2b4d;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  padding: 13px 24px;
  font-size: 1rem;
  display: block;
  margin: 15px auto 0;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.shulte-button:hover {
  background-color: #fff;
  transform: scale(1.03);
}

@media (max-width: 600px) {
  .shulte-stats {
    gap: 30px;
  }

  .shulte-stat strong {
    font-size: 1.4rem;
  }

  .shulte-grid {
    gap: 6px;
    max-width: 320px;
  }

  .shulte-cell {
    font-size: 1.1rem;
  }

  .shulte-result-value {
    font-size: 1.5rem;
  }
}

/* =========================
   Flash Number Test
   ========================= */

.focus-hero {
  background-color: #1a202c;
  min-height: 600px;
  height: auto;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  /* changed from flex-start */
  justify-content: center;
  /* added */
  position: relative;
  padding-top: 0;
  /* removed 40px */
}

.focus-hero .hero__content {
  color: #fff;
  position: relative;
  z-index: 2;
  width: 100%;
}

.focus-hero .hero__content p {
  color: #a0aec0;
}

.focus-hero .start-message {
  color: #FED41D;
}

.focus-game {
  display: none;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
  text-align: center;
}

.focus-numbers {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #FED41D;
  margin: 20px 0;
}

.focus-numbers .number-done {
  color: #5ca555;
  font-size: 3rem;
}

.focus-input-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.focus-prompt {
  color: #a0aec0;
  font-size: 1.1rem;
  margin-bottom: 12px;
  text-align: center;
}

.focus-input {
  background-color: #2d3748;
  border: 2px solid #4a5568;
  border-radius: 6px;
  color: #fff;
  font-size: 1.5rem;
  padding: 12px 16px;
  width: 200px;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  transition: border-color 0.2s ease;
}

.focus-input:focus {
  outline: none;
  border-color: #FED41D;
}

.focus-input::placeholder {
  color: #718096;
}

.focus-submit {
  background-color: #FED41D;
  border: 0;
  color: #0f2b4d;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  padding: 13px 24px;
  font-size: 1rem;
  margin: 30px auto;
  display: block;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.focus-submit:hover {
  background-color: #fff;
  transform: scale(1.03);
}

.focus-result {
  padding: 20px;
  margin: 20px 0;
  border-radius: 8px;
  font-size: 1.3rem;
  font-weight: 700;
}

.focus-result.success {
  background-color: rgba(92, 165, 85, 0.2);
  border: 2px solid #5ca555;
  color: #5ca555;
}

.focus-result.fail {
  background-color: rgba(214, 69, 69, 0.2);
  border: 2px solid #d64545;
  color: #d64545;
}

.focus-result-icon {
  display: inline-block;
  margin-right: 10px;
  font-size: 1.8rem;
}

.focus-result.success .focus-result-icon::before {
  content: "✓";
}

.focus-result.fail .focus-result-icon::before {
  content: "✗";
}

.focus-button {
  background-color: #FED41D;
  border: 0;
  color: #0f2b4d;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  padding: 13px 24px;
  font-size: 1rem;
  display: block;
  margin: 15px auto 0;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.focus-button:hover {
  background-color: #fff;
  transform: scale(1.03);
}

@media (max-width: 600px) {
  .focus-numbers {
    font-size: 3rem;
    min-height: 80px;
  }

  .focus-input {
    width: 150px;
    font-size: 1.2rem;
  }

  .focus-submit {
    margin-left: 6px;
    padding: 13px 16px;
    font-size: 0.9rem;
  }

  .focus-result {
    font-size: 1.1rem;
  }
}

/* =========================
   Secret Code Test
   ========================= */

.secretcode-hero {
  background-color: #8a7a9e;
  min-height: 600px;
  height: auto;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  /* changed from flex-start */
  justify-content: center;
  /* added */
  position: relative;
  padding-top: 0;
  /* changed from 40px */
}

.secretcode-hero .hero__content {
  color: #fff;
  position: relative;
  z-index: 2;
  width: 100%;
}

.secretcode-hero .hero__content p {
  color: #d8d9db;
}

.secretcode-hero .start-message {
  color: #FED41D;
}

.secretcode-game {
  display: none;
  width: 100%;
  max-width: 750px;
  /* increased from 500px – gives more room to spread */
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.secretcode-stats {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin: 10px auto 16px;
}

.secretcode-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.secretcode-stat span {
  color: #fdfdfd;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.secretcode-stat strong {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
}

.secretcode-stat strong#secretcodeLevel {
  color: #60a5fa;
}

.secretcode-stat strong#secretcodeStreak {
  color: #FED41D;
}

.secretcode-stat strong#secretcodeBest {
  color: #5ca555;
}

.secretcode-instruction {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  color: #fcfcfc;
  font-size: 1.15rem;
  margin-bottom: 16px;
  padding: 14px 24px;
  width: 100%;
  box-sizing: border-box;
}

.instruction-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.instruction-item.left {
  margin-right: 70px;
}

.instruction-item.center {
  margin-left: auto;
  margin-right: auto;
}

.instruction-item.right {
  margin-left: 70px;
}

.secretcode-instruction .dot {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 20%;
  flex-shrink: 0;
}

.secretcode-instruction .dot.green {
  background-color: #5ca555;
}

.secretcode-instruction .dot.yellow {
  background-color: #FED41D;
}

.secretcode-instruction .dot.gray {
  background-color: #dd5550;
}

.secretcode-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 auto;
  width: 100%;
  max-width: 450px;
}

.secretcode-row {
  display: grid;
  gap: 6px;
  height: 60px;
}

.secretcode-tile {
  background-color: transparent;
  border: 4px solid #202020;
  border-radius: 6px;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  user-select: none;
  position: relative;
}

.secretcode-tile.filled {
  background-color: #334155;
  cursor: default;
}

.secretcode-tile.green {
  background-color: #5ca555;
  cursor: default;
}

.secretcode-tile.yellow {
  background-color: #FED41D;
  color: #0f172a;
  cursor: default;
}

.secretcode-tile.gray {
  background-color: #dd5550;
  cursor: default;
}

/* Flip animation */
.secretcode-tile.flip {
  animation: secretFlip 0.4s ease;
}

@keyframes secretFlip {
  0% {
    transform: rotateY(0deg);
  }

  50% {
    transform: rotateY(90deg);
  }

  100% {
    transform: rotateY(0deg);
  }
}

.secretcode-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.secretcode-btn {
  background-color: #1e293b;
  border: 1px solid #334155;
  color: #fafafa;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.secretcode-btn:hover {
  background-color: #334155;
  transform: scale(1.03);
}

.secretcode-btn i {
  margin-right: 6px;
}

/* Overlay */
.secretcode-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: secretFadeIn 0.3s ease;
}

@keyframes secretFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.secretcode-overlay-content {
  text-align: center;
  padding: 40px;
  background-color: #1e293b;
  border-radius: 12px;
  border: 1px solid #334155;
  max-width: 400px;
  width: 90%;
}

.secretcode-overlay-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.secretcode-overlay-content h2 {
  color: #fff;
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.secretcode-overlay-content p {
  color: #94a3b8;
  margin: 4px 0;
  font-size: 1.1rem;
}

.secretcode-best-text {
  color: #5ca555 !important;
  font-weight: 700;
  margin-top: 8px !important;
}

.secretcode-playagain {
  background-color: #FED41D;
  border: 0;
  color: #0f172a;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  padding: 13px 32px;
  font-size: 1rem;
  margin-top: 16px;
  border-radius: 6px;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.secretcode-playagain:hover {
  background-color: #fff;
  transform: scale(1.03);
}

@media (max-width: 600px) {
  .secretcode-stats {
    gap: 30px;
  }

  .secretcode-stat strong {
    font-size: 1.3rem;
  }

  .secretcode-row {
    height: 48px;
    gap: 4px;
  }

  .secretcode-tile {
    font-size: 1rem;
  }

  .secretcode-grid {
    max-width: 320px;
  }

  .secretcode-overlay-content {
    padding: 30px 20px;
  }

  .secretcode-overlay-content h2 {
    font-size: 1.4rem;
  }
}

/* =========================
   Memory Test
   ========================= */

/* Game area */

.memory-game {
  display: none;
  width: 400px;
  max-width: 100%;
  margin: 10px auto 0;
  /* box-sizing: border-box; */
}

.memory-instruction {
  color: #e9eef5;
  font-size: 0.95rem;
  margin-bottom: 14px;
  text-align: center;
}


/* Level / lives */

.memory-game__top {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto 12px;
  width: 100%;
}


.memory-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}


.memory-stat span {
  color: #e9eef5;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}


.memory-stat strong {
  color: #fff;
  font-size: 1.15rem;
}


/* Grid */

.memory-grid {
  display: grid;
  gap: 8px;
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
  /* remove the 650px limit */
  height: auto;
}

/* Make the boxes bigger */
.memory-box {
  aspect-ratio: 1;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  min-width: 0;
  min-height: 0;
  padding: 0;
  background-color: transparent;
  perspective: 600px;
  width: 100%;
  height: 100%;
}


/* .memory-box:hover {
  transform: scale(1.03);
} */


.memory-box--highlighted {
  background-color: #FED41D;
}


.memory-box--correct {
  background-color: #5ca555;
  cursor: default;
}


.memory-box--wrong {
  background-color: #d64545;
}


/* Try Again */

.memory-button {
  background-color: #FED41D;
  border: 0;
  color: #0f2b4d;
  cursor: pointer;
  display: none;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  margin-top: 20px;
  padding: 13px 24px;
}


.memory-button:hover {
  background-color: #fff;
}

/* Memory card flip */
.memory-box {
  aspect-ratio: 1;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  min-width: 0;
  padding: 0;
  background-color: transparent;
  perspective: 600px;
}

.memory-box-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease;
  transform-style: preserve-3d;
}

.memory-box.flipped .memory-box-inner {
  transform: rotateY(180deg);
}

.memory-box-front,
.memory-box-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 6px;
}

.memory-box-front {
  background-color: #e2e8f0;
}

.memory-box-back {
  background-color: #FED41D;
  transform: rotateY(180deg);
}

/* Correct / wrong states */
.memory-box.correct .memory-box-back {
  background-color: #5ca555;
}

/* Wrong box - red and shake, no flip */
.memory-box.wrong {
  background-color: #d64545 !important;
  border: 2px solid #d64545;
  animation: shake 0.3s ease;
  transform: none !important;
}

.memory-box.wrong .memory-box-inner {
  transform: none !important;
}

.memory-box.wrong .memory-box-front,
.memory-box.wrong .memory-box-back {
  background-color: #d64545 !important;
}

/* Game Over Buttons */
.game-over-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.try-again-btn {
  background-color: #FED41D;
  border: none;
  color: #0f2b4d;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  padding: 12px 24px;
  font-size: 1rem;
}

.share-btn {
  background-color: #0de2e2;
  border: none;
  color: #0f2b4d;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  padding: 12px 24px;
  font-size: 1rem;
}

.next-test-btn {
  background-color: #5ca555;
  border: none;
  color: #0f2b4d;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  padding: 12px 24px;
  font-size: 1rem;
}

.try-again-btn:hover,
.share-btn:hover,
.next-test-btn:hover {
  background-color: #ffffff;
}


/* @media (max-width: 600px) {

  .memory-game {
    width: min(100%, 320px);
  }

  .memory-grid {
    gap: 4px;
  }

  .memory-instruction {
    font-size: 0.85rem;
  }

} */


/* Mobile */

@media (max-width: 900px) {
  .brain-performance-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {

  .brain-health-card {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }

  .brain-health-info {
    max-width: none;
  }

  .brain-performance-grid,
  .achievement-list {
    grid-template-columns: 1fr;
  }

  .dashboard-challenge {
    align-items: flex-start;
    flex-direction: column;
  }

  .activity-item {
    grid-template-columns: 1fr auto;
  }

  .activity-item time {
    text-align: left;
  }
}

@media (max-width: 700px) {

  .dashboard-summary,
  .achievement-list {
    grid-template-columns: 1fr;
  }

  .dashboard-challenge {
    align-items: flex-start;
    flex-direction: column;
  }

  .test-card {
    grid-template-columns: 42px 1fr;
  }

  .test-card__score {
    grid-column: 2;
    text-align: left;
  }

  .test-card>a {
    grid-column: 2;
  }

  .activity-item {
    grid-template-columns: 1fr auto;
  }

  .activity-item time {
    text-align: left;
  }
}

/* footer */

.site-footer {
  background-color: #182235;
  color: #cbd5e1;
  margin-top: 28px;
  padding: 48px 0 20px;
}

.footer-content,
.footer-bottom {
  width: 92%;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  padding-bottom: 42px;
}

.footer-brand {
  max-width: 360px;
}

.footer-logo {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
}

.footer-brand p {
  line-height: 1.6;
  margin: 14px 0 0;
}

.footer-links {
  display: flex;
  gap: 64px;
}

.footer-links div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links h2 {
  color: #fff;
  font-size: 0.9rem;
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer-links a,
.footer-bottom a {
  color: #cbd5e1;
  text-decoration: none;
}

.footer-links a:hover,
.footer-bottom a:hover {
  color: #60a5fa;
}

.footer-bottom {
  align-items: center;
  border-top: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
}

.footer-bottom p {
  font-size: 0.9rem;
  margin: 0;
}

.footer-bottom a {
  font-size: 1.1rem;
}

/* =========================
   About Page / Privacy / Terms
   ========================= */

.about-page {
  max-width: 850px;
  margin: 40px auto;
  padding: 0 20px;
}

.about-page__container {
  background-color: #fff;
  border: 1px solid #e4e9f2;
  padding: 40px 48px;
}

.about-page__header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e4e9f2;
}

.about-page__header h1 {
  font-size: 2.2rem;
  margin: 0 0 8px;
  color: #172033;
}

.about-page__header p {
  color: #687384;
  font-size: 1.1rem;
  margin: 0;
}

.about-page__content h2 {
  font-size: 1.4rem;
  margin: 28px 0 12px;
  color: #172033;
}

.about-page__content h3 {
  font-size: 1.15rem;
  margin: 20px 0 10px;
  color: #172033;
}

.about-page__content p {
  color: #4d5867;
  line-height: 1.7;
  margin: 0 0 14px;
}

.about-page__content ul {
  padding-left: 24px;
  margin: 10px 0 16px;
}

.about-page__content ul li {
  color: #4d5867;
  line-height: 1.7;
  margin-bottom: 6px;
}

.about-page__content a {
  color: #3b7ea5;
  text-decoration: none;
  text-underline-offset: none;
}

.about-page__content a:hover {
  text-decoration: underline;
}

.about-page__content strong {
  color: #172033;
}

@media (max-width: 700px) {
  .about-page__container {
    padding: 24px 20px;
  }

  .about-page__header h1 {
    font-size: 1.8rem;
  }

  .about-page__content h2 {
    font-size: 1.2rem;
  }
}

/* =========================
   Statistics Section
   ========================= */

.stats-section {
  background-color: #fff;
  border: 1px solid #e4e9f2;
  margin: 20px auto 48px;
  max-width: 1100px;
  padding: 28px 32px;
}

.stats-container h2 {
  margin: 0 0 24px;
  font-size: 1.4rem;
  color: #172033;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.stat-card {
  text-align: center;
  padding: 16px;
  background-color: #f8fafc;
  /* border-radius: 6px; */
  border: 1px solid #e4e9f2;
}

.stat-label {
  display: block;
  color: #687384;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.stat-value {
  display: inline-block;
  font-size: 1.8rem;
  font-weight: 700;
  color: #172033;
}

.stat-unit {
  color: #687384;
  font-size: 0.9rem;
  margin-left: 2px;
}

.stat-card .stat-value#statRating {
  font-size: 1.2rem;
  color: #3b7ea5;
}

/* Graph */
.graph-container {
  position: relative;
  margin-top: 10px;
  padding: 10px 0;
}

.graph-container canvas {
  width: 100%;
  height: 200px;
  display: block;
  /* background: #fafbfc; */
  /* border-radius: 6px; */
  /* border: 1px solid #e4e9f2; */
}

.graph-labels {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 0;
  color: #687384;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

@media (max-width: 700px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-container {
    padding: 20px;
  }
}

@media (max-width: 450px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .graph-container canvas {
    height: 150px;
  }
}

/* On wide displays, keep both the navigation and page content at 60% width. */
@media (min-width: 1150px) {

  nav ul,
  main,
  .footer-content,
  .footer-bottom {
    max-width: 60%;
  }
}

@media (max-width: 900px) {
  .card-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  nav ul {
    flex-wrap: wrap;
  }

  .nav-item--right {
    margin-left: 0;
  }

  main {
    padding: 28px 0;
  }

  .hero {
    padding: 58px 20px;
  }

  .card-container {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding-top: 36px;
  }

  .footer-content,
  .footer-links,
  .footer-bottom {
    flex-direction: column;
  }

  .footer-content {
    gap: 30px;
  }

  .footer-links {
    gap: 28px;
  }

  .footer-bottom {
    align-items: flex-start;
    gap: 14px;
  }
}

/* Add more styles as needed */