/* Ported from Word Atlas (word-atlas @9eff300, src/styles/app.css). MIT License. Copyright (c) 2026 Word Atlas contributors. */
/* Full MIT text: site/vendor/word-atlas/LICENSE. */
/* Sections copied verbatim: tokens, base, buttons, chips & segmented, layout, */
/* panels, illustration, entry, sheet, today, learn, view transitions, night sky, gold. */

/* Word Atlas — design system
   Paper, ink and four field-guide pigments, matched to the illustration palette. */

:root {
  /* Light: bright ivory paper lit from above; gold is the colour of "light". */
  --paper: #f6f1e7;
  --paper-2: #eee7d9;
  --paper-3: #e4dac8;
  --card: #fffdf8;
  --card-2: #faf5ec;
  --ink: #1a2035;
  --ink-2: #434b65;
  --ink-3: #7a7d8a;
  --ink-4: #aba79f;
  --line: rgba(26, 32, 53, 0.1);
  --line-strong: rgba(26, 32, 53, 0.15);
  --terra: #c4573a;
  --terra-ink: #a8432a;
  --terra-soft: #f5ddd1;
  --ochre: #cb922c;
  --ochre-soft: #f7e7c4;
  --sage: #6a8c63;
  --sage-ink: #4b6b45;
  --sage-soft: #dfe9d8;
  --sky: #5f88a8;
  --sky-soft: #dde8f0;
  --plum: #9a6283;
  --glow: rgba(255, 200, 110, 0.26);
  --mark: rgba(211, 154, 47, 0.32);
  --shadow-sm: 0 1px 2px rgba(30, 38, 64, 0.06), 0 2px 6px -2px rgba(30, 38, 64, 0.06);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 1px 2px rgba(30, 38, 64, 0.05), 0 18px 40px -24px rgba(30, 38, 64, 0.28);
  --shadow-lg: 0 30px 80px -30px rgba(20, 26, 46, 0.45), 0 8px 24px -12px rgba(20, 26, 46, 0.2);
  --serif: "Fraunces Variable", "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", "Microsoft YaHei", "Noto Sans SC", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --top: 68px;
  --tab: 0px;
  --gutter: 20px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1120;
    --paper-2: #151b2d;
    --paper-3: #1e263b;
    --card: #131a2b;
    --card-2: #19213a;
    --ink: #f2ebdd;
    --ink-2: #c8c1b3;
    --ink-3: #8d8c94;
    --ink-4: #5f6372;
    --line: rgba(242, 235, 221, 0.08);
    --line-strong: rgba(242, 235, 221, 0.14);
    --terra: #e57c5a;
    --terra-ink: #f29a7b;
    --terra-soft: rgba(229, 124, 90, 0.16);
    --ochre: #e8b65a;
    --ochre-soft: rgba(232, 182, 90, 0.15);
    --sage: #97b88e;
    --sage-ink: #b5d1ac;
    --sage-soft: rgba(151, 184, 142, 0.15);
    --sky: #8fb2cc;
    --sky-soft: rgba(143, 178, 204, 0.15);
    --glow: rgba(232, 182, 90, 0.14);
    --mark: rgba(232, 182, 90, 0.28);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.75);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1120;
  --paper-2: #151b2d;
  --paper-3: #1e263b;
  --card: #131a2b;
  --card-2: #19213a;
  --ink: #f2ebdd;
  --ink-2: #c8c1b3;
  --ink-3: #8d8c94;
  --ink-4: #5f6372;
  --line: rgba(242, 235, 221, 0.08);
  --line-strong: rgba(242, 235, 221, 0.14);
  --terra: #e57c5a;
  --terra-ink: #f29a7b;
  --terra-soft: rgba(229, 124, 90, 0.16);
  --ochre: #e8b65a;
  --ochre-soft: rgba(232, 182, 90, 0.15);
  --sage: #97b88e;
  --sage-ink: #b5d1ac;
  --sage-soft: rgba(151, 184, 142, 0.15);
  --sky: #8fb2cc;
  --sky-soft: rgba(143, 178, 204, 0.15);
  --glow: rgba(232, 182, 90, 0.14);
  --mark: rgba(232, 182, 90, 0.28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.75);
  color-scheme: dark;
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--top) + 12px);
}
html.is-locked {
  overflow: hidden;
}
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 560px at 50% -220px, var(--glow), transparent 72%) no-repeat,
    var(--paper);
  color: var(--ink);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "palt";
}
body::before {
  /* Risograph grain shared with the illustrations. */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.14 0 0 0 0 0.22 0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
:root[data-theme="dark"] body::before {
  mix-blend-mode: screen;
  opacity: 0.18;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body::before {
    mix-blend-mode: screen;
    opacity: 0.18;
  }
}
#root {
  position: relative;
  z-index: 1;
}
img {
  max-width: 100%;
  display: block;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 2px solid var(--terra);
  outline-offset: 3px;
  border-radius: 8px;
}
::selection {
  background: var(--mark);
}
h1,
h2,
h3,
p {
  margin: 0;
}
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  background: var(--card);
  color: var(--ink-3);
  font: 600 11px/1 var(--mono);
}
code {
  font: 500 0.9em var(--mono);
  background: var(--paper-2);
  padding: 2px 6px;
  border-radius: 6px;
}

.display {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 120;
  text-wrap: balance;
}
.display small {
  font-size: 0.45em;
  color: var(--ink-3);
  letter-spacing: 0;
}
.eyebrow {
  font: 600 11.5px/1.2 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.lede {
  color: var(--ink-2);
  font-size: 16px;
  margin-top: 12px;
  max-width: 56ch;
  text-wrap: pretty;
}
.muted {
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.65;
}
.warn-text {
  color: var(--terra-ink);
  font-size: 14px;
}
.ipa {
  font-family: "Charis SIL", "Doulos SIL", "Lucida Grande", "Segoe UI", "Noto Sans", var(--sans);
  letter-spacing: 0.01em;
}
.link {
  color: var(--terra-ink);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.link:hover {
  border-color: currentColor;
}
.br-sm {
  display: none;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: transform 0.25s var(--spring), background-color 0.2s, box-shadow 0.25s, color 0.2s, opacity 0.2s;
  user-select: none;
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.45;
}
.btn-xl {
  height: 56px;
  padding: 0 28px;
  font-size: 16.5px;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 10px 24px -12px rgba(30, 38, 64, 0.65), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px -14px rgba(30, 38, 64, 0.7), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}
.btn-primary svg {
  transition: transform 0.3s var(--spring);
}
.btn-primary:hover svg:last-child {
  transform: translateX(3px);
}
.btn-terra {
  background: var(--terra);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(196, 87, 58, 0.8);
}
.btn-sage {
  background: var(--sage-ink);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(79, 110, 73, 0.8);
}
:root[data-theme="dark"] .btn-sage {
  background: var(--sage);
  color: #10140f;
}
.btn-ghost {
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--card-2);
  border-color: var(--ink-4);
}
.btn-glass {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-glass:hover {
  background: rgba(255, 255, 255, 0.24);
}
.btn-danger {
  color: var(--terra-ink);
}
.btn kbd {
  background: transparent;
  border-color: currentColor;
  color: inherit;
  opacity: 0.55;
  height: 20px;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: var(--ink-2);
  transition: background-color 0.2s, color 0.2s, transform 0.25s var(--spring);
  flex: none;
}
.icon-btn:hover:not(:disabled) {
  background: var(--paper-2);
  color: var(--ink);
}
.icon-btn:active:not(:disabled) {
  transform: scale(0.92);
}
.icon-btn:disabled {
  opacity: 0.3;
}
.icon-btn.is-on {
  color: var(--terra);
}

/* ---------- chips & segmented ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--paper-2);
  white-space: nowrap;
}
.chip-level {
  font-family: var(--mono);
  letter-spacing: 0.02em;
}
.lv-A1,
.lv-A2 {
  --lv: var(--sage);
  --lv-soft: var(--sage-soft);
}
.lv-B1,
.lv-B2 {
  --lv: var(--sky);
  --lv-soft: var(--sky-soft);
}
.lv-C1,
.lv-C2 {
  --lv: var(--terra);
  --lv-soft: var(--terra-soft);
}
.chip-level[class*="lv-"] {
  background: var(--lv-soft);
  color: var(--lv);
}
.chip-status {
  background: var(--ochre-soft);
  color: var(--ochre);
}
.chip-status.is-done {
  background: var(--sage-soft);
  color: var(--sage-ink);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter));
  padding: 2px var(--gutter);
  mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
}
.chips-scroll::-webkit-scrollbar {
  display: none;
}
.chip-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.chip-btn:hover {
  border-color: var(--ink-4);
  color: var(--ink);
}
.chip-btn.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.chip-btn.lv {
  font-family: var(--mono);
  font-weight: 600;
}
.chip-btn.lv.is-on {
  background: var(--lv);
  border-color: var(--lv);
  color: #fff;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--paper-2);
  border-radius: 999px;
  border: 1px solid var(--line);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented button {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
  transition: all 0.22s var(--ease);
}
.segmented button:hover {
  color: var(--ink);
}
.segmented button.is-on {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.segmented-icons button {
  width: 36px;
  padding: 0;
  display: grid;
  place-items: center;
}
.segmented-wide {
  display: flex;
  width: 100%;
}
.segmented-wide button {
  flex: 1;
}

/* ---------- layout ---------- */

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.main {
  flex: 1;
  width: 100%;
}
.page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px var(--gutter) 64px;
  animation: page-in 0.5s var(--ease) both;
}
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.page-head {
  margin-bottom: 28px;
}
.page-head .eyebrow {
  margin-bottom: 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 max(var(--gutter), calc((100vw - 1200px) / 2 + var(--gutter)));
  background: color-mix(in oklab, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.topbar-logo {
  margin-right: 8px;
  border-radius: 10px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.mark {
  flex: none;
}
.logo-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.logo-text b {
  font: 700 21px/1 "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  letter-spacing: 0.06em;
}
.logo-text small {
  font: italic 500 14px/1 var(--serif);
  color: var(--ink-3);
  letter-spacing: 0.01em;
  font-variation-settings: "opsz" 24;
}
.topnav {
  display: none;
  gap: 4px;
  margin-left: 8px;
}
.topnav a {
  position: relative;
  height: 38px;
  padding: 0 14px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 500;
  color: var(--ink-3);
  transition: color 0.2s, background-color 0.2s;
}
.topnav a:hover {
  color: var(--ink);
}
.topnav a.is-on {
  color: var(--ink);
  font-weight: 600;
  background: var(--paper-2);
}
.topbar-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.search-pill {
  display: none;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 8px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-3);
  font-size: 14px;
  margin-right: 6px;
  min-width: 220px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-pill:hover {
  border-color: var(--ink-4);
  box-shadow: var(--shadow-sm);
}
.search-pill span {
  flex: 1;
  text-align: left;
}
.search-pill::before {
  content: none;
}
@media (max-width: 759px) {
  .search-pill {
    display: inline-flex;
    min-width: 0;
    width: 40px;
    padding: 0;
    justify-content: center;
    border: 0;
    background: none;
    margin: 0;
  }
  .search-pill span,
  .search-pill kbd {
    display: none;
  }
  .hide-sm {
    display: none;
  }
}

.tabbar {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in oklab, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 0 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  border-radius: 14px;
  transition: color 0.2s;
}
.tabbar a.is-on {
  color: var(--ink);
}
.tabbar a.is-on svg {
  color: var(--terra);
}
.app:not(.is-focus) {
  --tab: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: var(--tab);
}

.footer {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 28px var(--gutter) 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
}
.footer .mark {
  width: 22px;
  height: 22px;
}
.footer .logo-text b {
  font-size: 17px;
}
.footer a:hover {
  color: var(--ink);
}

@media (min-width: 760px) {
  :root {
    --gutter: 32px;
  }
  .topnav {
    display: flex;
  }
  .search-pill {
    display: inline-flex;
  }
  .tabbar {
    display: none;
  }
  .app:not(.is-focus) {
    --tab: 0px;
    padding-bottom: 0;
  }
  .page {
    padding-top: 40px;
  }
}

.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 24px;
  color: var(--ink-3);
  text-align: center;
  padding: 24px;
}
.spinner {
  display: block;
  width: 26px;
  height: 26px;
  margin: 40px auto;
  border-radius: 50%;
  border: 2.5px solid var(--line-strong);
  border-top-color: var(--terra);
  animation: spin 0.8s linear infinite;
}
.boot .spinner {
  margin: 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- panels ---------- */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  min-width: 0;
}
.panel > .eyebrow {
  margin-bottom: 16px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
  padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
}
.mini-stats > div {
  min-width: 0;
}
.mini-stats dt {
  font-size: 12px;
  color: var(--ink-3);
}
.mini-stats dd {
  margin: 2px 0 0;
  font: 600 24px/1.1 var(--serif);
  font-variation-settings: "opsz" 48;
  font-variant-numeric: tabular-nums;
}
.mini-stats dd small {
  font: 500 11px var(--sans);
  color: var(--ink-3);
  margin-left: 3px;
}

/* ---------- illustration ---------- */

.illo {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r);
  background: #ece3d2;
  isolation: isolate;
}
.illo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(30, 38, 64, 0.06);
  pointer-events: none;
}
.illo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.5s var(--ease), transform 0.8s var(--ease);
}
.illo.is-loaded img {
  opacity: 1;
  transform: none;
}
.illo {
  container-type: inline-size;
}
.plate {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12%;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in oklab, var(--hue) 14%, transparent), transparent 70%),
    #efe7d8;
  color: var(--hue);
}
.plate::before {
  /* inner printed frame */
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid color-mix(in oklab, var(--hue) 35%, transparent);
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px #efe7d8, inset 0 0 0 4px color-mix(in oklab, var(--hue) 18%, transparent);
}
.plate-word {
  position: relative;
  font: italic 500 1px/1.05 var(--serif);
  font-size: clamp(14px, calc(150cqw / var(--len)), 22cqw);
  font-variation-settings: "opsz" 72;
  text-align: center;
  overflow-wrap: anywhere;
  letter-spacing: -0.01em;
}
.plate-rule {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 18%;
  height: 1px;
  margin-left: -9%;
  background: currentColor;
  opacity: 0.45;
}
.plate-rule::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  background: #efe7d8;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}
.plate-initial {
  display: none;
  font: italic 500 52cqw/1 var(--serif);
}
@container (max-width: 90px) {
  .plate::before,
  .plate-word,
  .plate-rule {
    display: none;
  }
  .plate-initial {
    display: block;
  }
}

/* ---------- entry (word card) ---------- */

.entry {
  display: grid;
  gap: 22px;
}
.entry-art .illo {
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}
.entry-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.entry-actions {
  display: flex;
  gap: 2px;
  margin-right: 40px;
}
.headword {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(40px, 7vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 144;
  margin: 8px 0 12px;
  overflow-wrap: anywhere;
}
.pron {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.speak {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  border-radius: 999px;
  transition: background-color 0.2s, color 0.2s, transform 0.25s var(--spring);
}
.speak:active {
  transform: scale(0.95);
}
.speak-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink);
  transition: background-color 0.2s, color 0.2s;
}
.speak-sm .speak-icon {
  width: 30px;
  height: 30px;
}
.speak-lg .speak-icon {
  width: 52px;
  height: 52px;
}
.speak:hover .speak-icon {
  background: var(--ink);
  color: var(--paper);
}
.speak.is-on .speak-icon {
  background: var(--terra);
  color: #fff;
}
.speak-waves {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}
.speak.is-on .speak-waves {
  animation: ripple 1.2s var(--ease) infinite;
}
@keyframes ripple {
  from {
    box-shadow: 0 0 0 0 color-mix(in oklab, var(--terra) 45%, transparent);
  }
  to {
    box-shadow: 0 0 0 12px transparent;
  }
}
.speak.has-label {
  padding: 3px 14px 3px 3px;
  background: var(--card);
  border: 1px solid var(--line-strong);
}
.speak.has-label:hover {
  border-color: var(--ink-4);
}
.speak-label {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 15px;
}
.speak-label em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
}
.senses {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.senses li {
  display: grid;
  grid-template-columns: 48px 1fr;
  column-gap: 6px;
  align-items: baseline;
}
.pos {
  font: italic 500 15px var(--serif);
  color: var(--terra);
}
.senses .zh {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
}
.senses .en {
  grid-column: 2;
  font: italic 400 15px/1.45 var(--serif);
  color: var(--ink-3);
  font-variation-settings: "opsz" 14;
}
.block {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.block .eyebrow {
  margin-bottom: 14px;
}
.examples {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}
.ex-en {
  font: 400 19px/1.5 var(--serif);
  font-variation-settings: "opsz" 24;
  color: var(--ink);
  text-wrap: pretty;
}
.ex-en mark,
.feedback-ex mark,
.wotd-ex mark {
  background: linear-gradient(transparent 58%, var(--mark) 58%);
  color: inherit;
  font-weight: 600;
  padding: 0 1px;
}
.ex-speak {
  vertical-align: -6px;
  margin-left: 8px;
}
.ex-zh {
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 14.5px;
}
.collocations {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.collocations li {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
  display: grid;
}
.collocations span {
  font: 500 16px/1.35 var(--serif);
  font-variation-settings: "opsz" 18;
}
.collocations small {
  color: var(--ink-3);
  font-size: 12.5px;
}
.relations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px;
}
.relations p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font: 400 16px/1.45 var(--serif);
}
.relations .link {
  font: inherit;
  color: var(--ink);
  border-bottom: 1px dashed var(--ink-4);
}
.relations .link:hover {
  color: var(--terra-ink);
  border-color: currentColor;
}
.tip {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--ochre-soft);
  color: var(--ink);
}
.tip svg {
  color: var(--ochre);
  flex: none;
  margin-top: 3px;
}
.tip p {
  font-size: 14.5px;
  line-height: 1.6;
}
.memory-note {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--ink-3);
}

@media (min-width: 860px) {
  .entry-detail,
  .entry-intro {
    grid-template-columns: minmax(280px, 0.86fr) 1.14fr;
    gap: 40px;
    align-items: start;
  }
  .entry-detail .entry-art,
  .entry-intro .entry-art {
    position: sticky;
    top: 0;
  }
}

/* ---------- sheet ---------- */

.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(14, 18, 30, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.25s var(--ease);
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.sheet {
  position: relative;
  width: 100%;
  max-height: 94dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  border-radius: 28px 28px 0 0;
  padding: 26px var(--gutter) calc(28px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  animation: sheet-up 0.42s var(--ease);
  outline: none;
}
@keyframes sheet-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}
.sheet-grip {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 40px;
  height: 4px;
  margin-left: -20px;
  border-radius: 4px;
  background: var(--line-strong);
}
.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.sheet .entry-art .illo {
  max-width: 420px;
  margin: 0 auto;
}
.sheet-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.sheet-error {
  padding: 40px 0;
  text-align: center;
  color: var(--ink-3);
}
@media (min-width: 760px) {
  .sheet-root {
    align-items: center;
    padding: 32px;
  }
  .sheet {
    border-radius: var(--r-xl);
    max-width: 640px;
    max-height: calc(100dvh - 64px);
    padding: 36px;
    animation: sheet-pop 0.38s var(--ease);
  }
  .sheet-wide {
    max-width: 1040px;
  }
  .sheet-grip {
    display: none;
  }
  .sheet .entry-art .illo {
    max-width: none;
  }
}
@keyframes sheet-pop {
  from {
    transform: translateY(16px) scale(0.98);
    opacity: 0;
  }
}

/* ---------- today ---------- */

.greet {
  margin-bottom: 22px;
}
.greet .eyebrow {
  margin-bottom: 10px;
}
/* The book line starts with "A2", which must not be shouted as "A2 KEY". */
.greet .eyebrow.is-book {
  text-transform: none;
  letter-spacing: 0.06em;
}
.journey {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  min-height: 460px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: #2a3550;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}
.journey-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 40%;
  z-index: -2;
  animation: drift 40s ease-in-out infinite alternate;
}
@keyframes drift {
  to {
    transform: scale(1.06) translate(-1%, -1%);
  }
}
.journey::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(18, 24, 42, 0) 20%, rgba(18, 24, 42, 0.55) 55%, rgba(18, 24, 42, 0.86) 100%);
}
.journey-body {
  width: 100%;
  padding: 28px 22px 24px;
}
@media (max-width: 759px) {
  .journey {
    display: block;
    min-height: 0;
    background: #1c2440;
  }
  .journey-art {
    position: relative;
    height: auto;
    aspect-ratio: 16 / 10;
    object-position: 70% 30%;
    animation: none;
  }
  .journey::before {
    inset: auto 0 0;
    top: 0;
    background: linear-gradient(180deg, transparent 0, transparent calc(62.5vw - 140px), #1c2440 calc(62.5vw - 30px));
  }
  .journey-body {
    margin-top: -64px;
    position: relative;
    padding: 0 20px 22px;
  }
  .journey h2 {
    font-size: 32px;
  }
}
.journey .eyebrow-light {
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 10px;
}
.journey h2 {
  font: 600 clamp(34px, 6vw, 56px) / 1.05 var(--serif);
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 120;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.25);
  text-wrap: balance;
}
.journey h2 b {
  font-weight: 700;
  color: #ffd79a;
}
.journey h2 i {
  font-style: normal;
  opacity: 0.4;
}
.journey-lede {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15.5px;
}
.teaser {
  display: flex;
  align-items: center;
  margin: 22px 0 4px;
}
.teaser .illo {
  width: 48px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.5);
  margin-right: -10px;
  transition: transform 0.35s var(--spring);
}
.teaser .illo:nth-child(odd) {
  transform: rotate(-4deg);
}
.teaser .illo:nth-child(even) {
  transform: rotate(3deg) translateY(-3px);
}
.teaser:hover .illo {
  transform: none;
  margin-right: 4px;
}
.teaser .illo::after {
  display: none;
}
.teaser > span {
  margin-left: 22px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}
.journey-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.journey .btn-primary {
  background: #fbf8f2;
  color: #1e2640;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.6);
}
.journey .btn-xl {
  flex: 1 1 auto;
}
@media (min-width: 760px) {
  .journey {
    min-height: 520px;
    align-items: center;
  }
  .journey::before {
    background: linear-gradient(90deg, rgba(18, 24, 42, 0.86) 0%, rgba(18, 24, 42, 0.55) 38%, rgba(18, 24, 42, 0) 68%);
  }
  .journey-body {
    max-width: 560px;
    padding: 48px 52px;
  }
  .journey .btn-xl {
    flex: 0 0 auto;
  }
}

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.today-grid > * {
  min-width: 0;
}
@media (min-width: 900px) {
  .today-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 20px;
    margin-top: 20px;
  }
  .path-panel,
  .topics-panel {
    grid-column: 1 / -1;
  }
}

.wotd {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 20px;
  align-items: start;
  cursor: pointer;
  transition: transform 0.35s var(--spring), box-shadow 0.3s;
}
.wotd:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.wotd-art {
  border-radius: 18px;
}
.wotd-body {
  min-width: 0;
}
.wotd-word {
  font: 600 38px/1.05 var(--serif);
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.02em;
  margin: 8px 0 10px;
  overflow-wrap: anywhere;
}
.wotd-zh {
  margin-top: 10px;
  font-weight: 600;
}
.wotd-ex {
  margin-top: 8px;
  font: italic 400 16px/1.5 var(--serif);
  color: var(--ink-2);
}
@media (min-width: 560px) {
  .wotd {
    grid-template-columns: 200px 1fr;
    gap: 26px;
  }
}

.streak {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}
.streak.is-on {
  color: var(--terra);
}
.streak-body {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}
.ring {
  position: relative;
  flex: none;
}
.ring svg {
  display: block;
}
.ring-arc {
  transition: stroke-dashoffset 1s var(--ease);
}
.ring-body {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.ring-body b {
  font: 600 30px/1 var(--serif);
  font-variation-settings: "opsz" 72;
  font-variant-numeric: tabular-nums;
}
.ring-body small {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 4px;
}
.week {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  flex: 1;
  height: 112px;
}
.week li {
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  gap: 6px;
}
.week li span {
  align-self: end;
  width: 100%;
  max-width: 22px;
  height: calc(10% + var(--h) * 90%);
  border-radius: 6px;
  background: var(--paper-3);
  transition: height 0.6s var(--ease);
}
.week li.is-on span {
  background: linear-gradient(180deg, var(--terra), color-mix(in oklab, var(--terra) 70%, var(--ochre)));
}
.week li small {
  font-size: 11px;
  color: var(--ink-3);
}
.week li.is-today small {
  color: var(--ink);
  font-weight: 700;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
}
.legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-left: 8px;
}
.lg-seen {
  background: var(--ochre);
}
.lg-done {
  background: var(--sage);
}
.route {
  --gap: 0px;
  position: relative;
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}
.route::before {
  /* the dotted road between stations */
  content: "";
  position: absolute;
  top: 38px;
  left: calc(100% / 12);
  right: calc(100% / 12);
  border-top: 2px dashed var(--line-strong);
}
.route li {
  position: relative;
  min-width: 0;
}
.route button {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 0 4px 6px;
  border-radius: 16px;
  text-align: center;
}
.station {
  --size: 76px;
  position: relative;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, var(--card) 0 58%, transparent 59%),
    conic-gradient(var(--sage) calc(var(--done) * 360deg), var(--ochre) 0 calc(var(--seen) * 360deg), var(--paper-3) 0);
  box-shadow: 0 0 0 6px var(--card);
  transition: transform 0.35s var(--spring);
}
.route button:hover .station {
  transform: translateY(-3px) scale(1.04);
}
.station b {
  font: 700 17px/1 var(--mono);
  color: var(--ink-2);
}
.route li.is-start .station {
  background:
    radial-gradient(circle, var(--ink) 0 58%, transparent 59%),
    conic-gradient(var(--sage) calc(var(--done) * 360deg), var(--ochre) 0 calc(var(--seen) * 360deg), var(--paper-3) 0);
}
.route li.is-start .station b {
  color: var(--paper);
}
.station-name {
  font-weight: 600;
  font-size: 14px;
  margin-top: 6px;
}
.station-count {
  font: 600 13px var(--serif);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.station-count small {
  color: var(--ink-4);
  font-weight: 400;
}
.station-flag {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(10px);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--terra);
  box-shadow: 0 6px 14px -6px var(--terra);
}
@media (max-width: 640px) {
  .route {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 18px;
  }
  .route::before {
    display: none;
  }
  .station {
    --size: 64px;
  }
}

.topics-panel .panel-head {
  margin-bottom: 14px;
  padding: 0 2px;
}
.topic-tiles {
  list-style: none;
  margin: 0 calc(-1 * var(--gutter));
  padding: 4px var(--gutter) 16px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 168px;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.topic-tiles::-webkit-scrollbar {
  display: none;
}
.topic-tiles li {
  scroll-snap-align: start;
}
.topic-tiles button {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 22px;
  overflow: hidden;
  background: #ece3d2;
  display: block;
  text-align: left;
  isolation: isolate;
  box-shadow: var(--shadow);
  transition: transform 0.4s var(--spring), box-shadow 0.3s;
}
.topic-tiles button:hover {
  transform: translateY(-4px) rotate(-0.6deg);
  box-shadow: var(--shadow-lg);
}
.topic-tiles img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  transition: transform 0.7s var(--ease);
}
.topic-tiles button:hover img {
  transform: scale(1.06);
}
.topic-tiles button::after {
  content: "";
  position: absolute;
  inset: 50% 0 0;
  z-index: -1;
  background: linear-gradient(transparent, rgba(18, 24, 42, 0.78));
}
.topic-tiles span {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: grid;
  color: #fff;
}
.topic-tiles b {
  font: 600 22px/1.1 var(--serif);
}
.topic-tiles small {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 1200px) {
  .topic-tiles {
    margin: 0;
    padding: 4px 2px 16px;
    scroll-padding: 0;
  }
}

/* ---------- learn ---------- */

.learn {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.learn-loading {
  display: grid;
  place-items: center;
}
.learn-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px max(var(--gutter), calc((100vw - 980px) / 2));
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.learn-progress {
  flex: 1;
  height: 10px;
  border-radius: 10px;
  background: var(--paper-3);
  overflow: hidden;
}
.learn-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), color-mix(in oklab, var(--sage) 60%, var(--ochre)));
  transition: width 0.6s var(--ease);
  min-width: 10px;
}
.learn-count {
  font: 600 16px var(--serif);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: right;
}
.learn-count small {
  color: var(--ink-3);
  font-weight: 400;
}
.learn-stage {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 12px var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  animation: stage-in 0.45s var(--ease) both;
}
@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
}
.stage-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  margin: 6px 0 18px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-new {
  background: var(--ochre);
}
.dot-review {
  background: var(--sky);
}
.dot-retry {
  background: var(--terra);
}
.intro {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.intro .entry-art .illo {
  max-width: 440px;
  margin: 0 auto;
}
.learn-actions {
  position: sticky;
  bottom: 0;
  margin: 28px calc(-1 * var(--gutter)) -40px;
  padding: 16px var(--gutter) calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--paper) 32%);
  display: flex;
  align-items: center;
  gap: 16px;
}
.learn-actions .btn {
  flex: 1;
}
.hint-keys {
  display: none;
  color: var(--ink-3);
  font-size: 13px;
  gap: 6px;
  align-items: center;
}
@media (min-width: 760px) {
  .learn-actions {
    justify-content: flex-end;
  }
  .learn-actions .btn {
    flex: 0 0 auto;
    min-width: 260px;
  }
  .hint-keys {
    display: inline-flex;
    order: -1;
  }
}

.quiz {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.prompt {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 12px 0 28px;
  min-height: 200px;
}
.prompt-word {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 10px;
}
.prompt-word .headword {
  font-size: clamp(48px, 11vw, 96px);
  margin: 0;
}
.prompt-picture {
  width: 100%;
  max-width: 560px;
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}
.prompt-picture .illo {
  width: min(100%, 300px);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.cloze {
  font: 400 clamp(20px, 3.2vw, 26px) / 1.45 var(--serif);
  font-variation-settings: "opsz" 30;
  text-wrap: balance;
}
.cloze-sm {
  font-size: 18px;
  text-align: left;
  margin-top: 8px;
}
.blank {
  display: inline-block;
  min-width: 3.2em;
  padding: 0 6px;
  border-bottom: 2.5px solid var(--terra);
  color: var(--terra-ink);
  font-weight: 600;
  line-height: 1.2;
}
.cloze-zh {
  color: var(--ink-3);
  font-size: 14.5px;
}
.prompt-listen {
  display: grid;
  justify-items: center;
  gap: 18px;
}
.listen-orb {
  position: relative;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 24px 50px -20px rgba(30, 38, 64, 0.7);
  transition: transform 0.3s var(--spring);
}
.listen-orb:hover {
  transform: scale(1.04);
}
.listen-orb:active {
  transform: scale(0.96);
}
.listen-orb span {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  animation: orbit 2.4s var(--ease) infinite;
}
@keyframes orbit {
  0% {
    transform: scale(0.92);
    opacity: 1;
  }
  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}
.prompt-spell {
  width: 100%;
  max-width: 640px;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 22px;
  align-items: center;
}
.spell-art {
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.spell-zh {
  font-size: 20px;
  font-weight: 600;
}
.prompt-spell .speak {
  margin-top: 12px;
}
@media (min-width: 640px) {
  .prompt-spell {
    grid-template-columns: 200px 1fr;
    gap: 32px;
  }
}

.options {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 10px;
}
@media (min-width: 640px) {
  .options {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}
.option {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-bottom-width: 3px;
  text-align: left;
  font-size: 17px;
  font-weight: 500;
  transition: transform 0.25s var(--spring), border-color 0.2s, background-color 0.2s, opacity 0.3s;
}
.options-en .option span {
  font: 500 21px var(--serif);
  font-variation-settings: "opsz" 30;
}
.option kbd {
  flex: none;
}
.option span {
  flex: 1;
  min-width: 0;
}
.option:hover:not(:disabled) {
  border-color: var(--ink-3);
  transform: translateY(-1px);
}
.option:active:not(:disabled) {
  transform: translateY(1px);
  border-bottom-width: 1.5px;
}
.option.is-answer {
  background: var(--sage-soft);
  border-color: var(--sage);
  color: var(--ink);
  animation: pop 0.45s var(--spring);
}
.option.is-answer kbd {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}
.option.is-chosen {
  background: var(--terra-soft);
  border-color: var(--terra);
  animation: shake 0.4s var(--ease);
}
.option.is-dim {
  opacity: 0.45;
}
.option-mark {
  flex: none;
}
.is-answer .option-mark {
  color: var(--sage-ink);
}
.is-chosen .option-mark {
  color: var(--terra);
}
@keyframes pop {
  40% {
    transform: scale(1.025);
  }
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

.spell {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
  position: relative;
}
.slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  cursor: text;
}
.slot {
  width: clamp(28px, 7vw, 42px);
  height: clamp(42px, 10vw, 56px);
  border-radius: 10px;
  border: 1.5px solid var(--line-strong);
  border-bottom-width: 3px;
  background: var(--card);
  display: grid;
  place-items: center;
  font: 600 clamp(20px, 4.6vw, 28px) var(--serif);
  text-transform: lowercase;
  transition: border-color 0.15s, transform 0.25s var(--spring), background-color 0.2s;
}
.slot-space {
  width: 14px;
  border-color: transparent;
  background: none;
}
.slot.is-filled {
  border-color: var(--ink-3);
  transform: translateY(-2px);
}
.slot.is-caret {
  border-color: var(--terra);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--terra) 16%, transparent);
}
.slot.is-ok {
  border-color: var(--sage);
  background: var(--sage-soft);
}
.slot.is-bad {
  border-color: var(--terra);
  background: var(--terra-soft);
  color: var(--terra-ink);
}
.spell-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  opacity: 0;
  font-size: 16px;
}
.spell-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.feedback {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin: 0 calc(-1 * var(--gutter)) -40px;
  padding: 0 var(--gutter) env(safe-area-inset-bottom);
  animation: rise 0.42s var(--ease);
}
@keyframes rise {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
}
.feedback-inner {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px 16px;
  align-items: center;
  padding: 18px;
  border-radius: 24px 24px 0 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom: 0;
  box-shadow: 0 -20px 50px -30px rgba(30, 38, 64, 0.4);
}
.feedback.is-right .feedback-inner {
  background: color-mix(in oklab, var(--sage-soft) 70%, var(--card));
}
.feedback.is-wrong .feedback-inner {
  background: color-mix(in oklab, var(--terra-soft) 70%, var(--card));
}
.feedback-art {
  width: 64px;
  border-radius: 14px;
}
.feedback-text {
  min-width: 0;
}
.feedback-verdict {
  font-size: 13px;
  font-weight: 700;
}
.is-right .feedback-verdict {
  color: var(--sage-ink);
}
.is-wrong .feedback-verdict {
  color: var(--terra-ink);
}
.feedback-word {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.feedback-word b {
  font: 600 24px var(--serif);
}
.feedback-word .ipa {
  color: var(--ink-3);
  font-size: 14px;
}
.feedback-zh {
  font-size: 14px;
  color: var(--ink-2);
}
.feedback-ex {
  display: none;
  margin-top: 4px;
  font: italic 400 15px/1.45 var(--serif);
  color: var(--ink-2);
}
.feedback .btn {
  grid-column: 1 / -1;
  width: 100%;
}
@media (min-width: 760px) {
  .feedback {
    margin-bottom: -40px;
  }
  .feedback-inner {
    grid-template-columns: 84px 1fr auto;
    border-radius: 26px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--line);
    padding: 18px 18px 18px 18px;
  }
  .feedback-art {
    width: 84px;
  }
  .feedback-ex {
    display: block;
  }
  .feedback .btn {
    grid-column: auto;
    width: auto;
    min-width: 180px;
  }
}

.summary {
  padding: 24px var(--gutter) 48px;
  display: block;
}
.summary-card {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  animation: page-in 0.6s var(--ease) both;
}
.summary-art {
  width: 180px;
  margin: 0 auto 18px;
  border-radius: 36px;
  box-shadow: var(--shadow-lg);
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  50% {
    transform: translateY(-8px) rotate(-1.5deg);
  }
}
.summary-card .eyebrow {
  margin-bottom: 10px;
}
.summary-stats {
  margin: 28px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}
.summary-stats dl {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 28px;
  margin: 0;
  text-align: left;
}
.summary-stats dt {
  font-size: 12px;
  color: var(--ink-3);
}
.summary-stats dd {
  margin: 0;
  font: 600 34px/1.1 var(--serif);
  font-variant-numeric: tabular-nums;
}
.summary-stats dd small {
  font: 500 12px var(--sans);
  color: var(--ink-3);
  margin-left: 3px;
}
.summary-words {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px;
  text-align: left;
}
.summary-words li {
  display: grid;
  gap: 2px;
  min-width: 0;
  animation: page-in 0.5s var(--ease) both;
}
.summary-words li:nth-child(n) {
  animation-delay: calc(var(--i, 0) * 30ms);
}
.summary-words .illo {
  border-radius: 14px;
  margin-bottom: 6px;
}
.summary-words span {
  font: 600 15px var(--serif);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.summary-words small {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.summary-words li.is-wrong .illo {
  box-shadow: 0 0 0 2.5px var(--terra);
}
.summary-note {
  margin: 24px auto 0;
  color: var(--ink-3);
  font-size: 13px;
  max-width: 48ch;
}
.summary-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 26px;
}

/* ---------- view transitions ---------- */

.sheet .entry-detail .entry-art .illo {
  view-transition-name: word-art;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.32s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}
::view-transition-group(word-art) {
  animation-duration: 0.55s;
  animation-timing-function: cubic-bezier(0.2, 0.9, 0.1, 1);
}
::view-transition-image-pair(word-art) {
  isolation: auto;
}
::view-transition-old(word-art),
::view-transition-new(word-art) {
  animation: none;
  mix-blend-mode: normal;
  height: 100%;
  object-fit: cover;
  overflow: clip;
  border-radius: 20px;
}

/* Night sky for the dark theme: two layers of faint stars, matching the galaxy. */
:root[data-theme="dark"] body {
  background:
    radial-gradient(1200px 560px at 50% -220px, var(--glow), transparent 72%) no-repeat,
    radial-gradient(1px 1px at 12% 18%, rgba(255, 245, 225, 0.5), transparent 60%),
    radial-gradient(1px 1px at 68% 42%, rgba(255, 245, 225, 0.35), transparent 60%),
    radial-gradient(1.5px 1.5px at 38% 76%, rgba(255, 235, 200, 0.4), transparent 60%),
    radial-gradient(1px 1px at 86% 88%, rgba(255, 245, 225, 0.3), transparent 60%),
    var(--paper);
  background-size: auto, 260px 260px, 340px 340px, 420px 420px, 300px 300px, auto;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body {
    background:
      radial-gradient(1200px 560px at 50% -220px, var(--glow), transparent 72%) no-repeat,
      radial-gradient(1px 1px at 12% 18%, rgba(255, 245, 225, 0.5), transparent 60%),
      radial-gradient(1px 1px at 68% 42%, rgba(255, 245, 225, 0.35), transparent 60%),
      radial-gradient(1.5px 1.5px at 38% 76%, rgba(255, 235, 200, 0.4), transparent 60%),
      radial-gradient(1px 1px at 86% 88%, rgba(255, 245, 225, 0.3), transparent 60%),
      var(--paper);
    background-size: auto, 260px 260px, 340px 340px, 420px 420px, 300px 300px, auto;
  }
}
@media (min-width: 900px) {
  .galaxy-panel {
    grid-column: 1 / -1;
  }
}
/* Gold marks the things that are "lit". */
.streak.is-on {
  color: var(--ochre);
}
.streak-panel .ring-arc {
  stroke: var(--ochre);
}
.streak-panel .mini-stats div:first-child dd {
  color: var(--ochre);
}
