/* Home, lessons and the first visit. */

/* Home: progress arc */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 0 8px;
}

.gauge {
  width: 100%;
  max-width: 360px;
  height: auto;
  margin-top: 4px;
}

.gauge .tick {
  stroke: var(--faint);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.55;
}

.gauge .tick.is-on {
  stroke: var(--accent);
  opacity: 0.9;
}

.gauge-track {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
}

.gauge-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
}

.gauge-dot {
  fill: var(--accent);
}

.mission {
  max-width: 300px;
  margin: 6px auto 0;
  font-size: 14px;
  color: var(--muted);
}

.hero-number {
  font-size: 64px;
  line-height: 1;
  margin: -40px 0 6px;
}

.hero-text {
  max-width: 280px;
  margin: 0 0 18px;
  color: var(--muted);
}

.hero-cta {
  margin-top: 0;
}

/* Home: streak and duels */

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.stat {
  margin: 0;
  padding: 18px;
  text-align: left;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.stat-button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  justify-content: space-between;
}

.stat-button .icon-dot {
  align-self: flex-start;
}

.stat-label {
  margin: 0 0 auto;
  font-size: 13px;
  color: var(--muted);
}

.stat-value {
  margin: 8px 0 4px;
  font-size: clamp(20px, 6.6vw, 26px);
  overflow-wrap: anywhere;
  line-height: 1.05;
  color: var(--ink);
}

.stat-note {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.stat-note .icon {
  color: var(--accent);
}

/* Home: units */

.unit {
  padding: 18px 18px 16px;
}

.unit.is-current {
  border-color: rgba(242, 122, 42, 0.35);
}

.unit-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.unit-titles {
  flex: 1;
  min-width: 0;
}

.unit-label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.unit h2 {
  margin: 0;
  font-size: 24px;
}

.unit-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.unit-goal {
  margin: 10px 0 12px;
  font-size: 14px;
}

.unit-lessons {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.lesson {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.lesson.is-done .icon {
  color: var(--good);
}

.lesson.is-open {
  background: var(--pill);
  color: var(--on-pill);
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.lesson.is-open .icon {
  color: var(--accent-light);
}

.lesson.is-locked {
  color: var(--faint);
  cursor: not-allowed;
  background: transparent;
}

/* Lesson and duel round */

.play {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 0 20px;
}

.play-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0 10px;
  padding-top: max(18px, env(safe-area-inset-top));
}

.progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-light), var(--accent));
  transition: width 0.3s ease;
}

.play-body {
  flex: 1;
  padding: 14px 0 280px;
}

.chip-again {
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid currentColor;
  color: var(--accent);
}

.prompt {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 16px 0 22px;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  text-align: left;
  padding: 16px 18px;
  border-radius: var(--radius-m);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease;
}

.option:hover:not(:disabled) {
  border-color: var(--accent);
}

.option:active:not(:disabled) {
  transform: scale(0.99);
}

.option:disabled {
  cursor: default;
  opacity: 0.55;
}

.option.is-best {
  opacity: 1;
  border-color: var(--good);
  background: var(--good-soft);
}

.option.is-wrong {
  opacity: 1;
  border-color: var(--bad);
  background: var(--bad-soft);
}

.feedback {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: 520px;
  transform: translate(-50%, 110%);
  transition: transform 0.25s ease;
  z-index: 10;
}

.feedback.is-open {
  transform: translate(-50%, 0);
}

.feedback-inner {
  margin: 0 10px 10px;
  padding: 22px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  border-radius: var(--radius-l);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: 0 -10px 40px rgba(40, 30, 20, 0.12);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

.feedback-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 28px;
}

.feedback-head strong {
  font-weight: 400;
}

.feedback.is-good .feedback-head {
  color: var(--good);
}

.feedback.is-bad .feedback-head {
  color: var(--bad);
}

.feedback p {
  margin: 8px 0 0;
}

.feedback-why {
  color: var(--muted);
}

.feedback-best span {
  font-weight: 700;
}

.source {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* First visit */

.onboarding {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 0 20px 28px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.ob-top {
  display: flex;
  justify-content: flex-end;
  padding-top: max(20px, env(safe-area-inset-top));
}

.ob-top .chip {
  cursor: pointer;
  min-height: 44px;
  padding: 0 16px;
}

.ob-stage {
  position: relative;
  flex: 1;
  min-height: 330px;
}

.ob-card {
  position: absolute;
  width: 72%;
  margin: 0;
  padding: 16px 18px;
}

.ob-card-a {
  top: 34px;
  left: 4%;
}

.ob-card-b {
  top: 200px;
  right: 4%;
}

.ob-card-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.ob-card .small {
  margin: 2px 0 10px;
}

.ob-row {
  margin-top: 10px;
}

.ob-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.ob-float {
  position: absolute;
  top: 128px;
  right: 8%;
  width: 52px;
  height: 52px;
  color: #4f97e6;
}

.ob-avatars {
  display: flex;
  align-items: center;
  margin-top: 12px;
}

.ob-avatars .avatar {
  width: 32px;
  height: 32px;
  font-size: 13px;
  margin-right: -8px;
}

.ob-avatars .small {
  margin: 0 0 0 16px;
}

.ob-copy {
  text-align: center;
}

.ob-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
}

.ob-title-soft {
  color: var(--faint);
}

.ob-text {
  max-width: 320px;
  margin: 0 auto 18px;
  color: var(--muted);
}

/* Small and short phones: tighter spacing so the answers stay close to the question */
@media (max-width: 360px) {
  .dock {
    width: calc(100% - 20px);
  }

  .tabs {
    gap: 6px;
  }

  .tab {
    height: 46px;
    min-width: 46px;
    padding: 0 12px;
  }

  .tab.is-active {
    padding: 0 14px;
  }

  .fab {
    width: 52px;
    height: 52px;
  }

  .main,
  .play,
  .onboarding {
    padding-left: 14px;
    padding-right: 14px;
  }

  .stats {
    gap: 10px;
  }

  .stat {
    padding: 14px;
    min-height: 132px;
  }

  .prompt,
  .sketch + .prompt {
    font-size: 22px;
  }

  .ob-title {
    font-size: 34px;
  }

  .hero-number {
    font-size: 54px;
  }
}

@media (max-height: 700px) {
  .sketch-svg {
    max-height: 21vh;
  }

  .sketch {
    margin-top: 10px;
  }

  .play-top {
    padding-bottom: 4px;
  }

  .prompt,
  .sketch + .prompt {
    font-size: 21px;
    margin: 12px 0 14px;
  }

  .option {
    padding: 12px 16px;
  }

  .ob-stage {
    min-height: 270px;
  }
}

/* The narrowest phones show the active tab as an icon only; its name stays readable to screen readers */
@media (max-width: 340px) {
  .tab.is-active span {
    display: none;
  }
}
