:root {
  --bg: #f5efe3; --surface: #fffaf0; --ink: #1d2440; --muted: #666b7d; --line: #e0d5bd;
  --primary: #0e6f6b; --primary-ink: #ffffff; --accent: #f2b134; --accent-ink: #1d2440;
  --good: #23784a; --good-bg: #dff1e3; --bad: #b83a27; --bad-bg: #f8dfd9;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131727; --surface: #1c2238; --ink: #f1ead9; --muted: #a2a7bb; --line: #303758;
    --primary: #36a79e; --primary-ink: #0c1220; --good: #6fcf97; --good-bg: #18362a; --bad: #f08a78; --bad-bg: #40201c;
  }
}
* { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
/* The visible screen, not 100%: on iPhone home-screen apps with a see-through status bar, 100% is
   shorter than the screen, which leaves a gap under the tab bar and lifts it off the bottom edge. */
body {
  margin: 0 auto; height: 100vh; height: 100dvh;
  font: 16px/1.45 var(--sans); background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; max-width: 600px;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
h2 { font: 600 1.35rem/1.2 var(--serif); margin: 0 0 .4rem; }
h3 { font: 600 1.05rem/1.3 var(--sans); margin: 1.4rem 0 .4rem; }
p { margin: .5rem 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.block { display: block; }
.tag {
  font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: .05rem .35rem; white-space: nowrap;
}
.link { background: none; border: 0; padding: .5rem 0; color: var(--primary); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#view:focus-visible, #overlay:focus-visible { outline: none; }   /* page containers take focus only programmatically */

/* top bar + tabs */
#topbar {
  display: flex; align-items: center; gap: .9rem;
  padding: calc(.6rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) .6rem calc(1rem + env(safe-area-inset-left));
  background: #1d2440; color: #f5efe3;
}
.stat { display: flex; flex-direction: column; align-items: center; min-width: 3rem; }
.stat-n { font: 700 1.25rem/1 var(--serif); }
.stat-l { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; opacity: .75; }
.stat.hot .stat-n { color: var(--accent); }
.goal { flex: 1; }
.goal-row { display: flex; justify-content: space-between; font-size: .8rem; margin-bottom: .25rem; gap: .5rem; }
.bar { height: 8px; background: color-mix(in srgb, var(--muted) 30%, transparent); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .5s cubic-bezier(.3, 1.35, .5, 1); position: relative; }
#view { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem calc(1rem + env(safe-area-inset-right)) 1rem calc(1rem + env(safe-area-inset-left)); -webkit-overflow-scrolling: touch; }
#tabs {
  display: flex; border-top: 1px solid var(--line); background: var(--surface);
  /* The home indicator only needs the lowest ~13px clear; the full 34px inset plus the tab's own
     padding made the bar sit high on Face ID iPhones. */
  padding: 0 env(safe-area-inset-right) max(0px, calc(env(safe-area-inset-bottom) - 14px)) env(safe-area-inset-left);
}
.tab {
  flex: 1; background: none; border: 0; border-top: 3px solid transparent; padding: .7rem .1rem .65rem;
  font-size: .78rem; color: var(--muted); position: relative; min-height: 48px;
}
.tab.on { color: var(--ink); border-top-color: var(--primary); font-weight: 600; }
.badge {
  position: absolute; top: 4px; right: 12%; background: var(--accent); color: var(--accent-ink);
  border-radius: 9px; font-size: .65rem; font-weight: 700; padding: 0 .35rem; line-height: 1.5;
}

/* learn path */
.level { margin-bottom: 1.8rem; }
.level-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--ink); padding-bottom: .3rem; margin-bottom: .6rem; }
.level-head h2 { display: inline; margin: 0; }
.level-code { font: 700 .8rem var(--sans); background: var(--ink); color: var(--bg); padding: .1rem .4rem; border-radius: 3px; margin-right: .5rem; vertical-align: 3px; }
.level.locked .unit, .unit.locked { opacity: .55; }
.unit { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: .5rem; scroll-margin-top: .5rem; }
.unit.open { border-color: var(--primary); }
.unit-head {
  display: grid; grid-template-columns: 2rem 1fr; gap: .1rem .6rem; width: 100%; text-align: left;
  background: none; border: 0; padding: .7rem .8rem; align-items: center;
}
.unit-n { grid-row: span 2; font: 700 1.3rem var(--serif); color: var(--muted); text-align: center; }
.unit.complete .unit-n { color: var(--good); }
.unit-title { font-weight: 600; }
.segs { display: flex; gap: 3px; }
.segs i { flex: 1; max-width: 26px; height: 5px; border-radius: 2px; background: var(--line); }
.segs i.on { background: var(--primary); }
.unit-body { padding: 0 .8rem .8rem; display: flex; flex-direction: column; gap: .4rem; }
.guide-btn { background: none; border: 1px dashed var(--line); border-radius: 6px; padding: .6rem; color: var(--primary); text-align: left; }
.lesson {
  display: flex; align-items: center; gap: .6rem; background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: .65rem .7rem; text-align: left; min-height: 48px;
}
.lesson-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-state { font-size: .8rem; color: var(--muted); }
.lesson.next { border-color: var(--primary); border-width: 2px; }
.lesson.next .lesson-state { color: var(--primary); font-weight: 700; }
.lesson.finished .lesson-state { color: var(--good); }
.lesson:disabled { opacity: .5; cursor: default; }
.exam {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem; width: 100%; text-align: left;
  background: none; border: 2px solid var(--ink); border-radius: 8px; padding: .7rem .8rem; margin-top: .3rem;
}
.exam > span:first-child { display: flex; flex-direction: column; }
.exam.passed { border-color: var(--good); }
.jump-btn { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; text-align: left;
  padding: .6rem .75rem; border: 2px dashed var(--primary); border-radius: 8px; background: transparent; color: inherit; }
.level.locked .unit.open, .unit.locked.open { opacity: 1; }

/* buttons */
.btn {
  background: var(--primary); color: var(--primary-ink); border: 0; border-radius: 8px; padding: .7rem 1.2rem;
  font-weight: 700; box-shadow: 0 3px 0 color-mix(in srgb, var(--primary) 60%, #000);
}
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--primary) 60%, #000); }
.btn:disabled { background: var(--line); color: var(--muted); box-shadow: none; cursor: default; }
.btn.big { width: 100%; padding: .9rem; font-size: 1.05rem; }

/* overlay pages + player */
#overlay { position: fixed; inset: 0; background: var(--bg); z-index: 10; overflow-y: auto; }
.page, .player { max-width: 600px; margin: 0 auto; }
.page { padding: calc(.8rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) calc(2rem + env(safe-area-inset-bottom)) calc(1rem + env(safe-area-inset-left)); }
.page-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: .5rem; }
.page-head h2 { margin: 0; }
.cando { padding-left: 1.2rem; color: var(--muted); }
.guide section { border-top: 1px solid var(--line); margin-top: 1.2rem; }
.player { height: 100%; display: flex; flex-direction: column; }
.player-top { display: flex; align-items: center; gap: .8rem; padding: calc(.5rem + env(safe-area-inset-top)) 1rem .5rem; }
.player-top .bar { flex: 1; height: 10px; }
.player-top .bar-fill { background: var(--primary); }
.player-body { flex: 1; overflow-y: auto; padding: .5rem 1rem 1rem; }
.player-body.locked .choice, .player-body.locked .tile, .player-body.locked .type-in { pointer-events: none; }
.player-foot { padding: .8rem calc(1rem + env(safe-area-inset-right)) max(.8rem, calc(env(safe-area-inset-bottom) - .2rem)) calc(1rem + env(safe-area-inset-left)); border-top: 1px solid var(--line); }
.player-foot.ok { background: var(--good-bg); border-top-color: var(--good); }
.player-foot.no { background: var(--bad-bg); border-top-color: var(--bad); }
.fb { margin-bottom: .7rem; }
.fb-title { font-weight: 700; font-size: 1.1rem; }
.ok .fb-title { color: var(--good); }
.no .fb-title { color: var(--bad); }
.fb-answer, .fb-explain, .fb-reveal { margin-top: .3rem; }
.fb-explain { font-size: .92rem; }

/* exercises */
.ex-prompt { font-weight: 700; font-size: 1.1rem; margin: .4rem 0 1rem; }
.tl { font-family: var(--serif); }
.w { cursor: pointer; border-bottom: 1px dotted color-mix(in srgb, var(--muted) 70%, transparent); }
.big-tl { font: 600 1.7rem/1.25 var(--serif); display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.big-en { font-size: 1.2rem; margin: .5rem 0; }
.src { font: 1.3rem/1.35 var(--serif); margin-bottom: 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin-bottom: .7rem; }
.tags { display: flex; gap: .4rem; }
.choices { display: flex; flex-direction: column; gap: .55rem; }
.choice {
  background: var(--surface); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 8px;
  padding: .8rem .9rem; text-align: left; min-height: 52px; font-size: 1.02rem;
}
.choice[lang=tl] { font-family: var(--serif); font-size: 1.1rem; }
.choice.sel { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.choice.right { border-color: var(--good); background: var(--good-bg); }
.choice.wrong { border-color: var(--bad); background: var(--bad-bg); }
.choice.gone { opacity: 0; pointer-events: none; animation: pair-out .45s ease-out; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.match-col { display: flex; flex-direction: column; gap: .55rem; }
.match .choice { text-align: center; padding: .6rem .4rem; }
.listen { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin: .5rem 0 1.4rem; }
.spk {
  width: 2.3rem; height: 2.3rem; border-radius: 50%; border: 0; background: var(--primary); flex: none;
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
}
.spk-ico { width: 0; height: 0; border-style: solid; border-width: .42rem 0 .42rem .7rem; border-color: transparent transparent transparent var(--primary-ink); margin-left: .15rem; }
.spk.huge { width: 5.5rem; height: 5.5rem; box-shadow: 0 4px 0 color-mix(in srgb, var(--primary) 60%, #000); }
.spk.huge .spk-ico { border-width: 1rem 0 1rem 1.7rem; margin-left: .35rem; }
.bank-answer {
  min-height: 6.4rem; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line);
  padding: .6rem 0; margin-bottom: 1.2rem; display: flex; flex-wrap: wrap; gap: .45rem; align-content: flex-start;
}
.bank-pool { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; }
.tile {
  background: var(--surface); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 8px;
  padding: .45rem .7rem; font-size: 1.05rem; min-height: 44px;
}
.tile.used { visibility: hidden; }
.type-in {
  width: 100%; padding: .8rem; font-size: 1.15rem; border: 2px solid var(--line); border-radius: 8px;
  background: var(--surface); margin-bottom: .6rem;
}
.type-in:focus { border-color: var(--primary); outline: none; }
.line { display: flex; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.line > div { flex: 1; }
.speaker { font-size: .78rem; font-weight: 700; color: var(--primary); min-width: 3.2rem; padding-top: .2rem; }
.line-tl { font-size: 1.1rem; display: flex; gap: .5rem; align-items: center; justify-content: space-between; }
.line-tl .spk, .vrow .spk, .entry .spk, .sheet-head .spk { width: 1.9rem; height: 1.9rem; }
details summary { color: var(--primary); font-size: .85rem; cursor: pointer; padding: .2rem 0; }
.vrow { padding: .45rem 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .1rem; }
.vrow > div:first-child { display: flex; align-items: center; gap: .5rem; }
.vrow-tl { font: 600 1.1rem var(--serif); }
.done { text-align: center; padding-top: 2rem; }
.done-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 1rem 0; }
.done-grid > div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .8rem .3rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; }
.done-grid .stat-n { font-size: 1.5rem; }

/* panes */
.pane .bar { margin-top: .8rem; }
.pane input[type=range] { width: 100%; accent-color: var(--primary); }
.week { display: flex; gap: .4rem; align-items: flex-end; height: 120px; }
.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .2rem; height: 100%; }
.week-bar { width: 70%; background: var(--primary); border-radius: 3px 3px 0 0; opacity: .55; }
.week-bar.hit { opacity: 1; background: var(--accent); }
.course-row { margin-bottom: .7rem; }
.course-row .bar { margin-top: 0; }
.course-row .bar-fill { background: var(--primary); }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.setting select { padding: .4rem; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); }
.setting input[type=checkbox] { width: 1.5rem; height: 1.5rem; accent-color: var(--primary); }
.sources a { color: var(--primary); overflow-wrap: anywhere; }
.credit { display: flex; flex-direction: column; gap: .15rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.credit-title { font-weight: 600; }
.entry { border-bottom: 1px solid var(--line); padding: .6rem 0; }
.entry-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.entry-word { font: 600 1.25rem var(--serif); }
.ipa { color: var(--muted); font-size: .9rem; }
.entry ol { margin: .3rem 0 0; padding-left: 1.3rem; }
.empty { text-align: center; padding-top: 3rem; }

/* dictionary bottom sheet + toast */
#sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface);
  border-top: 2px solid var(--ink); max-height: 55vh; overflow-y: auto; box-shadow: 0 -6px 20px rgba(0, 0, 0, .25);
}
.sheet-body { max-width: 600px; margin: 0 auto; padding: .6rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; gap: .6rem; font-size: 1.2rem; }
.sheet-head .link { margin-left: auto; font-size: 1rem; }
#toast {
  position: fixed; left: 50%; bottom: calc(4.5rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  background: #1d2440; color: #f5efe3; padding: .6rem 1rem; border-radius: 8px; max-width: 90vw; text-align: center;
}

/* progress code */
.code-row { display: flex; gap: .5rem; align-items: center; margin: .5rem 0; }
.code-row .type-in { margin: 0; font-size: 1rem; }
.code { flex: 1; font: .95rem/1.3 ui-monospace, Consolas, monospace; background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: .6rem .7rem; overflow-wrap: anywhere; user-select: all; }
.link.danger { color: var(--bad); }

/* ------------------------------------------------------------ small and sideways phones */
/* iPhone SE (1st gen) and other 320–360px screens: five tab labels and the top bar must fit. */
@media (max-width: 360px) {
  .tab { font-size: .7rem; }
  #topbar { gap: .6rem; }
  .stat { min-width: 2.4rem; }
  .stat-n { font-size: 1.1rem; }
  .done-grid { gap: .4rem; }
  .big-tl { font-size: 1.45rem; }
  .choice { padding: .7rem .75rem; }
}
/* Phones turned sideways: little height, so slimmer bars and a smaller listening button. */
@media (orientation: landscape) and (max-height: 500px) {
  #topbar { padding-top: calc(.35rem + env(safe-area-inset-top)); padding-bottom: .35rem; }
  .stat-n { font-size: 1.05rem; }
  .tab { min-height: 40px; padding-top: .45rem; padding-bottom: .45rem; }
  .spk.huge { width: 4rem; height: 4rem; }
  .listen { margin: .2rem 0 .6rem; }
  .player-top { padding-top: calc(.3rem + env(safe-area-inset-top)); }
  .player-foot { padding-top: .5rem; }
  #sheet { max-height: 75vh; }
}

/* ------------------------------------------------------------ larger screens */
/* Tablet and large phones in landscape: a wider column, two-column answer choices. */
@media (min-width: 640px) {
  body { max-width: 760px; }
  #view { padding: 1.25rem 1.5rem; }
  .page, .player, .sheet-body { max-width: 720px; }
  .page { padding-left: 1.5rem; padding-right: 1.5rem; }
  .player-body, .player-top, .player-foot { padding-left: 1.5rem; padding-right: 1.5rem; }
  .choices:has(> .choice:nth-child(4)) { display: grid; grid-template-columns: 1fr 1fr; }
  .big-tl { font-size: 2rem; }
  .done-grid { grid-template-columns: repeat(6, 1fr); }
}

/* Desktop: navigation moves to a sidebar, Progress gets two columns, the dictionary opens as a side panel. */
@media (min-width: 1024px) {
  body {
    max-width: 1200px; display: grid; grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top top" "nav main";
  }
  #topbar { grid-area: top; padding: .8rem 2rem; gap: 1.5rem; border-radius: 0 0 10px 10px; }
  .goal { max-width: 520px; margin: 0 auto; }
  #tabs {
    grid-area: nav; flex-direction: column; gap: .25rem; border-top: 0; border-right: 1px solid var(--line);
    background: transparent; padding: 1.25rem .75rem;
  }
  .tab {
    flex: none; text-align: left; border-top: 0; border-left: 3px solid transparent; border-radius: 6px;
    padding: .7rem .9rem; font-size: .95rem; min-height: 0; display: flex; align-items: center; gap: .5rem;
  }
  .tab.on { border-left-color: var(--primary); background: var(--surface); }
  .badge { position: static; }
  #view { grid-area: main; padding: 1.75rem 2.5rem 3rem; }
  .learn, .pane:not(.me) { max-width: 820px; }
  .me-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 3rem; align-items: start; }
  .me-side > h3:first-child { margin-top: .2rem; }
  .done-grid { grid-template-columns: repeat(3, 1fr); }
  .page, .player, .sheet-body { max-width: 760px; }
  .player-body { padding-top: 1.5rem; }
  .ex-prompt { font-size: 1.25rem; }
  #sheet {
    left: auto; right: 2rem; bottom: 2rem; width: 440px; max-height: 70vh;
    border: 2px solid var(--ink); border-radius: 10px;
  }
  .sheet-body { padding: .8rem 1.1rem 1.1rem; }
  #toast { bottom: 2rem; }
}

/* Mouse and trackpad: hover feedback that touch screens skip. */
@media (hover: hover) and (pointer: fine) {
  .tab:hover:not(.on), .lesson:hover:not(:disabled), .unit-head:hover { background: color-mix(in srgb, var(--primary) 7%, transparent); }
  .choice:hover, .tile:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); }
  .btn:hover:not(:disabled) { filter: brightness(1.08); }
}

/* ------------------------------------------------------------ motion */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 70% { transform: scale(.98); } 100% { transform: scale(1); } }
@keyframes pop-in { 0% { opacity: 0; transform: scale(.6); } 65% { opacity: 1; transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes pair-out { 0% { opacity: 1; transform: scale(1); border-color: var(--good); background: var(--good-bg); } 45% { opacity: 1; transform: scale(1.07); border-color: var(--good); background: var(--good-bg); } 100% { opacity: 0; transform: scale(.85); } }
@keyframes beckon { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 45%, transparent); } 55% { box-shadow: 0 0 0 7px transparent; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 60%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
@keyframes shine { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.45); color: var(--accent); } 100% { transform: scale(1); } }

#overlay:not([hidden]) { animation: rise .26s ease-out; }
#sheet:not([hidden]) { animation: sheet-up .22s ease-out; }
#toast:not([hidden]) { animation: rise .2s ease-out; }
#view.switch > * { animation: rise .22s ease-out; }
.unit-body { animation: rise .24s ease-out; }
.unit-body .lesson { animation: rise .3s ease-out backwards; }
.unit-body .lesson:nth-child(2) { animation-delay: .03s; }
.unit-body .lesson:nth-child(3) { animation-delay: .06s; }
.unit-body .lesson:nth-child(4) { animation-delay: .09s; }
.unit-body .lesson:nth-child(5) { animation-delay: .12s; }
.unit-body .lesson:nth-child(n+6) { animation-delay: .15s; }
.lesson.next { animation: rise .3s ease-out backwards, beckon 2.2s ease-in-out .6s infinite; }
.stat-n.bump { display: inline-block; animation: bump .7s ease-out; }

.player-body > .ex { animation: slide-in .28s cubic-bezier(.2, .8, .3, 1); }
.intro .card { animation: pop-in .38s cubic-bezier(.2, .9, .3, 1.2) backwards; }
.intro .card.example { animation-delay: .12s; }
.choice, .tile { transition: transform .08s, border-color .12s, background-color .12s; }
.choice:active, .tile:active { transform: translateY(2px); }
.choice.sel { animation: pop .22s ease-out; }
.choice.right { animation: pop .4s ease-out; }
.choice.wrong { animation: shake .4s ease-out; }
.bank-pool .tile { animation: pop-in .3s ease-out backwards; }
.player-foot.ok, .player-foot.no { animation: sheet-up .24s cubic-bezier(.2, .9, .3, 1); }
.player-foot.no .fb-title { animation: shake .4s ease-out .15s; }
.player-foot.ok .fb-title { display: inline-block; animation: pop-in .4s ease-out .1s backwards; }
.player-top .bar-fill::after {
  content: ""; position: absolute; top: 2px; left: 0; width: 30%; height: 3px; border-radius: 2px;
  background: rgba(255, 255, 255, .45); transform: translateX(-120%);
}
.player-top .bar.gain .bar-fill::after { animation: shine .7s ease-out; }
.spk.playing { animation: ring 1s ease-out infinite; }
.spk:active { transform: scale(.92); }
.done h2 { animation: pop-in .5s cubic-bezier(.2, .9, .3, 1.3) backwards; }
.done .done-grid > div { animation: pop-in .45s cubic-bezier(.2, .9, .3, 1.2) backwards; }
.done .done-grid > div:nth-child(1) { animation-delay: .25s; }
.done .done-grid > div:nth-child(2) { animation-delay: .45s; }
.done .done-grid > div:nth-child(3) { animation-delay: .65s; }
.done > p { animation: rise .4s ease-out .9s backwards; }
.week-bar { transform-origin: bottom; animation: grow .5s cubic-bezier(.3, 1.3, .5, 1) backwards; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
