:root {
  --bg: #e5e8f0;
  --surface: #ffffff;
  --surface-muted: #f4f6fb;
  --line: rgba(60, 60, 67, 0.14);
  --line-strong: rgba(60, 60, 67, 0.22);
  --ink: #111114;
  --muted: #5b6170;
  --accent: #0077f6;
  --accent-soft: rgba(10, 132, 255, 0.1);
  --mark: rgba(10, 132, 255, 0.1);
  --shadow-soft: 0 16px 40px rgba(17, 17, 20, 0.12);
  --shadow-card: 0 8px 22px rgba(17, 17, 20, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --icon-person: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4' fill='black'/%3E%3Cpath d='M4 20c0-3.4 3.6-6 8-6s8 2.6 8 6' fill='black'/%3E%3C/svg%3E");
  --icon-cards: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='7' y='4' width='13' height='10' rx='2' fill='black'/%3E%3Cpath d='M4 8h10a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V10a2 2 0 0 1 2-2Z' fill='black'/%3E%3C/svg%3E");
  --icon-document: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z' fill='black'/%3E%3Crect x='9' y='11' width='6' height='1.8' rx='0.9' fill='white'/%3E%3Crect x='9' y='15' width='6' height='1.8' rx='0.9' fill='white'/%3E%3Cpath d='M14 3v5h5' fill='white'/%3E%3C/svg%3E");
  --icon-crown: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 18 6.5 8l5.5 5 5.5-5L20 18H4Z' fill='black'/%3E%3Crect x='5' y='18' width='14' height='2.5' rx='1.2' fill='black'/%3E%3Ccircle cx='6.5' cy='7.5' r='1.5' fill='black'/%3E%3Ccircle cx='12' cy='4.5' r='1.5' fill='black'/%3E%3Ccircle cx='17.5' cy='7.5' r='1.5' fill='black'/%3E%3C/svg%3E");
  --icon-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 19 6v5c0 5.2-3 8.3-7 10.8C8 19.3 5 16.2 5 11V6l7-3Z' fill='black'/%3E%3C/svg%3E");
  --icon-speech: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 5h14a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2h-7l-4.5 4V16H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Z' fill='black'/%3E%3C/svg%3E");
}

body[data-theme="atelier"] {
  --bg: #ece4d7;
  --surface: #fffdf9;
  --surface-muted: #f7f1e8;
  --line: rgba(89, 74, 55, 0.14);
  --line-strong: rgba(89, 74, 55, 0.22);
  --ink: #1f1a16;
  --muted: #655a50;
  --accent: #9a6134;
  --accent-soft: rgba(154, 97, 52, 0.1);
  --mark: rgba(154, 97, 52, 0.1);
  --shadow-soft: 0 16px 34px rgba(31, 26, 22, 0.12);
  --shadow-card: 0 8px 20px rgba(31, 26, 22, 0.08);
}

body[data-theme="nachtprobe"] {
  --bg: #080b10;
  --surface: #1c2330;
  --surface-muted: #293344;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.18);
  --ink: #f5f7fb;
  --muted: #c5cedb;
  --accent: #6ab0ff;
  --accent-soft: rgba(94, 168, 255, 0.12);
  --mark: rgba(94, 168, 255, 0.16);
  --shadow-soft: 0 18px 42px rgba(0, 0, 0, 0.36);
  --shadow-card: 0 8px 18px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.36), transparent 26%),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
  line-height: 1.45;
}

body[data-theme="nachtprobe"] {
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.06), transparent 18%),
    var(--bg);
}

a,
button {
  font: inherit;
  color: inherit;
}

button {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
}

.app-shell {
  width: min(680px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 0 40px;
  animation: page-enter 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.shell-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 4px 2px;
}

.shell-link,
.shell-brand {
  font-size: 0.98rem;
  font-weight: 590;
  letter-spacing: -0.01em;
}

.shell-link {
  text-decoration: none;
  color: var(--accent);
  transition: color 160ms ease, transform 160ms ease;
}

.shell-link:hover {
  transform: translateX(-1px);
}

.shell-link-secondary {
  color: var(--muted);
  text-align: right;
}

.shell-link-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.shell-brand {
  color: var(--ink);
}

.shell-placeholder {
  display: block;
  width: 1.2rem;
}

.shell-current {
  text-align: center;
  min-width: 0;
  animation: soft-fade 280ms ease both;
}

.shell-current strong {
  display: block;
  font-size: 1rem;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.shell-subline {
  display: block;
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--muted);
}

.page-block {
  padding: 2px 2px 8px;
  animation: soft-fade 380ms ease both;
}

.page-block-home {
  padding-bottom: 4px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5.6vw, 2.6rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
  font-weight: 720;
}

.page-copy {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 48ch;
  font-size: 0.98rem;
  line-height: 1.45;
}

.page-status {
  margin: 14px 0 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-card);
}

.status-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.status-icon::before,
.status-icon::after {
  content: "";
  position: absolute;
  background: var(--accent);
}

.status-icon-role::after {
  inset: 0;
  -webkit-mask: var(--icon-person) center / contain no-repeat;
  mask: var(--icon-person) center / contain no-repeat;
}

.main-menu,
.choice-list,
.page-actions,
.script-stack,
.result-strip {
  display: grid;
}

.main-menu,
.choice-list {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.script-stack {
  margin-top: 14px;
  gap: 10px;
}

.page-actions {
  margin-top: 14px;
  gap: 12px;
}

.result-strip {
  margin-top: 14px;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.main-menu > *,
.choice-list > *,
.script-stack > * {
  opacity: 0;
  animation: list-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.main-menu > :nth-child(1),
.choice-list > :nth-child(1),
.script-stack > :nth-child(1) { animation-delay: 40ms; }
.main-menu > :nth-child(2),
.choice-list > :nth-child(2),
.script-stack > :nth-child(2) { animation-delay: 90ms; }
.main-menu > :nth-child(3),
.choice-list > :nth-child(3),
.script-stack > :nth-child(3) { animation-delay: 140ms; }
.main-menu > :nth-child(4),
.choice-list > :nth-child(4),
.script-stack > :nth-child(4) { animation-delay: 190ms; }
.script-stack > :nth-child(n + 5) { animation-delay: 220ms; }

.menu-button,
.choice-button,
.theme-button,
.primary-link,
.primary-button,
.secondary-button {
  display: block;
  width: 100%;
  text-decoration: none;
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.menu-button,
.choice-button,
.theme-button {
  position: relative;
  padding: 19px 52px 19px 78px;
  background: var(--surface);
}

.menu-button:not(:last-child),
.choice-button:not(:last-child),
.theme-button:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.menu-button::after,
.choice-button::after,
.theme-button::after {
  content: "›";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 180ms ease, color 180ms ease;
}

.menu-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, white), color-mix(in srgb, var(--accent) 20%, var(--surface-muted)));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, var(--line)),
    0 6px 14px color-mix(in srgb, var(--accent) 10%, transparent);
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.menu-icon::before,
.choice-icon::before {
  content: "";
  position: absolute;
  inset: 9px;
  background: var(--accent);
  -webkit-mask: var(--icon-shape) center / contain no-repeat;
  mask: var(--icon-shape) center / contain no-repeat;
}

.menu-icon-role { --icon-shape: var(--icon-person); }
.menu-icon-mode,
.menu-icon-learn { --icon-shape: var(--icon-cards); }
.menu-icon-script { --icon-shape: var(--icon-document); }
.menu-icon-quiz { --icon-shape: var(--icon-cards); }

.choice-list-characters {
  display: grid;
}

.choice-button-role {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  column-gap: 14px;
  padding: 16px 18px;
  text-align: left;
}

.choice-list-characters .choice-button::after,
.choice-list-characters .choice-button.active::before {
  content: none;
}

.choice-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, white), color-mix(in srgb, var(--accent) 18%, var(--surface-muted)));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, var(--line)),
    0 8px 18px color-mix(in srgb, var(--accent) 11%, transparent);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.choice-icon-crown { --icon-shape: var(--icon-crown); }
.choice-icon-shield { --icon-shape: var(--icon-shield); }
.choice-icon-speech { --icon-shape: var(--icon-speech); }

.theme-button::after,
.choice-button.active::after,
.theme-button.active::after {
  content: "";
}

.menu-button:hover,
.choice-button:hover,
.theme-button:hover,
.secondary-button:hover {
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-muted));
}

.menu-button:hover::after,
.choice-button:hover::after,
.theme-button:hover::after {
  transform: translateY(-50%) translateX(2px);
  color: var(--accent);
}

.menu-button:hover .menu-icon,
.choice-button:hover .menu-icon,
.theme-button:hover .menu-icon,
.choice-button:hover .choice-icon {
  transform: translateY(-50%) scale(1.08);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, var(--line)),
    0 10px 18px color-mix(in srgb, var(--accent) 15%, transparent);
}

.choice-button:hover .choice-icon {
  transform: translateY(0) scale(1.06);
}

.menu-button:active,
.choice-button:active,
.theme-button:active,
.primary-link:active,
.primary-button:active,
.secondary-button:active {
  transform: scale(0.988);
}

.menu-button-title,
.choice-button strong,
.theme-button strong {
  display: block;
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.menu-button-copy,
.choice-button span,
.theme-button span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.choice-button small,
.theme-button small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.choice-button-role small {
  margin-bottom: 3px;
  font-size: 0.7rem;
}

.choice-button-role strong {
  line-height: 1.15;
}

.choice-button-role span {
  margin-top: 3px;
  line-height: 1.3;
}

.choice-button.active,
.theme-button.active {
  background: linear-gradient(180deg, var(--accent-soft), color-mix(in srgb, var(--surface) 88%, var(--accent-soft)));
}

.choice-button-role.active {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 36%, transparent);
}

.choice-button-role.active .choice-icon {
  transform: translateY(-1px) scale(1.04);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, var(--line)),
    0 10px 18px color-mix(in srgb, var(--accent) 16%, transparent);
}

.choice-button.active::before,
.theme-button.active::before {
  content: "✓";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  animation: pop-in 240ms ease;
}

.primary-link,
.primary-button {
  min-height: 54px;
  padding: 15px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent));
  color: #fff;
  font-weight: 650;
  text-align: center;
  box-shadow: 0 14px 28px color-mix(in srgb, var(--accent) 28%, transparent);
}

.primary-link:hover,
.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px color-mix(in srgb, var(--accent) 32%, transparent);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.text-button {
  min-height: 38px;
  color: var(--muted);
  padding: 0;
  font-weight: 520;
  transition: color 150ms ease, transform 150ms ease;
}

.text-button:hover {
  color: var(--ink);
}

.practice-sheet {
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, white), var(--surface));
  box-shadow: var(--shadow-soft);
  padding: 22px 20px 20px;
  animation: soft-fade 420ms ease both;
}

.practice-intro {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.practice-logo {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-muted) 84%, white);
  padding: 8px;
  box-shadow: var(--shadow-card);
}

.practice-intro-copy .page-copy {
  margin-top: 10px;
}

.practice-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.practice-summary-item,
.practice-panel,
.result-strip-practice .result-box {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.practice-summary-item {
  min-width: 0;
  padding: 14px 15px;
  border-radius: 18px;
}

.practice-summary-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.practice-summary-item strong {
  display: block;
  min-width: 0;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.practice-sheet .progress-track {
  height: 8px;
  margin: 18px 0 0;
  background: color-mix(in srgb, var(--surface-muted) 88%, white);
}

.practice-sheet .progress-fill {
  animation: none;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, white));
}

.practice-panels {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.practice-panel {
  border-radius: 22px;
  padding: 18px;
}

.practice-panel-answer {
  background: color-mix(in srgb, var(--surface-muted) 92%, white);
}

.practice-panel h2 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.practice-panel p {
  margin: 0;
  font-size: clamp(1.03rem, 3.4vw, 1.15rem);
  line-height: 1.68;
  letter-spacing: -0.01em;
}

.practice-panel.is-swapping {
  animation: soft-swap 260ms ease;
}

.practice-panel.is-revealed {
  animation: reveal-pop 260ms ease;
}

.practice-panel.is-hidden {
  border-style: dashed;
}

.page-actions-practice {
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.page-actions-practice .text-button,
.page-actions-practice .primary-button:only-child,
.page-actions-practice .secondary-button:only-child {
  grid-column: 1 / -1;
}

.result-strip-practice {
  margin-top: 14px;
}

.practice-block,
.content-box,
.result-box,
.script-item {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.practice-block {
  border-radius: var(--radius-xl);
  padding: 22px 20px;
  box-shadow: var(--shadow-soft);
  animation: soft-fade 420ms ease both;
}

.practice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.progress-badge {
  min-width: 70px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-weight: 640;
  font-size: 0.95rem;
  transition: transform 180ms ease, background-color 180ms ease;
  animation: badge-breathe 2.6s ease-in-out infinite;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 74%, white));
  transition: width 340ms cubic-bezier(0.22, 1, 0.36, 1);
  background-size: 180% 100%;
  animation: progress-shimmer 2.4s linear infinite;
}

.content-box {
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 12px;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.content-box-answer {
  background: var(--surface-muted);
}

.content-box h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.content-box p {
  margin: 0;
  font-size: clamp(1.03rem, 3.3vw, 1.12rem);
  line-height: 1.62;
  letter-spacing: -0.01em;
}

.content-box.is-swapping {
  animation: soft-swap 260ms ease;
}

.content-box.is-revealed {
  animation: reveal-pop 260ms ease;
}

.is-hidden {
  border-style: dashed;
}

.is-hidden p {
  filter: blur(10px);
  user-select: none;
  opacity: 0.52;
  transition: filter 220ms ease, opacity 220ms ease;
}

.quiz-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.secondary-button {
  min-height: 54px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  font-weight: 630;
  box-shadow: var(--shadow-card);
}

.result-box {
  border-radius: var(--radius-lg);
  padding: 15px 16px;
  background: var(--surface-muted);
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.result-box span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.result-box strong {
  font-size: 1.3rem;
  font-weight: 680;
}

.result-box.is-updated {
  animation: stat-pulse 280ms ease;
}

.script-scene {
  margin-top: 18px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.script-item {
  border-radius: var(--radius-lg);
  padding: 15px 16px;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.script-item.highlight {
  background: var(--mark);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
}

.script-item:hover {
  transform: translateX(2px);
}

.script-speaker {
  display: block;
  font-weight: 650;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.script-text {
  color: var(--ink);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, white);
  outline-offset: 2px;
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes soft-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes list-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-50%) scale(0.82);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

@keyframes badge-breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes soft-swap {
  0% {
    opacity: 0.78;
    transform: translateY(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-pop {
  0% {
    background: color-mix(in srgb, var(--accent-soft) 85%, var(--surface-muted));
    transform: translateY(4px);
  }
  100% {
    background: var(--surface-muted);
    transform: translateY(0);
  }
}

@keyframes stat-pulse {
  0% {
    transform: scale(0.985);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  }
  100% {
    transform: scale(1);
    border-color: var(--line);
  }
}

@keyframes progress-shimmer {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 100% 50%;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 16px, 680px);
    padding-top: 12px;
  }

  .shell-header {
    gap: 10px;
  }

  .shell-current strong {
    font-size: 0.96rem;
  }

  .result-strip,
  .quiz-row {
    grid-template-columns: 1fr;
  }

  .practice-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .practice-block {
    padding: 18px 16px;
  }

  .practice-sheet {
    padding: 18px 16px 16px;
    border-radius: 24px;
  }

  .practice-intro {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }

  .practice-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .practice-summary,
  .page-actions-practice,
  .quiz-row,
  .result-strip-practice {
    grid-template-columns: 1fr;
  }

  .menu-button,
  .choice-button,
  .theme-button,
  .content-box,
  .practice-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .menu-button,
  .choice-button,
  .theme-button {
    padding-left: 68px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell,
  .shell-current,
  .main-menu > *,
  .choice-list > *,
  .script-stack > *,
  .menu-button,
  .primary-link,
  .primary-button,
  .choice-button,
  .theme-button,
  .text-button,
  .practice-block,
  .content-box,
  .result-box,
  .script-item,
  .progress-fill,
  .secondary-button {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
