/* ph.css: lane PH styles for /practice/phonics/. Works on top of kid.css (body.kid-young) and also on its own.
   Colour pairs: ink #121212 on tints (soft red/yellow/blue/green) and white are all well above 4.5:1; red-ink #8e2b25 on white about 8:1. */
.ph-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 18px 16px 72px;
  --ph-ink: #121212;
  --ph-read: var(
    --k-read,
    "Andika",
    "Atkinson Hyperlegible",
    Figtree,
    system-ui,
    sans-serif
  );
}
.ph-page h1 {
  margin: 6px 0 10px;
}
.ph-eyebrow {
  display: inline-block;
  margin: 6px 0 0;
  padding: 4px 12px;
  border-radius: 999px;
  font: 800 0.8rem var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 2px solid var(--ph-ink);
  color: var(--ph-ink);
}
.ph-p2 {
  --ph-tint: #e3f3ea;
}
.ph-p3 {
  --ph-tint: #e9eefc;
}
.ph-p4 {
  --ph-tint: #fdf4d6;
}
.ph-p5 {
  --ph-tint: #fbe7e5;
}
.ph-eyebrow {
  background: var(--ph-tint, #fff);
}
.ph-kit {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #dce7ff;
  border: 3px solid var(--ph-ink);
}
.ph-sec {
  margin: 34px 0;
}
.ph-h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.ph-h2 h2 {
  margin: 0;
}
.ph-h2s {
  margin: 24px 0 8px;
}
.ph-note {
  font: 600 0.8em var(--sans);
  color: #4a4a4a;
  margin: 6px 0 14px;
}
.ph-fig {
  margin: 18px 0;
}
.ph-scene {
  display: block;
  width: 100%;
  height: auto;
  border: 3px solid var(--ph-ink);
  border-radius: 22px;
  background: #fff7ed;
}

/* grapheme cards */
.ph-cards {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 118px), 1fr));
  gap: 12px;
}
.ph-card {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 118px;
  padding: 10px 8px;
  background: #fff;
  border: 3px solid var(--ph-ink);
  border-radius: 22px;
  box-shadow: 0 6px 0 rgba(18, 18, 18, 0.16);
  cursor: pointer;
  text-align: center;
}
.ph-card:hover {
  background: #fdf4d6;
}
.ph-card:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 rgba(18, 18, 18, 0.16);
}
.ph-card[data-playing],
.ph-card.playing {
  background: #fdf4d6;
}
.ph-gl {
  font: 800 2.8rem/1.1 var(--ph-read);
  color: var(--ph-ink);
}
.ph-cap {
  font: 600 0.75rem/1.2 var(--sans);
  color: #4a4a4a;
}
.ph-trk {
  color: #8e2b25;
  text-decoration: underline wavy #8e2b25 2px;
  text-underline-offset: 6px;
  font-weight: 800;
}
.ph-twgrid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
}
.ph-twgrid .ph-gl {
  font-size: 2rem;
}

/* picture tiles */
.ph-tiles {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 14px;
}
.ph-tile {
  padding: 10px;
  align-items: center;
}
.ph-tilebody {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding-bottom: 6px;
}
.ph-img,
.ph-slot {
  width: 100%;
  max-width: 170px;
  aspect-ratio: 1;
  border-radius: 16px;
  object-fit: contain;
  background: #fff7ed;
}
.ph-slot {
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(
    45deg,
    #fff7ed,
    #fff7ed 10px,
    #fdf4d6 10px,
    #fdf4d6 20px
  );
  border: 3px dashed #8c8c86;
  font: 800 1.6rem var(--ph-read);
  color: var(--ph-ink);
  text-align: center;
  padding: 6px;
}
.ph-tile .k-say {
  position: static;
  align-self: center;
}
.ph-tile .k-label {
  font: 800 1.3rem var(--ph-read);
}
.ph-cover {
  aspect-ratio: 4/3;
  max-width: 100%;
}

/* tap to blend */
.ph-rows {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.ph-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 3px solid var(--ph-ink);
  border-radius: 22px;
  box-shadow: 0 6px 0 rgba(18, 18, 18, 0.12);
}
.ph-word {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex: 1 1 160px;
  min-width: 0;
}
.ph-g {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 52px;
  min-height: 64px;
  padding: 6px 8px 4px;
  border-radius: 14px;
  font: 800 2.4rem/1.1 var(--ph-read);
  color: var(--ph-ink);
  cursor: pointer;
  border: 3px solid transparent;
}
.ph-g:hover {
  background: #fdf4d6;
}
.ph-g.lit {
  background: #fdf4d6;
  border-color: var(--ph-ink);
}
.ph-g::after,
.ph-t::after {
  content: "";
  display: block;
  margin-top: 4px;
  background: transparent;
}
.ph-g.ph-dot::after {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ph-ink);
}
.ph-g.ph-bar::after {
  width: 100%;
  min-width: 24px;
  height: 6px;
  border-radius: 3px;
  background: var(--ph-ink);
}
.ph-g.split.a::after,
.ph-g.split.e::after {
  background: #2d5bd7;
}
.ph-g.silent {
  color: #5c5c5c;
}
.ph-bigword {
  justify-content: center;
  margin: 18px 0;
}
.ph-bigword .ph-g {
  font-size: 3.2rem;
  min-width: 64px;
  min-height: 84px;
}
.ph-sentence {
  font: 800 clamp(1.5rem, 5vw, 2.1rem)/1.6 var(--ph-read);
  margin: 10px 0;
}
.ph-actions {
  margin: 10px 0 6px;
}

/* books */
.ph-pages {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  display: grid;
  gap: 26px;
}
.ph-js .ph-pg[hidden] {
  display: none;
}
.ph-pg {
  display: block;
}
.ph-text {
  font: 700 clamp(1.7rem, 6.2vw, 2.2rem)/2.1 var(--ph-read);
  margin: 14px 0;
}
.ph-bw {
  all: unset;
  box-sizing: border-box;
  display: inline-block;
  text-align: center;
  padding: 0 0.1em;
  margin: 0 0.04em;
  border-radius: 10px;
  cursor: pointer;
  vertical-align: bottom;
}
.ph-bw:hover {
  background: #fdf4d6;
}
.ph-bw.tricky {
  text-decoration: underline dotted #8e2b25 3px;
  text-underline-offset: 8px;
}
.ph-t {
  display: inline-block;
  text-align: center;
}
.ph-sounds .ph-t.ph-dot::after {
  width: 0.3em;
  height: 0.3em;
  border-radius: 50%;
  background: var(--ph-ink);
  margin-left: auto;
  margin-right: auto;
}
.ph-sounds .ph-t.ph-bar::after {
  width: 100%;
  height: 0.14em;
  border-radius: 0.1em;
  background: var(--ph-ink);
}
.ph-sounds .ph-t.split::after {
  background: #2d5bd7;
}
.ph-bookbar {
  margin: 12px 0;
}
.ph-pager {
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
}
.ph-count {
  font: 800 1rem var(--sans);
}
.ph-end {
  margin: 14px 0;
}

/* tricky words and flash cards */
.ph-flash {
  text-align: center;
}
.ph-flashcard {
  font: 800 clamp(3rem, 14vw, 5.5rem)/1.2 var(--ph-read);
  background: #fff;
  border: 3px solid var(--ph-ink);
  border-radius: 28px;
  padding: 28px 12px;
  margin: 14px 0;
  box-shadow: 0 6px 0 rgba(18, 18, 18, 0.16);
}
.ph-flash .k-row {
  justify-content: center;
}

/* hub */
.ph-ph {
  display: inline-block;
  margin: 22px 0 4px;
  padding: 3px 14px;
  border-radius: 999px;
  background: var(--ph-tint);
  border: 2px solid var(--ph-ink);
  font: 800 1rem var(--sans);
}
.ph-settiles {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 14px;
  margin: 8px 0;
}
.ph-settile {
  background: var(--ph-tint);
}
.ph-settile .k-tile-link {
  align-items: center;
  text-align: center;
  padding: 14px 8px 12px;
  gap: 4px;
  background: transparent;
}
.ph-settile .k-tile-link:hover {
  background: rgba(255, 255, 255, 0.6);
}
.ph-setnum {
  font: 800 0.95rem var(--sans);
}
.ph-setg {
  font: 800 1.6rem/1.1 var(--ph-read);
  word-spacing: 0.1em;
}
.ph-settile .k-say {
  top: 6px;
  right: 6px;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
}
.ph-settile .k-say {
  position: static;
  margin: 0 auto 10px;
}
.ph-ico {
  margin: 0 auto;
}

/* games */
.ph-levels {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 92px), 1fr));
  gap: 10px;
}
.ph-level {
  width: 100%;
  padding: 8px 6px;
}
.ph-lvn {
  font: 800 1.7rem var(--ph-read);
}
.ph-lvg {
  font: 700 0.7rem var(--sans);
  color: #4a4a4a;
  word-spacing: 0.1em;
}
.ph-roundhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.ph-lvl {
  font: 800 0.9rem var(--sans);
}
.ph-dots {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ph-dots li {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--ph-ink);
  background: #fff;
}
.ph-dots li.done {
  background: #257a4e;
}
.ph-dots li.now {
  background: #f2c230;
}
.ph-picks {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
}
.ph-pickbtn {
  padding: 8px;
}
.ph-pickbtn .ph-img,
.ph-pickbtn .ph-slot {
  max-width: 150px;
}
.ph-fb {
  min-height: 2.2em;
  margin: 12px 0 4px;
  font: 800 1.1rem var(--sans);
}
.ph-fb.good {
  color: #1b5a39;
}
.ph-fb.soft {
  color: #1f3b8c;
}
.ph-after {
  margin: 8px 0;
}
.ph-balloons {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  justify-items: center;
}
.ph-balloons li {
  width: 100%;
  display: flex;
  justify-content: center;
}
.ph-balloon {
  all: unset;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: min(100%, 150px);
  aspect-ratio: 5/6;
  border-radius: 50% 50% 48% 48% / 55% 55% 45% 45%;
  border: 3px solid var(--ph-ink);
  font: 800 2.6rem var(--ph-read);
  color: var(--ph-ink);
  cursor: pointer;
  position: relative;
  box-shadow: 0 6px 0 rgba(18, 18, 18, 0.14);
}
.ph-balloon::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 50%;
  width: 3px;
  height: 14px;
  background: var(--ph-ink);
}
.ph-balloon.b0 {
  background: #fbe7e5;
}
.ph-balloon.b1 {
  background: #fdf4d6;
}
.ph-balloon.b2 {
  background: #e9eefc;
}
.ph-balloon.b3 {
  background: #e3f3ea;
}
.ph-balloon.try {
  opacity: 0.45;
  border-style: dashed;
}
.ph-balloon.ok {
  box-shadow: 0 0 0 4px #257a4e;
}
.ph-slots {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.ph-slotbtn {
  all: unset;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  min-width: 72px;
  height: 84px;
  padding: 0 10px;
  border: 3px dashed #8c8c86;
  border-radius: 18px;
  background: #fff;
  font: 800 2.6rem var(--ph-read);
  cursor: pointer;
}
.ph-slotbtn.filled {
  border-style: solid;
  border-color: var(--ph-ink);
  background: #fdf4d6;
}
.ph-slotbtn.ok {
  background: #e3f3ea;
  border-color: #257a4e;
}
.ph-tray {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.ph-tile2 {
  min-width: 72px;
  width: auto;
  font-size: 2.2rem;
}
.ph-buildpic {
  max-width: 180px;
}
.ph-yn .k-choice {
  flex-direction: row;
  gap: 12px;
  font-size: 1.3rem;
}
.ph-real.ok,
.ph-alien.ok {
  box-shadow: 0 0 0 4px #257a4e;
}
.ph-finish {
  text-align: center;
}
.ph-stars {
  font-size: 3.4rem;
  letter-spacing: 0.1em;
  color: #8a5f00;
  margin: 8px 0;
}
.ph-finish .k-row {
  justify-content: center;
}

@media (max-width: 560px) {
  .ph-page {
    padding: 12px 12px 60px;
  }
  .ph-gl {
    font-size: 2.4rem;
  }
  .ph-g {
    font-size: 2rem;
    min-width: 46px;
    padding: 6px 4px 4px;
  }
  .ph-bigword .ph-g {
    font-size: 2.6rem;
    min-width: 52px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .ph-balloon {
    transition: transform 0.15s;
  }
  .ph-balloon:hover {
    transform: translateY(-3px);
  }
  .ph-balloon.popped {
    animation: ph-pop 0.35s ease-out forwards;
  }
  @keyframes ph-pop {
    0% {
      transform: scale(1);
    }
    40% {
      transform: scale(1.18);
    }
    100% {
      transform: scale(1);
      box-shadow: 0 0 0 4px #257a4e;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .ph-balloon.popped {
    box-shadow: 0 0 0 4px #257a4e;
  }
}
.ph-blend {
  padding: 0 !important;
  width: 56px;
  min-width: 56px;
}
.ph-word {
  flex: 1 1 110px;
}
.ph-pager {
  flex-wrap: nowrap;
}
.ph-pager .k-btn {
  padding: 8px 16px;
}
.ph-bw {
  min-width: 48px;
}
