:root {
  --navy: #102a43;
  --navy-2: #173f5f;
  --teal: #0b8a8f;
  --teal-dark: #087278;
  --blue: #2f6fed;
  --green: #169b62;
  --ink: #172b3a;
  --muted: #60758a;
  --line: #dce5ea;
  --surface: #ffffff;
  --canvas: #f5f8fa;
  --soft-teal: #e8f7f7;
  --soft-blue: #edf4ff;
  --soft-green: #eaf8f1;
  --danger: #c83b4d;
  --radius: 12px;
  --shadow: 0 12px 32px rgba(16, 42, 67, 0.07);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(47, 111, 237, 0.22);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

.home-screen {
  min-height: 100vh;
  background: var(--surface);
}

.site-header,
.app-header-inner,
.hero-section,
.benefit-strip,
.progress-section,
.site-footer,
.app-container {
  width: min(calc(100% - 48px), 1180px);
  margin-inline: auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-screen::before,
.app-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  border-bottom: 1px solid var(--line);
}

.home-screen::before {
  top: 75px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--navy);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  letter-spacing: -0.06em;
  box-shadow: inset -10px -10px 0 rgba(11, 138, 143, 0.68);
}

.site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 34px;
  color: #40586d;
  font-size: 14px;
  font-weight: 650;
}

.site-nav a {
  position: relative;
  padding: 28px 0 25px;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--teal-dark);
}

.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--teal);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.text-button,
.outline-button,
.primary-button,
.small-primary-button {
  border: 0;
  cursor: pointer;
  font-weight: 750;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.text-button {
  padding: 10px 12px;
  background: transparent;
  color: var(--navy);
}

.outline-button {
  padding: 10px 16px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: #fff;
  color: var(--teal-dark);
}

.outline-button:hover {
  background: var(--soft-teal);
}

.hero-section {
  min-height: 600px;
  padding: 70px 0 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

.eyebrow {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.eyebrow span {
  margin: 0 8px;
  color: #9bb0bd;
}

.hero-content h1 {
  margin-top: 18px;
  color: var(--navy);
  font-size: clamp(44px, 5vw, 68px);
  line-height: 1.03;
  letter-spacing: -0.055em;
  text-align: center;
}

.hero-content h1 span {
  color: var(--teal);
}

.hero-description {
  max-width: 520px;
  margin-top: 24px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
}

.hero-actions {
  margin-top: 32px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 24px;
}

.primary-button,
.small-primary-button {
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 8px 18px rgba(11, 138, 143, 0.18);
}

.primary-button {
  min-height: 52px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  gap: 28px;
}

.primary-button:hover,
.small-primary-button:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.secondary-link {
  color: var(--navy-2);
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid #9fb0bd;
}

.trust-points {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  color: #40586d;
  font-size: 14px;
}

.trust-points>span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.check-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft-green);
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.challenge-preview {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.preview-heading,
.preview-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.preview-heading h2 {
  margin-top: 4px;
  color: var(--navy);
  font-size: 23px;
}

.preview-date {
  color: var(--muted);
  font-size: 13px;
}

.preview-tags,
.question-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-tags {
  margin-top: 20px;
}

.preview-tags span,
.daily-label,
.level-label {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.preview-tags span:first-child,
.daily-label {
  background: var(--soft-teal);
  color: var(--teal-dark);
}

.preview-tags span:last-child,
.level-label {
  background: var(--soft-blue);
  color: #285fc8;
}

.preview-question {
  margin: 18px 0;
  color: var(--navy);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.45;
}

.preview-answers {
  display: grid;
  gap: 9px;
}

.preview-answers div {
  min-height: 43px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #3c5367;
  font-size: 13px;
  font-weight: 620;
}

.preview-answers div>span {
  width: 22px;
  color: #7890a1;
  font-weight: 800;
}

.preview-answers div.selected {
  border-color: var(--teal);
  background: var(--soft-teal);
  color: var(--navy);
}

.preview-answers div.selected>span {
  color: var(--teal-dark);
}

.preview-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.preview-rewards {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
}

.preview-rewards strong {
  color: var(--navy);
}

.small-primary-button {
  min-height: 40px;
  padding: 0 16px;
  font-size: 12px;
}

.benefit-strip {
  padding: 32px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.benefit-strip::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: -1;
  height: 117px;
  margin-top: -32px;
  background: var(--canvas);
}

.benefit-item {
  padding: 0 34px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.benefit-item+.benefit-item {
  border-left: 1px solid var(--line);
}

.line-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #abd2d3;
  border-radius: 50%;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 850;
}

.benefit-item h2 {
  color: var(--navy);
  font-size: 16px;
}

.benefit-item p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.progress-section {
  padding: 74px 0;
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  align-items: center;
  gap: 64px;
}

.progress-copy h2 {
  margin-top: 7px;
  color: var(--navy);
  font-size: 31px;
  letter-spacing: -0.035em;
}

.progress-copy>p:last-child {
  margin-top: 12px;
  color: var(--muted);
}

.progress-card {
  min-height: 142px;
  padding: 26px;
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1.35fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.progress-metric,
.activity-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.progress-metric {
  padding: 0 20px;
  border-right: 1px solid var(--line);
}

.progress-metric strong {
  color: var(--navy);
  font-size: 27px;
}

.progress-metric span,
.activity-summary>span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.activity-summary {
  padding-left: 22px;
}

.activity-bars {
  height: 55px;
  margin-top: 8px;
  display: flex;
  align-items: flex-end;
  gap: 7px;
}

.activity-bars i {
  width: 9px;
  height: var(--activity);
  border-radius: 5px;
  background: #55bfc0;
}

.site-footer {
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  text-align: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.footer-link {
  display: block;
  width: fit-content;
  margin: 6px auto 0;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.footer-link:hover {
  color: var(--teal);
  text-decoration: underline;
}

.preview-close {
  display: block;
  margin: 18px auto 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.preview-close:hover {
  color: var(--navy);
}

/* Application */
#game-screen {
  display: none;
  min-height: 100vh;
}

.app-header {
  position: relative;
  background: #fff;
}

.app-header::after {
  bottom: 0;
}

.app-header-inner {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 44px;
}

.app-wordmark {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.app-nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  font-size: 13px;
  font-weight: 700;
}

.app-nav button,
.app-nav a {
  border: 0;
  background: transparent;
  color: #51697d;
  cursor: pointer;
}

.app-nav .active {
  color: var(--teal-dark);
}

.date-time {
  text-align: right;
  color: var(--navy);
  font-size: 12px;
  line-height: 1.5;
}

#current-time {
  color: var(--muted);
}

.app-container {
  padding-top: 42px;
  padding-bottom: 64px;
}

.app-intro {
  margin-bottom: 26px;
  text-align: center;
}

.app-intro h1 {
  margin-top: 5px;
  color: var(--navy);
  font-size: 32px;
  letter-spacing: -0.035em;
}

.app-intro p:last-child {
  margin-top: 5px;
  color: var(--muted);
}

.login-required.is-locked {
  display: none;
}

.auth-card,
.stat-card,
.question-card,
.leaderboard-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 5px 18px rgba(16, 42, 67, 0.045);
}

.auth-card {
  max-width: 650px;
  margin: 0 auto 22px;
  padding: 26px;
}

.auth-heading h2 {
  color: var(--navy);
  font-size: 21px;
}

.auth-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.auth-tabs {
  margin: 22px 0 18px;
  display: flex;
  gap: 8px;
  padding: 4px;
  border-radius: 9px;
  background: var(--canvas);
}

.auth-tab {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.auth-tab.active {
  background: #fff;
  color: var(--teal-dark);
  box-shadow: 0 2px 8px rgba(16, 42, 67, 0.08);
}

#signup-form,
#login-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

#signup-form label,
#login-form label {
  display: grid;
  gap: 6px;
  color: #40586d;
  font-size: 12px;
  font-weight: 700;
}

#signup-form input,
#login-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #cad7df;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}

#signup-form input::placeholder,
#login-form input::placeholder {
  color: #91a2af;
}

#signup-form input:focus,
#login-form input:focus {
  border-color: var(--teal);
}

#signup-form button,
#login-form button,
#logout-button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  background: var(--teal);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}

#signup-form button {
  grid-column: 1 / -1;
}

#login-form button {
  align-self: end;
}

.auth-message {
  margin-top: 14px;
  color: var(--danger);
  font-size: 13px;
}

#auth-logged-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.signed-in-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.signed-in-user strong {
  color: var(--navy);
}

.user-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft-green);
  color: var(--green);
  font-weight: 900;
}

#logout-button {
  min-height: 38px;
  background: var(--navy);
  font-size: 12px;
}

.stats-section {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stat-card {
  min-height: 96px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--soft-blue);
  color: var(--blue);
  font-weight: 900;
}

.stat-icon-streak {
  background: var(--soft-teal);
  color: var(--teal-dark);
}

.stat-copy {
  display: flex;
  flex-direction: column;
}

.stat-label {
  color: var(--navy);
  font-size: 14px;
  font-weight: 750;
}

.stat-note,
.stat-unit {
  color: var(--muted);
  font-size: 11px;
}

.stat-number {
  color: var(--navy);
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.app-grid {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 18px;
  align-items: start;
}

.question-card {
  padding: 30px;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.question-count {
  color: var(--muted);
  font-size: 12px;
}

#question {
  max-width: 760px;
  margin-bottom: 24px;
  color: var(--navy);
  font-size: 24px;
  line-height: 1.42;
  letter-spacing: -0.02em;
}

#answers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.answer-button {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid #cad7df;
  border-radius: 8px;
  background: #fff;
  color: #2d465a;
  text-align: left;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.answer-button:hover:not(:disabled) {
  border-color: #75bfc2;
  background: #f7fcfc;
  transform: translateY(-1px);
}

.answer-button.selected {
  border-color: var(--teal);
  background: var(--soft-teal);
  color: var(--navy);
  box-shadow: 0 0 0 2px rgba(11, 138, 143, 0.1);
}

.answer-button.correct {
  border-color: #35a873;
  background: var(--soft-green);
  color: #116b44;
}

.answer-button.wrong {
  border-color: #de7783;
  background: #fff1f2;
  color: #9d2f3c;
}

.answer-button:disabled {
  cursor: default;
}

#confirm-answer {
  min-height: 48px;
  margin-top: 8px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

#confirm-answer:hover:not(:disabled) {
  background: var(--teal-dark);
}

#confirm-answer:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.feedback {
  margin-top: 18px;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.65;
}

.challenge-sidebar {
  display: grid;
  gap: 16px;
}

.leaderboard-card {
  overflow: hidden;
}

.leaderboard-header {
  padding: 24px 26px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.leaderboard-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.leaderboard-title h2 {
  margin: 0;
}

.leaderboard-title #leaderboard-period {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}

.leaderboard-header h2 {
  margin-top: 3px;
  color: var(--navy);
  font-size: 22px;
}

.leaderboard-header p:last-child {
  color: var(--muted);
  font-size: 12px;
}

.leaderboard-status {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--soft-green);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.leaderboard-columns,
.leaderboard-row {
  display: grid;
  grid-template-columns: 90px 1fr 120px;
}

.leaderboard-columns {
  padding: 11px 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leaderboard-row {
  align-items: center;
  padding: 15px 26px;
  border-bottom: 1px solid #edf1f4;
  font-size: 13px;
}

.leaderboard-row:last-child {
  border-bottom: 0;
}

.leaderboard-row:hover,
.leaderboard-row.current-user {
  background: #f5fbfb;
}

.rank,
.username {
  color: var(--navy);
  font-weight: 750;
}

.points {
  color: var(--teal-dark);
  text-align: right;
  font-weight: 850;
}

.app-footer {
  padding: 24px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

@media (max-width: 900px) {

  .site-header,
  .app-header-inner {
    grid-template-columns: 1fr auto;
  }

  .site-nav,
  .app-nav {
    display: none;
  }

  .hero-section {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: 54px;
  }

  .hero-content {
    max-width: 650px;
  }

  .challenge-preview {
    max-width: 680px;
  }

  .progress-section {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .challenge-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {

  .site-header,
  .app-header-inner,
  .hero-section,
  .benefit-strip,
  .progress-section,
  .site-footer,
  .app-container {
    width: min(calc(100% - 32px), 1180px);
  }

  .site-header,
  .app-header-inner {
    min-height: 68px;
  }

  .home-screen::before {
    top: 67px;
  }

  .wordmark {
    font-size: 15px;
  }

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

  .header-actions {
    gap: 2px;
  }

  .outline-button {
    padding: 8px 10px;
    font-size: 12px;
  }

  .text-button {
    padding: 8px;
    font-size: 12px;
  }

  .hero-section {
    min-height: auto;
    padding: 46px 0 54px;
    gap: 36px;
  }

  .hero-content h1 {
    font-size: clamp(40px, 12vw, 54px);
  }

  .hero-description {
    font-size: 17px;
  }

  .hero-actions {
    align-items: center;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
  }

  .primary-button {
    width: auto;
    justify-content: center;
    padding: 0 18px;
    gap: 12px;
  }

  .trust-points {
    flex-direction: column;
  }

  .challenge-preview {
    padding: 20px;
  }

  .preview-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .small-primary-button {
    width: 100%;
  }

  .benefit-strip {
    grid-template-columns: 1fr;
    padding: 10px 0;
  }

  .benefit-strip::before {
    height: 266px;
    margin-top: -10px;
  }

  .benefit-item {
    padding: 20px 8px;
  }

  .benefit-item+.benefit-item {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .progress-section {
    padding: 54px 0;
  }

  .progress-card {
    grid-template-columns: repeat(3, 1fr);
    padding: 20px 12px;
  }

  .progress-metric {
    padding: 0 10px;
  }

  .progress-metric strong {
    font-size: 22px;
  }

  .activity-summary {
    grid-column: 1 / -1;
    margin-top: 22px;
    padding: 18px 10px 0;
    border-top: 1px solid var(--line);
  }

  .site-footer {
    padding: 24px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
  }

  .site-footer p {
    margin: 0;
  }

  .footer-link {
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
  }

  .footer-link:hover {
    color: var(--teal);
    text-decoration: underline;
  }

  .date-time {
    font-size: 10px;
  }

  .app-container {
    padding-top: 30px;
  }

  .app-intro h1 {
    font-size: 27px;
  }

  .auth-card,
  .question-card {
    padding: 20px;
  }

  #signup-form,
  #login-form {
    grid-template-columns: 1fr;
  }

  #signup-form button {
    grid-column: auto;
  }

  .stats-section,
  .challenge-sidebar {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 84px;
  }

  .question-header {
    align-items: flex-start;
    flex-direction: column;
  }

  #question {
    font-size: 21px;
  }

  .answer-button {
    min-height: 56px;
  }

  #confirm-answer {
    width: 100%;
    min-height: 50px;
  }

  .leaderboard-header {
    align-items: flex-start;
  }

  .leaderboard-columns {
    display: none;
  }

  .leaderboard-row {
    grid-template-columns: 46px 1fr auto;
    padding: 15px 18px;
  }

  .leaderboard-title {
    display: flex;
    align-items: baseline;
    gap: 50px;
  }

  .leaderboard-title h2 {
    margin: 0;
  }

  .leaderboard-title #leaderboard-period {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
  }

}

@media (max-width: 420px) {
  .wordmark>span:last-child {
    max-width: 92px;
    line-height: 1.05;
  }

  .header-actions .text-button {
    display: none;
  }

  .preview-rewards {
    justify-content: space-between;
  }

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

  .progress-metric {
    padding: 12px 4px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .activity-summary {
    grid-column: auto;
  }

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

  .stat-unit {
    display: none;
  }

  .app-wordmark>span:last-child {
    display: none;
  }
}

/* Integration refinements: readable controls and navigation at every width. */
.site-nav button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  min-height: 44px;
}

.site-nav a,
.app-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.progress-card {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.progress-metric {
  min-width: 0;
  padding: 0 16px;
}

.progress-metric:last-child {
  border-right: 0;
}

.progress-metric strong {
  font-size: 24px;
}

.progress-metric span {
  font-size: 14px;
}

.eyebrow,
.preview-date,
.preview-rewards {
  font-size: 12px;
}

.preview-tags span,
.daily-label,
.level-label {
  font-size: 12px;
  letter-spacing: .03em;
}

.benefit-item p,
.preview-answers div,
.small-primary-button,
.auth-tab,
.auth-heading p,
.auth-message,
.leaderboard-row,
.leaderboard-header p:last-child,
.question-count {
  font-size: 14px;
}

#signup-form label,
#login-form label {
  font-size: 14px;
}

#signup-form input,
#login-form input {
  font-size: 16px;
}

.stat-note,
.stat-unit,
.leaderboard-columns,
.app-footer {
  font-size: 12px;
}

.username,
.signed-in-user strong {
  overflow-wrap: anywhere;
  min-width: 0;
}

.preview-rewards {
  flex-wrap: wrap;
}

.site-header {
  gap: 22px;
}

.site-nav {
  gap: 20px;
}

.benefit-strip::before,
.home-screen::before {
  display: none;
}

.benefit-strip {
  background: var(--canvas);
  border-radius: 12px;
}

.site-header {
  border-bottom: 1px solid var(--line);
}

#auth-card:has(#auth-logged-out[style*="none"]) {
  max-width: none;
}

@media (max-width: 1100px) {
  .hero-section {
    gap: 32px;
    grid-template-columns: 1fr 1fr;
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .site-nav a {
    padding: 8px 0;
  }
}

@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
  }

  .site-nav,
  .app-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
  }

  .app-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    padding-bottom: 8px;
  }

  .app-header-inner {
    gap: 12px;
    padding-top: 12px;
  }
}

@media (max-width: 680px) {
  .hero-content h1 {
    font-size: clamp(36px, 9vw, 50px);
    letter-spacing: -.035em;
  }

  .site-header {
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 8px;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .header-actions button {
    min-height: 44px;
  }

  .question-card,
  .auth-card {
    padding: 20px 16px;
  }

  .preview-heading {
    align-items: flex-start;
    gap: 8px;
  }

  .preview-date {
    flex-shrink: 0;
  }

  .progress-card {
    gap: 16px;
  }

  .progress-metric {
    padding: 0 8px;
  }

  .progress-metric strong {
    font-size: 21px;
  }

  .signed-in-user {
    flex-wrap: wrap;
  }

  .leaderboard-columns {
    display: grid;
    grid-template-columns: 46px 1fr auto;
    padding: 12px 18px;
  }
}

@media (max-width: 420px) {
  .header-actions .text-button {
    display: block;
  }

  .site-header {
    grid-template-columns: 1fr;
  }

  .header-actions {
    grid-row: 2;
    justify-content: flex-start;
  }

  .site-nav {
    grid-row: 3;
    gap: 8px 18px;
    font-size: 14px;
  }

  .wordmark>span:last-child {
    max-width: none;
    line-height: 1.3;
  }

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

  .progress-metric {
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}


.hero-content {
  width: 100%;
  text-align: center;
}


/* Small visitor counters at the bottom of the homepage */

.visitor-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 20px 16px 0;
}

.visitor-stat {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
}

.visitor-stat strong,
.visitor-stat:last-child strong {
  color: #52677b;
  font-size: 13px;
  font-weight: 600;
}

.visitor-stat span {
  margin: 0;
  color: #60758a;
  font-size: 13px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
}

#daily-preview[hidden] {
  display: none !important;
}

.spotlight-card {
  padding: 26px;
  border: 1px solid #dce7e5;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(19, 43, 65, 0.04);
}

.spotlight-card {
  margin: 0;
  color: #087f83;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.spotlight-art {
  display: grid;
  place-items: center;
  height: 150px;
  margin: 20px 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #e4f5ef, #f5faf8);
  font-size: 72px;
}

.spotlight-card h2 {
  margin: 0 0 14px;
  color: var(--navy, #102442);
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.spotlight-description {
  margin: 0 0 24px;
  color: var(--muted, #536477);
  font-size: 15px;
  line-height: 1.6;
}

.spotlight-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: #087f83;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.spotlight-button:hover {
  background: #06696c;
}

.spotlight-button:focus-visible {
  outline: 3px solid #087f83;
  outline-offset: 4px;
}



/* ===== 2026 compact account + progress redesign ===== */
.app-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  min-width: 0;
}

.account-menu {
  position: relative;
  align-items: center;
}

.account-menu-trigger {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 4px 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
}

.account-menu-trigger:hover,
.account-menu-trigger[aria-expanded="true"] {
  background: #f2f6f8;
}

.account-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: #40586d;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.account-avatar-large {
  width: 42px;
  height: 42px;
}

.account-trigger-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 750;
}

.account-chevron {
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  transform: translateY(-2px);
}

.account-menu-panel {
  position: absolute;
  z-index: 100;
  top: calc(100% + 10px);
  right: 0;
  width: 238px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(16, 42, 67, .16);
}

.account-menu-panel[hidden] {
  display: none !important;
}

.account-menu-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.account-menu-summary>span:last-child {
  min-width: 0;
  display: grid;
}

.account-menu-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--navy);
  font-size: 14px;
}

.account-menu-summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.account-menu-items {
  padding: 7px;
}

.account-menu-item,
#pc-edit-profile.account-menu-item,
#logout-button.account-menu-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  margin: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.account-menu-item>span:first-child,
#pc-edit-profile.account-menu-item>span:first-child {
  width: 20px;
  flex: 0 0 20px;
  text-align: center;
  color: #526a7d;
  font-size: 16px;
}

.account-menu-item:hover,
#pc-edit-profile.account-menu-item:hover {
  background: #f2f7f8;
}

.account-menu-divider {
  height: 1px;
  margin: 7px 4px;
  background: var(--line);
}

#logout-button.account-menu-signout {
  color: var(--danger);
}

#logout-button.account-menu-signout>span:first-child {
  color: var(--danger);
}

/* Hide the login card once the logged-in account control is visible. */
body:has(#auth-logged-in[style*="display: flex"]) #auth-card {
  display: none;
}

/* Compact progress: same data, much less vertical space. */
.stats-section.compact-stats {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 8px 0 26px;
  justify-content: center;
}

.compact-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.compact-stat-icon {
  align-self: center;
  font-size: 23px;
  line-height: 1;
}

.compact-stat-star {
  color: var(--blue);
}

.compact-stats .stat-number {
  color: var(--navy);
  font-size: 27px;
  line-height: 1;
  font-weight: 800;
}

.compact-stats .stat-unit {
  color: var(--muted);
  font-size: 14px;
}

.compact-stat-divider {
  width: 1px;
  height: 38px;
  background: #cad6dd;
}

@media (max-width: 900px) {
  .app-header-inner {
    gap: 18px;
  }

  .app-header-actions {
    gap: 10px;
  }

  .account-trigger-name {
    display: none;
  }
}

@media (max-width: 680px) {
  .date-time {
    display: none;
  }

  .account-menu-panel {
    position: fixed;
    top: 68px;
    right: 12px;
    width: min(280px, calc(100vw - 24px));
  }

  .stats-section.compact-stats {
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
  }

  .compact-stat-divider {
    height: 30px;
  }

  .compact-stats .stat-number {
    font-size: 23px;
  }
  
/* Hide extra leaderboard labels on mobile */
#leaderboard-period,
#ranking-note {
  display: none;
}

  .spotlight-card {
  padding: 18px;
  font-weight: 400;
  letter-spacing: normal;
}

.spotlight-card .section-kicker {
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.spotlight-art {
  display: none;
}

.spotlight-card h2 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.spotlight-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
}


  .challenge-sidebar {
    margin-top: 28px;
  }

  .spotlight-button {
    display: inline-flex;
    width: auto;
    padding: 9px 13px;
    font-size: 12px;
  }

.app-footer .footer-link {
  display: block;
  width: fit-content;
  margin: 8px auto 0;
}

}


#confirm-answer,
#confirm-follow-up {
  min-height: 48px;
  margin-top: 12px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

#confirm-answer:hover:not(:disabled),
#confirm-follow-up:hover:not(:disabled) {
  background: var(--teal-dark);
}

#confirm-answer:disabled,
#confirm-follow-up:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#follow-up-answers {
  margin-bottom: 10px;
}

#follow-up-feedback {
  margin-top: 12px;
  line-height: 1.6;
}

#follow-up-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbfa;
}

#follow-up-card .daily-label {
  margin-bottom: 8px;
}

#follow-up-question {
  margin-top: 10px;
  margin-bottom: 14px;
  line-height: 1.5;
}

#follow-up-answers {
  display: grid;
  gap: 10px;
}

#confirm-follow-up {
  min-height: 44px;
  margin-top: 14px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--teal);
  color: white;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#confirm-follow-up:hover:not(:disabled) {
  filter: brightness(0.95);
}

#confirm-follow-up:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#follow-up-feedback {
  margin-top: 12px;
  line-height: 1.5;
}
/* Optional recovery uses the existing question card and theme. */
.follow-up-note { color: var(--muted); line-height: 1.5; font-size: 14px; }
#skip-follow-up { margin: 14px 0 0 12px; min-height: 44px; }
#skip-follow-up:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 480px) { #follow-up-card { padding: 16px; } }
