/* The play screens: adventure HUD chip and level-up text, practice picker, map, grown-ups additions.
   Right to left throughout. Must fit an iPad (1024x768), a laptop window (1000x560) and a phone
   in landscape (932x430). Own class prefixes: nq- (adventure), np- (picker/practice), nm- (map), ng- (grown-ups). */

/* ---------- adventure ---------- */

.nq-chip {
  display: inline-flex; align-items: center; gap: 0.6rem; max-width: min(24rem, 42vw); min-height: 2.8rem;
  padding: 0.2rem 0.5rem 0.2rem 0.9rem; font: inherit; font-size: 1rem; font-weight: 900; color: var(--ink);
  background: var(--paper); border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); cursor: pointer;
}
.nq-chip-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nq-chip-count { flex: none; padding: 0.05rem 0.6rem; font-family: var(--font-num); background: var(--gold); border: 2px solid var(--ink); border-radius: 999px; }
.nq-chip:focus-visible { outline: 4px solid var(--orchid); outline-offset: 3px; }

#levelup .levelup-card { direction: rtl; }
#lu-name { max-width: 28rem; text-wrap: balance; }
#lu-next { max-width: 28rem; text-wrap: balance; }
#lu-skill:empty, #lu-blurb:empty { display: none; }
#lu-hero { inset-inline-start: auto; inset-inline-end: -10.5rem; transform: scaleX(-1); }
@media (max-height: 520px) {
  #lu-hero { inset-inline-end: -7rem; height: 11rem; }
  #lu-name { font-size: 1.3rem; }
}

/* ---------- practice: stage and lesson picker ---------- */

#screen-practice .sub-body { overflow-y: auto; overscroll-behavior: contain; }
.np-practice {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  grid-template-areas: "intro intro" "picker detail"; gap: 0.8rem 1.4rem;
  width: min(64rem, 100%); padding: 1.1rem 1.6rem 1.3rem; text-align: start;
}
.np-intro { grid-area: intro; text-align: center; }
.np-intro .title { margin-bottom: 0.2rem; }
.np-intro .lead { font-size: 1.05rem; }
.np-practice > .np-picker { grid-area: picker; }
.np-detail {
  grid-area: detail; align-self: start; display: flex; flex-direction: column; gap: 0.7rem; padding: 1rem 1.1rem;
  background: var(--blush); border: 3px solid var(--ink); border-radius: var(--radius-m);
}
.np-detail.empty { opacity: 0.7; }
.np-d-title { font-size: 1.35rem; font-weight: 900; line-height: 1.25; }
.np-d-goal { font-size: 1rem; font-weight: 700; line-height: 1.5; color: var(--ink-soft); }
.np-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.2rem; }
.np-actions .btn { flex: 1 1 auto; }
.np-actions .btn-big { min-height: 3.6rem; font-size: 1.4rem; }

.np-picker { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.np-stages { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.np-stage {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.6rem; padding: 0 0.8rem; font: inherit; font-size: 0.95rem;
  font-weight: 900; color: var(--ink); background: var(--paper); border: 3px solid var(--ink); border-radius: 999px; cursor: pointer;
}
.np-stage .np-dot { width: 0.8rem; height: 0.8rem; background: var(--stage); border: 2px solid var(--ink); border-radius: 50%; }
.np-stage.here { box-shadow: 0 0 0 3px var(--gold); }
.np-stage.on { background: var(--stage); color: #fff; text-shadow: 0 2px 0 var(--ink); }
.np-stage.on .np-dot { background: #fff; }
.np-stage:focus-visible, .np-lesson:focus-visible { outline: 4px solid var(--orchid); outline-offset: 2px; }
.np-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; font-size: 1.05rem; }
.np-head span { font-weight: 800; color: var(--ink-soft); }
.np-lessons { display: flex; flex-direction: column; gap: 0.4rem; max-height: max(9rem, calc(100dvh - 21rem)); overflow-y: auto; padding: 0.2rem 0.2rem 0.4rem; overscroll-behavior: contain; }
.np-lesson {
  display: flex; align-items: center; gap: 0.7rem; min-height: 3rem; padding: 0.3rem 0.8rem 0.3rem 0.6rem; text-align: start; font: inherit;
  font-size: 1rem; font-weight: 800; color: var(--ink); background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius-s); cursor: pointer;
}
.np-num {
  flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; font-family: var(--font-num); font-weight: 900;
  background: var(--stage, var(--lilac)); color: #fff; text-shadow: 0 1px 0 var(--ink); border: 2px solid var(--ink); border-radius: 50%;
}
.np-title { flex: 1; min-width: 0; line-height: 1.3; }
.np-mark { flex: none; font-size: 1.1rem; font-weight: 900; }
.np-lesson.np-done .np-mark, .np-lesson.np-placed .np-mark { color: var(--turquoise-deep); }
.np-lesson.np-here { background: var(--butter); }
.np-lesson.np-placed { opacity: 0.8; }
.np-lesson.on { background: var(--gold); box-shadow: 0 3px 0 var(--ink); }
.np-lesson.np-ahead, .np-lesson.np-unwritten { opacity: 0.5; cursor: default; border-style: dashed; }

@media (max-width: 760px) {
  .np-practice { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "picker" "detail"; padding: 1rem; }
  .np-lessons { max-height: 14rem; }
}
@media (max-height: 520px) {
  .np-practice { padding: 0.6rem 1rem 0.8rem; gap: 0.4rem 1rem; }
  .np-intro .lead { display: none; }
  .np-intro .title { font-size: 1.5rem; }
  .np-lessons { max-height: max(7rem, calc(100dvh - 14rem)); }
  .np-lesson { min-height: 2.6rem; font-size: 0.95rem; }
  .np-d-title { font-size: 1.15rem; }
  .np-d-goal { font-size: 0.9rem; }
}

/* ---------- map ---------- */

.nm-path { padding-bottom: 0.3rem; border-bottom: 3px dashed rgba(59, 30, 84, 0.18); }
.nm-path:last-child { border-bottom: 0; }
.nm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; padding: 0 1.6rem; }
.nm-title {
  display: inline-flex; align-items: center; gap: 0.5rem; flex: none; padding: 0.15rem 0.5rem 0.15rem 1rem; font-size: 1.25rem; font-weight: 900;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink);
}
.nm-dot { width: 1.6rem; height: 1.6rem; background: var(--stage); border: 3px solid var(--ink); border-radius: 50%; }
.nm-say { font-size: 1rem; font-weight: 800; }
.nm-say small { font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); }
.nm-scroll { overflow-x: auto; overflow-y: hidden; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.nm-inner { position: relative; direction: ltr; }
.nm-road { position: absolute; left: 0; top: 0; }
.nm-decor { position: absolute; inset: 0; pointer-events: none; opacity: 0.85; }
.nm-deco { position: absolute; width: 2rem; height: 2rem; }
.nm-star { color: var(--gold); }
.nm-moon { color: var(--peach); transform: scaleX(-1); }
.nm-lantern { color: var(--rose); width: 1.6rem; height: 3.2rem; }
.nm-palm { position: absolute; font-size: 2.6rem; line-height: 1; }

.nm-stone {
  position: absolute; z-index: 2; transform: translate(-50%, -50%); width: 4.2rem; height: 4.2rem; padding: 0; display: grid; place-items: center;
  font: inherit; font-size: 1.6rem; font-weight: 900; color: var(--ink); background: var(--lilac); border: 4px solid var(--ink); border-radius: 50%;
  box-shadow: 0 5px 0 var(--ink); cursor: pointer;
}
.nm-stone:focus-visible { outline: 4px solid var(--orchid); outline-offset: 3px; }
.nm-num { font-family: var(--font-num); }
.nm-done { background: var(--gold); }
.nm-placed { background: #ffe9a8; }
.nm-ahead { background: var(--paper); opacity: 0.75; border-style: dashed; box-shadow: 0 3px 0 var(--ink); }
.nm-here {
  z-index: 4; width: 5.4rem; height: 5.4rem; font-size: 2.3rem; background: var(--rose); color: #fff; text-shadow: 0 2px 0 var(--ink);
  animation: nm-pulse 1.6s ease-in-out infinite;
}
@keyframes nm-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 5px 0 var(--ink), 0 0 0 0 rgba(255, 200, 61, 0.9); }
  50% { transform: translate(-50%, -50%) scale(1.07); box-shadow: 0 5px 0 var(--ink), 0 0 0 14px rgba(255, 200, 61, 0); }
}
.nm-stone.nm-unwritten { opacity: 0.4; filter: grayscale(0.6); }
.nm-tick {
  position: absolute; top: -0.5rem; right: -0.4rem; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; font-size: 0.95rem;
  font-weight: 900; color: #fff; background: var(--turquoise-deep); border: 3px solid var(--ink); border-radius: 50%;
}
.nm-placed .nm-tick { background: #7fd8cf; }
.nm-lock { position: absolute; bottom: -0.5rem; right: -0.4rem; font-size: 1.1rem; line-height: 1; }
.nm-pin {
  position: absolute; bottom: calc(100% + 0.5rem); left: 50%; transform: translateX(-50%); padding: 0.1rem 0.7rem; font-size: 0.95rem; font-weight: 900;
  white-space: nowrap; color: var(--ink); text-shadow: none; background: var(--butter); border: 3px solid var(--ink); border-radius: 999px;
}
.nm-label {
  position: absolute; z-index: 2; transform: translateX(-50%); width: 8.6rem; text-align: center; font-size: 0.9rem; font-weight: 800;
  line-height: 1.2; color: var(--ink); pointer-events: none;
}
.nm-label span {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 0 4px var(--cream), 0 0 4px var(--cream), 0 0 4px var(--cream);
}
.nm-label-cur span { font-weight: 900; }
.nm-label.nm-unwritten { opacity: 0.45; }
.nm-end { position: absolute; z-index: 2; transform: translate(-50%, -50%); font-size: 3.6rem; line-height: 1; filter: drop-shadow(0 5px 0 rgba(59, 30, 84, 0.3)); pointer-events: none; }

.nm-walkpath { position: absolute; width: 0; height: 0; overflow: hidden; }
.nm-girl { position: absolute; z-index: 6; height: 6rem; width: auto; transform: translate(-50%, -100%) scaleX(-1); pointer-events: none; filter: drop-shadow(0 4px 0 rgba(59, 30, 84, 0.25)); }
.nm-girl[hidden] { display: none; }
.nm-girl:not(.nm-girl-walking):not(.nm-girl-cheer) { animation: nm-girl-idle 2.4s ease-in-out infinite; }
.nm-girl-cheer { animation: nm-girl-hop 0.6s ease-in-out 3; }
@keyframes nm-girl-idle { 0%, 100% { transform: translate(-50%, -100%) scaleX(-1); } 50% { transform: translate(-50%, calc(-100% - 4px)) scaleX(-1); } }
@keyframes nm-girl-hop { 0%, 100% { transform: translate(-50%, -100%) scaleX(-1); } 50% { transform: translate(-50%, calc(-100% - 18px)) scaleX(-1); } }
.nm-arriving .nm-title { box-shadow: 0 3px 0 var(--ink), 0 0 0 5px var(--gold); }

#map-paths { flex: none; display: flex; flex-direction: column; gap: 0.9rem; }
.nm-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem; width: min(30rem, 92%); max-height: calc(100% - 1rem); overflow-y: auto;
  padding: 1.4rem 1.8rem; text-align: center; border-color: var(--ink); animation: card-in 0.4s var(--pop);
}
.nm-card-kicker { font-size: 1.05rem; font-weight: 900; color: var(--orchid-deep); }
.nm-card-name { font-size: 1.6rem; font-weight: 900; line-height: 1.25; }
.nm-card-goal { font-size: 1.05rem; font-weight: 700; line-height: 1.55; color: var(--ink-soft); }
.nm-card-state { font-size: 1.05rem; font-weight: 900; color: var(--turquoise-deep); }
.nm-card-state.nm-s-ahead { color: var(--ink-soft); }
.nm-card-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.nm-card-actions:empty { display: none; }
@media (max-height: 520px) {
  .nm-card { gap: 0.4rem; padding: 0.8rem 1.4rem; }
  .nm-card-name { font-size: 1.3rem; }
  .nm-card-goal { font-size: 0.95rem; }
  .nm-say { font-size: 0.9rem; }
}

/* ---------- grown-ups additions ---------- */

.ng-place { font-size: 1.15rem; font-weight: 900; color: var(--orchid-deep); line-height: 1.5; }
.ng-field { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.6rem 0; }
.ng-select {
  width: 100%; min-height: var(--tap); padding: 0.3rem 0.8rem; font: inherit; font-size: 1.05rem; font-weight: 800; color: var(--ink);
  background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius-s);
}
.ng-select:focus-visible { outline: 4px solid var(--orchid); outline-offset: 2px; }
.ng-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.ng-stage { display: grid; grid-template-columns: minmax(9rem, 1.2fr) 2fr auto; align-items: center; gap: 0.8rem; margin: 0.45rem 0; }
.ng-stage-name { font-size: 0.98rem; font-weight: 800; }
.ng-stage-n { font-size: 0.95rem; font-weight: 900; color: var(--orchid-deep); white-space: nowrap; }
.ng-bar { height: 1rem; background: var(--paper); border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; }
.ng-bar span { display: block; height: 100%; background: var(--turquoise); }
.ng-hard { display: flex; flex-direction: column; gap: 0.4rem; }
.ng-hard-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0.8rem; font-weight: 800; background: var(--butter); border: 3px solid var(--ink); border-radius: var(--radius-s); }
@media (max-width: 640px) {
  .ng-stage { grid-template-columns: 1fr auto; }
  .ng-bar { grid-column: 1 / -1; order: 3; }
}
