:root{
  --bg1:#bfe9ff;
  --bg2:#d9ffd6;
  --card:#ffffffcc;
  --card2:#ffffff;
  --text:#0c1b2a;
  --muted:#4b647a;
  --shadow: 0 18px 50px rgba(0,0,0,.12);
  --shadow2: 0 10px 22px rgba(0,0,0,.10);
  --radius: 18px;
  --green:#22c55e;
  --blue:#3b82f6;
  --line: rgba(0,0,0,.08);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background: radial-gradient(1200px 600px at 20% 10%, var(--bg1), transparent 60%),
              radial-gradient(1200px 700px at 90% 20%, var(--bg2), transparent 55%),
              linear-gradient(180deg, #f7fbff, #fff7e9);
  overflow-x:hidden;
}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand{ display:flex; gap:12px; align-items:center; }
.logo{
  width:44px; height:44px; border-radius:14px;
  display:grid; place-items:center;
  background:#fff;
  box-shadow: var(--shadow2);
  font-size:22px;
}
.brandText .title{ font-weight:800; font-size:18px; }
.brandText .subtitle{ font-size:12px; color:var(--muted); margin-top:2px; }

.stats{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.pill{
  display:flex; align-items:center; gap:8px;
  padding:10px 12px;
  border-radius:999px;
  background:#fff;
  border:1px solid var(--line);
  box-shadow: var(--shadow2);
  font-size:13px;
}
.userPill b{ max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.wrap{ max-width:1100px; margin:0 auto; padding:22px 18px 40px; }

.hero{
  display:grid;
  grid-template-columns: 1fr 220px;
  gap:14px;
  align-items:stretch;
  margin-top:10px;
}
.heroCard{
  background: rgba(255,255,255,.65);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:22px 22px;
}
.heroCard h1{ margin:0; font-size:28px; letter-spacing:.2px; }
.heroCard p{ margin:6px 0 0; color:var(--muted); }

.btnPrimary{
  border:none;
  border-radius: 18px;
  background: linear-gradient(180deg, #2ee57a, #14b85b);
  color:#053019;
  font-weight:900;
  cursor:pointer;
  box-shadow: 0 12px 24px rgba(20,184,91,.25);
  font-size:16px;
  padding:18px 16px;
}
.btnPrimary:hover{ filter:brightness(1.02); transform: translateY(-1px); }
.btnPrimary:active{ transform: translateY(0px); }

.gridTitle{ margin:22px 0 10px; }
.gridTitle h2{ margin:0; font-size:22px; }
.hint{ color:var(--muted); font-size:13px; margin-top:4px; }

.grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:14px;
}
@media (max-width: 980px){
  .hero{ grid-template-columns:1fr; }
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .grid{ grid-template-columns: 1fr; }
}

.unitCard{
  background: rgba(255,255,255,.75);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding:16px;
  position:relative;
  overflow:hidden;
}
.unitTop{ display:flex; gap:10px; align-items:center; }
.unitIcon{
  width:44px; height:44px; border-radius:14px;
  display:grid; place-items:center;
  background:#fff;
  border:1px solid var(--line);
  font-size:20px;
}
.unitName{ font-weight:900; font-size:14px; }
.unitMeta{ font-size:12px; color:var(--muted); margin-top:2px; }

.miniLine{
  margin-top:12px;
  display:flex; align-items:center; gap:10px;
}
.miniBar{
  flex:1;
  height:10px;
  background: rgba(0,0,0,.06);
  border-radius:999px;
  overflow:hidden;
}
.miniFill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, var(--blue), #60a5fa);
}
.miniPct{ font-size:12px; color:var(--muted); min-width:70px; text-align:right; }

.unitBottom{
  margin-top:12px;
  display:flex; justify-content:space-between; align-items:center;
  gap:10px;
}
.tag{
  font-size:12px;
  color:#0b3b5f;
  background:#e9f4ff;
  border:1px solid #cfe8ff;
  padding:8px 10px;
  border-radius:999px;
  font-weight:700;
}
.btnStart{
  border:1px solid var(--line);
  background:#fff;
  border-radius: 14px;
  padding:10px 12px;
  font-weight:900;
  cursor:pointer;
}
.btnStart:hover{ transform: translateY(-1px); }
.btnStart:active{ transform: translateY(0px); }

.modal{
  position:fixed; inset:0;
  display:grid; place-items:center;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  z-index:50;
  padding:18px;
  overflow:auto; /* IMPORTANT: scroll works */
}
.hidden{ display:none; }

.modalCard{
  width:min(420px, 100%);
  background:#fff;
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding:18px;
  border:1px solid var(--line);
}
.modalHeader{
  display:flex; align-items:center; justify-content:space-between;
}
.lbl{ display:block; margin:12px 0 6px; font-weight:800; font-size:13px; }
.input{
  width:100%;
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  outline:none;
  font-size:14px;
}
.row{ display:flex; gap:10px; margin-top:14px; }
.btnGhost{
  border:1px dashed rgba(0,0,0,.2);
  background:#fff;
  border-radius: 16px;
  padding:14px 14px;
  font-weight:900;
  cursor:pointer;
}
.btnGhost:hover{ background:#fafafa; }

.btnX{
  width:40px; height:40px;
  border-radius: 14px;
  border:1px solid var(--line);
  background:#fff;
  font-size:16px;
  cursor:pointer;
}

.lessonCard{
  width:min(720px, 100%);
  background:#fff;
  border-radius: 26px;
  box-shadow: var(--shadow);
  border:1px solid var(--line);
  padding:18px;
}
.lessonTop{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
}
.lessonUnit{ font-weight:1000; font-size:16px; }
.lessonStep{ color:var(--muted); font-size:12px; margin-top:3px; }

.progressWrap{
  margin:12px 0 6px;
  display:flex; gap:10px; align-items:center;
}
.progressBar{
  flex:1;
  height:12px;
  background: rgba(0,0,0,.07);
  border-radius: 999px;
  overflow:hidden;
}
#progressFill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, #34d399, #60a5fa);
}
.progressPct{ font-size:12px; color:var(--muted); min-width:44px; text-align:right; }

.task{
  margin-top:12px;
  border-radius: 22px;
  border:1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  padding:16px;
}

.taskTitle{
  font-weight:1000;
  font-size:16px;
  margin-bottom:10px;
}
.bigWord{
  display:flex; align-items:center; justify-content:center;
  gap:10px;
  padding:14px 10px;
  border-radius: 18px;
  background: rgba(59,130,246,.08);
  border:1px solid rgba(59,130,246,.18);
  margin-bottom:12px;
}
.bigEmoji{ font-size:34px; }
.bigGreek{ font-size:44px; font-weight:1000; letter-spacing:.5px; }
.bigInfo{ color:var(--muted); font-size:13px; text-align:center; margin-top:8px; }

.options{
  display:grid;
  gap:10px;
  margin-top:10px;
}
.optBtn{
  width:100%;
  text-align:left;
  border:1px solid var(--line);
  background:#fff;
  border-radius: 16px;
  padding:14px 14px;
  cursor:pointer;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.optBtn small{ color:var(--muted); font-weight:700; }
.optBtn.active{
  outline: 3px solid rgba(34,197,94,.25);
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.06);
}

.lessonBottom{
  display:flex; align-items:center; gap:10px;
  margin-top:14px;
}
.grow{ flex:1; }

.toast{
  position:fixed;
  left:50%; bottom:22px;
  transform: translateX(-50%);
  background:#111827;
  color:#fff;
  padding:12px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow2);
  opacity:0;
  pointer-events:none;
  transition: opacity .2s ease, transform .2s ease;
  z-index:80;
  font-weight:900;
}
.toast.show{
  opacity:1;
  transform: translateX(-50%) translateY(-6px);
}
