* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  background: #f6f8fb;
  color: #0b1220;
}

.header {
  padding: 16px 16px 8px;
  background: #ffffff;
  border-bottom: 1px solid #eef1f6;
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-icon {
  font-size: 18px;
}

.title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.subtitle {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.3;
  color: rgba(11, 18, 32, 0.62);
}

.main {
  padding: 14px 14px 22px;
}

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

.card {
  width: 100%;
  border: 1px solid #e7eaf0;
  border-radius: 12px;
  background: #ffffff;
  padding: 14px 10px 12px;
  display: grid;
  place-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: 132px;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.card:active {
  transform: scale(0.99);
}

.card[data-playing="true"] {
  border-color: rgba(30, 86, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(30, 86, 255, 0.12);
}

.letters-pair {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: center;
}

.upper {
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
  color: #1e56ff;
}

.lower {
  font-size: 26px;
  line-height: 1;
  font-weight: 650;
  color: rgba(11, 18, 32, 0.85);
}

.ipa-block {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.ipa-line {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: rgba(11, 18, 32, 0.8);
}

.ipa-tag {
  font-size: 11px;
  line-height: 16px;
  height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef3ff;
  color: rgba(30, 86, 255, 0.95);
  border: 1px solid rgba(30, 86, 255, 0.15);
}

.speaker {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #e7eaf0;
  background: #ffffff;
  color: rgba(11, 18, 32, 0.68);
  font-size: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.speaker:active {
  transform: scale(0.98);
}

.speaker svg {
  width: 22px;
  height: 22px;
}

.speaker[data-playing="true"] {
  color: rgba(30, 86, 255, 0.9);
  border-color: rgba(30, 86, 255, 0.35);
  background: rgba(30, 86, 255, 0.06);
}

.speaker:focus-visible,
.card:focus-visible {
  outline: 3px solid rgba(30, 86, 255, 0.3);
  outline-offset: 2px;
}

.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast[data-show="true"] {
  transform: translateY(0);
  opacity: 1;
}

@media (min-width: 680px) {
  .main {
    padding: 18px 16px 26px;
    max-width: 820px;
    margin: 0 auto;
  }

  .header {
    max-width: 820px;
    margin: 0 auto;
    padding: 18px 16px 10px;
  }

  .title {
    font-size: 24px;
  }

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