:root {
  --bg: #f5f4f0;
  --ink: #0d0d0d;
  --muted: #77756f;
  --line: rgba(13, 13, 13, 0.18);
  --soft-line: rgba(13, 13, 13, 0.09);
  --card-bg: #f7f3e9;
  --card-edge: rgba(255, 255, 255, 0.82);
  --lanyard: #312b49;
  --lanyard-dark: #211d32;
  --shadow: rgba(48, 38, 24, 0.17);
  --ring-card-stand-rotation: 86deg;
  font-family: "Helvetica Neue", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}

body {
  min-height: 100svh;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background:
    radial-gradient(circle at 45% 42%, rgba(255, 255, 255, 0.52), transparent 34%),
    linear-gradient(135deg, rgba(13, 13, 13, 0.025), transparent 28%, rgba(255, 255, 255, 0.28) 62%, transparent);
  z-index: 0;
}

button {
  font: inherit;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-header {
  position: fixed;
  z-index: 80;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  pointer-events: none;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 46px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-grid;
  gap: 2px;
  line-height: 0.92;
  font-weight: 650;
}

.brand__main {
  font-size: 18px;
}

.brand__sub {
  font-size: 11px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 34px;
  font-size: 13px;
  font-weight: 560;
}

.nav-current {
  position: relative;
  padding-bottom: 5px;
}

.nav-current::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-bottom: 1px solid currentColor;
}

.nav-button,
.menu-button {
  border: 0;
  background: transparent;
  padding: 5px 0;
  cursor: pointer;
}

.nav-link {
  color: inherit;
  display: inline-block;
  text-decoration: none;
}

.github-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(13, 13, 13, 0.16);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(248, 247, 243, 0.72);
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.github-button:hover {
  border-color: rgba(13, 13, 13, 0.42);
  background: rgba(248, 247, 243, 0.95);
  transform: translateY(-1px);
}

.github-button svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.app-header .brand,
.app-header nav,
.app-header button,
.app-header .github-button {
  pointer-events: auto;
}

.menu-button {
  display: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-button span {
  display: block;
  width: 17px;
  border-top: 1px solid var(--ink);
}

.app-shell {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 360ms ease;
}

body.is-ready .app-shell {
  opacity: 1;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  background: var(--bg);
  transition: opacity 420ms ease, visibility 420ms ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader__mascot {
  width: min(520px, calc(100vw - 56px));
  aspect-ratio: 16 / 9;
  height: auto;
  margin-bottom: 2px;
  object-fit: cover;
  object-position: 58% 45%;
  border: 1px solid rgba(13, 13, 13, 0.1);
  border-radius: 8px;
  background: #eee5d6;
  box-shadow: 0 20px 50px rgba(48, 38, 24, 0.16);
}

.loader__brand {
  font-size: 18px;
  font-weight: 650;
}

.loader__text {
  font-size: 11px;
  color: var(--muted);
  font-weight: 650;
}

.loader__line {
  width: 170px;
  height: 1px;
  background: var(--soft-line);
  overflow: hidden;
}

.loader__line span {
  display: block;
  width: 68%;
  height: 100%;
  background: var(--ink);
  animation: loadLine 900ms ease-in-out infinite alternate;
}

@keyframes loadLine {
  from { transform: translateX(-100%); }
  to { transform: translateX(148%); }
}

.ring-scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  perspective: 1600px;
  z-index: 5;
  touch-action: none;
  transform-style: preserve-3d;
}

.ring-gallery {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.orbit-item {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: opacity 240ms ease, transform 300ms cubic-bezier(0.22, 0.61, 0.21, 1);
  contain: layout style;
}

/* While the ring is spinning, JS drives the transform every frame, so the
   per-frame CSS transition must be off (otherwise the ring rubber-bands). */
.ring-gallery.is-rotating .orbit-item {
  transition: opacity 240ms ease;
}

.orbit-item:focus-visible {
  outline: 1px solid rgba(13, 13, 13, 0.62);
  outline-offset: 8px;
}

/* Snappy hover feedback: a quick nudge/shake that settles, applied on the
   stand so it composes with the item's 3D placement and the visual's scale. */
@keyframes cardNudge {
  0% { transform: rotateZ(0deg); }
  26% { transform: rotateZ(-3.4deg); }
  56% { transform: rotateZ(2deg); }
  80% { transform: rotateZ(-0.8deg); }
  100% { transform: rotateZ(0deg); }
}

.orbit-item.is-hovered .orbit-card-stand {
  animation: cardNudge 460ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.orbit-card-stand,
.orbit-card-visual {
  pointer-events: none;
  transform-style: preserve-3d;
}

.orbit-card-stand {
  display: grid;
  place-items: center;
  transform-origin: center center;
  will-change: transform;
}

.orbit-card-visual {
  --ring-card-thickness: 9px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: visible;
  transition: transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 280ms ease;
  will-change: transform;
  filter:
    drop-shadow(0 4px 6px rgba(50, 39, 25, 0.062))
    drop-shadow(0 12px 16px rgba(50, 39, 25, 0.036));
}

.orbit-card-visual::before,
.orbit-card-visual::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 8px;
  transform-style: preserve-3d;
}

.orbit-card-visual::before {
  top: 4.5%;
  right: calc(var(--ring-card-thickness) * -0.48);
  width: var(--ring-card-thickness);
  height: 91%;
  background:
    linear-gradient(90deg, rgba(94, 71, 43, 0.2), rgba(255, 255, 255, 0.82) 34%, rgba(134, 102, 61, 0.18));
  box-shadow: 1px 0 4px rgba(58, 43, 27, 0.1);
  opacity: var(--ring-edge-opacity, 0.36);
  transform-origin: left center;
  transform: rotateY(90deg);
}

.orbit-card-visual::after {
  top: 4.5%;
  left: calc(var(--ring-card-thickness) * -0.48);
  width: var(--ring-card-thickness);
  height: 91%;
  background:
    linear-gradient(90deg, rgba(134, 102, 61, 0.16), rgba(255, 255, 255, 0.8) 64%, rgba(94, 71, 43, 0.2));
  box-shadow: -1px 0 4px rgba(58, 43, 27, 0.08);
  opacity: var(--ring-edge-opacity, 0.36);
  transform-origin: right center;
  transform: rotateY(-90deg);
}

.orbit-item.is-selected .orbit-card-visual,
.orbit-item.is-hovered .orbit-card-visual {
  filter:
    drop-shadow(0 6px 9px rgba(48, 38, 24, 0.11))
    drop-shadow(0 16px 20px rgba(48, 38, 24, 0.055));
}

.vocab-card {
  position: relative;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: clamp(14px, 5.2%, 22px);
  background: var(--card-bg);
  border: 1px solid var(--card-edge);
  box-shadow:
    var(--shadow-x, 0px) var(--shadow-y, 10px) calc(34px + var(--swing-speed, 0) * 28px) rgba(48, 38, 24, calc(0.16 + var(--swing-speed, 0) * 0.08)),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(130, 105, 70, 0.08);
  color: var(--ink);
  user-select: none;
  transform-style: preserve-3d;
}

.vocab-card--ring {
  border-radius: 7px;
  background: #fbf7ee;
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 4px 7px rgba(48, 38, 24, 0.086),
    0 11px 15px rgba(48, 38, 24, 0.045),
    1px 0 0 rgba(118, 95, 63, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backface-visibility: visible;
  opacity: var(--ring-front-opacity, 1);
}

.vocab-card--ring::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(105deg, transparent 0 34%, rgba(255, 255, 255, 0.74) 43%, rgba(255, 246, 214, 0.52) 50%, transparent 62%),
    radial-gradient(circle at 58% 18%, rgba(255, 230, 170, 0.34), transparent 34%);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translateX(-130%);
}

.orbit-item.is-selected .vocab-card--ring::before {
  animation: selected-card-glint 2.8s cubic-bezier(0.2, 0.7, 0.2, 1) infinite;
}

.vocab-card--ring::after {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent 24%, rgba(67, 48, 27, 0.11) 100%);
  mix-blend-mode: multiply;
  opacity: 0.18;
}

@keyframes selected-card-glint {
  0% {
    opacity: 0;
    transform: translateX(-130%);
  }
  46% {
    opacity: 0;
    transform: translateX(-130%);
  }
  58% {
    opacity: 0.58;
  }
  76% {
    opacity: 0;
    transform: translateX(130%);
  }
  100% {
    opacity: 0;
    transform: translateX(130%);
  }
}

.vocab-card--image-card {
  background: #fbfaf6;
}

.vocab-card--ring.vocab-card--image-card {
  border-color: rgba(255, 255, 255, 0.7);
}

.complete-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  pointer-events: none;
}

.card-art {
  position: relative;
  flex: 0 0 58%;
  margin: 5%;
  margin-bottom: 0;
  border-radius: 13px;
  overflow: hidden;
  background: linear-gradient(145deg, #eee4cf, #fbf7ec);
  border: 1px solid rgba(138, 112, 72, 0.12);
}

.abstract-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  --art-a: #d9b368;
  --art-b: #7f9a8c;
  --art-c: #8f6a42;
  background:
    radial-gradient(circle at 52% 47%, color-mix(in srgb, var(--art-a) 70%, white) 0 15%, transparent 16%),
    radial-gradient(circle at 52% 46%, rgba(255, 232, 162, 0.55) 0 24%, transparent 25%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.52), color-mix(in srgb, var(--art-b) 32%, #eadfc8));
}

.abstract-art[data-category="greetings-basics"] { --art-a: #dcb86c; --art-b: #789c9b; --art-c: #7b6744; }
.abstract-art[data-category="essential-verbs"] { --art-a: #e3bb62; --art-b: #bd8e6f; --art-c: #7a5833; }
.abstract-art[data-category="family-people"] { --art-a: #d8a879; --art-b: #8c9d79; --art-c: #7d5e4a; }
.abstract-art[data-category="time-calendar"] { --art-a: #d7c27a; --art-b: #6d8ea2; --art-c: #665b45; }
.abstract-art[data-category="places-locations"] { --art-a: #cdae72; --art-b: #77a18e; --art-c: #766047; }
.abstract-art[data-category="food-drink"] { --art-a: #d9a85f; --art-b: #8aa66f; --art-c: #7e5337; }
.abstract-art[data-category="adjectives"] { --art-a: #d7b164; --art-b: #8f92a9; --art-c: #755a52; }
.abstract-art[data-category="question-words-connectors"] { --art-a: #d4b56e; --art-b: #8f7fa3; --art-c: #6c5948; }
.abstract-art[data-category="everyday-essentials"] { --art-a: #d8bd73; --art-b: #7ca0a5; --art-c: #705c42; }
.abstract-art[data-category="prepositions"] { --art-a: #c9b372; --art-b: #9b8967; --art-c: #655644; }
.abstract-art[data-category="colors"] { --art-a: #dca36b; --art-b: #6f9ba8; --art-c: #8b5a56; }
.abstract-art[data-category="body-health"] { --art-a: #d6aa72; --art-b: #86a481; --art-c: #715c4f; }
.abstract-art[data-category="transportation-directions"] { --art-a: #d3b06c; --art-b: #7894a4; --art-c: #675f52; }
.abstract-art[data-category="weather-nature"] { --art-a: #d8c56f; --art-b: #78a88b; --art-c: #606d4f; }
.abstract-art[data-category="numbers"] { --art-a: #dcb96f; --art-b: #8f9080; --art-c: #6d6049; }

.abstract-art::before {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 12%;
  height: 18%;
  border-bottom: 5px solid color-mix(in srgb, var(--art-c) 78%, #412d1d);
  border-radius: 50%;
  transform: rotate(var(--seed-a));
}

.abstract-art::after {
  content: "";
  position: absolute;
  left: 38%;
  top: 25%;
  width: 23%;
  height: 36%;
  border: 2px solid color-mix(in srgb, var(--art-c) 62%, transparent);
  border-top-left-radius: 45% 52%;
  border-top-right-radius: 45% 52%;
  border-bottom: 6px solid color-mix(in srgb, var(--art-c) 64%, transparent);
  filter: drop-shadow(0 4px 8px rgba(132, 88, 30, 0.22));
}

.art-sun,
.art-shape,
.art-line,
.art-mark {
  position: absolute;
  display: block;
}

.art-shape {
  opacity: 0.38;
  border: 1px solid color-mix(in srgb, var(--art-c) 58%, transparent);
}

.art-shape--one {
  left: 13%;
  top: 17%;
  width: 23%;
  height: 23%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--art-b) 24%, transparent);
}

.art-shape--two {
  right: 10%;
  bottom: 15%;
  width: 28%;
  height: 18%;
  border-radius: 45% 55% 42% 58%;
  background: color-mix(in srgb, var(--art-a) 28%, transparent);
  transform: rotate(calc(var(--seed-a) * -1));
}

.abstract-art[data-variant="1"] .art-shape--one {
  border-radius: 4px 18px 12px 20px;
  transform: rotate(16deg);
}

.abstract-art[data-variant="2"] .art-shape--two {
  border-radius: 999px;
  right: 18%;
  bottom: 22%;
}

.art-line {
  left: 50%;
  top: 48%;
  width: 42%;
  border-top: 1px solid color-mix(in srgb, var(--art-c) 52%, transparent);
  transform-origin: left center;
}

.art-line--one { transform: rotate(28deg); }
.art-line--two { transform: rotate(-38deg); }

.art-mark {
  color: color-mix(in srgb, var(--art-c) 78%, transparent);
  font-weight: 500;
  font-size: clamp(18px, 5vw, 38px);
}

.art-mark--one { left: 18%; top: 18%; }
.art-mark--two { right: 16%; bottom: 18%; }

.card-body {
  flex: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.34em;
  padding: 5% 9% 8%;
  text-align: center;
  min-height: 0;
}

.card-hanzi {
  font-size: clamp(24px, calc(18px + 11.5cqw), 56px);
  line-height: 1.02;
  font-weight: 680;
  transform: scale(var(--hanzi-scale, 1));
  transform-origin: center bottom;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.vocab-card--ring .card-hanzi {
  font-size: clamp(13px, calc(9px + 7cqw), 24px);
}

.card-pinyin {
  font-size: clamp(11px, calc(8px + 2.4cqw), 18px);
  color: var(--muted);
  font-weight: 560;
}

.card-translation {
  font-size: clamp(10px, calc(8px + 2.5cqw), 19px);
  line-height: 1.18;
  color: #282725;
  overflow-wrap: anywhere;
}

.vocab-card--ring .card-pinyin,
.vocab-card--ring .card-translation,
.vocab-card--ring .card-meta {
  display: none;
}

.card-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.vocab-card--sentence .card-hanzi {
  line-height: 1.12;
}

.label-leaders {
  position: fixed;
  inset: 0;
  z-index: 9;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.leader-line {
  stroke: rgba(13, 13, 13, 0.42);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.leader-line.is-emphasized {
  stroke: rgba(13, 13, 13, 0.82);
  stroke-width: 1.4;
  stroke-dasharray: none;
}

.leader-dot {
  fill: var(--bg);
  stroke: rgba(13, 13, 13, 0.54);
  stroke-width: 1.2;
}

.leader-dot.is-emphasized {
  fill: var(--ink, #131313);
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1.5;
}

.category-labels {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.category-label {
  position: absolute;
  max-width: 184px;
  font-size: 13.5px;
  line-height: 1.14;
  font-weight: 560;
  color: var(--ink);
  transition: opacity 200ms ease, color 180ms ease;
  text-wrap: balance;
  pointer-events: auto;
  cursor: pointer;
}

.category-label:hover,
.category-label.is-highlighted {
  font-weight: 680;
}

.category-label.is-highlighted .category-label__name {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.category-label__main {
  display: inline;
}

.category-label small {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 500;
  font-size: 9.5px;
}

.category-label.is-active {
  font-weight: 650;
}

.category-label.is-filtered-out {
  pointer-events: none;
}

.category-label.is-filtered-in .category-label__name {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.mobile-category {
  display: none;
}

.lanyard-stage {
  position: fixed;
  z-index: 30;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.lanyard-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.lanyard-shadow,
.lanyard-body,
.lanyard-stitch {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lanyard-shadow {
  stroke: rgba(20, 16, 31, 0.22);
  stroke-width: 24;
  transform: translate(4px, 3px);
}

.lanyard-body {
  stroke: var(--lanyard);
  stroke-width: 19;
}

.lanyard-stitch {
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1;
  stroke-dasharray: 4 7;
}

.lanyard-text {
  fill: rgba(255, 255, 255, 0.68);
  font-size: 9px;
  letter-spacing: 0.25em;
  font-weight: 650;
}

.lanyard-clip {
  position: absolute;
  width: 30px;
  height: 24px;
  pointer-events: none;
  z-index: 34;
  border-radius: 999px 999px 10px 10px;
  border: 1px solid rgba(31, 26, 43, 0.28);
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.88) 0 14%, transparent 16%),
    linear-gradient(180deg, rgba(236, 226, 203, 0.94), rgba(174, 156, 124, 0.9));
  box-shadow: 0 7px 16px rgba(48, 38, 24, 0.16);
}

.physical-card {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 35;
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
  transform-origin: center center;
  will-change: transform;
  transform-style: preserve-3d;
}

.physical-card.is-dragging {
  cursor: grabbing;
}

.physical-card:focus-visible {
  outline: 2px solid rgba(13, 13, 13, 0.66);
  outline-offset: 8px;
  border-radius: 22px;
}

.central-card-content {
  transition: opacity 190ms ease;
}

.central-card-content.is-fading {
  opacity: 0;
  transition-duration: 110ms;
}

.audio-control {
  position: absolute;
  z-index: 45;
  left: 0;
  top: 0;
  transform: translate3d(0, 0, 0);
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: auto;
  color: var(--muted);
}

.practice-toolbar {
  display: grid;
  gap: 8px;
}

.practice-button,
.speaker-button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(247, 245, 238, 0.88);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(48, 38, 24, 0.12);
}

.practice-button,
.speaker-button {
  position: relative;
}

.practice-button {
  font-size: 14px;
}

.practice-button.is-active,
.practice-button[aria-expanded="true"] {
  color: var(--ink);
  border-color: rgba(13, 13, 13, 0.58);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 22px rgba(48, 38, 24, 0.18), inset 0 0 0 1px rgba(13, 13, 13, 0.04);
}

.practice-button.is-active::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.practice-panel {
  width: 212px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 247, 243, 0.94);
  box-shadow: 0 18px 42px rgba(48, 38, 24, 0.18);
  display: grid;
  gap: 9px;
  backdrop-filter: blur(10px);
}

.practice-panel[hidden] {
  display: none;
}

.practice-field {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 620;
  color: var(--muted);
}

.practice-label-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.practice-label-wrap label {
  min-width: 0;
}

.practice-help {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border: 1px solid rgba(13, 13, 13, 0.28);
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
  cursor: help;
}

.practice-help::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 120;
  left: 0;
  bottom: calc(100% + 8px);
  width: 210px;
  max-width: calc(100vw - 42px);
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(248, 247, 243, 0.98);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(48, 38, 24, 0.18);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 560;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.practice-help:hover,
.practice-help:focus-visible {
  color: var(--ink);
  border-color: rgba(13, 13, 13, 0.56);
}

.practice-help:hover::after,
.practice-help:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.practice-field input,
.practice-field select {
  min-width: 0;
  height: 28px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  padding: 0 8px;
}

.practice-field input:focus,
.practice-field select:focus {
  outline: 1px solid rgba(13, 13, 13, 0.72);
  outline-offset: 2px;
}

.practice-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
}

.practice-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--ink);
}

.practice-check label {
  cursor: pointer;
}

.orbit-item.is-filtered-out .orbit-card-visual {
  filter: grayscale(0.65);
}

.speaker-button:disabled {
  cursor: default;
  opacity: 0.46;
}

.speaker-button.is-playing {
  color: var(--ink);
  border-color: rgba(13, 13, 13, 0.48);
}

.practice-button:focus-visible,
.practice-help:focus-visible,
.speaker-button:focus-visible,
.nav-button:focus-visible,
.github-button:focus-visible,
.menu-button:focus-visible,
.dialog-close:focus-visible,
.mobile-menu-item:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

.footer-copy {
  position: fixed;
  z-index: 70;
  bottom: 29px;
  font-size: 12px;
  font-weight: 560;
  pointer-events: none;
}

.footer-left { left: 32px; }
.footer-right { right: 32px; }

.info-dialog {
  width: min(420px, calc(100vw - 40px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: #f8f7f3;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(48, 38, 24, 0.22);
}

.info-dialog:not(.mobile-menu) {
  width: min(700px, calc(100vw - 40px));
}

.info-dialog::backdrop {
  background: rgba(245, 244, 240, 0.62);
}

.info-dialog h2 {
  margin: 0 0 20px;
  font-size: 18px;
  line-height: 1;
}

.help-mascot {
  height: auto;
  margin: -4px 0 22px;
  overflow: hidden;
  border: 1px solid rgba(13, 13, 13, 0.1);
  border-radius: 8px;
  background: #eee5d6;
  box-shadow: 0 12px 30px rgba(48, 38, 24, 0.12);
}

.help-mascot img {
  display: block;
  width: 100%;
  height: auto;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.dialog-list {
  display: grid;
  gap: 13px;
  margin: 0;
}

.dialog-list div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
}

.dialog-list dt {
  color: var(--muted);
  font-size: 12px;
}

.dialog-list dd {
  margin: 0;
  font-size: 13px;
}

.help-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  font-size: 13px;
  line-height: 1.35;
}

.help-contact {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(13, 13, 13, 0.12);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.help-contact p {
  margin: 0;
}

.help-contact p + p {
  margin-top: 4px;
}

.help-contact__title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.help-contact a {
  display: inline-flex;
  margin-top: 8px;
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.mobile-menu-item {
  display: block;
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--soft-line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.mobile-menu-link {
  color: inherit;
  text-decoration: none;
}

@media (max-width: 768px) {
  html,
  body {
    height: 100svh;
    overscroll-behavior: none;
  }

  .app-header {
    height: 62px;
    padding: 0 20px;
  }

  .brand__main {
    font-size: 16px;
  }

  .brand__sub {
    font-size: 10px;
  }

  .desktop-nav {
    display: none;
  }

  .menu-button {
    display: flex;
  }

  .ring-scene {
    z-index: 14;
  }

  .orbit-item {
    cursor: grab;
  }

  .category-labels,
  .label-leaders {
    display: none;
  }

  .mobile-category {
    display: block;
    position: fixed;
    z-index: 38;
    left: 22px;
    right: 22px;
    top: calc(62px + 59svh);
    color: var(--muted);
    font-size: 12px;
    font-weight: 620;
    text-align: center;
    pointer-events: none;
  }

  .lanyard-stage {
    inset: 0;
    z-index: 32;
  }

  .lanyard-shadow {
    stroke-width: 18;
  }

  .lanyard-body {
    stroke-width: 16;
  }

  .lanyard-text {
    font-size: 7px;
  }

  .practice-button,
  .speaker-button {
    width: 30px;
    height: 30px;
  }

  .audio-control {
    gap: 8px;
  }

  .practice-toolbar {
    gap: 7px;
  }

  .practice-panel {
    width: min(204px, calc(100vw - 118px));
    padding: 10px;
  }

  .loader__mascot {
    width: min(320px, calc(100vw - 52px));
  }

  .help-mascot {
    margin-bottom: 18px;
  }

  .practice-field {
    grid-template-columns: 74px 1fr;
    gap: 7px;
  }

  .footer-copy {
    display: none;
  }

  .vocab-card {
    box-shadow: 0 12px 30px rgba(48, 38, 24, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 80ms !important;
  }
}
