html {
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 172, 203, 0.24), transparent 22%),
    radial-gradient(circle at 85% 12%, rgba(126, 211, 255, 0.24), transparent 20%),
    radial-gradient(circle at 50% 28%, rgba(174, 150, 255, 0.16), transparent 24%),
    linear-gradient(180deg, #eef3ff 0%, #e8f0ff 40%, #e2ecff 100%);
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #172033;
  -webkit-tap-highlight-color: transparent;
  font-family: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

textarea,
button,
input {
  font: inherit;
}

textarea {
  resize: none;
}

pre {
  margin: 0;
}

button,
a,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.safe-pb {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

.glass-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  box-shadow:
    0 18px 45px rgba(68, 88, 145, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.hero-grid {
  background-image:
    linear-gradient(rgba(117, 96, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(117, 96, 255, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

.app-shell {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.65), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.12));
}

.candy-card {
  position: relative;
  overflow: hidden;
}

.candy-card::after {
  content: "";
  position: absolute;
  inset: auto -20px -30px auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.38), transparent 70%);
  pointer-events: none;
}

.section-banner {
  background:
    linear-gradient(135deg, rgba(245, 238, 255, 0.96), rgba(233, 247, 255, 0.94)),
    linear-gradient(135deg, rgba(117, 96, 255, 0.16), rgba(74, 201, 255, 0.16));
  border: 1px solid rgba(212, 221, 255, 0.9);
  box-shadow:
    0 14px 30px rgba(123, 110, 216, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.soft-dots {
  background-image:
    radial-gradient(rgba(117, 96, 255, 0.14) 1.2px, transparent 1.2px);
  background-size: 18px 18px;
}

.app {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 16px 16px 110px;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.card {
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  padding: 20px;
}

.hero {
  border-radius: 32px;
  padding: 20px;
}

.hero h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.05;
}

.hero .body-text {
  margin-top: 12px;
}

.hero-label,
.code-pill,
.assignment-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-label,
.code-pill {
  background: #ecebff;
  color: #4f39d2;
}

.assignment-badge {
  background: #fff0cf;
  color: #a25b00;
}

.body-text {
  margin: 10px 0 0;
  color: #576885;
  font-size: 0.98rem;
  line-height: 1.58;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.stat-pill {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px;
  text-align: center;
}

.stat-pill strong {
  display: block;
  font-size: 1.15rem;
  color: #18233d;
}

.stat-pill span {
  display: block;
  margin-top: 4px;
  font-size: 0.76rem;
  color: #6b7a96;
}

.hero-box {
  border-radius: 28px;
  padding: 20px;
  color: #fff;
  background: linear-gradient(135deg, #6a56ff, #47b9ff);
}

.hero-box h2 {
  margin: 10px 0 0;
  font-size: 1.7rem;
  line-height: 1.12;
}

.hero-box .btn {
  margin-top: 18px;
}

.hero-tagline {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.9rem;
  font-weight: 700;
}

.works-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 24px;
  padding: 16px;
  color: #fff;
  background: linear-gradient(135deg, #162033, #4f39d2);
}

.works-count {
  margin-top: 4px;
  font-size: 1.35rem;
  font-weight: 800;
}

.muted-light {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
}

.section-head,
.section-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2,
.section-head h3,
.card h3,
.card h2,
.assignment-card h4 {
  margin: 0;
  color: #18233d;
  line-height: 1.2;
}

.section-head span {
  color: #72809a;
  font-size: 0.9rem;
  font-weight: 700;
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.lesson-list-item {
  width: 100%;
  border: 1px solid #dde4f2;
  border-radius: 24px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  background: linear-gradient(135deg, #ffffff, #f4fbff);
  color: #18233d;
}

.lesson-topic {
  display: inline-block;
  color: #5f46f2;
  font-size: 0.88rem;
  font-weight: 800;
}

.lesson-title,
.lesson-screen-title {
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 800;
  color: #18233d;
}

.lesson-screen-title {
  font-size: 1.75rem;
}

.lesson-badge {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #6b7a96;
  background: #eef2f7;
}

.lesson-badge.is-done {
  color: #0f8b63;
  background: #dff7ee;
}

.lesson-list-item.is-soft-done {
  background: linear-gradient(135deg, #f5fffb, #eafaf5);
}

.progress-mark {
  color: #6b7a96;
  font-weight: 800;
}

.achievement-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 22px;
  border: 1px solid #dde4f2;
  padding: 14px;
  background: #f8f9fd;
}

.achievement-card.is-unlocked {
  border-color: #d5ccff;
  background: linear-gradient(135deg, #f5f0ff, #eef8ff);
}

.achievement-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: #fff;
}

.achievement-title {
  font-weight: 800;
  color: #18233d;
}

.achievement-text {
  margin-top: 4px;
  color: #72809a;
  font-size: 0.92rem;
  line-height: 1.5;
}

.material-box,
.section-banner {
  margin-top: 14px;
  border-radius: 24px;
  padding: 16px;
}

.practice-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.practice-task {
  border-radius: 20px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f8f4ff, #eef7ff);
  border: 1px solid rgba(213, 220, 246, 0.95);
}

.practice-task__title {
  color: #24314f;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.35;
}

.practice-task__text {
  margin-top: 8px;
}

.section-banner__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.section-banner__title,
.material-title,
.section-label,
.result-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  color: #536580;
}

.material-text,
.section-banner__text {
  margin-top: 8px;
}

.material-box .btn,
.section-banner .btn {
  margin-top: 14px;
}

.code-preview,
.result-box,
.code-textarea {
  width: 100%;
  border-radius: 24px;
  background: #050b25;
  color: #d2f6de;
  padding: 18px;
  font-family: "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.94rem;
  line-height: 1.62;
}

.code-preview {
  margin-top: 12px;
  color: #c7ecff;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.code-textarea {
  min-height: 220px;
  color: #c7ecff;
  border: 1px solid #dbe2f0;
  resize: vertical;
}

.code-textarea--embedded {
  border: 0;
  box-shadow: none;
}

.editor-title {
  margin-top: 12px;
  font-size: 1rem;
  font-weight: 800;
  color: #18233d;
  line-height: 1.25;
}

.editor-subtitle {
  margin-top: 6px;
  color: #72809a;
  line-height: 1.5;
  font-size: 0.95rem;
}

.editor-shell {
  margin-top: 12px;
}

.editor-shell--embedded {
  margin-top: 10px;
}

.button-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 22px;
  padding: 15px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.96rem;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #6a56ff, #47b9ff);
}

.btn-light,
.btn-plain-light {
  background: #fff;
  color: #4f39d2;
}

.btn-dark {
  color: #fff;
  background: linear-gradient(135deg, #131d33, #273652);
}

.btn-soft,
.btn-outline,
.btn-outline-brand {
  background: #fff;
  color: #41506a;
  border: 1px solid #d9e0ec;
}

.btn-outline-brand {
  color: #5f46f2;
  border-color: #d5ccff;
}

.btn-success {
  color: #fff;
  background: linear-gradient(135deg, #2cc18c, #14a6a3);
}

.btn-danger {
  color: #b13a54;
  background: #ffeef2;
}

.percent-pill {
  border-radius: 18px;
  padding: 12px 14px;
  background: #ecebff;
  color: #5f46f2;
  font-weight: 800;
}

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

.progress-bar__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #6a56ff, #47b9ff);
}

.assignment-card,
.work-card {
  border-radius: 24px;
  border: 1px solid #dde4f2;
  padding: 16px;
  background: linear-gradient(135deg, #fffdfd, #f0f6ff);
  box-shadow: 0 12px 26px rgba(84, 102, 154, 0.08);
}

.work-title {
  font-size: 1rem;
  font-weight: 800;
  color: #18233d;
  line-height: 1.25;
}

.work-date,
.empty-box {
  color: #72809a;
  font-size: 0.94rem;
}

.work-date {
  margin-top: 6px;
}

.hint-inline {
  margin-top: 12px;
  border-radius: 20px;
  padding: 14px 16px;
  color: #4636b7;
  background: linear-gradient(135deg, #f0ecff, #e9f4ff);
  border: 1px solid rgba(210, 218, 255, 0.85);
}

.result-box {
  margin-top: 10px;
  min-height: 110px;
  color: #d9ffe7;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

.assignment-card .result-box {
  min-height: 120px;
}

.assignment-card h4 {
  margin-top: 10px;
}

.assignment-card .code-textarea {
  min-height: 180px;
  font-size: 0.92rem;
}

.assignment-card .button-stack {
  gap: 10px;
}

.assignment-card .body-text {
  margin-bottom: 0;
}

.section-label,
.result-title {
  margin-top: 16px;
}

.card > .section-label:first-child,
.card > .code-pill:first-child,
.assignment-card > .assignment-badge:first-child,
.editor-shell > .code-pill:first-child,
.section-banner > h3:first-child,
.material-box > .material-title:first-child {
  margin-top: 0;
}

.code-pill + .editor-title,
.assignment-badge + h4,
.section-label + .body-text,
.material-title + .body-text,
.result-title + .code-preview,
.result-title + .result-box {
  margin-top: 10px;
}

.empty-box {
  padding: 4px 2px 2px;
  line-height: 1.5;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 20;
  width: calc(100% - 24px);
  max-width: 430px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
}

.nav-btn {
  border: 0;
  border-radius: 18px;
  padding: 12px 8px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #66758f;
  background: rgba(255, 255, 255, 0.88);
}

.nav-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, #131d33, #4f39d2);
}

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 40;
  width: calc(100% - 32px);
  max-width: 360px;
  transform: translateX(-50%);
  border-radius: 18px;
  padding: 12px 16px;
  text-align: center;
  font-weight: 800;
  color: #fff;
  background: #131d33;
  box-shadow: 0 16px 36px rgba(19, 29, 51, 0.22);
}

@media (max-width: 420px) {
  .app {
    padding-left: 14px;
    padding-right: 14px;
  }

  .card,
  .hero,
  .assignment-card,
  .work-card {
    padding: 18px;
  }

  .lesson-screen-title {
    font-size: 1.55rem;
  }

  .code-preview,
  .result-box,
  .code-textarea {
    padding: 16px;
    font-size: 0.9rem;
    line-height: 1.56;
  }

  .btn {
    padding: 14px 16px;
    font-size: 0.92rem;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .section-banner__header,
  .section-top,
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }
}
