* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --text: #eef4ff;
  --muted: #adc0e8;
  --line: rgba(255,255,255,0.08);
}

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, #14315a 0%, #07111f 42%, #050b14 100%);
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

body { padding: env(safe-area-inset-top) 0 calc(88px + env(safe-area-inset-bottom)); }
img { display: block; max-width: 100%; }
button, a { font: inherit; }

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(circle at top, #17386c 0%, #0c1830 45%, #050b14 100%);
  transition: opacity .35s ease, visibility .35s ease;
}
.splash-screen.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-logo {
  width: min(280px, 74vw);
  filter: drop-shadow(0 14px 24px rgba(0,0,0,0.25));
}
.splash-screen p {
  margin: 0;
  color: #dfe9ff;
  font-weight: 700;
}

.app-shell { width: 100%; max-width: 520px; margin: 0 auto; }
.topbar { padding: 18px 16px 6px; }

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-logo {
  width: min(250px, 68vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.28));
}

.share-btn, .ghost-btn.small-btn {
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: var(--text);
  padding: 10px 14px;
  font-weight: 700;
}

.hero-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 28px;
  background:
    linear-gradient(140deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05)),
    linear-gradient(145deg, #15284d, #0c1830 72%);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
  overflow: hidden;
  position: relative;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(255,183,3,0.28), rgba(255,183,3,0));
  pointer-events: none;
}

.pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,183,3,0.15);
  color: #ffd774;
  font-weight: 700;
  font-size: 12px;
}

.hero-copy h1 { margin: 12px 0 10px; font-size: 28px; line-height: 1.04; }
.hero-copy p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }

.hero-actions, .feature-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.hero-mascot {
  width: 155px;
  margin: 18px auto 0;
  filter: drop-shadow(0 16px 24px rgba(0,0,0,0.25));
  animation: floaty 3.8s ease-in-out infinite;
}

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

.primary-btn, .secondary-btn, .ghost-btn, .support-btn, .mini-btn, .install-btn, .continue-btn {
  border: 0;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}
.primary-btn:active, .secondary-btn:active, .ghost-btn:active, .support-btn:active, .mini-btn:active, .install-btn:active, .continue-btn:active {
  transform: scale(.98);
}

.primary-btn {
  padding: 13px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffcf33, #ff9c00);
  color: #1f1500;
  font-weight: 800;
}
.secondary-btn, .ghost-btn {
  padding: 13px 18px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-weight: 700;
}

.main-content { padding: 8px 16px 18px; }
.section { display: none; }
.section.active { display: block; }

.install-card, .progress-card, .continue-card {
  margin-bottom: 14px;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 28px rgba(0,0,0,0.18);
}

.install-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255,183,3,0.18), rgba(255,79,149,0.16));
}

.install-copy h2, .continue-card h3 {
  margin: 4px 0 6px;
}
.install-copy p, .continue-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.install-btn {
  min-width: 142px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffcf33, #ff7b00);
  color: #1f1500;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(255,156,0,0.22);
  animation: pulseGlow 2.2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 10px 20px rgba(255,156,0,0.22); }
  50% { box-shadow: 0 12px 28px rgba(255,156,0,0.34); }
}

.progress-card {
  padding: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
}

.progress-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-label {
  display: block;
  color: #ffd774;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.progress-topline h2 {
  margin: 0;
  font-size: 18px;
}

.progress-starline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.star-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(124,216,0,0.14);
  color: #dfffb4;
  font-size: 12px;
  font-weight: 800;
}
.star-chip.subtle {
  background: rgba(255,255,255,0.08);
  color: #e8f0ff;
}

.progress-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 11.11%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7cd800, #ffcf33);
  transition: width .3s ease;
}

.continue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(160deg, rgba(47,128,255,0.18), rgba(255,79,149,0.12));
}

.continue-btn {
  white-space: nowrap;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.12);
  color: var(--text);
  font-weight: 800;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 12px;
  gap: 12px;
}
.section-head h2 { margin: 0; font-size: 20px; }
.section-link { color: #ffd774; font-size: 13px; font-weight: 700; }

.feature-card {
  padding: 16px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(47,128,255,0.22), rgba(255,79,149,0.16));
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
}
.feature-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.12);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 22px; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.55; }

.card-grid { display: grid; gap: 14px; }

.lesson-card, .material-card, .support-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}
.lesson-card {
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.lesson-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(0,0,0,0.22);
}
.lesson-card.locked {
  opacity: .72;
}

.thumb { height: 128px; position: relative; overflow: hidden; }
.thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 25% 20%, rgba(255,255,255,0.16), rgba(255,255,255,0) 40%);
}
.thumb-1 { background: linear-gradient(135deg, #3654ff, #00b8ff); }
.thumb-2 { background: linear-gradient(135deg, #ff4f95, #ff9c00); }
.thumb-3 { background: linear-gradient(135deg, #33b249, #9fe300); }
.thumb-4 { background: linear-gradient(135deg, #7b61ff, #4cc9f0); }
.thumb-5 { background: linear-gradient(135deg, #fb8500, #ffd166); }
.thumb-6 { background: linear-gradient(135deg, #00b894, #55efc4); }

.thumb-tag, .status-badge {
  position: absolute;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.thumb-tag {
  left: 12px;
  top: 12px;
  background: rgba(7,17,31,0.32);
}
.status-badge {
  right: 12px;
  bottom: 12px;
  background: rgba(15, 23, 42, .45);
}
.locked-badge {
  background: rgba(0,0,0,.32);
}

.lesson-body { padding: 14px; }
.lesson-body h3 { margin: 0 0 6px; font-size: 18px; }
.lesson-body p { margin: 0; color: var(--muted); line-height: 1.45; font-size: 14px; }

.lesson-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.mini-btn {
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff;
  color: #09111f;
  font-weight: 800;
}
.mini-link {
  color: #ffd774;
  text-decoration: none;
  font-weight: 700;
}

.material-list { display: grid; gap: 12px; }
.material-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
}
.material-card strong { display: block; margin-bottom: 4px; font-size: 17px; }
.material-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.material-card span {
  min-width: 52px;
  text-align: center;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255,183,3,0.18);
  color: #ffd774;
  font-weight: 800;
}

.support-card { padding: 18px; }
.support-card p { margin: 0 0 16px; color: var(--muted); line-height: 1.55; }
.support-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  text-align: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(5,11,20,0), rgba(5,11,20,0.86) 35%, rgba(5,11,20,0.96));
  backdrop-filter: blur(14px);
}
.nav-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px 12px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-weight: 800;
}
.nav-item.active {
  color: #08101d;
  background: linear-gradient(135deg, #ffffff, #dce9ff);
  border-color: rgba(255,255,255,0.28);
}

.module-modal[hidden] { display: none; }
.module-modal { position: fixed; inset: 0; z-index: 60; }
.module-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.72); }
.module-sheet {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  border-radius: 24px;
  background: #09111f;
  border: 1px solid var(--line);
  padding: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
  max-height: 82vh;
  overflow: auto;
}
.module-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.close-module {
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  padding: 10px 12px;
  font-weight: 700;
}
.module-content p { color: var(--muted); line-height: 1.55; }
.module-list { display: grid; gap: 10px; margin-top: 12px; }
.module-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
}
.module-item strong { display: block; margin-bottom: 4px; }
.module-item-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.complete-btn, .watch-btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 14px;
  font-weight: 800;
  cursor: pointer;
}
.complete-btn {
  background: linear-gradient(135deg, #7cd800, #4caf50);
  color: #08120a;
}
.watch-btn {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

@media (max-width: 420px) {
  .install-card, .continue-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .install-btn, .continue-btn {
    width: 100%;
  }
}

@media (min-width: 460px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-card {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
    gap: 10px;
  }
  .hero-mascot {
    width: 170px;
    margin: 0 auto;
  }
}
