/* MEMORY GYM 50+ – Premium healthy-aging design */
:root {
  --primary: #1a5c3a;
  --primary-light: #2d7a52;
  --sage: #e8f0e9;
  --cream: #faf8f4;
  --accent: #e09f3e;
  --blue: #4a90a4;
  --text: #1f2a24;
  --muted: #5a6b62;
  --white: #ffffff;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(26, 92, 58, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background: var(--cream);
  min-height: 100vh;
}

/* Typography */
h1 { font-size: 2.6rem; font-weight: 700; line-height: 1.2; margin-bottom: 0.6em; }
h2 { font-size: 1.9rem; font-weight: 650; margin-bottom: 0.5em; }
h3 { font-size: 1.35rem; font-weight: 600; }
p { margin-bottom: 1em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid #e5ebe6;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.9rem 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.logo span { color: var(--accent); }
.nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.nav a {
  font-weight: 500;
  color: var(--text);
  padding: 0.4rem 0.2rem;
  border-radius: 6px;
}
.nav a:hover, .nav a.active { color: var(--primary); background: var(--sage); }
.brand-link {
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

/* Buttons – senior friendly */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 2rem;
  font-size: 1.15rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  gap: 0.5rem;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(26, 92, 58, 0.25);
}
.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  color: white;
  text-decoration: none;
}
.btn-secondary {
  background: var(--sage);
  color: var(--primary);
}
.btn-secondary:hover {
  background: #d4e5d6;
  text-decoration: none;
}
.btn-large { min-height: 64px; font-size: 1.25rem; padding: 0 2.5rem; }
.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--sage) 0%, var(--cream) 100%);
  padding: 4rem 0 5rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.hero-img {
  width: 100%;
  border-radius: 20px;
  box-shadow: var(--shadow);
  object-fit: cover;
  aspect-ratio: 4/3;
}
.hero-badges {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.hero-badges span {
  background: white;
  padding: 0.4rem 0.9rem;
  border-radius: 30px;
  border: 1px solid #e0e8e1;
}

/* Feature cards */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.feature-card {
  text-align: center;
  padding: 2rem 1.5rem;
}
.feature-icon {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  display: block;
}

/* Workout screen */
.workout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.progress-bar-wrap {
  height: 10px;
  background: #e0e8e1;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2rem;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.4s ease;
}
.game-card {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}
.memorize-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
}
.word-card, .pic-card, .name-card, .list-item {
  background: var(--sage);
  padding: 1.2rem 1.8rem;
  border-radius: 12px;
  font-size: 1.4rem;
  font-weight: 600;
  min-width: 120px;
}
.pic-card { font-size: 3rem; padding: 1.5rem; }
.timer {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1rem 0;
}
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}
.option-btn {
  min-height: 64px;
  font-size: 1.2rem;
  background: white;
  border: 2px solid #d0ddd3;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s;
  padding: 1rem;
}
.option-btn:hover, .option-btn:focus {
  border-color: var(--primary);
  background: var(--sage);
}
.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}
.feedback {
  margin: 2rem 0;
  padding: 1.5rem;
  border-radius: 14px;
  font-size: 1.3rem;
  font-weight: 600;
}
.feedback.correct { background: #e6f4ea; color: #1a5c3a; }
.feedback.wrong { background: #fef3e8; color: #9a5b1a; }

/* Score screen */
.score-display {
  font-size: 4.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin: 1rem 0;
}
.score-label { font-size: 1.2rem; color: var(--muted); }

/* Progress page */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}
.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-label { color: var(--muted); font-size: 0.95rem; }

/* Chart (simple pure CSS/JS bars) */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
  height: 200px;
  padding: 1rem 0;
}
.chart-bar {
  flex: 1;
  background: var(--primary);
  border-radius: 8px 8px 0 0;
  position: relative;
  min-width: 30px;
  transition: height 0.6s ease;
}
.chart-bar span {
  position: absolute;
  top: -1.8rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ========== CTA SECTION – bulletproof mobile fix ========== */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, #164a30 100%);
  color: #ffffff;
  border-radius: 24px;
  padding: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.cta-section .cta-text {
  min-width: 0;                 /* allows shrinking inside grid */
  max-width: 100%;
}

.cta-section h2 {
  color: #ffffff !important;
  font-size: 1.9rem;
  line-height: 1.25;
  margin-bottom: 0.8rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.cta-section p {
  color: #ffffff;
  opacity: 0.95;
  font-size: 1.15rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cta-section img {
  border-radius: 16px;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 4/3;
  max-width: 100%;
  display: block;
}

.cta-section .btn {
  background: var(--accent);
  color: #1f2a24;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  padding: 0.9rem 1.4rem;
  max-width: 100%;
  box-sizing: border-box;
}


/* Footer */
.site-footer {
  background: #1f2a24;
  color: #c8d4cc;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-links a {
  display: block;
  color: #c8d4cc;
  margin-bottom: 0.5rem;
}
.footer-links a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid #2e3d34;
  padding-top: 1.5rem;
  font-size: 0.95rem;
  text-align: center;
}

/* Disclaimer */
.disclaimer {
  font-size: 0.9rem;
  color: var(--muted);
  background: #f0f4f1;
  padding: 1rem 1.2rem;
  border-radius: 10px;
  margin-top: 2rem;
}

/* Accessibility */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.hidden { display: none !important; }