/* Playful, chunky, light-only: sky-to-sand background, pastel tiles with a
   white rim, heavy rounded type, buttons that press down. Big type and tap
   targets, readable while walking in sunlight. */
@font-face {
  font-family: "Nunito";
  src: url("vendor/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --ink: #213c47;
  --muted: #44606a;
  --teal: #0f807a;
  --teal-deep: #076661;
  --teal-ink: #ffffff;
  --cream: #fffaf0;
  --surface: #ffffff;
  --gold: #ffcf67;
  --gold-soft: #fff4c5;
  --gold-edge: #c7ae69;
  --amber: #ffb743;
  --mint: #2fae8a;
  --ok: #0b7a69;
  --miss: #b83d33;
  --shadow: 0 8px 0 rgba(39, 81, 82, 0.095), 0 14px 22px rgba(24, 60, 70, 0.075);
  --radius: 26px;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 10%, #fff1b5 0 11%, transparent 36%),
    linear-gradient(#b9e9ed, #f7f0dc 62%, #f3ead4);
  background-attachment: fixed;
  font: 600 17px/1.45 "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

#app {
  max-width: 560px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; transition: transform 0.12s; }
button:disabled { opacity: 0.5; cursor: default; }
button:not(:disabled):active { transform: scale(0.965); }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 10px; }
.top h1 {
  display: flex; align-items: center; gap: 11px;
  font-size: 20px; font-weight: 950; letter-spacing: -0.6px;
}
/* Brand mark: the auto's yellow hood over green body, in a white box. */
.top h1::before {
  content: "";
  width: 44px; height: 44px; flex: none;
  border: 2px solid #fff; border-radius: 15px;
  background:
    linear-gradient(#f3c623 0 45%, #1d6b3c 45%) center / 22px 22px no-repeat content-box,
    #fff;
  padding: 9px;
  box-shadow: var(--shadow);
}
.top--turn { justify-content: space-between; }
.top__title { font-weight: 900; font-size: 17px; flex: 1; letter-spacing: -0.3px; line-height: 1.2; }
.top__step {
  background: var(--gold-soft); border: 2px solid #fff6; border-radius: 99px;
  box-shadow: 0 3px var(--gold-edge);
  padding: 7px 13px; font-size: 14px; font-weight: 900; white-space: nowrap;
}
.back {
  flex: none; width: 48px; height: 48px; border-radius: 17px;
  border: 2px solid #fff; background: var(--surface); font-size: 22px; font-weight: 900;
  box-shadow: 0 5px #d5e2dc;
}

/* ---------- picker ---------- */
.hero { text-align: center; padding: 10px 8px 4px; }
.hero__mascot {
  font-size: 64px; line-height: 1.1;
  filter: drop-shadow(0 7px 0 #ffffff70);
  animation: bob 2.7s ease-in-out infinite;
}
.eyebrow {
  margin-top: 6px;
  font-size: 12px; font-weight: 900; letter-spacing: 2.1px; text-transform: uppercase; color: #33625f;
}
.lead {
  font-size: clamp(30px, 8vw, 42px); font-weight: 950; line-height: 1.08; letter-spacing: -1.4px;
  margin-top: 6px; text-wrap: balance;
}
.hero__sub {
  margin: 10px auto 0; max-width: 340px;
  font-size: 16px; font-weight: 700; color: var(--muted); line-height: 1.5;
}
.foot { color: var(--muted); font-size: 15px; font-weight: 700; }
.notice {
  background: var(--gold-soft); color: var(--ink);
  border: 2px solid #fff; border-radius: 20px; box-shadow: 0 4px var(--gold-edge);
  padding: 12px 16px; font-weight: 800;
}

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.card {
  --tile: #ffdbca;
  background: var(--tile);
  border: 2.5px solid #fff; border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
/* Hue follows the scene's place in scenes.json, so it stays put when the
   picker reorders. */
.card[data-hue="1"] { --tile: #ffed9f; }
.card[data-hue="2"] { --tile: #d2e9ce; }
.card[data-hue="3"] { --tile: #d9d8fd; }
.card[data-hue="4"] { --tile: #d8e8ff; }
.card[data-hue="5"] { --tile: #f7d9e8; }
.card--work { border-color: var(--gold); box-shadow: 0 0 0 2px var(--amber), var(--shadow); }

.card__main {
  position: relative; width: 100%;
  display: grid; grid-template-columns: 58px 1fr; column-gap: 12px; row-gap: 3px;
  align-items: start; text-align: left;
  border: 0; background: none; padding: 18px 52px 12px 16px; min-height: 96px;
}
.card__main > :not(.card__emoji):not(.card__arrow) { grid-column: 2; }
.card__emoji { grid-row: 1 / span 4; font-size: 46px; line-height: 1; padding-top: 2px; }
.card__title { font-size: 21px; font-weight: 950; letter-spacing: -0.7px; line-height: 1.15; }
.card__blurb { font-size: 15px; font-weight: 800; opacity: 0.78; }
.card__meta { font-size: 14px; font-weight: 700; color: var(--muted); }
.card__meta strong { color: var(--ink); font-weight: 900; }
.card__heard { font-size: 14px; font-style: italic; font-weight: 700; }
.card__arrow {
  position: absolute; right: 14px; top: 50%; translate: 0 -50%;
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff9; display: grid; place-items: center; font-size: 18px; font-weight: 900;
}

.card__side {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 0 14px 14px 86px;
}
.pin, .badge, .flag {
  min-height: 40px; padding: 0 16px; border-radius: 99px;
  border: 2px solid #fff; background: #ffffffb3;
  font-size: 14px; font-weight: 900; color: var(--ink);
}
.pin--on { background: var(--teal); color: var(--teal-ink); box-shadow: 0 4px var(--teal-deep); }
.badge { background: var(--gold); box-shadow: 0 4px var(--gold-edge); }
.flag {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
  background: var(--gold-soft); border-color: var(--gold); font-size: 13px;
}

/* Group tabs and the Up next heading */
.section { margin: 4px 4px -4px; font-size: 20px; font-weight: 950; letter-spacing: -0.5px; }
.tabs {
  display: flex; gap: 8px; padding: 5px; margin-top: 4px;
  background: #ffffff70; border: 2px solid #fff; border-radius: 99px;
}
.tab {
  flex: 1; min-height: 48px; padding: 0 12px; border: 0; border-radius: 99px;
  background: transparent; font-size: 16px; font-weight: 950; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.tab--on { background: var(--teal); color: var(--teal-ink); box-shadow: 0 4px var(--teal-deep); }
.tab__count {
  min-width: 24px; padding: 1px 7px; border-radius: 99px;
  background: #ffffffb3; color: var(--ink); font-size: 13px;
}
.tab { min-width: 0; }
.tab__label { display: inline-flex; align-items: center; gap: 6px; }
.empty { text-align: center; padding: 16px 0; }
/* Three tabs don't fit side by side on a phone: stack the emoji on top. */
@media (max-width: 420px) {
  .tabs { gap: 4px; border-radius: 26px; }
  .tab { flex-direction: column; gap: 0; min-height: 60px; padding: 6px 4px; border-radius: 21px; font-size: 14px; }
  .tab__emoji { font-size: 20px; line-height: 1.1; }
  .tab__label { gap: 4px; }
  .tab__count { min-width: 20px; padding: 0 5px; font-size: 12px; }
}

/* ---------- turn ---------- */
.them, .learn {
  background: var(--cream);
  border: 2.5px solid #fff; border-radius: 30px;
  box-shadow: var(--shadow);
  padding: 20px 18px; display: grid; gap: 10px; text-align: center;
}
.them__who, .hint-label {
  font-size: 12px; font-weight: 900; letter-spacing: 1.8px; text-transform: uppercase; color: #33625f;
}
.hint-label { text-align: center; }
.them__line {
  font-size: clamp(28px, 8vw, 38px); line-height: 1.15; font-weight: 950; letter-spacing: -0.8px;
  color: var(--teal); text-shadow: 3px 3px #d4f4e2; overflow-wrap: anywhere;
}
.them__gloss { color: var(--muted); font-weight: 800; font-size: 16px; }
.tag {
  display: inline-block; font-size: 12px; font-weight: 900; padding: 2px 8px; border-radius: 99px;
  background: #fff; border: 2px solid #e8e0cc; vertical-align: 1px;
}

.you { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.chips { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.chip {
  background: var(--surface); border: 2.5px solid #fff; border-radius: 20px;
  box-shadow: 0 4px #d9e8e6;
  padding: 13px 16px; font-size: 18px; font-weight: 800; text-align: center;
}
.heard { font-size: 16px; font-weight: 800; text-align: center; }
.heard--ok { color: var(--ok); font-weight: 950; }
.heard--miss { color: var(--miss); }
.message { color: var(--miss); font-weight: 800; text-align: center; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row--center { justify-content: center; }
.secondary {
  min-height: 50px; padding: 0 18px; border-radius: 18px;
  border: 2px solid #b5dad2; background: var(--surface); color: #126d69;
  font-weight: 900; box-shadow: 0 5px #d0e8dc;
}
.primary {
  min-height: 58px; padding: 0 20px; border-radius: 20px; border: 0;
  background: var(--teal); color: var(--teal-ink);
  font-weight: 950; font-size: 19px; box-shadow: 0 6px var(--teal-deep);
}
.primary:not(:disabled):active, .secondary:not(:disabled):active, .listen:not(:disabled):active {
  transform: translateY(3px);
}
.primary:not(:disabled):active { box-shadow: 0 3px var(--teal-deep); }
.listen {
  min-height: 44px; padding: 0 18px; border-radius: 99px; border: 0;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--teal); color: var(--teal-ink);
  font-size: 15px; font-weight: 900; box-shadow: 0 5px var(--teal-deep);
}
.listen--slow { background: #f3d28c; color: #29454d; box-shadow: 0 5px #d7b977; }
.link {
  background: none; border: 0; color: var(--teal-deep); font-weight: 900; padding: 10px 0;
  text-decoration: underline; text-underline-offset: 3px;
}

.mic {
  margin: auto auto 0; width: 148px; height: 148px; border-radius: 50%;
  border: 4px solid #fff; background: var(--teal); color: var(--teal-ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-weight: 950; font-size: 16px; line-height: 1.15; padding: 16px;
  box-shadow: 0 8px var(--teal-deep), 0 16px 26px rgba(24, 60, 70, 0.18);
}
.mic__icon { font-size: 38px; line-height: 1; }
.mic:not(:disabled):active { transform: translateY(4px); box-shadow: 0 4px var(--teal-deep); }
.mic--on {
  background: var(--gold); color: var(--ink); box-shadow: 0 8px var(--gold-edge);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  50% { box-shadow: 0 8px var(--gold-edge), 0 0 0 14px color-mix(in srgb, var(--gold) 35%, transparent); }
}

.selfmark, .outcomes, .note { display: grid; gap: 12px; }
.choice {
  text-align: left; min-height: 62px; padding: 14px 18px; border-radius: 22px;
  border: 2.5px solid #fff; background: var(--surface); box-shadow: 0 5px #2751521a;
  font-size: 18px; font-weight: 900; display: grid; gap: 2px;
}
.choice__intent { color: var(--muted); font-size: 15px; font-weight: 700; }
.choice--outcome { grid-template-columns: 44px 1fr; align-items: center; column-gap: 10px; }
.choice__emoji { font-size: 32px; text-align: center; }
.outcomes .choice:nth-child(1) { background: #d2ede4; }
.outcomes .choice:nth-child(2) { background: #ffe2d3; }
.outcomes .choice:nth-child(3) { background: #e2e1fd; }
.outcomes .choice:nth-child(4) { background: #d8e8ff; }

/* ---------- end ---------- */
.end {
  display: grid; gap: 12px; margin-top: 16px; text-align: center;
  background: linear-gradient(150deg, #fffbec, #fff1b5 55%, #fff5e9);
  border: 2.5px solid #ffda75; border-radius: 32px; box-shadow: var(--shadow);
  padding: 24px 20px;
}
.end__giant {
  font-size: 88px; line-height: 1.1;
  filter: drop-shadow(0 8px 3px #e9b64955);
  animation: bob 2s ease-in-out infinite;
}
.end h2 { font-size: 26px; font-weight: 950; letter-spacing: -0.8px; margin-top: 6px; }
.go { font-size: 20px; font-weight: 950; color: var(--teal); }

.confetti { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 99; }
.confetti span {
  position: absolute; top: -8%; font-size: 26px;
  animation: fall 1.6s ease-in forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(530deg); opacity: 0; } }

/* ---------- learn cards ---------- */
.progress { display: flex; gap: 5px; }
.pip { height: 9px; flex: 1; border-radius: 99px; background: #ffffff98; }
.pip--done { background: var(--mint); }
.pip--now { background: var(--amber); }
.learn__kind {
  justify-self: center; font-size: 13px; font-weight: 900; padding: 5px 13px; border-radius: 99px;
  border: 2px solid #fff;
}
.learn__kind--hear { background: var(--gold-soft); box-shadow: 0 3px var(--gold-edge); }
.learn__kind--say { background: #d2ede4; box-shadow: 0 3px #a9d3c5; }
.learn__text {
  font-size: clamp(30px, 9vw, 42px); line-height: 1.12; font-weight: 950; letter-spacing: -1px;
  color: var(--teal); text-shadow: 3px 3px #d4f4e2; overflow-wrap: anywhere;
}
.learn__gloss { font-size: 18px; font-weight: 800; color: var(--muted); }
.words {
  list-style: none; margin: 4px 0 0; padding: 4px 14px; display: grid; text-align: left;
  background: var(--surface); border: 2px solid #fff; border-radius: 18px;
}
.words li {
  display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 12px; align-items: baseline;
  padding: 8px 0; border-top: 2px dashed #ece4d0;
}
.words li:first-child { border-top: 0; }
.words__w { font-weight: 950; }
.words__m { color: var(--muted); font-weight: 700; }
.say-it { min-height: 56px; font-size: 18px; }
.say-it.mic--on { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.row--nav { margin-top: auto; }
.row--nav button { flex: 1; }
.row--nav .secondary { flex: 0 0 32%; }

@keyframes bob { 50% { transform: translateY(-6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 370px) {
  #app { padding-left: 12px; padding-right: 12px; }
  .card__main { grid-template-columns: 48px 1fr; padding-left: 12px; }
  .card__emoji { font-size: 38px; }
  .card__side { padding-left: 72px; }
  .mic { width: 132px; height: 132px; }
}
