:root {
  --bg-top: #eff8ff;
  --bg-bottom: #dceffd;
  --panel: #ffffff;
  --ink: #143152;
  --muted: #5e6e82;
  --accent: #1f6f8b;
  --accent-strong: #155c75;
  --border-soft: #d7e6f3;
  --shadow: 0 22px 45px rgba(16, 55, 95, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Barlow", "Trebuchet MS", "Gill Sans", sans-serif;
  color: var(--ink);
  background: linear-gradient(155deg, var(--bg-top), var(--bg-bottom));
}

.background-glow {
  position: fixed;
  inset: -30% auto auto -12%;
  width: 68vw;
  height: 68vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(92, 177, 214, 0.34), rgba(92, 177, 214, 0));
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1020px, 94vw);
  margin: 0 auto;
  padding: 1.2rem 0 3rem;
}

.app-header {
  min-height: 3rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.panel,
.home-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border-soft);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 2.6vw, 2.4rem);
}

.home-card {
  min-height: calc(100vh - 9rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
}

.logo-image {
  width: min(860px, 92%);
  max-height: 62vh;
  object-fit: contain;
}

.logo-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.92;
  margin-bottom: 1rem;
}

.fallback-top {
  font-family: "Outfit", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  color: #6f7782;
}

.fallback-main {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 6rem);
  color: #1f4578;
}

.fallback-bottom {
  font-family: "Outfit", sans-serif;
  font-weight: 500;
  font-size: clamp(2.5rem, 7vw, 5.1rem);
  color: #23758a;
}

h1 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

h2 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
}

.subtitle {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.level-list {
  margin-top: 1.4rem;
  display: grid;
  gap: 0.9rem;
}

.level-button,
.day-button,
.calendar-day-button,
.primary-button,
.ghost-button {
  border-radius: 14px;
  border: 1px solid transparent;
  font: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 0.86rem 2rem;
  font-size: 1.02rem;
  box-shadow: 0 12px 24px rgba(24, 84, 109, 0.3);
}

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

.ghost-button {
  border-color: #adc8de;
  background: #fff;
  color: #1b4f77;
  padding: 0.55rem 0.9rem;
  font-weight: 500;
}

.ghost-button:hover {
  background: #f4fafe;
}

.level-button {
  text-align: left;
  padding: 1rem;
  border-color: #c2d7e8;
  background: #f8fcff;
  color: #1e4368;
  font-weight: 600;
}

.active-level:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(57, 105, 141, 0.18);
}

.locked {
  opacity: 0.58;
  cursor: not-allowed;
}

.week-sections {
  margin-top: 1.1rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.schedule-calendar {
  min-width: 980px;
  display: grid;
  gap: 0.7rem;
}

.mobile-schedule {
  display: none;
}

.calendar-header,
.calendar-row {
  display: grid;
  gap: 0.7rem;
}

.calendar-header {
  grid-template-columns: 185px repeat(5, minmax(0, 1fr));
}

.calendar-row {
  grid-template-columns: 185px 1fr;
}

.calendar-week-header,
.calendar-weekday {
  border: 1px solid #c5dced;
  border-radius: 12px;
  background: #edf7ff;
  color: #1f4f74;
  font-weight: 700;
  padding: 0.55rem 0.6rem;
  text-align: center;
}

.calendar-row-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.calendar-week-label {
  border: 1px solid #d6e7f4;
  border-radius: 14px;
  padding: 0.7rem;
  background: #f8fcff;
  display: grid;
  align-content: center;
  gap: 0.2rem;
}

.calendar-week-name {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  color: #1f4f74;
}

.calendar-week-theme {
  font-size: 0.86rem;
  color: #456783;
  line-height: 1.2;
}

.mobile-week {
  border: 1px solid #d6e7f4;
  border-radius: 16px;
  padding: 0.8rem;
  background: #fbfdff;
  margin-bottom: 0.75rem;
}

.mobile-week-title {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

.mobile-day-list {
  display: grid;
  gap: 0.55rem;
}

.mobile-day-button {
  padding: 0.78rem;
  border-color: #bcd5e8;
  background: #fff;
  text-align: left;
  display: grid;
  gap: 0.25rem;
  border-radius: 12px;
  font: inherit;
  cursor: pointer;
}

.day-button {
  padding: 0.85rem;
  border-color: #bcd5e8;
  background: #fff;
  text-align: left;
  display: grid;
  gap: 0.25rem;
}

.calendar-day-button {
  padding: 0.85rem;
  border-color: #bcd5e8;
  background: #fff;
  text-align: left;
  display: grid;
  gap: 0.25rem;
  min-height: 108px;
}

.day-button:hover,
.calendar-day-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(42, 93, 132, 0.14);
}

.day-number {
  font-weight: 700;
  color: #1c4e78;
}

.day-topic {
  color: #254b6b;
  font-size: 0.95rem;
}

.focus-line {
  margin: 0.42rem 0 1.2rem;
  font-size: 1.03rem;
  color: #2c5676;
}

.content-card {
  border: 1px solid #d4e5f2;
  border-radius: 16px;
  padding: 1rem;
  background: #fcfeff;
  margin-bottom: 0.85rem;
}

.content-card ul {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.42rem;
}

.reading-text {
  margin-top: 0.65rem;
}

.reading-subtitle {
  margin: 0 0 0.85rem;
  font-weight: 600;
  color: #245a7e;
}

.reading-heading {
  margin: 1rem 0 0.5rem;
  font-family: "Outfit", sans-serif;
  font-size: 1.03rem;
  color: #1f4d72;
}

.reading-ordered {
  margin: 0.2rem 0 0.9rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.reading-item {
  margin: 0;
}

.reading-item-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  color: #1e4e73;
}

.reading-figure {
  margin: 0.2rem 0 0.8rem;
  border: 1px solid #cfe1f0;
  border-radius: 12px;
  background: #f8fcff;
  overflow: hidden;
  max-width: 52%;
}

.reading-image {
  width: 100%;
  display: block;
}

.reading-caption {
  margin: 0;
  padding: 0.45rem 0.6rem 0.55rem;
  font-size: 0.9rem;
  color: #2d5b7d;
  background: #eef7ff;
  border-top: 1px solid #d7e7f4;
}

.reading-table-wrap {
  margin: 0.25rem 0 0.85rem;
  overflow-x: auto;
  border: 1px solid #cfe1f0;
  border-radius: 10px;
  background: #ffffff;
}

.reading-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.reading-table th,
.reading-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #e1edf6;
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
  color: #204764;
}

.reading-table th {
  background: #eef7ff;
  color: #1e4e73;
  font-weight: 700;
}

.reading-table tbody tr:last-child td {
  border-bottom: none;
}

.reading-bullets {
  margin: 0.2rem 0 0.85rem;
  padding-left: 1.1rem;
  color: #204764;
  display: grid;
  gap: 0.35rem;
}

.reading-text p {
  margin: 0 0 0.85rem;
  line-height: 1.55;
  color: #204764;
}

.reading-text p:last-child {
  margin-bottom: 0;
}

.quiz-progress {
  margin: 0.2rem 0 0.6rem;
  color: #2d5f83;
  font-weight: 600;
}

.quiz-question {
  margin: 0 0 0.75rem;
  color: #173f61;
  font-weight: 600;
}

.quiz-options {
  display: grid;
  gap: 0.55rem;
}

.quiz-option {
  text-align: left;
  border: 1px solid #b7d1e4;
  background: #ffffff;
  color: #173f61;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  cursor: pointer;
}

.quiz-option:hover {
  background: #f3faff;
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-option.correct {
  border-color: #4f9a67;
  background: #edf9f1;
}

.quiz-option.incorrect {
  border-color: #c46d6d;
  background: #fff2f2;
}

.quiz-feedback {
  margin: 0.7rem 0 0;
  min-height: 1.4rem;
  line-height: 1.45;
}

.correct-feedback {
  color: #23663c;
}

.incorrect-feedback {
  color: #8a2f2f;
}

.quiz-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.mantra-card {
  background: linear-gradient(120deg, #eaf8ff, #f3fcff);
}

.mantra-card p {
  margin: 0.5rem 0 0;
  color: #245674;
}

.fade-up {
  animation: fadeUp 0.35s ease;
}

.hidden {
  display: none !important;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: 95vw;
    padding-top: 0.75rem;
  }

  .home-card {
    min-height: calc(100vh - 5.2rem);
  }

  .panel,
  .home-card {
    border-radius: 18px;
  }

  .schedule-calendar {
    display: none;
  }

  .mobile-schedule {
    display: block;
  }

  .reading-figure {
    max-width: 100%;
  }
}
