:root {
  --ink: #22223b;
  --muted: #6c698d;
  --paper: #fffaf0;
  --cream: #fff3cf;
  --line: rgba(34, 34, 59, 0.12);
  --accent: #ff7a90;
  --accent-dark: #d64f67;
  --success: #20a66a;
  --danger: #d94f54;
  --shadow: 0 22px 60px rgba(77, 60, 41, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Fredoka", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 214, 102, 0.35), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(119, 221, 186, 0.3), transparent 24rem),
    linear-gradient(135deg, #fff8e7 0%, #ffe9ef 52%, #e8fbf5 100%);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 44px;
}

.hero {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.eyebrow,
.quiz-kicker,
.question-label {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1;
}

h1 {
  font-size: clamp(2.5rem, 8vw, 5.8rem);
}

.hero-copy {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 500;
}

.mode-toggle-panel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(77, 60, 41, 0.14);
  backdrop-filter: blur(12px);
}

.mode-toggle-label {
  min-width: 68px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  border-radius: 999px;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.mode-toggle-label.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  transform: translateY(-1px);
}

.mode-toggle {
  position: relative;
  width: 76px;
  min-height: 40px;
  padding: 4px;
  background: linear-gradient(135deg, #ffd166, #ffcad4);
  border: 0;
  border-radius: 999px;
  box-shadow: inset 0 2px 8px rgba(100, 72, 38, 0.14), 0 8px 18px rgba(255, 122, 144, 0.22);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 220ms ease;
}

.mode-toggle:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 2px 8px rgba(100, 72, 38, 0.12), 0 12px 24px rgba(255, 122, 144, 0.28);
}

.mode-toggle:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(34, 34, 59, 0.14), 0 12px 24px rgba(255, 122, 144, 0.28);
}

.mode-toggle.is-write {
  background: linear-gradient(135deg, #a0c4ff, #b8f2e6);
  box-shadow: inset 0 2px 8px rgba(100, 72, 38, 0.12), 0 8px 18px rgba(110, 231, 183, 0.28);
}

.mode-toggle-thumb {
  display: block;
  width: 32px;
  height: 32px;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 7px 14px rgba(34, 34, 59, 0.2);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mode-toggle.is-write .mode-toggle-thumb {
  transform: translateX(36px);
}

.bento-grid {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  grid-auto-rows: minmax(150px, auto);
  gap: 16px;
}

.table-card {
  position: relative;
  display: grid;
  min-height: 150px;
  padding: 20px;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  border: 0;
  border-radius: 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  isolation: isolate;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.table-card::before {
  position: absolute;
  inset: 12px;
  z-index: -1;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 18px;
}

.table-card::after {
  position: absolute;
  right: -28px;
  bottom: -42px;
  width: 130px;
  height: 130px;
  content: "";
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

.table-card:hover,
.table-card:focus-visible {
  transform: translateY(-8px) scale(1.045) rotate(-0.6deg);
  box-shadow: 0 28px 70px rgba(77, 60, 41, 0.24);
  outline: 0;
}

.table-card:focus-visible {
  box-shadow: 0 0 0 4px rgba(34, 34, 59, 0.16), 0 28px 70px rgba(77, 60, 41, 0.24);
}

.wide {
  grid-column: span 2;
}

.tall {
  grid-row: span 2;
}

.spark {
  justify-self: end;
  font-size: 2rem;
  animation: bounce 2.4s ease-in-out infinite;
}

.number {
  align-self: end;
  font-size: clamp(4rem, 9vw, 7.6rem);
  font-weight: 700;
  line-height: 0.82;
}

.subtitle {
  margin-top: 8px;
  font-size: 1.2rem;
  font-weight: 700;
}

.record {
  align-self: end;
  display: inline-grid;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin-top: 16px;
  padding: 9px 12px;
  color: rgba(34, 34, 59, 0.78);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.16;
  background: rgba(255, 255, 255, 0.52);
  border-radius: 18px;
}

.record span {
  display: block;
}

.card-1 {
  background: linear-gradient(135deg, #ffe2ad, #ffd0c7);
}

.card-2 {
  background: linear-gradient(135deg, #c9f7df, #f9f1a7);
}

.card-3 {
  background: linear-gradient(135deg, #c7e6ff, #dff7c8);
}

.card-4 {
  background: linear-gradient(135deg, #ffd1dc, #ffe8ad);
}

.card-5 {
  background: linear-gradient(135deg, #b8f2e6, #ffd6a5);
}

.card-6 {
  background: linear-gradient(135deg, #fbd0ff, #bde0fe);
}

.card-7 {
  background: linear-gradient(135deg, #ffcfd2, #caffbf);
}

.card-8 {
  background: linear-gradient(135deg, #fdffb6, #a0c4ff);
}

.card-9 {
  background: linear-gradient(135deg, #d0f4de, #ffcad4);
}

.card-10 {
  background: linear-gradient(135deg, #fff1b8, #b9fbc0);
}

.is-hidden {
  display: none !important;
}

.quiz {
  max-width: 860px;
  margin: 0 auto;
  animation: pop-in 260ms ease both;
}

.quiz-topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.ghost-button,
.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 12px 18px;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ghost-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 10px 28px rgba(77, 60, 41, 0.12);
}

.primary-button {
  color: #ffffff;
  background: var(--accent-dark);
  box-shadow: 0 14px 30px rgba(214, 79, 103, 0.28);
}

.secondary-button {
  color: var(--ink);
  background: var(--cream);
  box-shadow: inset 0 0 0 2px rgba(34, 34, 59, 0.08);
}

.ghost-button:hover,
.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.ghost-button:disabled,
.primary-button:disabled,
.secondary-button:disabled {
  cursor: default;
  opacity: 0.65;
}

.ghost-button:disabled:hover,
.primary-button:disabled:hover,
.secondary-button:disabled:hover {
  transform: none;
}

.progress-panel,
.question-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.progress-panel {
  padding: 18px;
  margin-bottom: 18px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 700;
}

.progress-track {
  position: relative;
  height: 22px;
  overflow: visible;
  background: #ffe6bd;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  box-shadow: inset 0 2px 8px rgba(100, 72, 38, 0.14);
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff9f7a, #ffd166, #6ee7b7);
  border-radius: inherit;
  transition: width 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.progress-kitten {
  position: absolute;
  top: 50%;
  left: 0%;
  z-index: 2;
  font-size: 2rem;
  filter: drop-shadow(0 5px 6px rgba(68, 50, 35, 0.2));
  transform: translate(-50%, -62%);
  transition: left 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: kitten-bounce 1.4s ease-in-out infinite;
}

.question-card {
  position: relative;
  display: grid;
  gap: 18px;
  padding: clamp(22px, 5vw, 40px);
  text-align: center;
}

.hint-bubble {
  position: absolute;
  top: -20px;
  left: 50%;
  z-index: 3;
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  color: #78350f;
  font-family: "Fredoka", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde047;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(120, 53, 15, 0.18);
  translate: -50% 0;
  animation: popIn 0.3s ease-out;
}

.hint-bubble::before {
  position: absolute;
  bottom: -9px;
  left: 50%;
  width: 0;
  height: 0;
  content: "";
  border-top: 9px solid #fde047;
  border-right: 9px solid transparent;
  border-left: 9px solid transparent;
  translate: -50% 0;
}

.hint-bubble::after {
  position: absolute;
  bottom: -7px;
  left: 50%;
  width: 0;
  height: 0;
  content: "";
  border-top: 8px solid #fef3c7;
  border-right: 8px solid transparent;
  border-left: 8px solid transparent;
  translate: -50% 0;
}

.question-display {
  padding: 24px;
  font-size: clamp(3rem, 11vw, 6.8rem);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, rgba(255, 238, 168, 0.82), rgba(204, 251, 241, 0.7));
  border-radius: 24px;
  animation: pop-in 240ms ease both;
}

.visual-demo {
  display: grid;
  grid-template-columns: minmax(150px, 0.36fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  padding: 14px;
  overflow: hidden;
  text-align: left;
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.92), rgba(232, 251, 245, 0.88));
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 22px;
}

.visual-demo-art {
  position: relative;
  min-height: 178px;
  overflow: hidden;
  border-radius: 18px;
}

.visual-demo-art::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent 58%, rgba(255, 251, 235, 0.62));
}

.visual-demo-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
}

.visual-demo-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.visual-demo-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.demo-mode,
.demo-summary,
.demo-tool-label {
  font-weight: 700;
  line-height: 1;
}

.demo-mode {
  padding: 8px 10px;
  color: #7c2d12;
  font-size: 0.9rem;
  background: #ffedd5;
  border-radius: 999px;
}

.demo-summary {
  color: var(--ink);
  font-size: clamp(1rem, 3.5vw, 1.28rem);
}

.demo-stage {
  display: grid;
  gap: 12px;
}

.demo-object-groups {
  display: grid;
  grid-template-columns: repeat(var(--demo-columns), minmax(54px, 1fr));
  gap: 8px;
}

.demo-object-group {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px dashed rgba(34, 34, 59, 0.18);
  border-radius: 14px;
}

.demo-group-title {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.demo-items {
  display: grid;
  grid-template-columns: repeat(var(--items-per-row), minmax(0, 1fr));
  gap: 4px;
  justify-items: center;
}

.demo-item {
  display: inline-grid;
  place-items: center;
  width: clamp(20px, 3vw, 30px);
  aspect-ratio: 1;
  font-size: clamp(1.05rem, 3vw, 1.46rem);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  animation: demo-pop 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--delay);
}

.demo-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.demo-tool {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.58);
  border-radius: 16px;
}

.demo-tool-label {
  color: var(--accent-dark);
  font-size: 0.92rem;
}

.mini-abacus {
  display: grid;
  gap: 4px;
}

.abacus-row {
  display: flex;
  gap: 3px;
  align-items: center;
  min-height: 11px;
  padding: 2px 6px;
  background: linear-gradient(90deg, rgba(120, 53, 15, 0.22), rgba(120, 53, 15, 0.08));
  border-radius: 999px;
}

.abacus-bead {
  flex: 0 0 clamp(8px, 1.5vw, 13px);
  aspect-ratio: 1;
  background: #ff7a90;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  box-shadow: inset 0 -2px 3px rgba(124, 45, 18, 0.18);
  animation: bead-slide 460ms ease both;
  animation-delay: var(--delay);
}

.counting-rods {
  display: grid;
  gap: 5px;
}

.rod-group {
  display: flex;
  gap: 3px;
  min-width: 0;
}

.counting-rod {
  flex: 1 1 0;
  min-width: 6px;
  height: 11px;
  background: linear-gradient(90deg, #6ee7b7, #9bd0ff);
  border-radius: 999px;
  transform-origin: left center;
  animation: rod-grow 360ms ease both;
  animation-delay: var(--delay);
}

.visual-demo[data-theme="apple"] .abacus-bead,
.visual-demo[data-theme="apple"] .counting-rod {
  background: linear-gradient(90deg, #ff7a90, #ffd166);
}

.visual-demo[data-theme="strawberry"] .abacus-bead,
.visual-demo[data-theme="strawberry"] .counting-rod {
  background: linear-gradient(90deg, #ef476f, #ffd166);
}

.visual-demo[data-theme="kitten"] .abacus-bead,
.visual-demo[data-theme="kitten"] .counting-rod {
  background: linear-gradient(90deg, #ffbd7a, #a0c4ff);
}

.visual-demo[data-theme="puppy"] .abacus-bead,
.visual-demo[data-theme="puppy"] .counting-rod {
  background: linear-gradient(90deg, #c08457, #6ee7b7);
}

.visual-demo[data-theme="pear"] .abacus-bead,
.visual-demo[data-theme="pear"] .counting-rod {
  background: linear-gradient(90deg, #b9fbc0, #ffd166);
}

.demo-caption {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.32;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.option-button {
  min-height: 82px;
  color: var(--ink);
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  font-weight: 700;
  background: #ffffff;
  border: 3px solid transparent;
  border-radius: 22px;
  box-shadow: 0 12px 24px rgba(77, 60, 41, 0.12);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
  animation: pop-in 220ms ease both;
}

.option-button:hover:not(:disabled),
.option-button:focus-visible:not(:disabled) {
  transform: translateY(-4px) scale(1.02);
  border-color: #ffd166;
  outline: 0;
}

.option-button:disabled {
  cursor: default;
}

.write-input-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(520px, 100%);
  margin: 0 auto;
}

#answer-input {
  width: 100%;
  min-height: 82px;
  color: var(--ink);
  font: inherit;
  font-size: clamp(2rem, 7vw, 3.2rem);
  font-weight: 700;
  text-align: center;
  background: #ffffff;
  border: 3px solid transparent;
  border-radius: 22px;
  box-shadow: 0 12px 24px rgba(77, 60, 41, 0.12);
  outline: 0;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

#answer-input::-webkit-outer-spin-button,
#answer-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

#answer-input[type="number"] {
  appearance: textfield;
}

#answer-input:focus {
  border-color: #ffd166;
  box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.24), 0 12px 24px rgba(77, 60, 41, 0.12);
}

#answer-input:disabled {
  cursor: default;
  opacity: 0.78;
}

#answer-input.is-correct {
  color: #0f5132;
  background: #c9f7df;
  border-color: var(--success);
  animation: bounce 450ms ease;
}

#answer-input.is-wrong {
  color: #8c1d24;
  background: #ffd4d6;
  border-color: var(--danger);
}

.write-input-container .primary-button {
  min-height: 82px;
  padding-inline: 24px;
  font-size: 1.2rem;
}

.option-button.is-correct {
  color: #0f5132;
  background: #c9f7df;
  border-color: var(--success);
  animation: bounce 450ms ease;
}

.option-button.is-wrong {
  color: #8c1d24;
  background: #ffd4d6;
  border-color: var(--danger);
}

.feedback {
  min-height: 38px;
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 700;
}

.feedback.good {
  color: var(--success);
}

.feedback.bad {
  color: var(--danger);
}

.feedback-reward {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 15px;
  text-align: center;
}

.reward-image {
  max-width: 120px;
  max-height: 120px;
  border-radius: 20px;
  box-shadow: 0 16px 34px rgba(77, 60, 41, 0.2);
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reward-emoji {
  font-size: 4rem;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.correct-answer-button {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(390px, 100%);
  min-height: 66px;
  padding: 14px 24px;
  color: var(--ink);
  font-size: clamp(1.05rem, 4vw, 1.3rem);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  background: linear-gradient(135deg, #ffd166 0%, #ff9f7a 42%, #6ee7b7 100%);
  border: 4px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  box-shadow: 0 18px 38px rgba(214, 79, 103, 0.24), inset 0 2px 0 rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.correct-answer-button:hover:not(:disabled),
.correct-answer-button:focus-visible:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 24px 46px rgba(214, 79, 103, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.5);
  outline: 0;
}

.correct-answer-button:disabled {
  cursor: default;
  opacity: 0.48;
  filter: saturate(0.72);
  box-shadow: inset 0 0 0 2px rgba(34, 34, 59, 0.06);
}

.correct-answer-icon {
  flex: 0 0 auto;
  font-size: 1.55em;
  line-height: 1;
}

.celebration-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(34, 34, 59, 0.28);
  backdrop-filter: blur(10px);
}

.celebration-modal[hidden] {
  display: none;
}

.confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.celebration-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  padding: clamp(28px, 6vw, 48px);
  text-align: center;
  background: #fffaf0;
  border: 4px solid rgba(255, 255, 255, 0.82);
  border-radius: 30px;
  box-shadow: 0 32px 90px rgba(34, 34, 59, 0.28);
  animation: pop-in 320ms ease both;
}

.celebration-emoji {
  margin: 0 0 8px;
  font-size: 4rem;
  animation: bounce 1.2s ease-in-out infinite;
}

.final-score {
  margin: 20px 0 8px;
  font-size: clamp(2rem, 9vw, 4.4rem);
  font-weight: 700;
}

.final-rating {
  min-height: 32px;
  margin: 0;
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-8px);
  }
}

@keyframes demo-pop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.72);
  }
  70% {
    transform: translateY(-2px) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bead-slide {
  0% {
    opacity: 0;
    transform: translateX(-10px) scale(0.75);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes rod-grow {
  0% {
    opacity: 0;
    transform: scaleX(0.12);
  }
  100% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes kitten-bounce {
  0%,
  100% {
    transform: translate(-50%, -62%) translateY(0);
  }
  45% {
    transform: translate(-50%, -62%) translateY(-8px);
  }
}

@media (max-width: 880px) {
  .bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(142px, auto);
  }

  .wide,
  .tall {
    grid-column: span 1;
    grid-row: span 1;
  }

  .visual-demo {
    grid-template-columns: 1fr;
  }

  .visual-demo-art {
    min-height: 150px;
  }

  .visual-demo-art::after {
    background: linear-gradient(0deg, rgba(255, 251, 235, 0.5), transparent 58%);
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 22px, 1160px);
    padding-top: 18px;
  }

  .bento-grid,
  .options-grid {
    grid-template-columns: 1fr;
  }

  .visual-demo {
    padding: 10px;
  }

  .demo-tools {
    grid-template-columns: 1fr;
  }

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

  .demo-object-groups {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  }

  .mode-toggle-panel {
    justify-content: space-between;
    width: 100%;
  }

  .quiz-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-card {
    min-height: 136px;
  }

  .progress-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .write-input-container {
    grid-template-columns: 1fr;
  }

  .write-input-container .primary-button {
    width: 100%;
  }
}

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