:root {
  color-scheme: light;
  --ink: #174e47;
  --muted: #718783;
  --cream: #fffdf7;
  --paper: #f8f3e7;
  --line: #ded5b9;
  --green: #4da47e;
  --green-dark: #28775d;
  --mint: #e8f5ec;
  --coral: #e36d5d;
  --coral-soft: #fff0ec;
  --mustard: #efb43a;
  --mustard-soft: #fff5d8;
  --blue: #65b7c7;
  --lavender: #eee9fb;
  --shadow: 0 13px 0 rgba(116, 99, 50, .14), 0 24px 45px rgba(47, 79, 70, .1);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(242, 185, 61, .16), transparent 25rem),
    radial-gradient(circle at 92% 22%, rgba(101, 183, 199, .15), transparent 31rem),
    #f9f6ea;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 4px solid rgba(239, 180, 58, .55);
  outline-offset: 3px;
}

.page-pattern {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .5;
  background-image: radial-gradient(rgba(23, 78, 71, .08) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.brand,
.collection-button,
.sound-button,
.back-button {
  border: 0;
  color: var(--ink);
  cursor: pointer;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  text-align: left;
  background: transparent;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 26px;
  border: 3px solid #b8ddd3;
  border-radius: 17px;
  background: #f6fff9;
  box-shadow: 0 5px 0 rgba(40, 119, 93, .15);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 21px;
  line-height: 1.12;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.collection-button,
.sound-button,
.back-button {
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 247, .92);
  box-shadow: 0 4px 0 rgba(116, 99, 50, .12);
  font-weight: 800;
}

.collection-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
}

.collection-button b {
  min-width: 44px;
  padding: 5px 8px;
  border-radius: 99px;
  color: var(--green-dark);
  background: var(--mint);
  font-size: 12px;
}

.sound-button {
  padding: 8px 14px;
}

.back-button {
  width: 48px;
  padding: 0;
  font-size: 24px;
}

.collection-button:hover,
.sound-button:hover,
.back-button:hover {
  border-color: #adccbd;
  background: #fff;
}

.hero,
.game-shell,
.result-card,
.collection-shell,
.qa-report {
  border: 3px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 253, 247, .97);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, .92fr);
  align-items: center;
  gap: 42px;
  padding: 56px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero h1,
.progress-heading h1,
.result-card h1,
.collection-heading h1,
.qa-report h1 {
  margin: 0;
  color: var(--ink);
  line-height: 1.04;
  letter-spacing: -.035em;
}

.hero h1 {
  max-width: 620px;
  font-size: clamp(42px, 5.1vw, 64px);
}

.hero-copy > p:not(.eyebrow),
.progress-heading > div > p:last-child,
.collection-heading p,
.qa-report > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.55;
}

.hero-actions,
.result-actions,
.collection-actions,
.typing-actions,
.qa-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.hero-actions {
  margin-top: 28px;
}

.primary-button,
.secondary-button,
.hero-progress {
  min-height: 54px;
  padding: 13px 22px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  border: 0;
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 0 var(--green-dark);
}

.primary-button:hover {
  background: #429770;
}

.primary-button:active {
  box-shadow: 0 4px 0 var(--green-dark);
}

.primary-button.compact {
  min-height: 48px;
  margin-left: auto;
  padding: 11px 18px;
  white-space: nowrap;
}

.primary-button:disabled {
  cursor: default;
  opacity: .48;
  box-shadow: none;
}

.secondary-button,
.hero-progress {
  border: 2px solid var(--line);
  color: var(--ink);
  background: var(--cream);
  box-shadow: 0 5px 0 rgba(116, 99, 50, .12);
}

.secondary-button:hover,
.hero-progress:hover {
  border-color: #b7cdbf;
  background: #fff;
}

.secondary-button:disabled {
  cursor: default;
  opacity: .48;
}

.hero-picture {
  aspect-ratio: 3 / 2;
  margin: 0;
  overflow: hidden;
  border: 10px solid #fff;
  border-radius: 28px;
  background: #dcefea;
  box-shadow: 0 20px 34px rgba(38, 75, 63, .18);
}

.hero-picture img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.routes-section {
  padding-top: 58px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -.03em;
}

.section-heading > p {
  max-width: 390px;
  margin: 0 0 6px;
  color: var(--muted);
  text-align: right;
  font-weight: 700;
  line-height: 1.45;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.route-card {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 3px solid var(--line);
  border-radius: 28px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  background: var(--cream);
  box-shadow: 0 10px 0 rgba(116, 99, 50, .14);
}

.route-card:nth-child(1) {
  background: #f0f8ef;
}

.route-card:nth-child(2) {
  background: #fff3e0;
}

.route-card:nth-child(3) {
  background: #f1edfc;
}

.route-card:hover {
  border-color: #9fcab9;
}

.route-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .8);
  font-size: 34px;
}

.route-card small,
.route-card strong,
.route-card p {
  display: block;
}

.route-card > small {
  margin-bottom: 8px;
  color: #8d7350;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.route-card > h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
}

.route-card > p {
  min-height: 48px;
  margin: 12px 0 20px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.route-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px dashed rgba(83, 99, 94, .23);
}

.route-stars {
  color: #d9a124;
  letter-spacing: .08em;
}

.game-shell {
  padding: 38px;
}

.progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.progress-heading h1 {
  font-size: clamp(36px, 4.2vw, 54px);
}

.progress-heading > div > p:last-child {
  margin: 10px 0 0;
  font-size: 16px;
}

.progress-box {
  width: 100px;
  height: 100px;
  display: grid;
  place-content: center;
  flex: 0 0 auto;
  text-align: center;
  border: 3px solid #c8dfd3;
  border-radius: 26px;
  background: #eef8ee;
}

.progress-box b,
.progress-box small {
  display: block;
}

.progress-box b {
  font-size: 34px;
  line-height: 1;
}

.progress-box small {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 800;
}

.typing-layout {
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(0, 1.22fr);
  gap: 24px;
}

.picture-card,
.typing-panel {
  min-width: 0;
  border: 3px solid var(--line);
  border-radius: 28px;
}

.picture-card {
  min-height: 525px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, .95) 0 25%, transparent 26%),
    linear-gradient(145deg, #dff2ed, #fff0ca);
}

.picture-card::before,
.picture-card::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  border: 24px solid rgba(255, 255, 255, .42);
  border-radius: 50%;
}

.picture-card::before {
  top: -72px;
  left: -80px;
}

.picture-card::after {
  right: -72px;
  bottom: -84px;
}

.picture-emoji {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 14px 12px rgba(39, 74, 63, .18));
  font-size: clamp(126px, 14vw, 190px);
  line-height: 1;
}

.picture-card > p {
  position: absolute;
  z-index: 2;
  right: 22px;
  bottom: 20px;
  left: 22px;
  margin: 0;
  color: #607b74;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}

.picture-sparkles i {
  position: absolute;
  z-index: 1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--mustard);
}

.picture-sparkles i:nth-child(1) {
  top: 18%;
  left: 22%;
}

.picture-sparkles i:nth-child(2) {
  top: 28%;
  right: 21%;
  width: 11px;
  height: 11px;
  background: var(--coral);
}

.picture-sparkles i:nth-child(3) {
  right: 29%;
  bottom: 17%;
  width: 22px;
  height: 22px;
  background: var(--blue);
}

.typing-panel {
  padding: 26px;
  background: #fffefb;
}

.typing-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.typing-heading h2 {
  margin: 0;
  font-size: 30px;
}

.typing-heading > span {
  padding: 8px 12px;
  border-radius: 99px;
  color: #8b6a27;
  background: var(--mustard-soft);
  font-weight: 800;
}

.word-slots {
  display: grid;
  grid-template-columns: repeat(var(--letters), minmax(42px, 1fr));
  gap: 8px;
  margin: 26px 0 10px;
}

.word-slot {
  min-width: 0;
  aspect-ratio: 1 / 1.06;
  display: grid;
  place-items: center;
  padding: 0;
  border: 3px solid #bdcfca;
  border-radius: 15px;
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  box-shadow: 0 5px 0 rgba(49, 87, 75, .11);
  font-size: clamp(24px, 3vw, 37px);
  font-weight: 900;
}

.word-slot span {
  align-self: end;
}

.word-slot small {
  align-self: start;
  color: #9aaca7;
  font-size: 10px;
  line-height: 1;
}

.word-slot:hover,
.word-slot.is-current {
  border-color: var(--mustard);
  background: #fffaf0;
}

.word-slot.is-wrong {
  border-color: #e49589;
  color: #a44438;
  background: var(--coral-soft);
}

.word-slot.is-revealed {
  border-color: #94b7d8;
  color: #315f85;
  background: #edf6ff;
}

.word-slot.is-correct {
  border-color: #81bb9c;
  color: var(--green-dark);
  background: var(--mint);
}

.word-slot:disabled {
  cursor: default;
}

.typing-note {
  min-height: 22px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.screen-keyboard {
  padding: 13px;
  border: 2px solid #d8e2dc;
  border-radius: 20px;
  background: #eef3ee;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.keyboard-row:first-child {
  margin-top: 0;
}

.keyboard-tools {
  align-items: center;
  justify-content: space-between;
}

.keyboard-tools > span {
  color: #718782;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.key-button {
  width: 40px;
  height: 43px;
  padding: 0;
  border: 2px solid #cbd7d1;
  border-radius: 11px;
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  box-shadow: 0 3px 0 #b9c7c0;
  font-size: 17px;
  font-weight: 900;
}

.key-button:hover {
  border-color: var(--green);
  color: var(--green-dark);
  background: #f5fff8;
}

.key-button:active {
  background: #e7f4eb;
  box-shadow: 0 1px 0 #b9c7c0;
}

.special-key {
  color: #8c601e;
  background: var(--mustard-soft);
}

.backspace-key {
  width: 56px;
  color: #a84f43;
  background: var(--coral-soft);
}

.typing-actions {
  justify-content: space-between;
  margin-top: 18px;
}

.typing-actions > button {
  flex: 1 1 190px;
}

.game-controls {
  margin-top: 20px;
}

.feedback-card {
  min-height: 94px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 18px 20px;
  border: 3px solid #d8e1d8;
  border-radius: 24px;
  background: #f5f8f4;
}

.feedback-card[data-kind="error"] {
  border-color: #e79a90;
  background: var(--coral-soft);
}

.feedback-card[data-kind="hint"] {
  border-color: #e6c568;
  background: var(--mustard-soft);
}

.feedback-card[data-kind="success"] {
  border-color: #8fc3a6;
  background: var(--mint);
}

.feedback-card > span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 17px;
  background: rgba(255, 255, 255, .85);
  font-size: 30px;
}

.feedback-card p {
  flex: 1 1 auto;
  margin: 0;
}

.feedback-card strong,
.feedback-card small {
  display: block;
}

.feedback-card strong {
  font-size: 20px;
}

.feedback-card small {
  margin-top: 5px;
  color: #5f7772;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.42;
}

.result-card {
  max-width: 940px;
  margin: 30px auto 0;
  padding: 54px;
  text-align: center;
}

.result-ribbon {
  padding: 20px;
  border-radius: 22px;
  color: #fff;
  background: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.result-card .eyebrow {
  margin-top: 30px;
}

.result-card h1 {
  font-size: clamp(42px, 6vw, 68px);
}

.result-card > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

.result-stars {
  margin: 24px 0;
  color: #e7a727;
  font-size: 46px;
  letter-spacing: .18em;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 26px 0 32px;
}

.result-stats span {
  padding: 22px 14px;
  border: 2px solid #d0dfd3;
  border-radius: 20px;
  background: #f0f7ed;
}

.result-stats b,
.result-stats small {
  display: block;
}

.result-stats b {
  font-size: 34px;
}

.result-stats small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.result-actions {
  justify-content: center;
}

.collection-shell,
.qa-report {
  padding: 42px;
}

.collection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.collection-heading h1,
.qa-report h1 {
  font-size: clamp(40px, 5vw, 60px);
}

.collection-heading p {
  margin: 10px 0 0;
  font-size: 16px;
}

.collection-heading > span {
  width: 110px;
  height: 110px;
  display: grid;
  place-content: center;
  flex: 0 0 auto;
  text-align: center;
  border: 3px solid #c8dfd3;
  border-radius: 28px;
  background: #eef8ee;
}

.collection-heading > span b,
.collection-heading > span small {
  display: block;
}

.collection-heading > span b {
  font-size: 36px;
}

.collection-heading > span small {
  color: var(--muted);
  font-weight: 800;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.collection-card {
  min-height: 190px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 18px 8px;
  border: 2px solid #d8ddd2;
  border-radius: 20px;
  color: #9aa59f;
  background: #f3f3ec;
}

.collection-card.is-open {
  border-color: #bfd9ca;
  color: var(--ink);
  background: #f3faef;
}

.collection-card > span {
  font-size: 52px;
}

.collection-card strong {
  font-size: 18px;
  text-transform: uppercase;
}

.collection-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.collection-actions {
  justify-content: space-between;
  margin-top: 28px;
}

.danger-button {
  color: #9c453c;
  border-color: #e5b2a9;
  background: #fff5f1;
}

.qa-report {
  margin-top: 24px;
}

.qa-report > p:not(.eyebrow) {
  margin: 12px 0 28px;
  font-size: 17px;
}

.qa-report ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.qa-report li {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 2px 10px;
  padding: 13px;
  border: 2px solid #d8e1d8;
  border-radius: 14px;
  background: #f7faf5;
}

.qa-report li > span {
  grid-row: 1 / 3;
  font-size: 23px;
  font-weight: 900;
}

.qa-report li.ok > span {
  color: var(--green-dark);
}

.qa-report li.bad {
  border-color: #e69d94;
  background: var(--coral-soft);
}

.qa-report li.bad > span {
  color: #aa493e;
}

.qa-report li small {
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr 360px;
    gap: 28px;
    padding: 38px;
  }

  .hero h1 {
    font-size: 46px;
  }

  .game-shell {
    padding: 26px;
  }

  .typing-layout {
    grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
  }

  .picture-card {
    min-height: 470px;
  }

  .typing-panel {
    padding: 20px;
  }

  .key-button {
    width: 35px;
    height: 40px;
    font-size: 15px;
  }

  .backspace-key {
    width: 50px;
  }

  .collection-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-picture {
    max-width: 620px;
    grid-row: 1;
  }

  .route-grid {
    grid-template-columns: 1fr;
  }

  .route-card {
    min-height: 230px;
  }

  .typing-layout {
    grid-template-columns: 1fr;
  }

  .picture-card {
    min-height: 340px;
  }

  .picture-emoji {
    font-size: 150px;
  }

  .key-button {
    width: clamp(28px, 7.7vw, 48px);
    height: 44px;
  }

  .backspace-key {
    width: 58px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .section-heading > p {
    text-align: left;
  }

  .qa-report ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .app {
    width: min(100% - 18px, 1120px);
    padding-top: 8px;
  }

  .topbar {
    min-height: 62px;
    gap: 8px;
    margin-bottom: 10px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 22px;
  }

  .brand strong {
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand small {
    display: none;
  }

  .collection-button {
    min-height: 44px;
    padding: 5px 8px;
  }

  .collection-button > span:nth-child(2),
  .sound-button span:nth-child(2) {
    display: none;
  }

  .collection-button b {
    min-width: auto;
    padding-inline: 6px;
  }

  .sound-button {
    min-height: 44px;
    padding: 5px 10px;
  }

  .back-button {
    display: none;
  }

  .hero,
  .game-shell,
  .result-card,
  .collection-shell,
  .qa-report {
    border-width: 2px;
    border-radius: 24px;
  }

  .hero {
    gap: 24px;
    padding: 24px;
  }

  .hero h1 {
    font-size: clamp(37px, 11vw, 49px);
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 16px;
  }

  .hero-actions > *,
  .result-actions > * {
    width: 100%;
  }

  .routes-section {
    padding-top: 42px;
  }

  .route-card {
    padding: 22px;
  }

  .game-shell {
    padding: 18px;
  }

  .progress-heading {
    align-items: start;
    gap: 12px;
    margin-bottom: 20px;
  }

  .progress-heading h1 {
    font-size: clamp(30px, 9vw, 42px);
  }

  .progress-heading > div > p:last-child {
    font-size: 14px;
  }

  .progress-box {
    width: 68px;
    height: 68px;
    border-radius: 19px;
  }

  .progress-box b {
    font-size: 25px;
  }

  .picture-card {
    min-height: 270px;
  }

  .picture-emoji {
    font-size: 122px;
  }

  .typing-panel {
    padding: 15px 10px 16px;
  }

  .typing-heading {
    padding-inline: 5px;
  }

  .typing-heading h2 {
    font-size: 24px;
  }

  .typing-heading > span {
    padding: 6px 8px;
    font-size: 12px;
  }

  .word-slots {
    gap: 5px;
  }

  .word-slot {
    border-width: 2px;
    border-radius: 11px;
    font-size: clamp(21px, 7vw, 30px);
  }

  .screen-keyboard {
    margin-inline: -18px;
    padding: 7px 4px 9px;
    border-radius: 14px;
  }

  .keyboard-row {
    gap: 3px;
    margin-top: 5px;
  }

  .key-button {
    width: clamp(25px, 7.8vw, 35px);
    height: 40px;
    border-width: 1px;
    border-radius: 8px;
    font-size: 14px;
  }

  .keyboard-row:not(.keyboard-tools) .key-button {
    width: auto;
    flex: 0 0 calc((100% - 22px) / 12);
  }

  .backspace-key {
    width: 48px;
  }

  .typing-actions {
    gap: 9px;
  }

  .typing-actions > button {
    flex-basis: 100%;
  }

  .game-controls .secondary-button {
    width: 100%;
  }

  .feedback-card {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 15px;
  }

  .feedback-card > span {
    width: 46px;
    height: 46px;
    font-size: 24px;
  }

  .feedback-card p {
    flex-basis: calc(100% - 62px);
  }

  .feedback-card .primary-button {
    width: 100%;
    margin-left: 0;
  }

  .result-card,
  .collection-shell,
  .qa-report {
    padding: 24px 18px;
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .collection-heading {
    align-items: start;
  }

  .collection-heading > span {
    width: 74px;
    height: 74px;
    border-radius: 20px;
  }

  .collection-heading > span b {
    font-size: 26px;
  }

  .collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .collection-card {
    min-height: 130px;
    border-radius: 14px;
  }

  .collection-card > span {
    font-size: 36px;
  }

  .collection-card strong {
    font-size: 14px;
  }

  .collection-actions > * {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .app {
    width: min(100% - 30px, 1120px);
  }

  .hero {
    padding: 20px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .collection-button,
  .sound-button {
    padding-inline: 7px;
  }

  .keyboard-row {
    gap: 2px;
  }

  .screen-keyboard {
    margin-inline: -10px;
  }

  .key-button {
    width: 25px;
    height: 38px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
