:root {
  --coral: #ff6f61;
  --peach: #ffb26b;
  --cream: #fff9f2;
  --ink: #33261f;
  --muted: #8a7a70;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 0%, #ffe3c4 0%, transparent 45%),
              radial-gradient(circle at 90% 10%, #ffd0c9 0%, transparent 40%),
              linear-gradient(160deg, #fff6ec 0%, #fff1f0 60%, #ffe9dd 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

.page { max-width: 860px; margin: 0 auto; padding: 0 16px 40px; }

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30;
  padding: 18px 20px 14px;
  margin: 0 -16px 8px;
  background: linear-gradient(135deg, #ff6f61, #ff9a5a, #ffc15e);
  border-radius: 0 0 26px 26px;
  box-shadow: 0 8px 30px rgba(255,111,97,0.35);
  color: #fff;
}
.brand-row { display: flex; align-items: center; justify-content: space-between; }
.brand {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 800; margin: 0; letter-spacing: -1px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.berry { display: inline-block; animation: wiggle 2.6s ease-in-out infinite; }
@keyframes wiggle { 0%,100%{transform:rotate(0)} 25%{transform:rotate(-12deg)} 75%{transform:rotate(12deg)} }
.tagline { margin: 2px 0 12px; font-family: 'Fraunces', serif; font-style: italic; font-size: 15px; opacity: 0.95; }
.reset-link {
  background: rgba(255,255,255,0.22); border: none; color: #fff;
  padding: 5px 12px; border-radius: 20px; font-size: 12px; cursor: pointer;
  font-family: inherit; backdrop-filter: blur(4px);
}
.reset-link:hover { background: rgba(255,255,255,0.35); }

.progress-track {
  height: 8px; background: rgba(255,255,255,0.3);
  border-radius: 20px; overflow: hidden; margin-bottom: 12px;
}
.progress-fill {
  height: 100%; background: #fff; border-radius: 20px;
  transition: width 0.5s cubic-bezier(.34,1.56,.64,1);
}

.dots-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: thin;
}
.day-dot {
  flex: 0 0 auto; min-width: 72px;
  background: rgba(255,255,255,0.9); border: 2px solid transparent;
  border-radius: 16px; padding: 8px 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  transition: transform .18s, box-shadow .18s; font-family: inherit;
  color: var(--ink);
}
.day-dot:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(0,0,0,0.12); }
.day-dot.active { color: #fff; transform: translateY(-4px) scale(1.06); box-shadow: 0 8px 18px rgba(0,0,0,0.2); }
.day-dot.done .dot-emoji { color: #2fae6a; }
.day-dot.active.done .dot-emoji { color: #fff; }
.dot-emoji { font-size: 20px; line-height: 1; }
.dot-label { font-size: 10px; font-weight: 800; opacity: 0.7; }
.dot-topic { font-size: 10px; font-weight: 500; white-space: nowrap; }

/* ---------- Content ---------- */
.content { animation: fadeUp 0.5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.motivate { text-align: center; font-weight: 500; font-size: 14px; margin: 14px 0 10px; }

.lesson-card {
  background: #fffdfb; border-radius: 24px;
  border-top: 6px solid var(--coral);
  padding: 22px 20px 26px;
  box-shadow: 0 14px 40px rgba(200,120,90,0.14);
}
.lesson-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 6px; }
.lesson-emoji {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center; font-size: 28px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}
.lesson-title { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.lesson-intro { margin: 4px 0 0; font-family: 'Fraunces', serif; font-style: italic; color: var(--muted); font-size: 15px; }

.section-label {
  font-size: 18px; font-weight: 800; margin: 26px 0 12px;
  letter-spacing: -0.4px;
}

/* ---------- Vocab ---------- */
.vocab-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 560px) { .vocab-grid { grid-template-columns: 1fr; } }

.vocab-card {
  position: relative; border-radius: 16px; padding: 14px 14px 12px;
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform .18s, box-shadow .18s;
}
.vocab-card:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(0,0,0,0.1); }
.vocab-card.spotlight { box-shadow: 0 0 0 2px var(--coral), 0 8px 18px rgba(255,111,97,0.25); }
.vocab-top { display: flex; align-items: center; justify-content: space-between; }
.vocab-word { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }
.vocab-def { margin: 6px 0 4px; font-size: 14px; line-height: 1.4; }
.vocab-ex { margin: 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.say-btn {
  border: none; background: rgba(0,0,0,0.06); border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer; font-size: 15px;
  transition: transform .15s, background .15s;
}
.say-btn:hover { background: rgba(0,0,0,0.12); transform: scale(1.12); }
.say-btn:active { transform: scale(0.9); }
.say-mini {
  border: none; background: transparent; cursor: pointer; font-size: 13px;
  opacity: 0.7; padding: 2px 4px;
}
.say-mini:hover { opacity: 1; }
.spot-badge {
  position: absolute; top: -9px; right: 10px;
  background: var(--coral); color: #fff; font-size: 10px; font-weight: 800;
  padding: 2px 9px; border-radius: 12px; box-shadow: 0 3px 8px rgba(255,111,97,0.4);
}

/* ---------- Structure ---------- */
.structure-box { border-radius: 16px; padding: 16px; }
.pattern { font-size: 20px; font-weight: 500; margin: 0 0 12px; font-family: 'Fraunces', serif; }
.blank {
  display: inline-block; color: #fff; padding: 0 10px; border-radius: 8px;
  font-weight: 800; letter-spacing: 2px; transform: translateY(-1px);
}
.examples { display: flex; flex-direction: column; gap: 6px; }
.example-line {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 10px; padding: 7px 12px; font-size: 14px;
}

/* ---------- Exercise ---------- */
.exercise-box {
  background: #fff8f4; border-radius: 16px; padding: 18px;
  border: 1px dashed rgba(255,111,97,0.4);
}
.ex-question { font-size: 16px; font-weight: 500; margin: 0 0 14px; }
.ex-options { display: flex; flex-direction: column; gap: 10px; }
.opt-btn {
  text-align: left; padding: 12px 16px; border-radius: 12px;
  border: 2px solid #eadfd8; background: #fff; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 500;
  transition: transform .12s, background .15s;
}
.opt-btn:hover { transform: translateX(4px); }
.opt-correct { background: #e4f8ec; border-color: #2fae6a !important; font-weight: 800; }
.opt-wrong { background: #fdeaea; border-color: #e05d5d !important; }
.fill-row { display: flex; gap: 8px; }
.fill-input {
  flex: 1; padding: 12px 14px; border-radius: 12px; border: 2px solid #eadfd8;
  font-family: inherit; font-size: 15px; outline: none;
}
.fill-input:focus { border-color: var(--coral); }
.check-btn {
  border: none; color: #fff; padding: 0 20px; border-radius: 12px;
  cursor: pointer; font-family: inherit; font-weight: 800; font-size: 15px;
}
.ex-hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.ex-feedback { margin: 14px 0 0; font-weight: 800; font-size: 16px; animation: pop .3s ease; }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fb-ok { color: #2fae6a; }
.fb-no { color: #e05d5d; }

.complete-btn {
  margin-top: 18px; width: 100%; padding: 14px; border: none;
  border-radius: 14px; font-family: inherit; font-weight: 800; font-size: 16px;
  cursor: pointer; background: #e5dcd6; color: #a99b92;
  transition: transform .15s;
}
.complete-btn.ready, .complete-btn.already { color: #fff; }
.complete-btn.ready:hover { transform: translateY(-2px) scale(1.01); }
.complete-btn:disabled { cursor: not-allowed; }

/* ---------- Celebration ---------- */
.celebrate { position: relative; padding: 30px 0; text-align: center; animation: fadeUp .6s ease both; }
.cert {
  background: #fffdfb; border-radius: 28px; padding: 36px 24px;
  box-shadow: 0 20px 50px rgba(200,120,90,0.2);
  border: 3px solid var(--coral);
}
.cert-emoji { font-size: 60px; animation: wiggle 2.5s ease-in-out infinite; }
.cert-title { font-size: 34px; font-weight: 800; margin: 8px 0 4px; color: var(--coral); }
.cert-sub { font-family: 'Fraunces', serif; font-size: 16px; color: var(--muted); max-width: 440px; margin: 0 auto 18px; line-height: 1.5; }
.cert-badges { display: flex; justify-content: center; gap: 8px; font-size: 26px; margin-bottom: 20px; flex-wrap: wrap; }
.restart-btn {
  background: var(--coral); color: #fff; border: none; padding: 13px 28px;
  border-radius: 14px; font-family: inherit; font-weight: 800; font-size: 16px; cursor: pointer;
}
.restart-btn:hover { transform: translateY(-2px); }

/* ---------- Confetti ---------- */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti-bit {
  position: absolute; top: -30px; animation: fall 1.7s ease-in forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(540deg); opacity: 0; }
}

/* ---------- Footer ---------- */
.app-footer { text-align: center; margin-top: 28px; color: var(--muted); font-size: 13px; }
.app-footer a { color: var(--coral); font-weight: 800; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }