/*
 * Say Hi — styled to sit alongside youversion.com.
 *
 * Palette and type sampled from the live site: coral #F04C59 on a warm
 * off-white #F7F3F2, deep navy-black ink #0B1926, fully-pill buttons, and
 * headings set at weight 500 with slightly tight tracking.
 *
 * YouVersion sets Aktiv Grotesk App, which is licensed and not ours to serve.
 * It's first in the stack so anyone who has it gets it, with Inter and the
 * system UI faces behind — all grotesks with a similar colour and rhythm.
 */

:root {
  --bg: #f7f3f2;
  --surface: #ffffff;
  --ink: #0b1926;
  --ink-soft: #5b6670;
  --ink-faint: #97a0a8;
  --line: #e6dedc;

  --brand: #f04c59;
  --brand-hover: #d93f4c;
  --brand-soft: #fdecee;
  --on-brand: #ffffff;

  --correct: #1f7a4d;
  --correct-soft: #e3f5eb;
  --wrong: #c0392f;
  --wrong-soft: #fdeceb;

  --radius: 20px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(11, 25, 38, 0.04), 0 10px 30px rgba(11, 25, 38, 0.06);

  --font: 'Aktiv Grotesk App', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;

  color-scheme: light;
}

/*
 * Light only, on purpose. youversion.com is a light, warm surface, and the
 * headshots this app is built around read better against it. `color-scheme`
 * keeps form controls and scrollbars light even when the OS is in dark mode,
 * which is what a bare `prefers-color-scheme` opt-out would otherwise miss.
 */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 20px calc(40px + env(safe-area-inset-bottom));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------------ topbar */

.topbar {
  padding: 10px 0 22px;
}

/*
 * Title and tagline on the left, sign-out hard against the right. Its own row
 * so the button stays pinned to the top corner, level with the wordmark and
 * flush with the content edge below it, instead of drifting when the nav wraps.
 */
.topbar-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.brand {
  min-width: 0;
}

.wordmark {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

/* The one-line version of the sign-in page's pitch, on every screen. */
.tagline {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-faint);
}

/* Below this the header wraps to two rows and the tagline crowds the nav. */
@media (max-width: 460px) {
  .tagline {
    display: none;
  }
}

/*
 * Icon-only, so it can't be mistaken for part of the Play / Leaderboard nav
 * and can't be fat-fingered on the way to them. The accessible name lives in
 * aria-label and the tooltip in title.
 *
 * The negative margin pulls the round hit area out so the *glyph* lines up
 * with the content edge; without it the button's own padding insets the icon
 * and it reads as misaligned against the cards below.
 */
.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin: -4px -7px 0 0;
  padding: 0;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.iconbtn:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.iconbtn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--pill);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  background: var(--brand);
  color: var(--on-brand);
}

.streak {
  font-size: 14px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--pill);
  background: var(--brand-soft);
  color: var(--brand);
}

/* -------------------------------------------------------------------- card */

.view {
  flex: 1;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

.card.centered {
  text-align: center;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--ink-soft);
}

.small {
  font-size: 13px;
}

/* --------------------------------------------------------------------- hero */

.hero {
  text-align: center;
  padding: 8px 0 28px;
}

.hero-title {
  margin: 0;
  font-size: clamp(44px, 13vw, 68px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero-title em {
  font-style: normal;
  color: var(--brand);
}

.hero-tagline {
  margin: 14px auto 0;
  max-width: 22ch;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hero-intro {
  margin: 18px auto 0;
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------- forms */

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  text-align: left;
}

.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.input {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.15s ease;
}

.input::placeholder {
  color: var(--ink-faint);
}

.input:focus {
  outline: none;
  border-color: var(--brand);
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 14px 24px;
  font: inherit;
  font-weight: 500;
  border-radius: var(--pill);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.06s ease;
}

.btn:hover:not(:disabled) {
  border-color: var(--ink-faint);
}

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

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

.btn.primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* A link styled as a button: centre it and drop the underline. */
a.btn {
  text-align: center;
  text-decoration: none;
}

/* "or" with a rule through it, above the folded-away second option. */
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--ink-faint);
  font-size: 12px;
}

.or::before,
.or::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--line);
}

/* The email-link fallback, collapsed until asked for. */
.alt summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-soft);
  list-style: none;
  text-align: center;
  padding: 4px 0;
}

.alt summary::-webkit-details-marker {
  display: none;
}

/* Own marker, so it sits with the label rather than at the card's edge. */
.alt summary::after {
  content: ' ▾';
  color: var(--ink-faint);
}

.alt[open] summary::after {
  content: ' ▴';
}

.alt summary:hover {
  color: var(--ink);
}

.alt .stack {
  margin-top: 14px;
}


.linkish {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--brand);
  text-decoration: none;
  cursor: pointer;
}

.linkish:hover {
  text-decoration: underline;
}

.msg {
  margin: 16px 0 0;
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
}

.msg.error {
  background: var(--wrong-soft);
  color: var(--wrong);
}

/* -------------------------------------------------------------------- quiz */

.progressbar {
  height: 6px;
  background: var(--line);
  border-radius: var(--pill);
  overflow: hidden;
}

.progressbar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  border-radius: var(--pill);
  transition: width 0.3s ease;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin: 10px 2px 16px;
}

.photo-frame {
  position: relative;
  width: 210px;
  height: 210px;
  margin: 0 auto 22px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--line);
}

.photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--line) 25%, var(--bg) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.prompt {
  text-align: center;
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.choice {
  width: 100%;
  padding: 15px 20px;
  font: inherit;
  font-weight: 500;
  text-align: left;
  background: var(--bg);
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--pill);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.06s ease;
}

.choice:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--surface);
}

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

.choice:disabled {
  cursor: default;
}

.choice.correct {
  background: var(--correct-soft);
  border-color: var(--correct);
  color: var(--correct);
  font-weight: 700;
}

.choice.wrong {
  background: var(--wrong-soft);
  border-color: var(--wrong);
  color: var(--wrong);
}

.choice.dim {
  opacity: 0.4;
}

.reveal {
  margin-top: 18px;
  text-align: center;
}

/*
 * The whole reveal is one paragraph — name and details together, no panel.
 * A measure limit keeps it from running edge to edge on wide screens.
 */
.reveal-headline {
  margin: 0 auto 14px;
  max-width: 38ch;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
}

#next,
#c-next {
  margin-top: 18px;
}

/* ---------------------------------------------------------- challenge round */

.badge-line {
  margin: 0 0 18px;
  text-align: center;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 6px 14px;
  border-radius: var(--pill);
  background: var(--brand);
  color: var(--on-brand);
}

#c-form {
  margin-top: 0;
}

#c-input {
  text-align: center;
  font-size: 19px;
  font-weight: 500;
  border-radius: var(--pill);
}

/* ------------------------------------------------------------ notify toggle */

.notify-row {
  margin: 22px 0 6px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.switch input {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
  cursor: pointer;
}

.notify-msg {
  margin: 10px 0 0;
}

/* ------------------------------------------------------------- leaderboard */

.boards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

/* One column on phones; "who knows who" leads. */
@media (max-width: 620px) {
  .boards {
    grid-template-columns: minmax(0, 1fr);
  }
}

.board-card {
  padding: 20px 18px;
}

.board-sub {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-faint);
  /*
   * The two headings and the two subtitles wrap to different line counts, so
   * both reserve the taller one's height. Without it the cards' rows start at
   * different heights and the boards stop reading as a pair.
   */
  min-height: 70px;
}

/* Says which population is ranked — the thing the two boards differ on. */
.board-sub b {
  color: var(--ink-soft);
  font-weight: 500;
}

.board-card h2 {
  min-height: 44px;
}

/* Side by side they should line up; stacked on mobile the gap is wasted. */
@media (max-width: 620px) {
  .board-sub,
  .board-card h2 {
    min-height: 0;
  }
}

/*
 * Names both sides of a row, once, instead of on every row. Labelling only
 * the number left the rows themselves unexplained — and it's who is being
 * ranked, not what the number is, that the two boards differ on.
 */
.colhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
  margin-bottom: 2px;
}

.colhead span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* The right-hand label sits over the number, so it can't wrap under it. */
.colhead span:last-child {
  flex: none;
  text-align: right;
}

.brow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  font-size: 14px;
}

.brow + .brow {
  border-top: 1px solid var(--line);
}

.brank {
  width: 14px;
  flex: 0 0 auto;
  text-align: right;
  font-size: 12px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.bface {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line);
}

.bname {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.bval {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.brow.you {
  background: var(--brand-soft);
  border-radius: 10px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}

.brow.you + .brow {
  border-top: 0;
}

.brow.you .bname,
.brow.you .bval,
.brow.you .brank {
  color: var(--brand);
  font-weight: 700;
}

/* -------------------------------------------------------------------- misc */

.big-emoji {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 10px;
}

.score-line {
  font-size: 34px;
  font-weight: 500;
  margin: 6px 0 6px;
  letter-spacing: -0.03em;
  color: var(--brand);
}

#see-board {
  margin-top: 22px;
}

.footer {
  padding-top: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-link {
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 400;
}

.footer-link:hover {
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------- stats */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 20px;
}

.stat {
  background: var(--bg);
  border-radius: 16px;
  padding: 14px 16px;
}

.stat-value {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-faint);
}

.stat-bar {
  margin-bottom: 10px;
}

/* People worth a second look — framed as an invitation, not a failure list. */
/* Three across, so six people make two full rows. auto-fill fitted five and
   orphaned the sixth, and six across left no room for the team name. */
.tolearn {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 10px;
  margin-top: 14px;
}

.tolearn-person {
  text-align: center;
  min-width: 0;
}

.tolearn-face {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line);
}

.tolearn-name {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.tolearn-team {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Boards show a short list first; the rest is one tap away. */
.board-more {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  cursor: pointer;
}

.board-more:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------- share */

/*
 * A native <dialog>, so focus trapping and Escape-to-close come from the
 * browser rather than being hand-rolled.
 */
.modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 460px;
  width: calc(100% - 32px);
  color: var(--ink);
}

.modal::backdrop {
  background: rgba(11, 25, 38, 0.45);
}

.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  text-align: left;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
}

.modal-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
  padding-right: 32px;
}

.modal-title em {
  font-style: normal;
  color: var(--brand);
}

.modal-lede {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.modal-points {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.modal-points li {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.modal-points li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

.modal-points b {
  font-weight: 500;
  color: var(--ink);
}

.modal-note {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--ink-faint);
}

.share-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.share-row .input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  padding: 11px 14px;
}

.share-row .btn {
  width: auto;
  flex: 0 0 auto;
  padding: 11px 20px;
}

#share-native,
#copy-invite {
  margin-bottom: 8px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------- confusion / pairs */

/* Team lookalikes, under the boards. Two faces overlapped, since a pair is
   the unit here rather than either person. */
.pair {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid #f4efed;
}

.pair:last-child {
  border-bottom: 0;
}

.pface {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line);
  flex: none;
}

.pair .pface:nth-of-type(2) {
  margin-left: -14px;
  border: 2px solid var(--surface);
}

.pair-text {
  flex: 1;
  font-size: 13px;
  min-width: 0;
}

.pair-tag {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  white-space: nowrap;
}

.pair-n {
  font-size: 15px;
  font-weight: 600;
}

/* Your own confusers, on My stats. */
.crow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.crow-label {
  width: 116px;
  flex: none;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crow-track {
  flex: 1;
  height: 22px;
  border-radius: 7px;
  background: #f4efed;
  overflow: hidden;
}

.crow-fill {
  display: block;
  height: 100%;
  border-radius: 7px;
  background: var(--brand);
}

/* Being recognised is the good outcome, so it doesn't wear the same colour
   as the mistakes stacked above it. */
.crow-fill.is-right {
  background: var(--correct);
}

.crow-pct {
  width: 38px;
  flex: none;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
}
