:root {
  --cream: #ffffff;
  --ink: #1e1410;
  --muted: #6b5c54;
  --clay: #a64d3d;
  --shadow: 0 12px 40px rgba(30, 20, 16, 0.08);
  --radius: 18px;
  --radius-sm: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--cream);
}

.app {
  /* Wide enough for 10 consonant keys on one row (54px keys + gaps + padding). */
  max-width: 684px;
  margin: 0 auto;
  padding: 20px 16px 28px;
}

.hero {
  text-align: center;
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0;
  font-family: "Roboto Slab", Georgia, serif;
  font-size: clamp(1.75rem, 5vw, 2.2rem);
  font-weight: 700;
  color: var(--ink);
}

.hero-sub {
  margin: 6px auto 0;
  max-width: 34ch;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.sound-board {
  background: #ffffff;
  border-radius: 18px;
  padding: 14px 12px 12px;
  box-shadow: var(--shadow);
}

.sound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 72px);
  grid-auto-rows: 68px;
  gap: 8px;
  justify-content: center;
  justify-items: center;
}

.sound-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin: 0 0 8px;
}

.sound-row:last-child {
  margin-bottom: 0;
}


.sound-key {
  position: relative;
  border: 1px solid rgba(30, 20, 16, 0.08);
  border-radius: 12px;
  padding: 0;
  width: 54px;
  height: 48px;
  min-height: 48px;
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 1.22rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background-color 0.12s ease,
    border-color 0.12s ease;
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.06),
    0 4px 16px rgba(0, 0, 0, 0.06);
}

.sound-key:hover {
  transform: translateY(-2px);
  border-color: rgba(30, 20, 16, 0.18);
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.06),
    0 8px 22px rgba(0, 0, 0, 0.07);
}

.sound-key:active {
  transform: translateY(0) scale(0.98);
}

.sound-key:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.sound-key.is-playing {
  outline: 2px solid rgba(166, 77, 61, 0.5);
  outline-offset: 1px;
}

/* Pastel solid fills (no gradients) */
/* Short vowels — warm coral */
.sound-key.section-short-vowel {
  background-color: #f4d6cf;
  border-color: rgba(217, 168, 168, 0.85);
}

/* Long vowels — golden */
.sound-key.section-long-vowel {
  background-color: #f7ebc6;
  border-color: rgba(212, 184, 122, 0.9);
}

/* Consonants — sea sage */
.sound-key.section-consonant {
  background-color: #dbf0e1;
  border-color: rgba(143, 184, 170, 0.9);
}

/* Vowel combinations — soft violet */
.sound-key.section-blend {
  background-color: #e9e4f6;
  border-color: rgba(176, 160, 212, 0.9);
}

/* Voice practice controls */
.practice {
  margin: 16px auto 0;
  text-align: center;
  background: #fff;
  border: 1px solid rgba(166, 77, 61, 0.2);
  border-radius: 16px;
  padding: 12px 12px 10px;
  box-shadow: 0 8px 20px rgba(166, 77, 61, 0.08);
}

.practice h2 {
  margin: 0 0 8px;
  font-family: "Roboto Slab", Georgia, serif;
  font-size: clamp(1.2rem, 2.2vw, 1.4rem);
  line-height: 1.2;
  font-weight: 700;
  color: var(--clay);
}

.practice-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: #fff8f6;
  border: 1px solid rgba(166, 77, 61, 0.16);
  border-radius: 999px;
  padding: 8px 10px;
}

.control-btn {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(166, 77, 61, 0.28);
  border-radius: 999px;
  background: #ffffff;
  color: var(--clay);
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 2.15rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    transform 120ms ease,
    opacity 120ms ease,
    background-color 120ms ease,
    color 120ms ease,
    border-color 120ms ease;
}

.control-btn .icon {
  display: inline-block;
}

.icon-record {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: currentColor;
}

.icon-pause {
  position: relative;
  width: 18px;
  height: 18px;
}

.icon-pause::before,
.icon-pause::after {
  content: "";
  position: absolute;
  top: 0;
  width: 6px;
  height: 18px;
  border-radius: 4px;
  background: currentColor;
}

.icon-pause::before {
  left: 0;
}

.icon-pause::after {
  right: 0;
}

.icon-play {
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 16px solid currentColor;
  margin-left: 2px;
}

.control-btn:hover:not(:disabled) {
  transform: scale(1.04);
  border-color: var(--clay);
  background-color: #fff1ee;
}

.control-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.control-btn.stop {
  background: var(--clay);
  color: #fff;
  border-color: var(--clay);
}

.control-btn.stop:hover:not(:disabled) {
  background: #8f3f31;
}

.control-btn.pause {
  font-size: 1.95rem;
}

.control-btn.play {
  font-size: 2.2rem;
}

.control-btn.pause.is-paused .icon-pause {
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 16px solid currentColor;
}

.control-btn.pause.is-paused .icon-pause::before,
.control-btn.pause.is-paused .icon-pause::after {
  content: none;
}

.recorder-status {
  margin: 6px 0 0;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  min-height: 1.4em;
}

.board-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 380px) {
  .sound-key {
    width: 50px;
    height: 44px;
    min-height: 44px;
  }

  .control-btn {
    width: 48px;
    height: 48px;
    font-size: 1.85rem;
  }
}
