:root {
  --bg: #fff8f1;
  --bg-soft: #fffdf9;
  --peach: #ffd7c6;
  --rose: #ffc9d6;
  --yellow: #ffe8a3;
  --mint: #d9f4e6;
  --sky: #dcefff;
  --ink: #31415b;
  --ink-soft: #5c6c84;
  --line: #e8d9cc;
  --white: #ffffff;
  --success: #2f9a68;
  --shadow: 0 20px 45px rgba(107, 88, 73, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --timer-shell-height: 74px;
  --timer-viewport-offset: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 201, 214, 0.45), transparent 28%),
    radial-gradient(circle at bottom right, rgba(220, 239, 255, 0.75), transparent 30%),
    linear-gradient(180deg, #fff8f1 0%, #fffdf9 100%);
  min-height: 100vh;
}

img {
  max-width: 100%;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid #ff9f67;
  outline-offset: 3px;
}

.page-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 calc(var(--timer-shell-height) + 1.25rem);
}

.timer-shell {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem + var(--timer-viewport-offset));
  left: 50%;
  width: min(1180px, calc(100% - 2rem));
  transform: translateX(-50%);
  z-index: 80;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem;
  margin-top: 0.75rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 245, 238, 0.95));
  box-shadow: var(--shadow);
  border: 1px solid rgba(232, 217, 204, 0.7);
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d16e5d;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", "Avenir Next", sans-serif;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.6rem);
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.3rem);
}

h3 {
  font-size: 1.25rem;
}

.hero__text,
.panel__intro,
.lesson-panel__intro,
.parent-panel__text,
.progress-card__text,
#lessonExplanation,
#lessonExample {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.hero__actions,
.tasks-form__actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.timer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 217, 204, 0.78);
  box-shadow: 0 14px 28px rgba(107, 88, 73, 0.08);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.timer-shell.is-expired .timer-card {
  background: rgba(255, 230, 230, 0.96);
  border-color: rgba(205, 80, 80, 0.32);
  box-shadow: 0 18px 34px rgba(205, 80, 80, 0.14);
}

.timer-shell.is-expired .timer-card__time {
  color: #c73c3c;
}

.timer-card__actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.timer-card__label {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.78rem;
}

.timer-card__time {
  margin: 0.12rem 0 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1;
  font-weight: 800;
  color: #cb6c54;
}

.timer-card__button {
  flex-shrink: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.35rem;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:disabled {
  cursor: default;
  opacity: 0.72;
  transform: none;
}

.button--primary {
  background: linear-gradient(135deg, #ffb66f, #ff8f7a);
  color: #fff;
  box-shadow: 0 16px 28px rgba(255, 143, 122, 0.28);
}

.button--secondary {
  background: var(--white);
  color: var(--ink);
  border: 1px solid rgba(232, 217, 204, 0.9);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.75);
  color: #b04f55;
  border: 1px solid rgba(176, 79, 85, 0.18);
}

.hero__art {
  position: relative;
  min-height: 260px;
}

.bubble,
.hero__card {
  position: absolute;
  border-radius: 50%;
}

.bubble--one {
  width: 160px;
  height: 160px;
  top: 8%;
  left: 8%;
  background: rgba(255, 215, 198, 0.8);
}

.bubble--two {
  width: 110px;
  height: 110px;
  right: 18%;
  top: 18%;
  background: rgba(217, 244, 230, 0.9);
}

.bubble--three {
  width: 130px;
  height: 130px;
  right: 5%;
  bottom: 5%;
  background: rgba(220, 239, 255, 0.9);
}

.hero__card {
  inset: auto 12% 8% auto;
  width: 210px;
  height: 210px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.4rem;
  animation: floatCard 4.5s ease-in-out infinite;
}

.hero__card p {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.hero__star {
  display: block;
  font-size: 2.4rem;
  color: #ffb235;
}

.overview-panel,
.content-grid,
.bottom-grid {
  display: grid;
  gap: 1.2rem;
  margin-top: 1.4rem;
}

.overview-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr)) 1.3fr;
}

.content-grid {
  grid-template-columns: 1fr;
}

.bottom-grid {
  grid-template-columns: 0.9fr 1.1fr;
}

.panel,
.stat-card,
.progress-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(232, 217, 204, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.panel,
.progress-card {
  padding: 1.35rem;
}

.plan-panel {
  width: 100%;
}

.plan-panel__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  list-style: none;
  cursor: pointer;
}

.plan-panel__summary::-webkit-details-marker {
  display: none;
}

.plan-panel__toggle {
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: #fff6ef;
  color: #b1644a;
  font-weight: 800;
  white-space: nowrap;
}

.plan-panel__toggle::before {
  content: "Plan";
}

.plan-panel[open] .plan-panel__toggle::after {
  content: " einklappen";
}

.plan-panel:not([open]) .plan-panel__toggle::after {
  content: " ausklappen";
}

.stat-card {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card__label {
  margin: 0;
  color: var(--ink-soft);
}

.stat-card__value {
  margin: 0.35rem 0 0;
  font-size: 1.7rem;
  font-weight: 800;
}

.section-heading {
  margin-bottom: 0.6rem;
}

.progress-bar {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: #f7ebe1;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffcf6f 0%, #ff8f7a 100%);
  transition: width 0.45s ease;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 0.85rem;
}

.day-card {
  position: relative;
  border: 0;
  padding: 0.95rem 0.75rem;
  border-radius: 18px;
  background: #fff;
  text-align: left;
  box-shadow: 0 10px 24px rgba(107, 88, 73, 0.08);
  min-height: 92px;
}

.day-card__number {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
}

.day-card__title {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.day-card__star {
  position: absolute;
  top: 0.65rem;
  right: 0.7rem;
  font-size: 1rem;
  color: #ffb235;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.day-card.is-complete .day-card__star {
  opacity: 1;
  transform: scale(1);
}

.day-card.is-active {
  transform: translateY(-2px);
  outline: 3px solid rgba(255, 159, 103, 0.35);
}

.phase-1 {
  background: linear-gradient(180deg, #fff5ec, #fff);
}

.phase-2 {
  background: linear-gradient(180deg, #fff0f3, #fff);
}

.phase-3 {
  background: linear-gradient(180deg, #f2fbf7, #fff);
}

.phase-4 {
  background: linear-gradient(180deg, #eef7ff, #fff);
}

.lesson-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1rem 0 1.25rem;
}

.lesson-panel {
  width: 100%;
}

.lesson-card__box,
.task-item,
.badge {
  background: #fffdfa;
  border: 1px solid rgba(232, 217, 204, 0.8);
  border-radius: var(--radius-md);
}

.lesson-card__box {
  padding: 1rem;
}

.tasks-form {
  display: grid;
  gap: 1rem;
}

#tasksContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.task-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 0.8rem;
  padding: 0.9rem;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.task-item.is-correct {
  border-color: rgba(47, 154, 104, 0.45);
  background: rgba(217, 244, 230, 0.78);
  box-shadow: 0 12px 24px rgba(47, 154, 104, 0.08);
}

.task-item.is-wrong {
  border-color: rgba(214, 94, 94, 0.42);
  background: rgba(255, 232, 232, 0.82);
  box-shadow: 0 12px 24px rgba(214, 94, 94, 0.08);
}

.task-item.is-blank {
  border-color: rgba(219, 162, 54, 0.42);
  background: rgba(255, 242, 203, 0.84);
  box-shadow: 0 12px 24px rgba(219, 162, 54, 0.08);
}

.task-item__index {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffe4af, #ffc8b6);
  color: #9a5d33;
  font-weight: 800;
  font-size: 1rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.task-item.is-correct .task-item__index {
  background: linear-gradient(135deg, #8fe0b8, #63c48e);
  color: #fff;
}

.task-item.is-wrong .task-item__index {
  background: linear-gradient(135deg, #ffbbb6, #ff8c8c);
  color: #fff;
}

.task-item.is-blank .task-item__index {
  background: linear-gradient(135deg, #ffe8a3, #ffc96f);
  color: #8a5b12;
}

.task-item__body {
  display: grid;
  gap: 0.55rem;
}

.task-item__prompt {
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.4;
}

.task-item__input {
  width: 100%;
  max-width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid #d9c8bb;
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.2s ease, background 0.2s ease;
  scroll-margin-top: calc(var(--timer-shell-height) + 2rem);
  scroll-margin-bottom: 35vh;
}

.task-item.is-correct .task-item__input {
  border-color: rgba(47, 154, 104, 0.65);
  background: rgba(255, 255, 255, 0.96);
}

.task-item.is-wrong .task-item__input {
  border-color: rgba(214, 94, 94, 0.65);
  background: rgba(255, 255, 255, 0.96);
}

.task-item.is-blank .task-item__input {
  border-color: rgba(219, 162, 54, 0.65);
  background: rgba(255, 255, 255, 0.96);
}

.feedback {
  min-height: 68px;
  margin-top: 0.35rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-soft);
}

.feedback.is-success {
  background: rgba(217, 244, 230, 0.72);
  color: #256e4d;
  animation: popIn 0.45s ease;
}

.feedback.is-try-again {
  background: rgba(255, 232, 163, 0.45);
  color: #8a6b24;
}

.stars-row,
.badges-grid,
.completed-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.star-chip,
.completed-chip {
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(232, 217, 204, 0.8);
  font-weight: 800;
}

.star-chip {
  color: #b07400;
}

.badge {
  padding: 0.95rem 1rem;
  flex: 1 1 170px;
}

.badge.is-locked {
  opacity: 0.55;
}

.badge__title {
  display: block;
  font-weight: 800;
}

.badge__text {
  display: block;
  margin-top: 0.15rem;
  color: var(--ink-soft);
}

.celebration {
  position: fixed;
  inset: auto 1rem 1rem auto;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff5bc, #ffd1bf);
  box-shadow: var(--shadow);
  font-weight: 800;
  animation: popIn 0.45s ease;
  z-index: 50;
}

@keyframes floatCard {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  .hero,
  .content-grid,
  .bottom-grid,
  .overview-panel {
    grid-template-columns: 1fr;
  }

  .hero__art {
    min-height: 210px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 100%);
  }

  .hero,
  .panel,
  .progress-card,
  .stat-card {
    padding: 1rem;
  }

  .lesson-card {
    grid-template-columns: 1fr;
  }

  .timer-card__actions {
    justify-content: flex-end;
  }

  .timer-card__button {
    width: auto;
    padding: 0.48rem 0.62rem;
    font-size: 0.78rem;
  }

  .page-shell,
  .timer-shell {
    width: min(100% - 1rem, 100%);
  }

  .timer-card {
    gap: 0.45rem;
    padding: 0.42rem 0.5rem;
    border-radius: 15px;
  }

  .timer-card__label {
    font-size: 0.68rem;
  }

  .timer-card__time {
    font-size: 1.22rem;
  }

  #tasksContainer {
    grid-template-columns: 1fr;
  }

  .day-card {
    min-height: 84px;
  }
}
