/* MasakYuk — tema hangat & ramah pemula. Mobile-first. */
:root {
  --bg: #fdf6ec;
  --surface: #ffffff;
  --ink: #3a2a22;
  --muted: #96796b;
  --line: #f0e2d3;
  --primary: #f26b3a;
  --primary-dark: #d9480f;
  --primary-soft: #fde5d8;
  --good: #2e9e5b;
  --good-soft: #e3f4e9;
  --warn: #e08a1e;
  --warn-soft: #fdf1dc;
  --bad: #d64545;
  --bad-soft: #fbe4e4;
  --info: #3a7bd5;
  --info-soft: #e3edfb;
  --radius: 18px;
  --shadow: 0 2px 10px rgba(90, 55, 30, .07);
  --shadow-lg: 0 8px 26px rgba(90, 55, 30, .13);
  --nav-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── App bar ── */
.appbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(135deg, #ff9a5c, #f26b3a 55%, #e8572a);
  color: #fff;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 2px 10px rgba(180, 80, 20, .25);
}
.brand { font-size: 1.15rem; font-weight: 800; letter-spacing: .2px; color: #fff; display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.appbar .spacer { flex: 1; }
.appbar .streak-pill {
  background: rgba(255,255,255,.2); border-radius: 999px;
  padding: 4px 12px; font-weight: 700; font-size: .9rem;
  display: inline-flex; align-items: center; gap: 5px;
}
.appbar .avatar {
  font-size: 1.3rem; background: rgba(255,255,255,.25);
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
}

/* ── Bottom nav ── */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: #fffdfa;
  border-top: 1px solid var(--line);
  display: flex;
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(90,55,30,.06);
}
.bottomnav a {
  flex: 1; text-align: center; padding: 7px 2px 5px;
  color: var(--muted); font-size: .62rem; font-weight: 600;
  border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none;
}
.bottomnav a .ico { font-size: 1.35rem; line-height: 1.1; filter: grayscale(.55); opacity: .8; }
.bottomnav a.active { color: var(--primary-dark); background: var(--primary-soft); }
.bottomnav a.active .ico { filter: none; opacity: 1; }

/* ── Layout helpers ── */
.wrap { max-width: 780px; margin: 0 auto; padding: 16px 14px 40px; }
.wrap-narrow { max-width: 640px; }
section { margin-bottom: 22px; }
h1 { font-size: 1.45rem; margin: 6px 0 4px; letter-spacing: -.3px; }
h2 { font-size: 1.15rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 10px; }

/* ── Cards ── */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
  border: 1px solid transparent;
}
.card + .card { margin-top: 12px; }
.card-tap { transition: transform .06s ease, box-shadow .15s ease; }
.card-tap:active { transform: scale(.985); }
.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; box-shadow: var(--shadow-lg); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; cursor: pointer;
  font-family: inherit; font-size: 1rem; font-weight: 700;
  border-radius: 14px; padding: 11px 18px;
  transition: transform .05s ease, filter .12s ease;
  min-height: 44px; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, #ff8f55, var(--primary)); color: #fff; box-shadow: 0 4px 14px rgba(242,107,58,.35); }
.btn-primary:hover { filter: brightness(1.05); text-decoration: none; }
.btn-dark { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn-good { background: var(--good); color: #fff; }
.btn-danger-soft { background: var(--bad-soft); color: var(--bad); }
.btn-big { width: 100%; padding: 15px; font-size: 1.1rem; border-radius: 16px; }
.btn-sm { padding: 7px 12px; font-size: .85rem; min-height: 36px; border-radius: 11px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.d-grid { display: grid; gap: 10px; }
.d-grid-2 { grid-template-columns: 1fr 1fr; }

/* ── Flash ── */
.flashes { position: sticky; top: 62px; z-index: 45; max-width: 780px; margin: 0 auto; padding: 0 14px; }
.flash {
  border-radius: 14px; padding: 11px 16px; margin-bottom: 8px;
  font-weight: 600; font-size: .93rem; box-shadow: var(--shadow);
  animation: slideDown .25s ease;
}
.flash-success { background: var(--good-soft); color: #1c6b3c; border: 1px solid #bfe6cd; }
.flash-danger { background: var(--bad-soft); color: #9c2c2c; border: 1px solid #f3c4c4; }
.flash-info { background: var(--info-soft); color: #2b5fa8; border: 1px solid #c9dcf6; }
@keyframes slideDown { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Chips & pills ── */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f7ede1; border-radius: 999px;
  padding: 4px 12px; font-size: .8rem; font-weight: 600; color: var(--ink);
  white-space: nowrap;
}
.diff-1 { background: var(--good-soft); color: #1c6b3c; }
.diff-2 { background: var(--warn-soft); color: #965f10; }
.diff-3 { background: #fde8e0; color: #b03a1a; }
.diff-4 { background: #eee7fb; color: #6b46c1; }
.status-good { background: var(--good-soft); color: #1c6b3c; }
.status-warn { background: var(--warn-soft); color: #965f10; }
.status-bad { background: var(--bad-soft); color: #9c2c2c; }

/* filter chips resep */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { padding: 8px 14px; font-size: .9rem; cursor: pointer; }
.filters a.chip { text-decoration: none; }
.filters .chip.active { background: var(--primary); color: #fff; }

/* ── Recipe cards ── */
.recipe-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 620px) { .recipe-grid { grid-template-columns: 1fr 1fr; } }
.r-card { display: flex; gap: 14px; align-items: center; }
.r-emoji {
  width: 66px; height: 66px; flex: none; border-radius: 16px;
  display: grid; place-items: center; font-size: 2.1rem;
  background: linear-gradient(145deg, #fff3e6, #ffe1cc);
}
.r-card .r-info { flex: 1; min-width: 0; }
.r-card .r-title { font-weight: 800; font-size: 1.02rem; line-height: 1.25; }
.r-meta { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.r-fav { font-size: 1.2rem; background: none; border: none; cursor: pointer; padding: 6px; }

/* kategori section header */
.kat-head { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.kat-head h2 { margin: 0; }
.kat-head .line { flex: 1; height: 2px; background: var(--line); border-radius: 2px; }
.cat-kue { --cat: #e8739b; --cat-soft: #fdeaf1; }
.cat-roti { --cat: #c08a2d; --cat-soft: #fdf3df; }
.cat-masakan { --cat: #3c9e67; --cat-soft: #e6f5ec; }
.cat-kudapan { --cat: #4f7fd8; --cat-soft: #e8effc; }
.r-card.cat-x { background: var(--cat-soft); }
.r-emoji.cat-x { background: var(--cat-soft); }

/* ── Detail resep ── */
.hero {
  border-radius: 22px; color: #fff; padding: 20px 18px 26px;
  background: linear-gradient(140deg, #ffab70, #f26b3a 60%, #e04e1f);
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.hero .big-emoji { font-size: 3.4rem; line-height: 1; }
.hero h1 { color: #fff; margin: 6px 0 4px; }
.hero .sub { opacity: .92; font-weight: 500; }
.hero .chips-row { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.hero .chip { background: rgba(255,255,255,.22); color: #fff; backdrop-filter: blur(4px); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 9px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; align-items: baseline; }
.list-plain li:last-child { border-bottom: none; }
.step-list { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.step-list li { counter-increment: step; padding: 0 0 18px 44px; position: relative; }
.step-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-dark);
  font-weight: 800; display: grid; place-items: center; font-size: .95rem;
}
.tip-box {
  background: #fff8e6; border-left: 4px solid #f2b63c;
  border-radius: 10px; padding: 9px 12px; margin-top: 8px; font-size: .88rem;
}
.tip-box strong { color: #8a6400; }
.accordion-detail { margin: 0; }
.accordion-detail summary {
  cursor: pointer; font-weight: 700; padding: 12px 2px;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.accordion-detail summary::-webkit-details-marker { display: none; }
.accordion-detail summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.accordion-detail[open] summary::after { transform: rotate(180deg); }

/* checklist interaktif */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; cursor: pointer; border-radius: 10px; }
.checklist input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.checklist label.cek { color: var(--muted); }
.checklist label.cek span { text-decoration: line-through; }

/* ── Dashboard ── */
.greet { display: flex; align-items: center; gap: 14px; }
.greet .avatar-big {
  width: 64px; height: 64px; border-radius: 50%; background: var(--surface);
  box-shadow: var(--shadow); display: grid; place-items: center; font-size: 2rem; flex: none;
}
.level-card { display: flex; align-items: center; gap: 14px; }
.level-card .lv-emoji { font-size: 2.4rem; }
.progress { height: 12px; background: #f3e6d8; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: linear-gradient(90deg, #ffb35c, var(--primary)); border-radius: 999px; transition: width .5s ease; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-box { background: var(--surface); border-radius: var(--radius); padding: 12px 8px; text-align: center; box-shadow: var(--shadow); }
.stat-box .n { font-size: 1.45rem; font-weight: 800; }
.stat-box .l { font-size: .72rem; color: var(--muted); font-weight: 600; }
.saran-card {
  background: linear-gradient(140deg, #fff6ec, #ffe9d8);
  border: 2px dashed #f2b98c; border-radius: var(--radius);
  padding: 14px 16px; display: flex; gap: 14px; align-items: center;
}
.saran-card .big { font-size: 2.6rem; }
.attempt-mini { display: flex; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px dashed var(--line); }
.attempt-mini:last-child { border-bottom: none; }
.attempt-mini .st { font-size: 1.5rem; }
.badge-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.badge-row::-webkit-scrollbar { display: none; }
.badge-mini {
  flex: none; width: 84px; text-align: center;
  background: var(--surface); border-radius: 14px; padding: 10px 6px;
  box-shadow: var(--shadow); font-size: .68rem; font-weight: 600;
}
.badge-mini .e { font-size: 1.7rem; display: block; margin-bottom: 3px; }
.badge-mini.dim { filter: grayscale(1); opacity: .4; }

/* ── Praktik wizard ── */
.pw-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pw-progress { flex: 1; }
.pw-count { font-weight: 800; }
.pw-card { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 20px 18px; }
.pw-stepno {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff; border-radius: 999px;
  font-weight: 800; font-size: .8rem; padding: 4px 13px; margin-bottom: 12px;
}
.pw-text { font-size: 1.2rem; font-weight: 600; line-height: 1.5; }
.pw-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 18px; }
.timerbox {
  margin-top: 16px; border-radius: 16px; background: #fff3ea;
  border: 2px solid #ffc7a8; padding: 14px; text-align: center;
}
.timerbox .t-label { font-weight: 700; margin-bottom: 4px; }
.timerbox .t-time { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.timerbox.aktif { border-color: var(--primary); background: var(--primary-soft); }
.timerbox.aktif .t-time { color: var(--primary-dark); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.quick-timers { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; justify-content: center; }
.quick-timers .btn { min-height: 38px; padding: 6px 12px; font-size: .8rem; }

/* overlay countdown */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(60, 35, 20, .55); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.overlay.show { display: flex; }
.overlay-card {
  background: var(--surface); border-radius: 24px; padding: 26px 24px;
  width: 100%; max-width: 340px; text-align: center; box-shadow: var(--shadow-lg);
}
.overlay-card .ot-time { font-size: 3.4rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 3px; color: var(--primary-dark); }
.overlay-card .ot-label { margin: 6px 0 16px; font-weight: 600; color: var(--muted); }

/* ── Hasil praktik (form) ── */
.hasil-pilih { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hasil-btn {
  border: 2px solid var(--line); background: var(--surface); border-radius: 16px;
  padding: 14px 6px; cursor: pointer; text-align: center; font-family: inherit;
  transition: border-color .1s, background .1s; min-height: 96px;
}
.hasil-btn .e { font-size: 2rem; display: block; }
.hasil-btn .l { font-weight: 700; font-size: .8rem; }
.hasil-btn input { display: none; }
.hasil-btn:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.star-pick { display: flex; gap: 4px; justify-content: center; }
.star-pick button { font-size: 1.9rem; background: none; border: none; cursor: pointer; filter: grayscale(1); opacity: .45; padding: 4px; }
.star-pick button.on { filter: none; opacity: 1; }

/* ── Kuis ── */
.soal { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.soal + .soal { margin-top: 14px; }
.opsi { display: flex; gap: 9px; align-items: flex-start; padding: 11px 12px; border: 2px solid var(--line); border-radius: 13px; cursor: pointer; margin-top: 8px; }
.opsi:hover { border-color: #f2b98c; }
.opsi input { accent-color: var(--primary); margin-top: 3px; }
.opsi .huruf { font-weight: 800; color: var(--primary-dark); }
.opsi.pilih { border-color: var(--primary); background: var(--primary-soft); }
.opsi.benar { border-color: var(--good); background: var(--good-soft); }
.opsi.salah { border-color: var(--bad); background: var(--bad-soft); }
.jawab-status { font-weight: 800; margin: 10px 0 4px; font-size: .95rem; }
.jawab-benar { color: var(--good); }
.jawab-salah { color: var(--bad); }
.xp-box { background: linear-gradient(135deg, #fff6ec, #ffe9d8); border-radius: var(--radius); padding: 14px 18px; text-align: center; font-weight: 800; }

/* ── Belajar / teknik ── */
.t-card { display: flex; gap: 13px; align-items: center; }
.t-card .e { width: 54px; height: 54px; flex: none; border-radius: 15px; background: #f2f6fd; display: grid; place-items: center; font-size: 1.7rem; }
.bab { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.bab:last-child { border-bottom: none; }
.bab h3 { margin-bottom: 3px; }

/* ── Klinik ── */
.klinik-gejala li::marker, .klinik-penyebab li::marker, .klinik-solusi li::marker { font-weight: 800; }
.klinik-solusi { background: var(--good-soft); border-radius: 12px; padding: 10px 14px 10px 30px; }
.klinik-solusi li::marker { color: var(--good); }

/* ── Profil ── */
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lv-item { background: var(--surface); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; }
.lv-item .e { font-size: 1.5rem; }
.lv-item.dicapai { background: var(--good-soft); }
.lv-item .nm { font-weight: 700; font-size: .85rem; }
.lv-item .xp-min { font-size: .7rem; color: var(--muted); }
.xp-log { list-style: none; margin: 0; padding: 0; }
.xp-log li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.xp-log li:last-child { border-bottom: none; }
.xp-log .xp { font-weight: 800; color: var(--good); white-space: nowrap; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.badge-cell { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 6px; text-align: center; }
.badge-cell .e { font-size: 1.9rem; display: block; }
.badge-cell .nm { font-weight: 700; font-size: .75rem; }
.badge-cell.dim { filter: grayscale(1); opacity: .38; }
.badge-cell.dim .nm { color: var(--muted); }
.rating-stars { color: #f2a93c; letter-spacing: 1px; }

/* ── Coach chat ── */
.chat-box { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.bubble { max-width: 85%; padding: 11px 14px; border-radius: 16px; font-size: .95rem; white-space: pre-wrap; word-break: break-word; }
.bubble.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.bubble.coach { align-self: flex-start; background: var(--surface); box-shadow: var(--shadow); border-bottom-left-radius: 5px; }
.chat-input { display: flex; gap: 8px; }
.chat-input input { flex: 1; border: 2px solid var(--line); border-radius: 14px; padding: 11px 14px; font-size: 1rem; font-family: inherit; background: var(--surface); }
.chat-input input:focus { outline: none; border-color: var(--primary); }

/* ── Form ── */
label.f { display: block; font-weight: 700; margin: 14px 0 5px; font-size: .9rem; }
input.txt, textarea.txt, select.sel {
  width: 100%; border: 2px solid var(--line); border-radius: 13px;
  padding: 11px 13px; font-size: 1rem; font-family: inherit; background: var(--surface);
  color: var(--ink);
}
input.txt:focus, textarea.txt:focus { outline: none; border-color: var(--primary); }
.auth-card { max-width: 420px; margin: 26px auto; }
.auth-brand { text-align: center; font-size: 2rem; margin-bottom: 4px; }
.auth-tag { text-align: center; color: var(--muted); margin-bottom: 18px; }

/* form check inline kecil */
.inline-form { display: inline; }

/* misc */
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.emoji-row { font-size: 1.6rem; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 15px; font-weight: 700; font-size: .9rem; color: var(--ink); cursor: pointer; font-family: inherit; }
.pill-btn:hover { border-color: var(--primary); color: var(--primary-dark); text-decoration: none; }
