html.la-lock,
html.la-lock body {
  overflow: hidden;
  height: 100%;
}

.learn-alphabet {
  display: none;
}

.learn-alphabet.is-on {
  display: block;
  position: fixed;
  inset: 0;
  height: 100svh;
  max-height: 100svh;
  z-index: 6000;
  overflow: hidden;
  background: #d9d6d0;
  color: #1c1c1c;
}

.learn-alphabet,
.learn-alphabet * {
  box-sizing: border-box;
}

.la-shell,
.learn-alphabet.is-on {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

.learn-alphabet.is-on > section,
.learn-alphabet > section {
  width: min(100%, 520px);
  height: 100%;
  margin: 0 auto;
  background: #f3f2ef;
  min-height: 0;
}

.learn-alphabet > section {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.learn-alphabet > section[hidden] {
  display: none !important;
}

.la-head {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 56px;
  padding: max(6px, env(safe-area-inset-top)) 8px 6px;
}

.la-head h2,
.la-modes-title {
  margin: 0;
  font: 600 18px/1.2 Inter, "Segoe UI", system-ui, sans-serif;
  color: #1c1c1c;
}

.la-back {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
}

.la-points {
  margin: 0 20px 8px;
  color: #6d6862;
  font-size: 14px;
}

.la-charts {
  flex: 1;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px max(12px, env(safe-area-inset-bottom));
}

.la-chart {
  flex: 1 1 0%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  border: 0;
  border-radius: 22px;
  background: #fff;
  color: #1c1c1c;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  text-align: center;
  white-space: normal;
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.la-chart:active { filter: brightness(1.06); }

.la-chart:focus-visible {
  outline: 2px solid #7aa2ff;
  outline-offset: -2px;
}

.la-chart-run {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-family: "EB Garamond", "Libre Baskerville", Palatino, Georgia, serif;
  font-size: clamp(16px, 5.4vw, 28px);
  font-size: clamp(13px, min(5.4vw, 2.5svh), 28px);
  line-height: 1.16;
  letter-spacing: 0.08em;
  direction: ltr;
}

.la-chart.is-hebrew .la-chart-run {
  font-family: "David Libre", "Times New Roman", "Noto Serif Hebrew", David, serif;
  letter-spacing: 0.04em;
  font-size: clamp(15px, 5vw, 26px);
  font-size: clamp(12px, min(5vw, 2.2svh), 26px);
}

.la-chart-run > span { display: block; }

.la-chart-ch { unicode-bidi: isolate; direction: ltr; }

.la-chart-finals {
  color: #6d6862;
  font-size: 0.82em;
  margin-top: 2px;
}

.la-chart-finals i {
  font-style: normal;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-right: 6px;
}

.la-chart-name {
  display: block;
  align-self: stretch;
  width: auto;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 4px;
  font: 600 clamp(17px, 4.8vw, 22px)/1.25 Inter, "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.02em;
  margin-top: 6px;
  white-space: normal;
  text-wrap: wrap;
  overflow-wrap: break-word;
}

.la-chart.is-verses .la-chart-name {
  margin-top: 0;
}

.la-chart-count {
  margin-top: 2px;
  color: #6d6862;
  font-size: 14px;
  font-weight: 500;
}

.la-mode-note {
  margin: 0 20px 8px;
  color: #6d6862;
  font-size: 14px;
  line-height: 1.4;
}

.la-menu-scroll {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom);
}

.la-group {
  margin: 16px 20px 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8680;
}

.la-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font: 500 17px/1.35 Inter, "Segoe UI", system-ui, sans-serif;
  color: #1c1c1c;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.la-row:active {
  background: rgba(0, 0, 0, 0.04);
}

.la-row.is-soon {
  color: #8a8680;
}

.la-soon {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.la-mode-status {
  min-height: 1.2em;
  margin: 14px 20px 20px;
  color: #6d6862;
  font-size: 14px;
}

.la-mode-status:empty {
  display: none;
  margin: 0;
  min-height: 0;
}

.la-door-stack {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 16px max(16px, env(safe-area-inset-bottom));
}

.la-door {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 0;
  border-radius: 28px;
  text-align: left;
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 6px;
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.la-door:active { filter: brightness(1.06); }

.la-door:focus-visible,
.la-pair-acts button:focus-visible {
  outline: 2px solid #7aa2ff;
  outline-offset: -2px;
}

.la-door-study {
  background: #fff;
  color: #1c1c1c;
}

.la-door-play {
  background: #12121c;
  color: #f4f1ea;
}

.la-door-letters {
  margin-bottom: auto;
  font-family: "EB Garamond", "Libre Baskerville", Palatino, Georgia, serif;
  font-size: 32px;
  letter-spacing: 0.08em;
  line-height: 1;
}

.la-door-cat {
  display: block;
  width: 64px;
  height: 64px;
  margin-bottom: auto;
  background: url('../img/alphabet-cat.png?v=20261031-cat-grey') -128px 0 / 640px 64px no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.la-door-eye {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.la-door-study .la-door-eye,
.la-door-study .la-door-sub { color: #6d6862; }

.la-door-play .la-door-eye { color: #9aa0a8; }

.la-door-title {
  font: 600 34px/1.05 Inter, "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.03em;
}

.la-door-sub {
  max-width: 16rem;
  font-size: 14px;
  line-height: 1.35;
}

.la-door-play .la-door-sub { color: #c5c8ce; }

.la-door-ground {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 3px;
  background: #00ffcc;
  box-shadow: 0 0 16px rgba(0, 255, 204, 0.65);
}

.la-pairs {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 16px max(16px, env(safe-area-inset-bottom));
}

.la-pair {
  flex: 1 1 0;
  min-height: 128px;
  background: #fff;
  color: #1c1c1c;
  border-radius: 24px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.la-pair-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
}

.la-pair-mark {
  font-family: "EB Garamond", "Libre Baskerville", Palatino, Georgia, serif;
  font-size: 40px;
  width: 64px;
  text-align: center;
  line-height: 1;
  flex: 0 0 auto;
}

.la-pair-mark.is-mixed { font-size: 22px; }

.la-pair-dot {
  color: #6d6862;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 0.55em;
  padding: 0 0.12em;
}

.la-pair-top b {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.la-pair-acts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.la-pair-acts button {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: #e8e6e1;
  color: #1c1c1c;
  font: 600 13px/1.2 Inter, "Segoe UI", system-ui, sans-serif;
  padding: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.la-pair-acts button:active { filter: brightness(0.96); }

.learn-alphabet[data-lang="hebrew"] .la-door-letters,
.learn-alphabet[data-lang="hebrew"] .la-pair-mark {
  font-family: "David Libre", "Times New Roman", "Noto Serif Hebrew", David, serif;
}

.learn-alphabet > section.la-play-view {
  position: relative;
  background: #2a2a2a;
  padding-bottom: env(safe-area-inset-bottom);
}

.la-prompt {
  position: relative;
  flex: 1.15;
  min-height: 0;
  background: #f3f2ef;
  color: #1a1a1a;
}

.la-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.06);
  z-index: 3;
}

.la-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: #1f8f4e;
}

.la-play-view .la-back {
  position: absolute;
  top: max(6px, env(safe-area-inset-top));
  left: 4px;
  z-index: 2;
}

.la-score {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 16px;
  z-index: 2;
  text-align: right;
  pointer-events: none;
}

.la-score-num {
  display: block;
  font-family: "EB Garamond", "Libre Baskerville", Georgia, serif;
  font-size: 28px;
  line-height: 1;
  color: #2a2a2a;
}

.la-score-num.is-bump {
  animation: la-bump 0.35s ease;
}

.la-score-label {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a8680;
}

.la-hear {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  padding: 64px 20px 56px;
  -webkit-tap-highlight-color: transparent;
}

.la-glyph {
  font-family: "EB Garamond", "Libre Baskerville", Palatino, "Palatino Linotype", "Times New Roman", serif;
  font-size: clamp(92px, 22vw, 168px);
  line-height: 1;
  font-weight: 500;
}

.learn-alphabet[data-lang="hebrew"] .la-glyph,
.learn-alphabet[data-lang="hebrew"] .la-choice.is-glyph {
  font-family: "David Libre", "Times New Roman", "Noto Serif Hebrew", David, serif;
}

.la-glyph.is-word {
  font-size: clamp(42px, 9vw, 76px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.la-caption {
  max-width: 16rem;
  min-height: 1.2em;
  font: 500 14px/1.3 Inter, "Segoe UI", system-ui, sans-serif;
  color: #6d6862;
}

.la-caption:empty {
  display: none;
}

.la-speaker {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.4;
  pointer-events: none;
}

.la-status {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 44px;
  margin: 0;
  text-align: center;
  font: 500 15px/1.3 Inter, "Segoe UI", system-ui, sans-serif;
  color: #6d6862;
  pointer-events: none;
}

.la-grid {
  flex: 1;
  min-height: 42%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  background: #f3f2ef;
}

.la-choice {
  min-width: 0;
  border: 0;
  background: #2c2c2c;
  color: #f7f4ee;
  font-family: "EB Garamond", "Libre Baskerville", Georgia, serif;
  font-size: clamp(22px, 5.2vw, 38px);
  line-height: 1.1;
  text-align: center;
  padding: 0 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.15s ease;
}

.la-choice.is-long {
  font-size: clamp(20px, 4.4vw, 30px);
  padding: 0 8px;
}

.la-choice.is-glyph {
  font-size: clamp(64px, 14vw, 104px);
}

.la-choice:active:not(:disabled) {
  filter: brightness(1.18);
}

.la-choice:disabled {
  cursor: default;
  opacity: 1;
  color: #f7f4ee;
}

.la-choice.is-right:disabled,
.la-choice.is-wrong:disabled {
  color: #fff;
}

.la-choice:focus-visible,
.la-flyer:focus-visible,
.la-hear:focus-visible,
.la-row:focus-visible,
.la-back:focus-visible,
.la-primary:focus-visible,
.la-quiet:focus-visible,
.la-next:focus-visible {
  outline: 2px solid #1f8f4e;
  outline-offset: -3px;
}

.la-choice.is-right {
  background: #1f8f4e;
  color: #fff;
}

.la-choice.is-wrong {
  background: #c4453c;
  color: #fff;
}

.la-next {
  position: absolute;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 5;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  background: #f7f4ee;
  color: #1c1c1c;
  font: 600 16px/1 Inter, "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  -webkit-tap-highlight-color: transparent;
}

.la-next[hidden] {
  display: none !important;
}

.la-next:active {
  filter: brightness(0.92);
}

.la-done-view {
  background: #f3f2ef;
}

.la-done-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.la-done-kicker {
  margin: 0 0 12px;
  color: #6d6862;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.la-done-line {
  margin: 0;
  max-width: 16em;
  font-family: "EB Garamond", "Libre Baskerville", Georgia, serif;
  font-size: clamp(28px, 7vw, 46px);
  line-height: 1.15;
}

.la-done-round,
.la-done-all {
  margin: 10px 0 0;
  color: #6d6862;
  font-size: 16px;
}

.la-done-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
}

.la-primary,
.la-quiet {
  width: 100%;
  min-height: 52px;
  border: 0;
  cursor: pointer;
  font: 600 17px/1 Inter, "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.la-primary {
  background: #2c2c2c;
  color: #f7f4ee;
}

.la-quiet {
  background: transparent;
  color: #1c1c1c;
}

@keyframes la-bump {
  50% { transform: scale(1.16); }
}

.learn-alphabet > section.la-game-view {
  position: relative;
  background: #101018;
  padding-bottom: env(safe-area-inset-bottom);
}

.la-lane {
  position: relative;
  flex: 1.05;
  min-height: 0;
  overflow: hidden;
  background: #12121c;
  color: #f4f1ea;
}

.la-fx {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.la-sky {
  display: none;
  position: absolute;
  inset: 0 0 54px 0;
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.6px),
    radial-gradient(circle at 72% 22%, rgba(255, 255, 255, 0.4) 0 1px, transparent 1.6px),
    radial-gradient(circle at 40% 62%, rgba(255, 255, 255, 0.35) 0 1px, transparent 1.6px),
    radial-gradient(circle at 84% 48%, rgba(255, 255, 255, 0.45) 0 1px, transparent 1.6px),
    radial-gradient(circle at 56% 16%, rgba(255, 255, 255, 0.3) 0 1px, transparent 1.6px),
    linear-gradient(#161622, #101018);
  pointer-events: none;
}

.la-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 54px;
  z-index: 1;
  background: #101018;
  border-top: 0;
  box-shadow: 0 -2px 0 #00ffcc, 0 -8px 18px rgba(0, 255, 204, 0.5);
  pointer-events: none;
}

.la-cat {
  position: absolute;
  left: 4px;
  bottom: 28px;
  width: 128px;
  height: 128px;
  z-index: 2;
  background: url('../img/alphabet-cat.png?v=20261031-cat-grey') 0 0 / 1280px 128px no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  animation: la-cat-run 0.8s steps(10) infinite;
  pointer-events: none;
}

@keyframes la-cat-run {
  from { background-position: 0 0; }
  to { background-position: -1280px 0; }
}

.la-game-view .la-back {
  position: absolute;
  top: max(6px, env(safe-area-inset-top));
  left: 4px;
  z-index: 4;
  color: #f4f1ea;
}

.la-game-view .la-score-num { color: #f7f4ee; }
.la-game-view .la-score-label { color: #b7b3ac; }
.la-game-view .la-progress { z-index: 4; }

.la-flyer {
  position: absolute;
  bottom: 70px;
  z-index: 3;
  max-width: 70%;
  border: 0;
  background: transparent;
  color: #f7f4ee;
  padding: 6px 8px;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.la-fly-text {
  display: block;
  font-family: "EB Garamond", "Libre Baskerville", Palatino, Georgia, serif;
  font-size: clamp(72px, 16vw, 128px);
  line-height: 0.9;
  font-weight: 500;
  text-shadow: 0 2px 0 #000, 0 10px 24px rgba(0, 0, 0, 0.35);
}

.la-flyer.is-word .la-fly-text {
  font-size: clamp(32px, 7vw, 60px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.learn-alphabet[data-lang="hebrew"] .la-flyer:not(.is-word) .la-fly-text,
.learn-alphabet[data-lang="hebrew"] .la-game-view .la-choice.is-glyph {
  font-family: "David Libre", "Times New Roman", "Noto Serif Hebrew", David, serif;
}

.la-game-note {
  position: absolute;
  top: 76px;
  left: 16px;
  right: 16px;
  z-index: 4;
  margin: 0;
  text-align: center;
  font: 500 14px/1.3 Inter, "Segoe UI", system-ui, sans-serif;
  color: #d9d4cc;
  pointer-events: none;
}

.la-game-note:empty { display: none; }

.la-game-status {
  position: absolute;
  top: 52px;
  left: 48px;
  right: 16px;
  z-index: 4;
  margin: 0;
  text-align: center;
  font: 500 15px/1.3 Inter, "Segoe UI", system-ui, sans-serif;
  color: #d9d4cc;
  pointer-events: none;
}

.la-game-view .la-grid {
  flex: 1;
  min-height: 42%;
}

.la-game-view .la-progress { background: rgba(255, 255, 255, 0.14); }

.la-level,
.la-hearts,
.la-combo,
.la-banner {
  position: absolute;
  z-index: 5;
  pointer-events: none;
}

.la-level {
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  font: 700 13px/1 "Courier New", monospace;
  letter-spacing: 0.12em;
  color: #00ffcc;
}

.la-hearts {
  top: max(58px, calc(env(safe-area-inset-top) + 46px));
  right: 16px;
  font-size: 18px;
  letter-spacing: 3px;
  color: #2a2a3a;
}

.la-hearts i {
  font-style: normal;
}

.la-hearts i.is-on {
  color: #ff3366;
}

.la-combo {
  top: max(34px, calc(env(safe-area-inset-top) + 24px));
  left: 50%;
  transform: translateX(-50%);
  font: 700 18px/1 "Courier New", monospace;
  color: #ffcc00;
  text-shadow: 0 0 10px rgba(255, 204, 0, 0.45);
}

.la-banner {
  top: 42%;
  left: 50%;
  margin: 0;
  font: 800 clamp(36px, 9vw, 56px)/1 "Arial Black", "Segoe UI", sans-serif;
  color: #00ffcc;
  text-shadow: 0 0 18px rgba(0, 255, 204, 0.85);
  opacity: 0;
}

.la-banner.is-on {
  animation: la-banner 1.15s ease forwards;
}

@keyframes la-banner {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.82); }
  16% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  68% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -56%) scale(1.04); }
}

.la-flyer.is-burst .la-fly-text {
  animation: la-burst 0.38s ease forwards;
}

@keyframes la-burst {
  to { transform: scale(1.45); opacity: 0; }
}

.la-over {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  background: rgba(0, 0, 0, 0.94);
  text-align: center;
}

.la-over[hidden] { display: none; }

.la-over-title {
  margin: 0;
  font: 800 clamp(36px, 10vw, 52px)/1 "Arial Black", "Segoe UI", sans-serif;
  color: #ff2266;
  text-shadow: 0 0 16px rgba(255, 34, 102, 0.8);
}

.la-over-score {
  margin: 8px 0 0;
  font: 700 48px/1 "EB Garamond", Georgia, serif;
  color: #fff;
}

.la-over-best {
  margin: 0 0 12px;
  font: 700 16px/1.3 "Courier New", monospace;
  color: #ffcc00;
}

.la-over .la-primary {
  min-width: 180px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  font: 600 16px/1 Inter, "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .la-score-num.is-bump { animation: none; }
  .la-choice { transition: none; }
  .la-cat { animation: none; background-position: 0 0; }
  .la-banner.is-on { animation: none; opacity: 1; }
  .la-flyer.is-burst .la-fly-text { animation: none; opacity: 0; }
}

@media (max-height: 520px) {
  .la-glyph { font-size: clamp(64px, 16vh, 120px); }
  .la-glyph.is-word { font-size: clamp(32px, 8vh, 56px); }
  .la-grid { min-height: 46%; }
}

/* Three home buttons are the same size and share a phone screen.
   A short window, or a narrow one, keeps the labels and the letter
   rows inside the cards. */
@media (max-height: 700px) {
  .la-head { min-height: 48px; }
  .la-points { margin-bottom: 2px; }
  .la-charts { gap: 8px; padding-top: 2px; }
  .la-chart { padding: 6px 10px 8px; border-radius: 18px; }
  .la-chart-run { font-size: clamp(12px, min(4.6vw, 2.2svh), 20px); line-height: 1.1; letter-spacing: 0.04em; }
  .la-chart.is-hebrew .la-chart-run { font-size: clamp(11px, min(4.2vw, 2svh), 18px); }
  .la-chart-name { margin-top: 4px; }
}

@media (max-width: 360px) {
  .la-charts { padding-left: 12px; padding-right: 12px; }
  .la-chart-run { font-size: min(15px, 2.2svh); letter-spacing: 0.02em; }
  .la-chart.is-hebrew .la-chart-run { font-size: min(14px, 2svh); letter-spacing: 0.01em; }
  .la-chart-name,
  .la-chart.is-verses .la-chart-name { font-size: clamp(17px, 4.8vw, 22px); }
}

/* Night is data-theme=dark. OLED is data-theme=oled. Menus, the done
   screen, and flashcards use the same page colors as the reader.
   Light mode stays the cream cards above. The runner keeps its own sky. */
[data-theme="dark"] .learn-alphabet.is-on,
[data-theme="oled"] .learn-alphabet.is-on,
[data-theme="dark"] .learn-alphabet > section.la-menu-view,
[data-theme="dark"] .learn-alphabet > section.la-done-view,
[data-theme="dark"] .learn-alphabet > section.la-play-view,
[data-theme="oled"] .learn-alphabet > section.la-menu-view,
[data-theme="oled"] .learn-alphabet > section.la-done-view,
[data-theme="oled"] .learn-alphabet > section.la-play-view,
[data-theme="dark"] .la-prompt,
[data-theme="oled"] .la-prompt,
[data-theme="dark"] .la-play-view .la-grid,
[data-theme="oled"] .la-play-view .la-grid {
  background: var(--bg);
  color: var(--fg);
}

[data-theme="dark"] .la-head h2,
[data-theme="dark"] .la-modes-title,
[data-theme="dark"] .la-done-line,
[data-theme="dark"] .la-menu-view .la-back,
[data-theme="dark"] .la-done-view .la-back,
[data-theme="dark"] .la-play-view .la-back,
[data-theme="dark"] .la-play-view .la-score-num,
[data-theme="dark"] .la-row,
[data-theme="dark"] .la-quiet,
[data-theme="oled"] .la-head h2,
[data-theme="oled"] .la-modes-title,
[data-theme="oled"] .la-done-line,
[data-theme="oled"] .la-menu-view .la-back,
[data-theme="oled"] .la-done-view .la-back,
[data-theme="oled"] .la-play-view .la-back,
[data-theme="oled"] .la-play-view .la-score-num,
[data-theme="oled"] .la-row,
[data-theme="oled"] .la-quiet {
  color: var(--fg);
}

[data-theme="dark"] .la-points,
[data-theme="dark"] .la-mode-note,
[data-theme="dark"] .la-group,
[data-theme="dark"] .la-mode-status,
[data-theme="dark"] .la-done-kicker,
[data-theme="dark"] .la-done-round,
[data-theme="dark"] .la-done-all,
[data-theme="dark"] .la-row.is-soon,
[data-theme="dark"] .la-play-view .la-score-label,
[data-theme="dark"] .la-caption,
[data-theme="dark"] .la-status,
[data-theme="oled"] .la-points,
[data-theme="oled"] .la-mode-note,
[data-theme="oled"] .la-group,
[data-theme="oled"] .la-mode-status,
[data-theme="oled"] .la-done-kicker,
[data-theme="oled"] .la-done-round,
[data-theme="oled"] .la-done-all,
[data-theme="oled"] .la-row.is-soon,
[data-theme="oled"] .la-play-view .la-score-label,
[data-theme="oled"] .la-caption,
[data-theme="oled"] .la-status {
  color: var(--fg-secondary);
}

[data-theme="dark"] .la-row,
[data-theme="oled"] .la-row {
  border-bottom-color: var(--ui-chrome-border);
}

[data-theme="dark"] .la-row:active,
[data-theme="oled"] .la-row:active {
  background: var(--highlight);
}

[data-theme="dark"] .la-play-view .la-progress,
[data-theme="oled"] .la-play-view .la-progress {
  background: var(--highlight);
}

[data-theme="dark"] .la-play-view .la-choice:not(.is-right):not(.is-wrong),
[data-theme="oled"] .la-play-view .la-choice:not(.is-right):not(.is-wrong) {
  background: var(--ui-chrome);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--ui-chrome-border);
}

[data-theme="dark"] .la-done-view .la-primary,
[data-theme="oled"] .la-done-view .la-primary {
  background: var(--ui-chrome);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--ui-chrome-border);
}

[data-theme="dark"] .la-play-view .la-next,
[data-theme="oled"] .la-play-view .la-next {
  background: var(--fg);
  color: var(--bg);
}

[data-theme="dark"] .la-door-study,
[data-theme="oled"] .la-door-study,
[data-theme="dark"] .la-pair,
[data-theme="oled"] .la-pair,
[data-theme="dark"] .la-chart,
[data-theme="oled"] .la-chart {
  background: var(--ui-chrome);
  color: var(--fg);
}

[data-theme="dark"] .la-chart-count,
[data-theme="dark"] .la-chart-finals,
[data-theme="oled"] .la-chart-count,
[data-theme="oled"] .la-chart-finals {
  color: var(--fg-secondary);
}

[data-theme="dark"] .la-door-study .la-door-eye,
[data-theme="dark"] .la-door-study .la-door-sub,
[data-theme="oled"] .la-door-study .la-door-eye,
[data-theme="oled"] .la-door-study .la-door-sub,
[data-theme="dark"] .la-pair-dot,
[data-theme="oled"] .la-pair-dot {
  color: var(--fg-secondary);
}

[data-theme="dark"] .la-pair-acts button,
[data-theme="oled"] .la-pair-acts button {
  background: var(--ui-chrome-hover);
  color: var(--fg);
}
