/* The Sounds page (sounds.html), on top of css/reader.css: the same bars, buttons,
   book print and sound marks as the reading books. Laid out for an iPad held
   either way, with phones upright and on their side. */

/* ---- The sets ---- */

.sounds-home { overflow-y: auto; padding: 0 24px 32px; }

.set-jump { align-items: center; }
.set-year-label { flex: none; color: var(--muted); font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.set-jump .level-chip { font-size: 24px; }
.set-jump .level-chip[aria-pressed="true"] { border-color: var(--subject-dark, var(--accent)); background: var(--subject-dark, var(--accent)); color: #fff; }
/* The set the child is learning now wears a little target. */
.set-jump .level-chip.learning { position: relative; }
.set-jump .level-chip.learning::after { content: '🎯'; position: absolute; top: -6px; right: -6px; font-size: 16px; line-height: 1; }

.set-head { display: grid; justify-items: center; gap: 6px; margin: 10px 0 20px; text-align: center; }
.set-name { margin: 0; font: 400 40px/1.1 var(--book); }
.set-sounds { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; margin: 0; font: 400 72px/1.2 var(--book); }
.set-shape { font-size: 36px; }
.set-about { margin: 0; color: var(--muted); font-size: 16px; font-weight: 600; }
.learning-toggle {
  min-height: 48px;
  margin-top: 6px;
  padding: 0 18px;
  border: 2px dashed var(--line);
  border-radius: 24px;
  background: #fff;
  font: 700 16px/1 var(--ui);
}
.learning-toggle[aria-pressed="true"] { border-style: solid; border-color: var(--accent); color: var(--accent); }

.activities { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.activity {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 150px;
  padding: 16px 12px;
  border: 0;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}
.activity-icon { font-size: 50px; line-height: 1.1; }
.activity[data-activity="tricky"] .activity-icon { color: var(--heart); }
.activity-name { font: 400 28px/1.15 var(--book); }
.activity-note { color: var(--muted); font-size: 15px; font-weight: 600; }
.activity:active, .sound-card:active, .picture-choice:active:not(:disabled), .tile:active:not(:disabled),
.tricky-word:active, .learning-toggle:active { transform: scale(0.94); filter: brightness(0.92); }

/* ---- An activity ---- */

.activity-screen {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 20px;
  padding: 20px 24px 32px;
  overflow-y: auto;
  text-align: center;
}
/* Centred while it fits; from the top once it scrolls (a phone on its side cut the top off). */
.activity-screen.blend, .activity-screen.build { align-content: start; align-content: safe center; }
.round-count { margin: 0; color: var(--muted); font-weight: 700; }

/* A word with its sound marks; the bottom padding leaves room for the marks. */
.big-word { padding: 0 0.15em 0.12em; font: 400 96px/1.3 var(--book); }

.sound-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; width: min(100%, 940px); }
.sound-card {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 12px 12px 18px;
  border: 3px solid transparent;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}
.sound-card.saying { border-color: var(--accent); background: var(--now); }
.card-grapheme { font: 400 92px/1.1 var(--book); }
.card-picture { font-size: 52px; line-height: 1.2; }
.card-word { font: 400 34px/1.3 var(--book); color: var(--muted); }
.card-word .target { color: var(--accent); text-decoration: underline 0.08em; text-underline-offset: 0.12em; }

.blend-word { display: flex; align-items: center; gap: 16px; }
.picture-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.picture-choice {
  width: 150px;
  height: 150px;
  padding: 0;
  border: 4px solid var(--line);
  border-radius: 28px;
  background: #fff;
  font-size: 88px;
  line-height: 1;
}
.picture-choice.right { border-color: var(--right); background: #e6f6ec; }
.picture-choice.wrong { border-color: var(--wrong); opacity: 0.4; animation: shake 0.35s; }

.build-prompt { display: flex; align-items: center; gap: 20px; }
.build-picture { font-size: 96px; line-height: 1; }
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 100px; }
.slot {
  display: grid;
  place-items: center;
  min-width: 84px;
  height: 100px;
  padding: 0 10px;
  border: 3px dashed var(--line);
  border-radius: 18px;
  font: 400 64px/1 var(--book);
}
.slot.filled { border-style: solid; border-color: var(--accent); background: #fff; }
.slots.built { gap: 0; }
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; max-width: 760px; }
.tile {
  min-width: 84px;
  height: 84px;
  padding: 0 14px;
  border: 3px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
  font: 400 50px/1 var(--book);
}
.tile.used { visibility: hidden; }
.tile.nope { animation: shake 0.35s; border-color: var(--wrong); }

.tricky-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.tricky-word { padding: 6px 28px 14px; border: 3px solid transparent; border-radius: 24px; background: #fff; box-shadow: var(--shadow); font: 400 72px/1.3 var(--book); }
.tricky-word.saying { border-color: var(--accent); background: var(--now); }
.tricky-words.small .tricky-word { padding: 2px 18px 10px; font-size: 40px; }
.earlier { display: grid; gap: 10px; justify-items: center; }
.earlier h3 { margin: 12px 0 0; color: var(--muted); font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---- Phonics Check practice ---- */

.check-intro { display: grid; align-content: start; gap: 16px; width: min(100%, 780px); margin: 0 auto; padding: 20px 24px; overflow-y: auto; font-size: 19px; }
.check-warning { margin: 0; padding: 12px 16px; border-left: 6px solid var(--ks-sun, #e5a50a); border-radius: 10px; background: #fff6dc; font-weight: 700; }
.check-how { display: grid; gap: 10px; margin: 0; padding-left: 22px; }
.past-checks h3 { margin: 6px 0; color: var(--muted); font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; }
.past-checks ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.past-checks li { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 14px; border-radius: 14px; background: #fff; }
.past-split { color: var(--muted); }

.check-word { display: grid; align-content: start; align-content: safe center; justify-items: center; gap: 24px; padding: 20px; }
.check-section { margin: 0; color: var(--muted); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.check-card {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: min(90vw, 460px);
  justify-content: center;
  padding: 24px 56px 36px;
  border-radius: 32px;
  background: #fff;
  box-shadow: var(--shadow);
}
.check-text { font: 400 128px/1.2 var(--book); }
.alien { width: 120px; height: 120px; flex: none; }
.check-progress { width: min(600px, 90%); height: 10px; overflow: hidden; border-radius: 5px; background: var(--line); }
.check-progress span { display: block; height: 100%; background: var(--accent); }
.check-marks { justify-content: center; }
.big.mark-wrong { border-color: var(--wrong); color: var(--wrong); }
.big.mark-right { border-color: var(--right); background: var(--right); color: #fff; }

/* A long list of words to practise can be taller than the screen: start at the top, so all of it scrolls into view. */
.check-done { align-content: start; }
.check-done h2 { font-size: 64px; }
.controls.centred { justify-content: center; }
.verdict { margin: 0; max-width: 640px; font-size: 22px; font-weight: 700; }
.verdict.expected { color: var(--right); }
.check-done .check-warning { font-size: 16px; }
.missed-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 12px; }
.missed { display: inline-flex; align-items: center; gap: 6px; padding: 4px 16px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); font: 400 34px/1.3 var(--book); }
.missed .alien { width: 34px; height: 34px; }

@media (prefers-reduced-motion: reduce) {
  .picture-choice.wrong, .tile.nope { animation: none; }
}

/* ---- Phones: held upright (narrow) or on their side (short) ---- */

@media (max-width: 600px), (max-height: 500px) {
  .sounds-home { padding: 0 14px 24px; }
  .set-jump { flex-wrap: nowrap; }
  .set-jump .level-chip { font-size: 20px; }
  .set-head { margin: 6px 0 14px; }
  .set-name { font-size: 30px; }
  .set-sounds { gap: 2px 16px; font-size: 48px; }
  .set-shape { font-size: 26px; }
  .activities { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .activity { min-height: 110px; padding: 10px 8px; border-radius: 18px; }
  .activity-icon { font-size: 36px; }
  .activity-name { font-size: 21px; }
  .activity-note { font-size: 13px; }

  .activity-screen { gap: 14px; padding: 12px 14px 20px; }
  .big-word { font-size: 64px; }
  .sound-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .card-grapheme { font-size: 64px; }
  .card-picture { font-size: 38px; }
  .card-word { font-size: 24px; }
  .picture-choices { gap: 12px; }
  .picture-choice { width: 100px; height: 100px; border-radius: 20px; font-size: 58px; }
  .build-picture { font-size: 64px; }
  .slot { min-width: 56px; height: 70px; padding: 0 6px; border-radius: 14px; font-size: 42px; }
  .tiles { gap: 10px; }
  .tile { min-width: 60px; height: 60px; padding: 0 10px; border-radius: 16px; font-size: 36px; }
  .tricky-word { padding: 4px 18px 10px; font-size: 48px; }
  .tricky-words.small .tricky-word { font-size: 30px; }

  .check-intro { padding: 14px; font-size: 16px; }
  .check-word { gap: 14px; padding: 12px; }
  .check-card { gap: 16px; padding: 14px 24px 22px; }
  .check-text { font-size: 76px; }
  .alien { width: 76px; height: 76px; }
  .check-done h2 { font-size: 40px; }
  .verdict { font-size: 18px; }
  .missed { font-size: 24px; }
}

/* Phone on its side: little height, so the big things shrink again. */
@media (max-height: 500px) {
  .set-sounds { font-size: 40px; }
  .activities { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .activity { min-height: 96px; }
  .activity-screen.blend, .activity-screen.build { gap: 8px; }
  .big-word { font-size: 52px; }
  .picture-choice { width: 84px; height: 84px; font-size: 48px; }
  .build-picture { font-size: 48px; }
  .slot { height: 58px; font-size: 36px; }
  .tile { height: 52px; min-width: 52px; font-size: 30px; }
  .check-text { font-size: 60px; }
  .alien { width: 60px; height: 60px; }
  .check-done::before { display: none; }
  .card-grapheme { font-size: 52px; }
}
