:root {
  font-family: "Trebuchet MS", Arial, sans-serif;
  color: #243029;
  background: #78877a;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 1180px;
  min-height: 100vh;
  margin: 0;
  background: #78877a;
}

body.student-active {
  height: 100vh;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 4px solid #f5cf57;
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 42px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.brand,
.quiet-button,
.text-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  color: #f7f3e8;
  font-size: 1.15rem;
  font-weight: 700;
}

.brand-mark {
  color: #f5cf57;
  font-size: 1.6rem;
}

.quiet-button {
  padding: 12px 16px;
  color: #f7f3e8;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
}

.screen {
  min-height: calc(100vh - 76px);
  padding: 30px;
}

#student-screen {
  height: calc(100vh - 76px);
  min-height: 0;
  overflow: hidden;
  padding: 16px 24px;
}

.login-screen,
#track-screen,
#start-screen {
  display: grid;
  place-items: center;
}

.login-card,
.content-card,
.progress-card,
.activity-card,
.teacher-panel {
  background: #f4f0e6;
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(31, 43, 35, 0.16);
}

.login-card {
  width: min(520px, 80vw);
  padding: 46px 56px 52px;
  text-align: center;
}

.welcome-symbol {
  color: #d99b35;
  font-size: 4rem;
  line-height: 1;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 2.35rem;
}

.short-instruction,
.teacher-explanation {
  color: #59665d;
  font-size: 1.1rem;
  line-height: 1.5;
}

form {
  margin-top: 34px;
  text-align: left;
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

input {
  width: 100%;
  padding: 18px;
  border: 2px solid #97a196;
  border-radius: 12px;
  background: #fffefa;
  color: #243029;
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.form-message {
  min-height: 24px;
  margin: 8px 0;
  color: #695c3e;
  text-align: center;
}

.primary-button,
.secondary-button {
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  padding: 14px 24px;
  background: #365c4b;
  color: white;
  font-size: 1.15rem;
}

.secondary-button {
  padding: 12px 20px;
  border: 2px solid #68776c;
  background: transparent;
}

.compact {
  display: block;
  width: auto;
  margin: 18px auto 0;
}

.track-card {
  min-width: 820px;
  padding: 48px;
  text-align: center;
}

.start-card {
  min-width: 650px;
  padding: 46px;
  text-align: center;
}

.start-avatar {
  display: grid;
  place-items: center;
  min-height: 140px;
}

.start-avatar .evolving-object {
  width: 130px;
  height: 130px;
}

.start-options {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.start-option {
  display: grid;
  gap: 12px;
  place-items: center;
  min-width: 270px;
  min-height: 150px;
  padding: 20px;
  border: 3px solid #a8b0a7;
  border-radius: 20px;
  background: #fffefa;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
}

.completed-level-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.completed-level-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 10px 16px;
  border: 2px solid #a8b0a7;
  border-radius: 10px;
  background: #fffefa;
  color: #46594e;
  cursor: pointer;
  font-weight: 700;
}

.completed-level-button:hover {
  border-color: #365c4b;
}

.start-option:hover {
  border-color: #365c4b;
}

.start-option-icon {
  color: #365c4b;
  font-size: 3.3rem;
  line-height: 1;
}

.eyebrow {
  margin-bottom: 8px;
  color: #667269;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.track-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 36px;
}

.track-button {
  display: grid;
  gap: 14px;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  border: 3px solid #a8b0a7;
  border-radius: 20px;
  background: #fffefa;
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: 700;
}

.track-button:hover {
  border-color: #365c4b;
  transform: translateY(-2px);
}

.track-icon {
  font-size: 5.5rem;
}

.object-choice-panel {
  text-align: left;
}

.object-choice-panel > .eyebrow,
.object-choice-panel > h2 {
  text-align: center;
}

.object-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.object-choice-button {
  display: grid;
  gap: 12px;
  place-items: center;
  min-height: 200px;
  padding: 22px;
  border: 3px solid #a8b0a7;
  border-radius: 20px;
  background: #fffefa;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
}

.object-choice-button:hover {
  border-color: #365c4b;
}

.initial-sound-setting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 28px 0 0;
  color: #46594e;
  cursor: pointer;
}

.initial-sound-setting input {
  width: 24px;
  height: 24px;
  accent-color: #365c4b;
}

.student-layout {
  display: grid;
  grid-template-columns: 230px 1050px 130px;
  gap: 28px;
  justify-content: center;
}

#student-screen .student-layout {
  transform-origin: top center;
}

.progress-card {
  align-self: start;
  padding: 30px 24px;
  text-align: center;
}

.current-avatar {
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  min-height: 140px;
  margin: 0 auto;
  border-radius: 20px;
  background: #2478d2;
  filter: none;
  font-size: 6rem;
  transition: transform 260ms ease, filter 260ms ease;
}

.current-avatar.evolving {
  filter: none;
  transform: scale(1.12);
}

.evolution-label {
  min-height: 38px;
  margin-bottom: 8px;
  color: #59665d;
  font-size: 0.9rem;
  line-height: 1.3;
}

.student-code-heading {
  margin-bottom: 22px;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
}

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-bottom: 25px;
}

.progress-dot {
  width: 18px;
  height: 18px;
  border: 2px solid #718076;
  border-radius: 50%;
}

.progress-dot.complete {
  border-color: #365c4b;
  background: #365c4b;
}

.text-button {
  padding: 8px;
  color: #46594e;
  text-decoration: underline;
}

.activity-card {
  position: relative;
  padding: 20px 24px 24px;
  text-align: center;
}

.activity-title {
  margin-bottom: 10px;
  font-size: 1.6rem;
}

.activity-heading .eyebrow {
  margin-bottom: 5px;
}

.placement-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-height: 16px;
  margin-bottom: 14px;
}

.placement-dot {
  width: 14px;
  height: 14px;
  border: 2px solid #718076;
  border-radius: 50%;
}

.placement-dot.complete {
  border-color: #365c4b;
  background: #365c4b;
}

.play-area {
  position: relative;
  width: 1000px;
  height: 530px;
  overflow: hidden;
  border-radius: 18px;
  background: #dfe5dd;
}

.path-board,
.journey-board {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.path-board {
  z-index: 5;
}

.path-line {
  position: absolute;
  z-index: 1;
  height: 100px;
  border-radius: 999px;
  background: #287fc4;
  transform-origin: left center;
}

.path-point {
  position: absolute;
  z-index: 2;
  width: 100px;
  height: 100px;
  border-radius: 16px;
  background: #287fc4;
  transform: translate(-50%, -50%);
}

.journey-board {
  display: none;
}

.play-area.level-4::after {
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 50%;
  width: 2px;
  content: "";
  background: #aeb8b0;
}

.play-area.level-4 .journey-board {
  display: block;
  inset: 0 0 0 50%;
  border-radius: 0 18px 18px 0;
  background: rgba(255, 255, 255, 0.22);
}

.play-area.level-2 .journey-actor,
.play-area.level-3 .journey-actor {
  z-index: 2;
  filter: grayscale(0.35) saturate(0.7);
}

.draggable-block {
  position: absolute;
  z-index: 6;
  left: 90px;
  top: 145px;
  width: 100px;
  height: 100px;
  border: 0;
  border-radius: 18px;
  background: #2478d2;
  box-shadow: none;
  cursor: grab;
  touch-action: none;
  transition: left 320ms ease, top 320ms ease, transform 160ms ease, opacity 200ms ease;
}

.block-object {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 4rem;
  line-height: 1;
  pointer-events: none;
}

.placed-piece::after {
  position: absolute;
  z-index: 5;
  color: white;
  content: "➤";
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: none;
  pointer-events: none;
}

.placed-piece.direction-up::after {
  transform: rotate(-90deg);
}

.placed-piece.direction-down::after {
  transform: rotate(90deg);
}

.evolving-object {
  position: relative;
  display: inline-grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border-radius: 24px;
  transform: scale(0.78);
  transition: transform 260ms ease, background 260ms ease;
}

.object-emoji {
  position: relative;
  z-index: 2;
  font-size: 3.7rem;
  line-height: 1;
}

.object-bicycle .object-emoji {
  transform: translateX(-4px);
}

.stage-2 {
  transform: scale(0.86);
}

.stage-3 {
  transform: scale(0.92);
}

.stage-4 {
  transform: scale(0.97);
}

.stage-5 {
  transform: scale(1.04);
}

.object-flower,
.object-tree,
.object-cactus {
  filter: saturate(1.45) contrast(1.08);
}

.object-bicycle.stage-1,
.object-skateboard.stage-1,
.object-car.stage-1 {
  background: #c9924e;
  filter: sepia(0.35) saturate(1.2);
}

.object-bicycle.stage-2,
.object-skateboard.stage-2,
.object-car.stage-2 {
  background: #ef6a5b;
  filter: saturate(1.45);
}

.object-bicycle.stage-3,
.object-skateboard.stage-3,
.object-car.stage-3 {
  background: #50a4dc;
  filter: saturate(1.35);
}

.object-bicycle.stage-4,
.object-skateboard.stage-4,
.object-car.stage-4 {
  background: #7657b5;
  filter: saturate(1.25) contrast(1.1);
}

.object-bicycle.stage-5,
.object-skateboard.stage-5,
.object-car.stage-5 {
  background: #20282c;
  filter: saturate(1.2) contrast(1.15);
  box-shadow: inset 0 0 0 4px #2a92d0;
}

.object-shine::after {
  position: absolute;
  z-index: 3;
  top: 13px;
  right: 14px;
  color: #e5f5ff;
  content: "✦";
  font-size: 1.25rem;
  text-shadow: 0 0 8px #4ba7df;
}

.object-premium {
  box-shadow: none;
}

.object-skateboard.stage-5 {
  background: #20282c;
}

.object-skateboard.stage-5 .detail-one,
.object-skateboard.stage-5 .detail-two {
  position: absolute;
  z-index: 4;
  bottom: 15px;
  width: 13px;
  height: 13px;
  border: 2px solid #d6e0e5;
  border-radius: 50%;
  background: #238bd0;
  box-shadow: 0 0 7px #5bc0ff;
}

.object-skateboard.stage-5 .detail-one {
  left: 23px;
}

.object-skateboard.stage-5 .detail-two {
  right: 23px;
}

.current-avatar .evolving-object {
  width: 140px;
  height: 140px;
  transform: scale(1);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.current-avatar .object-emoji {
  font-size: 5.5rem;
  transform: none;
}

.current-avatar .object-shine::after,
.current-avatar .upgrade-detail {
  display: none;
}

.object-choice-button .evolving-object {
  transform: scale(1);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.object-choice-button .object-shine::after,
.object-choice-button .upgrade-detail {
  display: none;
}

.dirt-block {
  position: relative;
  display: block;
  width: 72px;
  height: 62px;
  border: 4px solid #654124;
  border-radius: 7px;
  background:
    linear-gradient(#4f9b3d 0 13px, transparent 13px),
    linear-gradient(45deg, transparent 36%, #8b5b31 36% 52%, transparent 52%),
    #70451f;
  box-shadow: inset 0 -8px 0 rgba(62, 34, 15, 0.24);
}

.dirt-block::after {
  position: absolute;
  inset: 20px 10px 10px;
  content: "";
  background:
    radial-gradient(circle at 20% 30%, #a77544 0 4px, transparent 5px),
    radial-gradient(circle at 70% 65%, #49301d 0 5px, transparent 6px),
    radial-gradient(circle at 85% 15%, #9b693b 0 3px, transparent 4px);
}

.hint-arrow {
  position: absolute;
  z-index: 2;
  left: 270px;
  top: 125px;
  color: #5d6b62;
  font-size: 5.8rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-14px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.hint-arrow.visible {
  opacity: 0.9;
}

.draggable-block:hover,
.draggable-block.selected {
  transform: scale(1.08);
}

.draggable-block.selected {
  outline: 5px solid #1f2923;
  outline-offset: 5px;
}

/* The activity tile stays solid blue; only the selected object is shown on it. */
.draggable-block .evolving-object,
.draggable-block .evolving-object.stage-1,
.draggable-block .evolving-object.stage-2,
.draggable-block .evolving-object.stage-3,
.draggable-block .evolving-object.stage-4,
.draggable-block .evolving-object.stage-5 {
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: scale(1);
}

.draggable-block .object-emoji {
  font-size: 4.5rem;
  transform: none;
}

.draggable-block .object-shine::after,
.draggable-block .upgrade-detail {
  display: none;
}

.draggable-block.dragging {
  cursor: grabbing;
  transition: none;
}

.draggable-block.placed {
  box-shadow: none;
}

.draggable-block.placement-hidden {
  opacity: 0;
  pointer-events: none;
}

.drop-zone {
  position: absolute;
  z-index: 4;
  right: 62px;
  top: 75px;
  display: grid;
  place-items: center;
  width: 255px;
  height: 240px;
  padding: 0;
  border: 6px dashed #d5a82e;
  border-radius: 28px;
  background: rgba(245, 207, 87, 0.14);
  cursor: pointer;
}

.play-area.level-2 .drop-zone,
.play-area.level-3 .drop-zone,
.play-area.level-4 .drop-zone {
  width: 112px;
  height: 112px;
  border-width: 5px;
  border-radius: 20px;
}

.play-area.level-4 .drop-zone::after {
  width: 48px;
  height: 48px;
}

.play-area.level-2 .drop-zone::after,
.play-area.level-3 .drop-zone::after,
.play-area.level-4 .drop-zone::after {
  width: 70px;
  height: 70px;
  border-radius: 14px;
}

.play-area.level-2 .zone-cue,
.play-area.level-3 .zone-cue,
.play-area.level-4 .zone-cue {
  display: none;
}

.play-area.level-4 .draggable-block,
.play-area.level-4 .path-board {
  z-index: 5;
}

.play-area.level-4 .drop-zone {
  z-index: 4;
}

.placed-piece {
  position: absolute;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  color: #5a665e;
  font-size: 2.6rem;
  line-height: 1;
  filter: grayscale(0.25) saturate(0.7);
}

.placed-piece::after {
  display: none;
}

.placed-piece.path-step::after {
  display: grid;
  place-items: center;
  inset: 0;
}

.placed-piece.latest {
  background: transparent;
}

.placed-piece.latest .object-emoji {
  position: relative;
  z-index: 6;
  font-size: 4.5rem;
  line-height: 1;
}

.placed-piece.latest::after {
  display: none;
}

.placed-piece.latest.track-vehicles,
.placed-piece.latest.track-rocks {
  display: grid;
  place-items: center;
}

.track-vehicles.placed-piece,
.track-rocks.placed-piece {
  border-radius: 16px;
  background: transparent;
}

.track-plants.placed-piece::after {
  top: 12px;
}

.play-area.level-4 .placed-piece {
  width: 64px;
  height: 64px;
  transform: translate(18px, 18px);
}

.play-area.level-4 .placed-piece .dirt-block {
  transform: scale(0.64);
  transform-origin: center bottom;
}

.play-area.level-4 .placed-piece .planted-icon {
  top: -8px;
  font-size: 2.4rem;
}

.track-plants.placed-piece {
  filter: none;
}

.track-plants.placed-piece .dirt-block {
  position: absolute;
  bottom: 2px;
}

.planted-icon {
  position: absolute;
  z-index: 2;
  top: -22px;
  font-size: 3.6rem;
  filter: saturate(1.45) contrast(1.08);
}

.journey-actor {
  position: absolute;
  z-index: 4;
  display: none;
  width: 58px;
  height: 58px;
  place-items: center;
  font-size: 2.8rem;
  line-height: 1;
  pointer-events: none;
  transition: left 600ms ease, top 600ms ease;
}

.journey-actor.visible {
  display: grid;
}

/* Standard vehicle emoji face left; flip them so their travel reads left-to-right. */
.journey-actor.track-vehicles {
  transform: scaleX(-1);
}

.journey-step {
  position: absolute;
  display: grid;
  place-items: center;
  width: 55px;
  height: 34px;
  color: #667269;
  font-size: 2rem;
  opacity: 0.7;
}

.drop-zone::after {
  content: "";
  width: 128px;
  height: 128px;
  border: 3px solid rgba(165, 124, 18, 0.35);
  border-radius: 22px;
}

.zone-cue {
  position: absolute;
  bottom: 18px;
  color: #46594e;
  font-weight: 700;
}

.drop-zone.success {
  animation: gentle-glow 1.1s ease-in-out 2;
}

.drop-zone.target-complete {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  animation: none;
}

.drop-zone.target-complete::after,
.drop-zone.target-complete .zone-cue {
  visibility: hidden;
}

.activity-status {
  min-height: 30px;
  margin: 18px 0 0;
  color: #365c4b;
  font-size: 1.25rem;
  font-weight: 700;
}

.hint-panel {
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 20px 14px;
  border: 2px solid #d3d8d3;
  border-radius: 16px;
  background: #fffefa;
  color: #39473f;
  text-align: center;
  box-shadow: 0 12px 30px rgba(31, 43, 35, 0.12);
}

.assistant-hint-button {
  min-width: 0;
  min-height: 54px;
  padding: 10px;
  border: 2px solid #68776c;
  border-radius: 9px;
  background: white;
  color: #39473f;
  cursor: pointer;
  font-weight: 700;
}

.hint-countdown {
  display: block;
  min-height: 1.1em;
  margin-top: 2px;
  font-size: 1.2rem;
}

#student-screen .compact {
  position: absolute;
  z-index: 8;
  right: 48px;
  bottom: 32px;
  min-width: 250px;
  box-shadow: 0 7px 20px rgba(31, 57, 44, 0.25);
}

.assistant-hint-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.draggable-block.hint-focus,
.drop-zone.hint-focus {
  outline: 6px solid #fff8d8;
  outline-offset: 7px;
  animation: hint-focus 900ms ease-in-out 2;
}

.confetti-piece {
  position: absolute;
  z-index: 5;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: soft-confetti 1.5s ease-out forwards;
}

.teacher-panel {
  max-width: 1120px;
  margin: 0 auto;
  padding: 38px;
}

.teacher-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.teacher-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.teacher-apply {
  width: auto;
  min-width: 160px;
}

.teacher-apply:disabled {
  opacity: 0.5;
}

.clear-students-button {
  min-height: 48px;
  font-weight: 700;
}

.clear-students-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.teacher-explanation {
  max-width: 700px;
  margin: 12px 0 30px;
}

.teacher-manual {
  margin: 0 0 28px;
  border: 1px solid #abb4ac;
  border-radius: 12px;
  background: #fffefa;
}

.teacher-manual summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 700;
}

.manual-content {
  max-width: 760px;
  padding: 4px 20px 20px;
  color: #4f5e54;
  line-height: 1.55;
}

.manual-content h2 {
  margin-bottom: 12px;
  color: #243029;
  font-size: 1.2rem;
}

.manual-content p {
  margin-bottom: 10px;
}

.student-table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fffefa;
}

th,
td {
  padding: 17px 15px;
  border-bottom: 1px solid #d4d9d2;
  text-align: left;
}

th {
  color: #56645a;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reading-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  cursor: pointer;
}

.reading-toggle input {
  width: 24px;
  height: 24px;
  accent-color: #365c4b;
}

.level-select {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #97a196;
  border-radius: 8px;
  background: #fffefa;
  color: #243029;
}

.delete-button {
  padding: 9px 12px;
  border: 1px solid #8e6b62;
  border-radius: 8px;
  background: transparent;
  color: #684940;
  cursor: pointer;
}

.empty-state {
  padding: 32px;
  border: 2px dashed #9ca69d;
  border-radius: 14px;
  text-align: center;
}

body.no-reading .reader-text {
  display: none !important;
}

@keyframes gentle-glow {
  50% {
    border-color: #e1bd42;
    box-shadow: 0 0 32px rgba(225, 189, 66, 0.75);
  }
}

@keyframes soft-confetti {
  from {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(var(--move-x), var(--move-y)) scale(0.5);
  }
}

@keyframes hint-focus {
  50% {
    outline-offset: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-height: 760px) {
  .screen {
    padding-top: 24px;
  }

  #student-screen .student-layout {
    transform: scale(0.82);
  }

}
