/* Components: chunky buttons, cards, chips, stat tiles, progress, papel picado, tile strips, badges */

/* ---------- Chunky buttons ----------
   Set --c on the button (or a parent) to recolor. The darker "lip" is mixed from --c. */
.btn {
  --c: var(--coral-fill);
  --ink: var(--on-color);
  --lip-c: color-mix(in oklab, var(--c) 74%, black);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 52px;
  padding: 0 var(--s-5);
  border: 0;
  border-radius: var(--r-md);
  background: var(--c);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-1);
  line-height: 1.15;
  text-align: center;
  padding-block: 8px;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 var(--lip) 0 var(--lip-c);
  transform: translateY(0);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), filter var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:active {
  transform: translateY(calc(var(--lip) - var(--lip-press)));
  box-shadow: 0 var(--lip-press) 0 var(--lip-c);
}
.btn[disabled], .btn[aria-disabled="true"] {
  --c: var(--locked-fill);
  --ink: var(--locked-ink);
  cursor: not-allowed; filter: none;
}
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 40px; padding: 0 var(--s-4); font-size: var(--step-0); border-radius: var(--r-sm); --lip: 3px; }
.btn--sunny { --c: var(--sunny); --ink: var(--reward-ink); }
.btn--lagoon { --c: var(--lagoon); --ink: var(--on-lagoon); }
.btn--cactus { --c: var(--cactus); --ink: var(--on-cactus); }
.btn--pink { --c: var(--pink-fill); }
.btn--twilight { --c: var(--twilight); }
/* Quiet button: surface with a grey lip (answer options, secondary actions) */
.btn--ghost {
  --c: var(--surface);
  --ink: var(--text);
  --lip-c: var(--border);
  border: 2px solid var(--border);
}
.btn--ghost:hover { filter: none; background: var(--surface-2); }

/* Answer option states */
.btn--ghost.is-selected { --lip-c: color-mix(in oklab, var(--lagoon) 70%, black); border-color: var(--lagoon); background: color-mix(in oklab, var(--lagoon) 12%, var(--surface)); }
.btn--ghost.is-correct  { --lip-c: color-mix(in oklab, var(--cactus) 70%, black); border-color: var(--cactus); background: color-mix(in oklab, var(--cactus) 14%, var(--surface)); }
.btn--ghost.is-wrong    { --lip-c: color-mix(in oklab, var(--coral) 70%, black); border-color: var(--coral); background: color-mix(in oklab, var(--coral) 12%, var(--surface)); }

/* Round icon button (speaker, close, star) */
.icon-btn {
  --c: var(--surface-2);
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border: 0; border-radius: var(--r-pill);
  background: var(--c); color: var(--text);
  font-size: 1.2rem; line-height: 1;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast);
}
.icon-btn:hover { background: color-mix(in oklab, var(--c) 85%, var(--text)); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.card--flat { border: 0; background: var(--surface-2); }
/* A card that is itself a tap target gets the chunky lip */
.card--tap {
  display: block; width: 100%; text-align: left;
  color: inherit; text-decoration: none;
  border-color: var(--border);
  box-shadow: 0 var(--lip) 0 var(--border);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.card--tap:hover { border-color: color-mix(in oklab, var(--border) 60%, var(--text-muted)); }
.card--tap:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--border); }

/* Colored hero card (challenge banner, trip countdown, unit header) */
.card--color {
  --c: var(--coral);
  /* shaded a little so white text stays readable (AA) */
  background: color-mix(in oklab, var(--c) var(--shade), black);
  border: 0;
  color: var(--on-color);
  box-shadow: 0 var(--lip) 0 color-mix(in oklab, var(--c) 74%, black);
}
.card--color.on-lagoon { color: var(--on-lagoon); background: var(--c); }
.card--color.on-cactus { color: var(--on-cactus); background: var(--c); }

/* ---------- Chips & badges ---------- */
.chip {
  --c: var(--lagoon);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: color-mix(in oklab, var(--c) 14%, var(--surface));
  color: color-mix(in oklab, var(--c) var(--tint), var(--text));
  font-size: var(--step--1);
  font-weight: 700;
  white-space: nowrap;
}
.badge-pro {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--pink-fill);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800; font-size: 0.78rem; letter-spacing: 0.02em;
}

/* ---------- Stat tiles (streak / XP / pesos) ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.stat {
  --c: var(--coral);
  display: grid; justify-items: center; gap: 2px;
  padding: var(--s-3) var(--s-2);
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: var(--r-md);
  text-align: center;
}
.stat__icon {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: var(--r-pill);
  background: color-mix(in oklab, var(--c) 16%, var(--surface));
  font-size: 1.1rem;
}
.stat__value { font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); line-height: 1.1; }
.stat__label { font-size: var(--step--1); color: var(--text-2); font-weight: 600; }

/* ---------- Progress bar ---------- */
.progress {
  --c: var(--cactus);
  height: 14px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  overflow: hidden;
}
.progress > span {
  display: block; height: 100%;
  width: var(--value, 0%);
  border-radius: inherit;
  background: var(--c);
  /* highlight stripe like the app's chunky bar */
  background-image: linear-gradient(to bottom, rgb(255 255 255 / .35) 0 35%, transparent 35%);
  transition: width 400ms var(--ease-out);
}

/* ---------- Papel picado banner ----------
   Each flag gets the next brand color: the color gradient and the flag mask share the same 62px rhythm. */
.papel-picado {
  height: 52px;
  background:
    linear-gradient(90deg,
      var(--coral) 0 62px, var(--sunny) 62px 124px, var(--lagoon) 124px 186px,
      var(--cactus) 186px 248px, var(--bougainvillea) 248px 310px, var(--twilight) 310px 372px);
  background-size: 372px 100%;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='62' height='52'%3E%3Cpath fill-rule='evenodd' d='M0 1h62v2H0zM3 4h56v36l-7 8-7-8-7 8-7-8-7 8-7-8-7 8-7-8zM31 13l7 9-7 9-7-9zM11 16a3 3 0 1 0 6 0a3 3 0 1 0-6 0zM45 16a3 3 0 1 0 6 0a3 3 0 1 0-6 0zM11 30a3 3 0 1 0 6 0a3 3 0 1 0-6 0zM45 30a3 3 0 1 0 6 0a3 3 0 1 0-6 0z'/%3E%3C/svg%3E") repeat-x 0 0 / 62px 52px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='62' height='52'%3E%3Cpath fill-rule='evenodd' d='M0 1h62v2H0zM3 4h56v36l-7 8-7-8-7 8-7-8-7 8-7-8-7 8-7-8zM31 13l7 9-7 9-7-9zM11 16a3 3 0 1 0 6 0a3 3 0 1 0-6 0zM45 16a3 3 0 1 0 6 0a3 3 0 1 0-6 0zM11 30a3 3 0 1 0 6 0a3 3 0 1 0-6 0zM45 30a3 3 0 1 0 6 0a3 3 0 1 0-6 0z'/%3E%3C/svg%3E") repeat-x 0 0 / 62px 52px;
}
.papel-picado--sm { height: 32px; -webkit-mask-size: 38px 32px; mask-size: 38px 32px; background-size: 228px 100%;
  background-image: linear-gradient(90deg,
      var(--coral) 0 38px, var(--sunny) 38px 76px, var(--lagoon) 76px 114px,
      var(--cactus) 114px 152px, var(--bougainvillea) 152px 190px, var(--twilight) 190px 228px); }
/* Single-color variant (unit headers): set --c */
.papel-picado--mono { background: var(--c, var(--coral)); }

/* ---------- Talavera tile strip ---------- */
.tile-strip {
  --c: var(--lagoon);
  height: 24px;
  background: var(--c);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M0 0h6a6 6 0 0 1-6 6zM24 0v6a6 6 0 0 1-6-6zM0 24v-6a6 6 0 0 1 6 6zM24 24h-6a6 6 0 0 1 6-6zM12 4a3 3 0 0 1 3 3 3 3 0 0 1-3 3 3 3 0 0 1-3-3 3 3 0 0 1 3-3zM12 14a3 3 0 0 1 3 3 3 3 0 0 1-3 3 3 3 0 0 1-3-3 3 3 0 0 1 3-3zM7 9a3 3 0 0 1 3 3 3 3 0 0 1-3 3 3 3 0 0 1-3-3 3 3 0 0 1 3-3zM17 9a3 3 0 0 1 3 3 3 3 0 0 1-3 3 3 3 0 0 1-3-3 3 3 0 0 1 3-3z'/%3E%3C/svg%3E") repeat-x 0 0 / 24px 24px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M0 0h6a6 6 0 0 1-6 6zM24 0v6a6 6 0 0 1-6-6zM0 24v-6a6 6 0 0 1 6 6zM24 24h-6a6 6 0 0 1 6-6zM12 4a3 3 0 0 1 3 3 3 3 0 0 1-3 3 3 3 0 0 1-3-3 3 3 0 0 1 3-3zM12 14a3 3 0 0 1 3 3 3 3 0 0 1-3 3 3 3 0 0 1-3-3 3 3 0 0 1 3-3zM7 9a3 3 0 0 1 3 3 3 3 0 0 1-3 3 3 3 0 0 1-3-3 3 3 0 0 1 3-3zM17 9a3 3 0 0 1 3 3 3 3 0 0 1-3 3 3 3 0 0 1-3-3 3 3 0 0 1 3-3z'/%3E%3C/svg%3E") repeat-x 0 0 / 24px 24px;
  opacity: .55;
}

/* ---------- App Store button ----------
   Temporary stand-in. Phase 7 swaps in Apple's official "Download on the App Store" badge artwork. */
.appstore {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 6px 18px 6px 14px;
  border-radius: 12px;
  background: #000; color: #fff;
  border: 1px solid #A6A6A6;
  text-decoration: none; line-height: 1.05;
  white-space: nowrap;
}
.appstore img { width: 34px; height: 34px; border-radius: 8px; }
.appstore small { display: block; font-size: 0.7rem; color: #E8E8E8; }
.appstore strong { display: block; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.appstore:hover { background: #1a1a1a; }

/* ---------- Section header ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin: var(--s-6) 0 var(--s-3); }
.section-head h2 { font-size: var(--step-2); margin: 0; }
.section-head p { margin: 0; color: var(--text-2); font-size: var(--step--1); }

/* Official App Store badge (used automatically when assets/img/app-store-badge.svg exists) */
.appstore--official { padding: 0; border: 0; background: none; min-height: 0; }
.appstore--official:hover { background: none; opacity: .9; }
.appstore--official img { width: auto; height: 52px; border-radius: 0; }

