:root {
  --cream: #fff8ec;
  --paper: #fffdf8;
  --ink: #253047;
  --muted: #6e7790;
  --gold: #e7ad37;
  --gold2: #ffcf67;
  --sky: #66b8ff;
  --blue: #3a7bd5;
  --mint: #65d6a4;
  --rose: #ff7f91;
  --violet: #9b7cff;
  --line: rgba(37, 48, 71, .10);
  --shadow: 0 22px 60px rgba(37, 48, 71, .14);
  --soft: 0 10px 26px rgba(37, 48, 71, .10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 5%, rgba(255, 207, 103, .35), transparent 28rem),
    radial-gradient(circle at 90% 10%, rgba(102, 184, 255, .30), transparent 32rem),
    linear-gradient(180deg, #fffaf1 0%, #eef8ff 55%, #fff 100%);
  min-height: 100vh;
}

button, input, select { font: inherit; }
button { cursor: pointer; border: 0; }
.app-shell { min-height: 100vh; padding-bottom: 92px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px clamp(16px, 4vw, 42px);
  background: rgba(255, 253, 248, .78);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(255, 255, 255, .8);
}
.profile-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 8px 8px; border-radius: 999px;
  background: rgba(255,255,255,.76); border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--soft); font-weight: 950;
}
.profile-chip img {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 1000; letter-spacing: .2px; }
.brand-mark {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 16px;
  background: linear-gradient(145deg, var(--gold2), var(--gold));
  color: #fff; box-shadow: 0 12px 26px rgba(231, 173, 55, .36);
}
.brand small { display: block; color: var(--muted); font-weight: 800; font-size: 12px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 13px; border-radius: 999px;
  background: rgba(255, 255, 255, .82); border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: var(--soft); font-weight: 900; white-space: nowrap;
}
.pill.gold { color: #9a6b00; background: rgba(255, 207, 103, .28); }
.pill.blue { color: #155ca9; background: rgba(102, 184, 255, .20); }
.pill.mint { color: #0d7350; background: rgba(101, 214, 164, .20); }

.content { width: min(1420px, 100%); margin: 0 auto; padding: 22px clamp(14px, 3vw, 34px) 40px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 14px 0; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(42px, 7vw, 86px); line-height: .95; margin-bottom: 16px; }
h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 6px; }
h3 { font-size: 22px; margin-bottom: 8px; }
.muted { color: var(--muted); }
.hero {
  position: relative; overflow: hidden; min-height: 520px;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr); gap: 24px;
  border-radius: 38px; padding: clamp(24px, 4vw, 46px);
  background:
    linear-gradient(90deg, rgba(255, 253, 248, .98) 0%, rgba(255, 253, 248, .88) 46%, rgba(255,255,255,.2) 100%),
    url("/assets/hero-communion.png") center right / cover no-repeat;
  box-shadow: var(--shadow);
}
.hero-copy { align-self: center; max-width: 680px; }
.hero-visual { align-self: end; display: grid; gap: 14px; }
.floating {
  border-radius: 26px; padding: 18px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.8); box-shadow: var(--soft);
}
.mascot-card { display: flex; align-items: center; gap: 14px; }
.mascot {
  width: 78px; height: 78px; display: grid; place-items: center;
  border-radius: 28px; font-size: 42px;
  background: linear-gradient(145deg, rgba(255,207,103,.75), rgba(101,214,164,.50));
  box-shadow: 0 16px 30px rgba(231,173,55,.22);
}
.big-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.quest-dashboard {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; margin: 18px 0;
}
.metric-card {
  min-height: 122px; border-radius: 28px; padding: 18px;
  display: grid; align-content: center; justify-items: start; gap: 4px;
  color: var(--ink); border: 1px solid rgba(255,255,255,.82);
  box-shadow: var(--soft);
}
.metric-card span { font-size: 30px; }
.metric-card b { font-size: clamp(24px, 4vw, 36px); line-height: 1; }
.metric-card small { color: var(--muted); font-weight: 950; }
.metric-card.gold { background: linear-gradient(145deg, rgba(255,207,103,.40), rgba(255,255,255,.86)); }
.metric-card.mint { background: linear-gradient(145deg, rgba(101,214,164,.34), rgba(255,255,255,.86)); }
.metric-card.blue { background: linear-gradient(145deg, rgba(102,184,255,.32), rgba(255,255,255,.86)); }
.metric-card.rose { background: linear-gradient(145deg, rgba(255,127,145,.26), rgba(255,255,255,.86)); }
.streak-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px; align-items: center; margin-bottom: 18px;
}
.week-dots { display: grid; grid-template-columns: repeat(7, 44px); gap: 8px; }
.week-dots span {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 16px; font-weight: 1000;
  background: rgba(37,48,71,.08); color: var(--muted);
}
.week-dots span.active {
  color: #fff; background: linear-gradient(145deg, #7ce6ba, var(--mint));
  box-shadow: 0 12px 22px rgba(101,214,164,.26);
}
.promo-card {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  margin-top: 18px; padding: 20px; border-radius: 30px;
  background: linear-gradient(135deg, rgba(255,207,103,.30), rgba(102,184,255,.20)), rgba(255,255,255,.84);
  border: 1px solid rgba(255,255,255,.9); box-shadow: var(--shadow);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 13px 18px; border-radius: 18px;
  color: #fff; font-weight: 950;
  background: linear-gradient(145deg, var(--gold2), var(--gold));
  box-shadow: 0 12px 24px rgba(231,173,55,.28);
}
.btn.secondary { background: linear-gradient(145deg, var(--sky), var(--blue)); box-shadow: 0 12px 24px rgba(58,123,213,.22); }
.btn.mint { background: linear-gradient(145deg, #7ce6ba, var(--mint)); }
.btn.rose { background: linear-gradient(145deg, #ffa2b0, var(--rose)); }
.btn.dark { background: linear-gradient(145deg, #3e4964, #20283c); }
.btn.ghost { color: var(--ink); background: rgba(255,255,255,.84); border: 1px solid var(--line); box-shadow: var(--soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.image-card {
  position: relative; overflow: hidden; min-height: 210px; color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end;
  background-size: cover; background-position: center;
}
.image-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 15%, rgba(14, 23, 44, .78) 100%);
}
.image-card > * { position: relative; z-index: 1; }
.mini-icon {
  width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(10px); font-size: 27px;
}
.progress {
  height: 16px; border-radius: 999px; overflow: hidden; background: rgba(37,48,71,.10);
}
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), var(--gold2)); }
.track {
  display: grid; grid-template-columns: repeat(7, minmax(170px, 1fr)); gap: 14px;
  overflow-x: auto; padding-bottom: 10px;
}
.stage { min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; }
.stage.done { outline: 3px solid rgba(101,214,164,.35); }
.stars { color: var(--gold); letter-spacing: 2px; }
.learning-path {
  display: grid; grid-template-columns: repeat(12, minmax(82px, 1fr)); gap: 12px;
  padding: 18px; border-radius: 32px;
  background: linear-gradient(135deg, rgba(255,255,255,.78), rgba(234,247,255,.78));
  border: 1px solid rgba(255,255,255,.86); box-shadow: var(--shadow);
  overflow-x: auto;
}
.path-node {
  min-width: 82px; min-height: 116px; border-radius: 28px;
  display: grid; place-items: center; gap: 3px;
  background: rgba(255,255,255,.82); color: var(--ink);
  border: 2px solid rgba(37,48,71,.08); box-shadow: var(--soft);
  font-weight: 1000;
}
.path-node span {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  font-size: 24px; color: #fff; background: linear-gradient(145deg, var(--sky), var(--blue));
}
.path-node.done span { background: linear-gradient(145deg, #7ce6ba, var(--mint)); }
.path-node.current {
  border-color: var(--gold); transform: translateY(-5px);
  box-shadow: 0 0 0 7px rgba(255,207,103,.22), var(--shadow);
}
.path-node.current span {
  background: linear-gradient(145deg, var(--gold2), var(--gold));
  animation: pulse 1.6s ease-in-out infinite;
}
.path-node small { color: var(--muted); font-size: 11px; }
.chapter-rail {
  display: grid; grid-template-columns: repeat(8, minmax(150px, 1fr));
  gap: 10px; overflow-x: auto; padding: 6px 0 14px;
}
.chapter-pill {
  min-height: 76px; padding: 12px; border-radius: 24px;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px;
  background: rgba(255,255,255,.78); color: var(--ink); border: 2px solid rgba(37,48,71,.08);
  box-shadow: var(--soft); text-align: left;
}
.chapter-pill span { grid-row: span 2; font-size: 28px; }
.chapter-pill small { color: var(--muted); font-weight: 900; }
.chapter-pill.active { border-color: var(--gold); background: rgba(255,207,103,.22); }
.academy-path { display: grid; gap: 14px; }
.lesson-card {
  position: relative;
  display: grid; grid-template-columns: 74px 124px minmax(0, 1fr); gap: 16px; align-items: center;
}
.lesson-card.current { outline: 3px solid rgba(255,207,103,.35); }
.lesson-orb {
  width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 26px; font-weight: 1000;
  background: linear-gradient(145deg, var(--sky), var(--blue));
  box-shadow: 0 12px 24px rgba(58,123,213,.22);
}
.lesson-orb.done { background: linear-gradient(145deg, #7ce6ba, var(--mint)); }
.lesson-orb.current {
  background: linear-gradient(145deg, var(--gold2), var(--gold));
  animation: pulse 1.5s ease-in-out infinite;
}
.lesson-art {
  width: 124px; height: 104px; border-radius: 22px; background-size: cover; background-position: center;
  box-shadow: var(--soft);
}
.task-card { display: grid; align-content: space-between; min-height: 220px; }
.task-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.reward-badge {
  padding: 8px 10px; border-radius: 999px;
  color: #7b5400; background: rgba(255,207,103,.32);
  font-weight: 1000; white-space: nowrap;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 8px 11px; border-radius: 999px; background: rgba(102,184,255,.16);
  color: #155ca9; font-size: 13px; font-weight: 900;
}
.league-table { display: grid; gap: 10px; }
.league-row {
  display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px;
  padding: 13px; border-radius: 18px; background: rgba(255,255,255,.72); border: 1px solid var(--line);
}
.league-row.me { background: rgba(255,207,103,.24); outline: 2px solid rgba(231,173,55,.26); }
.story-list, .video-list { display: grid; gap: 14px; margin-top: 16px; }
.story-card {
  display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: center;
  padding: 12px; border-radius: 24px; background: rgba(255,255,255,.74);
  border: 1px solid var(--line); box-shadow: var(--soft);
}
.story-card img {
  width: 132px; height: 112px; object-fit: cover; border-radius: 20px;
}
.video-card {
  overflow: hidden; border-radius: 26px; background: rgba(255,255,255,.78);
  border: 1px solid var(--line); box-shadow: var(--soft);
}
.video-frame {
  aspect-ratio: 16 / 9; background: linear-gradient(145deg, #e9f5ff, #fff8ec);
}
.video-frame iframe {
  width: 100%; height: 100%; border: 0; display: block;
}
.video-meta { padding: 16px; }
.bottom-nav {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 30;
  width: min(860px, calc(100% - 24px)); display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  padding: 10px; border-radius: 28px; background: rgba(255,255,255,.82);
  backdrop-filter: blur(24px); box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.9);
}
.nav-btn {
  min-height: 58px; border-radius: 20px; background: transparent; color: var(--muted);
  display: grid; place-items: center; gap: 2px; font-weight: 950; font-size: 12px;
}
.nav-btn.active { color: #fff; background: linear-gradient(145deg, var(--sky), var(--blue)); }
.nav-btn span:first-child { font-size: 22px; }

.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px;
  background: rgba(21, 28, 44, .42); backdrop-filter: blur(8px);
}
.modal-card { width: min(820px, 100%); max-height: min(820px, 92vh); overflow: auto; }
.form { display: grid; gap: 12px; }
.field {
  width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.88);
  border-radius: 18px; min-height: 52px; padding: 0 15px; outline: none;
}
.quiz-options { display: grid; gap: 10px; }
.quiz-head { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.quiz-question {
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.08; font-weight: 1000; color: var(--ink);
  padding: 16px; border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,207,103,.20), rgba(102,184,255,.16));
}
.answer-panel {
  margin-top: 14px; padding: 14px 16px; border-radius: 18px; font-weight: 900;
}
.answer-panel.good { background: rgba(101,214,164,.22); color: #0d7350; }
.answer-panel.bad { background: rgba(255,127,145,.18); color: #8f2635; }
.lesson-task {
  border-left: 6px solid rgba(102,184,255,.55);
}
.character-line {
  padding: 12px 14px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(102,184,255,.18), rgba(255,207,103,.20));
  color: var(--ink); font-weight: 850;
}
.option {
  text-align: left; color: var(--ink); background: rgba(255,255,255,.76);
  border: 2px solid var(--line); border-radius: 18px; padding: 15px; font-weight: 900;
}
.option.correct { border-color: rgba(101,214,164,.9); background: rgba(101,214,164,.22); }
.option.wrong { border-color: rgba(255,127,145,.9); background: rgba(255,127,145,.18); }
.toast {
  position: fixed; right: 18px; top: 86px; z-index: 80; max-width: 360px;
  padding: 14px 16px; border-radius: 18px; background: #263047; color: #fff;
  box-shadow: var(--shadow); font-weight: 850;
}
.dev-code { padding: 12px; border-radius: 16px; background: rgba(255,207,103,.22); font-weight: 950; }
.creator-footer {
  width: min(1420px, 100%); margin: 0 auto; padding: 0 clamp(14px, 3vw, 34px) 24px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--muted); font-weight: 850;
}
.creator-footer b { color: var(--ink); }

.gate-screen {
  min-height: 100vh; display: grid; place-items: center; padding: clamp(16px, 4vw, 42px);
  background:
    linear-gradient(90deg, rgba(255, 253, 248, .98), rgba(255, 253, 248, .72)),
    url("/assets/hero-communion.png") center / cover no-repeat;
}
.gate-card {
  width: min(1180px, 100%);
  display: grid; grid-template-columns: .9fr 1.1fr; gap: 28px; align-items: center;
  padding: clamp(22px, 4vw, 42px); border-radius: 38px;
  background: rgba(255,255,255,.86); border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow); backdrop-filter: blur(22px);
}
.gate-preview {
  display: flex; align-items: center; gap: 14px; margin-top: 18px;
  padding: 14px; border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,207,103,.28), rgba(102,184,255,.20));
  border: 1px solid rgba(255,255,255,.9);
}
.gate-preview img {
  width: 74px; height: 74px; border-radius: 24px; object-fit: cover;
  box-shadow: 0 14px 28px rgba(37,48,71,.16);
}
.gate-preview b { display: block; font-size: 22px; }
.gate-preview span { display: block; color: var(--muted); font-weight: 850; margin-top: 3px; }
.avatar-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.avatar-choice {
  min-height: 154px; padding: 8px; border-radius: 24px;
  background: rgba(255,255,255,.82); border: 2px solid rgba(37,48,71,.08);
  color: var(--ink); font-weight: 950; text-align: left;
  box-shadow: var(--soft);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.avatar-choice:hover { transform: translateY(-3px); }
.avatar-choice img {
  width: 100%; height: 106px; border-radius: 18px; object-fit: cover; display: block; margin-bottom: 8px;
}
.avatar-choice.selected {
  border-color: var(--gold); box-shadow: 0 0 0 5px rgba(231,173,55,.20), var(--shadow);
}
.avatar-choice.selected::after {
  content: "Wybrany"; display: inline-block; margin-top: 7px;
  padding: 5px 9px; border-radius: 999px; color: #7b5400;
  background: rgba(255,207,103,.34); font-size: 12px;
}
.account-hero {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
}
.account-hero img {
  width: 86px; height: 86px; border-radius: 26px; object-fit: cover;
  box-shadow: var(--soft);
}
.account-hero h3 { margin-bottom: 2px; }

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 12px 24px rgba(231,173,55,.28); }
  50% { transform: scale(1.08); box-shadow: 0 18px 34px rgba(231,173,55,.40); }
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: auto; background-position: center; }
  .hero-visual { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quest-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .streak-card { grid-template-columns: 1fr; }
  .grid.four, .grid.three, .grid.two { grid-template-columns: 1fr; }
  .promo-card { align-items: flex-start; flex-direction: column; }
  .lesson-card { grid-template-columns: 74px minmax(0, 1fr); }
  .lesson-art { width: 100%; height: 180px; }
  .lesson-card .lesson-art { grid-column: 1 / -1; }
  .gate-card { grid-template-columns: 1fr; }
  .story-card { grid-template-columns: 1fr; }
  .story-card img { width: 100%; height: 180px; }
}

@media (max-width: 640px) {
  .topbar { align-items: flex-start; }
  .stats, .profile-chip { display: none; }
  .bottom-nav { grid-template-columns: repeat(3, 1fr); }
  h1 { font-size: 42px; }
  .hero { border-radius: 26px; padding: 22px; }
  .hero-visual, .quest-dashboard { grid-template-columns: 1fr; }
  .week-dots { grid-template-columns: repeat(7, 36px); }
  .week-dots span { width: 36px; height: 36px; border-radius: 13px; }
  .avatar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
