/* Learning atlas, virtual science and a city that grows with the family. */
.academy-feature {
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 25px;
  border-radius: 24px;
  border: 1px solid #dddcca;
  margin: 22px 0;
  background: linear-gradient(120deg, #fff0cc, #f1e8f5);
}
.academy-feature h3 {
  margin: 6px 0;
  font: 500 28px Fredoka;
}
.academy-feature p {
  font-size: 14px;
  line-height: 1.6;
}
.academy-feature small {
  letter-spacing: 2px;
  font-size: 10px;
  font-weight: 700;
}
.academy-feature-icon {
  font-size: 52px;
}
.academy-feature > div {
  flex: 1;
}
.academy-science {
  background: linear-gradient(120deg, #e6f4e9, #e0edf5);
}
.academy-faith {
  background: linear-gradient(120deg, #f1e5f5, #fff0d9);
}
.academy-hero {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: clamp(22px, 4vw, 44px);
  border-radius: 28px;
  background: linear-gradient(120deg, #fff0d6, #f5e9ed);
  margin-bottom: 28px;
}
.academy-hero h2 {
  font: 500 clamp(28px, 3vw, 42px)/1.15 Fredoka;
  color: #4e6555;
  max-width: 650px;
}
.academy-hero p {
  line-height: 1.8;
  max-width: 740px;
}
.academy-hero-art {
  font-size: 100px;
  position: relative;
  padding: 22px;
}
.academy-hero-art span {
  position: absolute;
  color: #d2b360;
  font-size: 30px;
  top: 0;
  right: 0;
}
.academy-hero.academy-science {
  background: linear-gradient(120deg, #e6f3e5, #e3eef5);
}
.academy-hero.academy-faith {
  background: linear-gradient(120deg, #ede6f7, #f9efd7);
}
.academy-games {
  margin: 24px 0 35px;
}
.academy-games h3,
.academy-library h3 {
  font: 500 26px Fredoka;
}
.academy-game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.academy-game-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 12px;
  padding: 22px;
  background: #fffaf0;
  border: 1px solid #e3dbc7;
  border-radius: 22px;
  min-height: 190px;
  box-shadow: 0 5px 0 #e9e0cc55;
}
.academy-game-card > span {
  font-size: 35px;
}
.academy-game-card strong {
  font: 500 20px Fredoka;
}
.academy-game-card small {
  font-size: 13px;
  line-height: 1.6;
  color: #63726f;
}
.academy-library .controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
}
.academy-library label {
  flex: 1;
  min-width: 160px;
}
.academy-library input,
.academy-library select {
  width: 100%;
  max-width: 100%;
}
.academy-period {
  border: 1px solid #e2decc;
  border-radius: 18px;
  background: #fffdf4;
  margin: 12px 0;
  overflow: hidden;
}
.academy-period summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  cursor: pointer;
  list-style: none;
  min-height: 72px;
}
.academy-period summary::-webkit-details-marker {
  display: none;
}
.academy-period summary > span:first-child {
  font-size: 32px;
}
.academy-period summary > span:nth-child(2) {
  display: grid;
  gap: 7px;
  flex: 1;
}
.academy-period strong {
  font: 500 23px Fredoka;
}
.academy-period small {
  font-size: 12px;
  color: #728273;
}
.academy-chevron {
  transition: transform 0.2s;
}
.academy-period[open] .academy-chevron {
  transform: rotate(180deg);
}
.academy-period-body {
  border-top: 1px solid #e8e1cd;
  padding: 20px 24px;
  background: #fffaf0;
}
.academy-period-body p {
  line-height: 1.8;
  max-width: 76ch;
}
.academy-topic-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.academy-topic-list button {
  padding: 18px;
  text-align: left;
  background: #f0f3e6;
  display: grid;
  gap: 10px;
}
.academy-topic-list strong {
  font: 500 18px Fredoka;
}
.academy-topic-list small {
  font-size: 12px;
}
.academy-reader {
  max-width: 920px;
  margin: auto;
  background: #fffdf6;
  border: 1px solid #e5dfd0;
  border-radius: 26px;
  padding: clamp(18px, 3vw, 36px);
}
.academy-reader-title {
  display: flex;
  gap: 18px;
  align-items: center;
  margin: 24px 0;
}
.academy-reader-title > span {
  font-size: 48px;
}
.academy-reader-title h2 {
  font: 500 clamp(25px, 3vw, 38px) Fredoka;
  margin: 8px 0;
}
.academy-picture {
  margin: 0 0 25px;
}
.academy-picture svg {
  width: 100%;
  max-height: 340px;
  border-radius: 20px;
  display: block;
}
.academy-picture figcaption {
  font-size: 11px;
  text-align: center;
  color: #6c7c73;
  padding: 10px;
}
.academy-prose {
  font-size: 18px;
  line-height: 1.9;
  max-width: 70ch;
  margin: 24px auto;
}
.academy-wonder {
  border-left: 5px solid #a3b890;
  background: #eff4e7;
  border-radius: 12px;
  padding: 15px 22px;
  margin: 28px 0;
}
.academy-wonder h3 {
  font: 500 22px Fredoka;
}
.academy-wonder p {
  line-height: 1.8;
}
.academy-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 25px 0;
}
.academy-answer-grid button {
  padding: 22px;
  background: #f0f3e6;
  font-size: 18px;
}
.academy-quiz h2 {
  font: 500 27px Fredoka;
  line-height: 1.4;
}
.academy-quiz [role="status"] {
  font-size: 17px;
  line-height: 1.8;
}
.academy-sequence #sequenceChoices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 25px 0;
}
.academy-sequence #sequenceChosen {
  min-height: 100px;
  padding: 20px 20px 20px 45px;
  border-radius: 18px;
  background: #eef2e2;
}
.academy-sequence li {
  margin: 12px 0;
  line-height: 1.6;
}
.science-model-note {
  background: #eaf2e9;
  padding: 20px;
  border-radius: 18px;
  line-height: 1.7;
  margin-bottom: 20px;
}
.science-circuit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(230px, 1fr);
  gap: 20px;
}
.science-circuit-layout .panel {
  padding: 20px;
}
.science-circuit-layout label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 12px 0;
}
.science-circuit-layout .check-label {
  flex-direction: row;
  align-items: center;
  min-height: 44px;
}
.science-circuit-layout select {
  width: 100%;
}
.circuit-diagram svg {
  display: block;
  width: 100%;
  border-radius: 20px;
}
.circuit-measurements {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  line-height: 1.8;
  padding: 18px;
  background: #fff7dd;
  border-radius: 15px;
}
.circuit-measurements > span:last-child {
  flex-basis: 100%;
  font-size: 13px;
}
.science-challenge {
  margin-top: 20px;
}
.science-challenge p {
  line-height: 1.8;
}
.current-flow {
  stroke-dasharray: 14 7;
  animation: circuitFlow 1s linear infinite;
}
.logic-board {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 25px;
  background: #eaf2eb;
  padding: 30px;
  border-radius: 22px;
  margin: 22px 0;
}
.logic-board label {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 44px;
}
.logic-board strong {
  font: 500 35px Fredoka;
}
.logic-board output {
  font-size: 28px;
  border-radius: 16px;
  padding: 16px;
  background: #e0e6df;
}
.logic-board .logic-on {
  background: #f9dc80;
}
.logic-board [hidden] {
  display: none;
}
#logicTable table,
#rampResults table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0;
}
#logicTable th,
#logicTable td,
#rampResults th,
#rampResults td {
  border-bottom: 1px solid #dce4d4;
  padding: 12px;
  text-align: left;
}
.ramp-track {
  container-type: inline-size;
  height: 100px;
  background: linear-gradient(#e7f0e8 70%, #d2d5bf 70%);
  border-radius: 20px;
  margin: 25px 0;
  overflow: hidden;
  padding: 25px 5px;
}
.ramp-track span {
  display: block;
  font-size: 42px;
  transition: transform 1s ease-out;
  width: 50px;
}
.city-dashboard {
  background: linear-gradient(115deg, #e7f0df, #eee7f4);
  border: 1px solid #d8e2ca;
  padding: 24px;
  border-radius: 22px;
  margin: 20px 0;
}
.city-dashboard h3 {
  font: 500 30px Fredoka;
  margin: 12px 0;
}
.city-dashboard p {
  font-size: 13px;
  line-height: 1.8;
}
.city-directory {
  border-top: 1px solid #d4ddcb;
  margin-top: 20px;
  padding-top: 18px;
}
.city-directory summary {
  cursor: pointer;
  min-height: 44px;
  font-weight: 700;
}
.city-resident-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.city-resident-list > span {
  padding: 10px;
  background: #fff9e9;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.7;
}
.city-resident-list i {
  font-style: normal;
  font-size: 22px;
}
.city-learning-places {
  margin: 20px 0;
}
.city-learning-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.city-learning-grid button {
  display: grid;
  gap: 12px;
  text-align: left;
  padding: 18px;
  background: #f1f4e8;
}
.city-learning-grid button > span {
  width: 85px;
  height: 85px;
}
.city-learning-grid svg {
  width: 100%;
  height: 100%;
}
.city-learning-grid small {
  font-size: 12px;
  line-height: 1.7;
}
.village-grid {
  position: relative;
}
.city-expanded .town-lawn {
  overflow-x: auto;
}
.city-expanded .village-grid {
  min-width: 570px;
}
.city-walkers {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}
.city-person {
  position: absolute;
  width: 12px;
  height: 22px;
  transform: translate(-50%, -50%);
  animation: cityWalk 15s linear infinite;
  filter: drop-shadow(0 2px 1px #4f6b5533);
}
.city-head {
  position: absolute;
  left: 3px;
  top: 0;
  width: 8px;
  height: 8px;
  background: var(--skin);
  border-radius: 50%;
  z-index: 1;
}
.city-body {
  position: absolute;
  left: 2px;
  top: 7px;
  width: 10px;
  height: 12px;
  background: var(--person);
  border-radius: 5px 5px 3px 3px;
}
.city-body:after {
  content: "";
  position: absolute;
  left: 1px;
  top: 10px;
  width: 3px;
  height: 5px;
  background: #596f72;
  box-shadow: 5px 0 #596f72;
}
.town-paused .city-person,
.walkers-paused .city-person {
  animation-play-state: paused;
}
.city-place-lesson {
  margin: 12px;
  background: #e3e9d5;
  min-height: 44px;
}
@keyframes cityWalk {
  0%,
  100% {
    left: var(--x0);
    top: var(--y0);
  }
  16.666% {
    left: var(--x1);
    top: var(--y1);
  }
  33.333% {
    left: var(--x2);
    top: var(--y2);
  }
  50% {
    left: var(--x3);
    top: var(--y3);
  }
  66.666% {
    left: var(--x4);
    top: var(--y4);
  }
  83.333% {
    left: var(--x5);
    top: var(--y5);
  }
}
@keyframes circuitFlow {
  to {
    stroke-dashoffset: -21;
  }
}
@media (max-width: 850px) {
  .academy-game-grid,
  .city-learning-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .science-circuit-layout {
    grid-template-columns: 1fr;
  }
  .academy-topic-list {
    grid-template-columns: 1fr;
  }
  .academy-hero-art {
    font-size: 70px;
  }
  .academy-feature {
    flex-wrap: wrap;
  }
  .academy-feature > button {
    width: 100%;
  }
  .city-resident-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .academy-game-grid,
  .academy-answer-grid,
  .city-learning-grid {
    grid-template-columns: 1fr;
  }
  .academy-hero-art {
    display: none;
  }
  .academy-reader {
    padding: 17px;
  }
  .academy-prose {
    font-size: 17px;
  }
  .academy-library .controls {
    display: grid;
    grid-template-columns: 1fr;
  }
  .academy-library label {
    min-width: 0;
  }
  .academy-period summary {
    padding: 16px;
    gap: 10px;
  }
  .academy-period strong {
    font-size: 20px;
  }
  .city-dashboard {
    padding: 18px;
  }
  .city-resident-list {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .city-person,
  .current-flow {
    animation: none;
  }
  .city-person {
    left: var(--x0);
    top: var(--y0);
  }
  .ramp-track span {
    transition: none;
  }
  .academy-chevron {
    transition: none;
  }
}

.academy-progress {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  background: #edf3e6;
  border-radius: 18px;
  padding: 18px;
  margin: 20px 0;
  color: #506c54;
}
.academy-progress small {
  flex-basis: 100%;
  font-size: 11px;
}
.academy-progress > span {
  background: #fff9e9;
  padding: 8px 13px;
  border-radius: 20px;
  font-size: 13px;
}
