/* feat-play – Lernreise, Leveldetail, Levelablauf (Vorlage lib/features/levels/).
 * Farben und Formen je Altersband über die Variablen --lern-* (lern-theme).
 * Masse wie in der Flutter-App (logische Pixel = CSS-Pixel). */

.play-fill { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.play-nopointer { pointer-events: none; }
.play-hidden { display: none !important; }
.play-center {
  min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: var(--lern-ink);
}
.play-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid transparent; border-top-color: var(--lern-primary); border-right-color: var(--lern-primary);
  animation: play-spin 1s linear infinite;
}
@keyframes play-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ Lernreise */

.play-levels { background: var(--lern-bg); min-height: 100%; padding-top: var(--lern-safe-top, 0px); }
.play-journey { max-width: 1100px; margin: 0 auto; padding: 10px 16px 24px; }

.play-header { display: flex; align-items: flex-end; gap: 12px; }
.play-header__text { flex: 1; min-width: 0; }
.play-header__title { margin: 0; color: var(--lern-ink); line-height: 1.17; }
.play-header__sub { font-size: 13.5px; color: var(--lern-muted); }
.play-header__count { display: flex; flex-direction: column; align-items: flex-end; }
.play-header__done { font-size: 30px; line-height: 1; font-weight: 900; color: var(--lern-primary); }
.play-header__of { font-size: 12px; font-weight: 700; color: var(--lern-muted); }

.play-bar { display: flex; gap: 6px; }
.play-bar__world {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; padding: 6px 0;
  background: none; border: 0; margin: 0; cursor: pointer;
}
.play-bar__seg { flex: 1 1 0; margin: 0 1px; border-radius: 4px; transition: height 160ms; }

.play-reading {
  width: 100%; display: flex; align-items: center; gap: 0; text-align: left; cursor: pointer;
  padding: 10px 14px; border: 2px solid #fff; border-radius: var(--lern-card-radius);
  background: linear-gradient(90deg, #FFE7C7, #FFC9A0); color: #2A1A12; font: inherit;
}
.play-reading:hover { filter: brightness(0.98); }
.play-reading__mouse { font-size: 30px; margin-right: 12px; }
.play-reading__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.play-reading__title { font-size: 16px; font-weight: 900; color: #2A1A12; }
.play-reading__sub { font-size: 12.5px; color: #6B5A50; }
.play-reading__count { font-weight: 900; color: #2A1A12; margin-left: 8px; }

/* Weltkacheln: passen alle sieben in die Breite (je ≥ 118 px), teilen sie sich
 * den Platz; sonst feste 150 px mit seitlichem Scrollen. */
.play-cards-wrap { container-type: inline-size; }
.play-cards {
  display: flex; gap: 10px; height: 112px; overflow-x: auto; overflow-y: visible;
  padding-right: 16px; scrollbar-width: none; margin-bottom: -20px; padding-bottom: 20px;
}
.play-cards::-webkit-scrollbar { display: none; }
.play-wcard { flex: 0 0 150px; height: 112px; }
@container (min-width: 886px) {
  .play-cards { overflow: visible; padding-right: 0; }
  .play-wcard { flex: 1 1 0; min-width: 0; }
}
.play-wcard {
  position: relative; padding: 0; margin: 0; cursor: pointer; background: none; font: inherit; text-align: left;
  border: 3px solid transparent; border-radius: min(var(--lern-card-radius), 18px);
  transition: border-color 280ms cubic-bezier(0.215, 0.61, 0.355, 1), box-shadow 280ms cubic-bezier(0.215, 0.61, 0.355, 1);
}
.play-wcard__clip {
  position: absolute; inset: 0; overflow: hidden; border-radius: min(var(--lern-card-radius), 18px);
  container-type: inline-size;
}
.play-wcard__lock { position: absolute; inset: 0; background: rgba(11, 15, 30, 0.45); }
.play-wcard__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.55) 100%);
}
.play-wcard__labels { position: absolute; left: 10px; right: 10px; bottom: 8px; display: flex; flex-direction: column; }
.play-wcard__row { display: flex; align-items: center; }
.play-wcard__stage {
  font-size: 9.5px; letter-spacing: 1.2px; font-weight: 800;
  text-shadow: 0 0 2.46px rgba(0,0,0,0.87), 0 0 10.24px rgba(0,0,0,0.54);
}
.play-wcard__done { font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 0 5.62px rgba(0,0,0,0.54); }
.play-wcard__name { color: #fff; white-space: nowrap; line-height: 1.17; text-shadow: 0 0 7.93px rgba(0,0,0,0.54); }

/* Karte */
.play-maps { position: relative; container-type: inline-size; }
.play-map-slot { position: relative; }
.play-map-slot--out { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }
.play-map-slot--in { animation: play-map-in 520ms cubic-bezier(0.215, 0.61, 0.355, 1) both; }
.play-map-slot--out { animation: play-map-out 520ms cubic-bezier(0.55, 0.055, 0.675, 0.19) both; }
@keyframes play-map-in { from { opacity: 0; transform: translateX(var(--play-dx)); } to { opacity: 1; transform: none; } }
@keyframes play-map-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(var(--play-dx)); } }

.play-map {
  position: relative; width: 100%; overflow: hidden; isolation: isolate;
  height: clamp(470px, calc(100cqw * 0.74), 640px);
}
.play-map__canvas { position: absolute; inset: 0; }
.play-map__canvas--hover { cursor: pointer; }
.play-map__title {
  position: absolute; left: 14px; top: 14px; right: 110px; padding: 4px 6px;
  display: flex; flex-direction: column; align-items: flex-start; pointer-events: none;
}
.play-map__line { font-size: 11px; letter-spacing: 1.4px; font-weight: 900; }
.play-map__motto { font-size: 13px; font-weight: 700; }
.play-node {
  position: absolute; padding: 0; margin: 0; border: 0; background: transparent;
  pointer-events: none; border-radius: 50%;
}
.play-node:focus-visible { outline: 3px solid #fff; outline-offset: -4px; box-shadow: 0 0 0 6px rgba(0,0,0,0.35); }
.play-map__arrows { position: absolute; right: 12px; top: 12px; display: flex; }
.play-arrow {
  width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0; margin: 0;
  display: grid; place-items: center; cursor: pointer;
}
.play-arrow:disabled { cursor: default; }
.play-arrow:not(:disabled):hover { filter: brightness(1.08); }

/* Vorschau als Blatt von unten */
.play-sheet {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.54);
  display: flex; align-items: flex-end; justify-content: center;
}
.play-sheet.play-anim { animation: play-fade 250ms ease-out both; }
.play-sheet.play-anim .play-sheet__card { animation: play-sheet-up 250ms cubic-bezier(0.2, 0, 0, 1) both; }
@keyframes play-fade { from { opacity: 0; } }
@keyframes play-sheet-up { from { transform: translateY(100%); } }
.play-sheet__card {
  width: calc(100% - 24px); max-width: 640px; margin: 0 12px 12px; overflow: hidden;
  background: var(--lern-surface); color: var(--lern-ink); max-height: calc(100dvh - 24px); overflow-y: auto;
}
.play-sheet__hero { position: relative; height: 110px; }
.play-sheet__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.55));
}
.play-sheet__heading { position: absolute; left: 20px; right: 20px; bottom: 14px; display: flex; flex-direction: column; }
.play-sheet__kicker { font-size: 11px; letter-spacing: 1.3px; font-weight: 800; }
.play-sheet__body { padding: 16px 20px 20px; }
.play-sheet__intro {
  font-size: 14.5px; line-height: 1.4; color: var(--lern-muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.play-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.play-fact {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  background: var(--lern-bg); border: 1px solid var(--lern-border);
  font-size: 13px; font-weight: 700; color: var(--lern-ink);
}
.play-sheet__locked {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--lern-bg); border: 1px solid var(--lern-border);
  color: var(--lern-ink); font-weight: 600; font-size: 14px;
}
.play-filled {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 24px 10px 16px; border: 0; cursor: pointer;
  background: var(--lern-primary); color: #fff; font: inherit; font-size: 14px; font-weight: 500; letter-spacing: 0.1px;
}
.play-filled:hover { filter: brightness(1.06); }
.play-filled--small { width: auto; min-height: 40px; border-radius: 20px; padding: 10px 24px; }

/* ------------------------------------------------------------ Leveldetail */

.play-detail { position: relative; min-height: 100dvh; background: var(--lern-bg); color: var(--lern-ink); }
.play-detail__bg { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.play-detail__col {
  position: relative; max-width: 760px; margin: 0 auto; height: 100dvh;
  display: flex; flex-direction: column;
  padding-top: var(--lern-safe-top, 0px); padding-bottom: var(--lern-safe-bottom, 0px);
}
.play-detail__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 20px 20px; }
.play-detail__start { flex: none; padding: 8px 20px 18px; }
.play-hero { position: relative; height: 236px; overflow: hidden; isolation: isolate; }
.play-hero__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.62) 100%);
}
.play-hero__back {
  position: absolute; left: 8px; top: 8px; width: 48px; height: 48px; border-radius: 50%;
  border: 0; padding: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(0,0,0,0.28); color: #fff;
}
.play-hero__back:hover { background: rgba(0,0,0,0.36); }
.play-hero__row { position: absolute; left: 20px; right: 20px; bottom: 18px; display: flex; align-items: flex-end; }
.play-hero__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.play-hero__kicker { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; }
.play-badge { flex: none; display: grid; place-items: center; }
.play-detail__intro { font-size: 16px; line-height: 1.45; color: var(--lern-muted); }
.play-detail__done { display: flex; align-items: center; margin-top: 14px; }
.play-detail__done-text { font-size: 13px; font-weight: 700; color: var(--lern-muted); }
.play-section { display: flex; align-items: center; }
.play-section__line { flex: 1; height: 1px; background: var(--lern-border); margin-left: 12px; }
.play-goal { display: flex; align-items: flex-start; padding-bottom: 12px; }
.play-goal__mark {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  color: var(--lern-primary); font-weight: 800; font-size: 13px;
}
.play-goal__text { flex: 1; padding-top: 4px; font-size: 16px; line-height: 1.35; font-weight: 600; color: var(--lern-ink); }
.play-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.play-chip {
  padding: 8px 14px; background: var(--lern-surface); border: 1px solid var(--lern-border);
  font-size: 13.5px; font-weight: 700; color: var(--lern-ink);
}
.play-life { display: flex; align-items: center; padding: 16px; background: var(--lern-surface); }
.play-life__icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; }
.play-life__text { flex: 1; font-size: 14px; line-height: 1.35; color: var(--lern-ink); }

/* ------------------------------------------------------------ Levelablauf */

.play-play { min-height: 100dvh; color: var(--lern-ink); padding-top: var(--lern-safe-top, 0px); }
.play-play__col { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; height: 100dvh; }
.play-phead { padding: 10px 16px 4px; }
.play-phead__strip { position: relative; height: 58px; overflow: hidden; isolation: isolate; }
.play-phead__shade { position: absolute; inset: 0; background: rgba(0,0,0,0.32); }
.play-phead__row { position: absolute; inset: 0; display: flex; align-items: center; color: #fff; }
.play-phead__text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.play-phead__kicker { font-size: 10.5px; letter-spacing: 1.2px; font-weight: 800; }
.play-phead__count { font-size: 15px; font-weight: 800; color: #fff; }
.play-segs { display: flex; gap: 5px; }
.play-seg { flex: 1 1 0; transition: background-color 320ms cubic-bezier(0.215, 0.61, 0.355, 1); }

.play-tasks { position: relative; flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; }
.play-task { padding: 8px 20px 24px; transform-origin: center; }
.play-task--in { animation: play-task-in 280ms cubic-bezier(0.215, 0.61, 0.355, 1) both; }
.play-task--out {
  position: absolute; top: 0; left: 0; right: 0; pointer-events: none;
  animation: play-task-out 280ms cubic-bezier(0.55, 0.055, 0.675, 0.19) both;
}
@keyframes play-task-in { from { opacity: 0; transform: translateX(8%) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes play-task-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(-6%) scale(0.97); } }

.play-life-badge { display: flex; }
.play-life-badge__pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 30px;
  background: rgba(255, 197, 61, 0.16); border: 1px solid rgba(255, 197, 61, 0.5);
  color: #FFC53D; font-weight: 800; font-size: 13px;
}
.play-prompt { font-weight: 800; line-height: 1.3; color: var(--lern-ink); }
.play-input { transition: opacity 160ms; }
.play-input--locked { opacity: 0.6; pointer-events: none; }
.play-classic { display: flex; justify-content: flex-end; }
.play-text-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 10px 12px 10px 16px;
  border: 0; border-radius: 20px; background: transparent; color: var(--lern-primary);
  font: inherit; font-size: 14px; font-weight: 500; letter-spacing: 0.1px; cursor: pointer;
}
.play-text-btn:hover { background: color-mix(in srgb, var(--lern-primary) 8%, transparent); }
.play-hints { padding-top: 16px; display: flex; flex-direction: column; align-items: flex-start; }
.play-hint { display: flex; align-items: flex-start; padding-bottom: 8px; width: 100%; }
.play-hint__text { flex: 1; font-size: 14px; line-height: 1.35; }

/* Abschluss */
.play-result { min-height: 100dvh; display: flex; justify-content: center; align-items: center; padding: 16px 20px 24px; }
.play-result__col { width: 100%; max-width: 640px; display: flex; flex-direction: column; }
.play-result__hero { position: relative; height: 250px; overflow: hidden; isolation: isolate; }
.play-result__figure { position: absolute; inset: 0; display: grid; place-items: center; }
.play-result__figure .lw-confetti { position: relative; }
.play-result__title { display: flex; justify-content: center; text-align: center; }
.play-result__msg { text-align: center; font-size: 15.5px; line-height: 1.4; color: var(--lern-muted); }
.play-stars { display: flex; justify-content: center; align-items: center; }
.play-star { display: inline-block; padding: 0 6px; }
.play-star--pop { animation-name: play-pop-o, play-pop-s; animation-timing-function: linear, cubic-bezier(0.175, 0.885, 0.32, 1.275); animation-fill-mode: both; }
.play-star__spin { display: inline-block; }
.play-star--spin { animation: play-spin-in 900ms cubic-bezier(0.175, 0.885, 0.32, 1.275) both; }
.play-star__glow { display: inline-block; border-radius: 50%; line-height: 0; }
@keyframes play-pop-o { from { opacity: 0; } to { opacity: 1; } }
@keyframes play-pop-s { from { transform: scale(0.4); } to { transform: scale(1); } }
@keyframes play-spin-in { from { transform: rotate(-1.2rad); } to { transform: none; } }
.play-unlock { color: var(--lern-ink); }
.play-stats { display: flex; justify-content: center; align-items: center; }
.play-stats__div { width: 1.5px; height: 40px; margin: 0 22px; }
.play-stats__note { text-align: center; font-size: 12.5px; line-height: 1.4; color: var(--lern-muted); }
.play-stat { display: flex; flex-direction: column; align-items: center; }
.play-stat__value { font-size: 20px; font-weight: 900; color: var(--lern-ink); }
.play-stat__label { font-size: 12px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .play-map-slot--in, .play-map-slot--out, .play-task--in, .play-task--out,
  .play-star--pop, .play-star--spin, .play-sheet.play-anim, .play-sheet.play-anim .play-sheet__card { animation: none; }
}
