.alphabet-practice {
  margin-block: 32px;
  padding: clamp(14px, 3vw, 24px);
  background: #103f35;
  border: 1px solid #2d6155;
  border-radius: 18px;
}
.alphabet-practice h2 { margin: 0 0 16px; }
.alphabet-controls, .alphabet-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}
.alphabet-controls label {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 15px;
}
.alphabet-controls select { width: 100%; max-width: min(330px, 100%); }
.alphabet-page button, .alphabet-page select, .alphabet-page input {
  font: inherit;
  color: inherit;
  border: 1px solid #548f7e;
  border-radius: 9px;
  padding: 8px 12px;
  min-height: 44px;
  background: #0a3028;
}
.alphabet-page button { cursor: pointer; }
.alphabet-page button.cta { background: #61d5b7; color: #09382c; border-color: transparent; }
.alphabet-page button:disabled { cursor: default; opacity: .7; }
.alphabet-page button[aria-pressed="true"] { outline: 2px solid #83e4c7; outline-offset: -3px; }
.alphabet-page :focus-visible { outline: 2px solid #ffe391; outline-offset: 3px; }
.alphabet-page [hidden] { display: none !important; }
.alphabet-status { color: #ffe391; margin-block: 8px 0; }
.alphabet-status:empty { margin: 0; }
.alphabet-round { margin-top: 18px; border-top: 1px solid #2d6155; padding-top: 14px; }
.alphabet-round h3 { margin: 0 0 10px; font-size: 17px; }
.alphabet-prompt { font-size: 24px; margin: 6px 0 12px; }
.alphabet-choice { min-width: 66px; overflow-wrap: anywhere; }
.alphabet-matching {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 520px;
  margin: 12px 0;
}
.alphabet-matching > div { display: grid; align-content: start; gap: 6px; }
.alphabet-matching .matched { color: #bce2bd; border-color: #83e4c7; }
.alphabet-matching .matched::after { content: ' ✓'; }
.alphabet-answer-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.alphabet-answer-form label { display: grid; gap: 4px; max-width: 100%; min-width: 0; }
.alphabet-group {
  margin-block: 24px;
}
.alphabet-group h3 {
  margin: 0 0 8px;
  color: #dcf4db;
  font-size: 17px;
}
.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, clamp(70px, 12vw, 128px)), 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.alphabet-grid li { display: flex; min-width: 0; margin: 0; }
.alphabet-page .alphabet-tile {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  min-height: 104px;
  gap: 2px;
  padding: 8px 4px 7px;
  background: #103f35;
  border-color: #2d6155;
  line-height: 1.2;
}
.alphabet-tile:hover:enabled { background: #164e41; border-color: #83e4c7; }
.alphabet-page .alphabet-tile:disabled { opacity: 1; }
.alphabet-tile .alphabet-tile-glyph {
  display: grid;
  place-items: center;
  flex: 1;
  width: 100%;
  min-height: 61px;
  font-size: clamp(29px, 5.3vw, 45px);
}
.alphabet-tile .alphabet-vertical { font-size: clamp(25px, 4.5vw, 36px); }
.alphabet-tile img { max-width: 90%; width: auto; height: auto; max-height: 58px; }
.alphabet-tile-reading { color: #e4efd6; font-size: .82rem; overflow-wrap: anywhere; }
.alphabet-tile-secondary { color: #bbc9aa; font-size: .7rem; overflow-wrap: anywhere; }
.alphabet-tile-audio { position: absolute; inset-block-start: 4px; inset-inline-end: 6px; color: #83e4c7; font-size: 12px; }

html:has(.alphabet-dialog[open]) { overflow: hidden; }
.alphabet-dialog {
  box-sizing: border-box;
  width: min(560px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid #548f7e;
  border-radius: 18px;
  background: #103f35;
  color: #ffffd5;
}
.alphabet-dialog::backdrop { background: rgba(0, 20, 16, .76); }
.alphabet-dialog-body { padding: clamp(12px, 4vw, 24px); }
.alphabet-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.alphabet-dialog-header h2 { margin: 0; font-size: 19px; }
.alphabet-dialog-glyph {
  display: grid;
  place-items: center;
  min-height: 135px;
  font-size: clamp(58px, 18vw, 118px);
  line-height: 1.13;
  margin: 8px 0 0;
}
.alphabet-dialog-glyph .alphabet-vertical { font-size: .65em; }
.alphabet-dialog-glyph img { max-width: min(88%, 260px); max-height: 180px; }
.alphabet-dialog-glyph .alphabet-guide img { max-width: 88%; max-height: 160px; }
.alphabet-dialog-glyph .alphabet-pad { margin: 0; }
.alphabet-dialog-glyph.alphabet-dialog-tracing { font-size: inherit; }
.alphabet-dialog-reading { text-align: center; font-size: 24px; margin: 2px 0 12px; }
.alphabet-dialog-actions { justify-content: center; }
.alphabet-dialog-details:not(:empty) { margin: 14px 0; }
.alphabet-dialog-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  border-top: 1px solid #2d6155;
  padding-top: 12px;
  margin-top: 16px;
}
.alphabet-dialog-nav button { font-size: .8rem; padding-inline: 8px; }
.alphabet-notes { white-space: pre-line; display: block; font-size: 14px; color: #d1dfc9; }
.alphabet-forms { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 4px 0; }
.alphabet-forms dt { font-size: 13px; }
.alphabet-forms dd { margin: 0; font-size: 20px; }
.alphabet-vertical { writing-mode: vertical-lr; text-orientation: sideways; display: inline-block; vertical-align: middle; }
.alphabet-guide {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 10px;
  pointer-events: none;
  color: #366253;
  font-size: clamp(52px, 16vw, 115px);
  line-height: 1.15;
}
.alphabet-guide img { opacity: .38; padding: 6px; max-width: 85%; max-height: 160px; }
.alphabet-guide .alphabet-vertical { font-size: clamp(44px, 13vw, 84px); }
.alphabet-pad {
  position: relative;
  overflow: hidden;
  width: min(100%, 480px);
  height: clamp(175px, 45vw, 245px);
  margin-block: 10px;
  border: 1px solid #548f7e;
  border-radius: 10px;
  background: #092e27;
}
.alphabet-pad svg { display: block; position: relative; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.alphabet-pad path {
  fill: none;
  stroke: #ffffd5;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
@media (max-width: 500px) {
  .alphabet-controls label { flex-basis: 100%; }
  .alphabet-controls select { max-width: 100%; }
}
.alphabet-choice [data-alphabet-symbol] { font-size: 26px; }
.alphabet-choice img, .alphabet-prompt img { max-width: 90px; max-height: 74px; }
.alphabet-pad .alphabet-reference-stroke { stroke: #86b6a4; stroke-width: 5; opacity: .62; }
.alphabet-reference-number { font: 24px system-ui, sans-serif; fill: #b7dfd1; pointer-events: none; }
