:root {
  --bg: #fff7ef; --surface: #ffffff; --surface-2: #fff1e4; --fg: #2a1b3d; --muted: #7a6b85; --line: #f1e2d3;
  --plum: #5b2a86; --plum-ink: #ffffff; --coral: #ff6b4a; --sun: #ffc145; --mint: #1fb58f; --sky: #3d8bd9;
  --mint-soft: #ddf6ee; --sun-soft: #fff1cf; --coral-soft: #ffe3dc; --plum-soft: #efe4f8; --sky-soft: #e0eefb;
  --ok: #138a6b; --bad: #d4462a;
  --shadow: 0 1px 2px rgba(42, 27, 61, .06), 0 8px 24px -12px rgba(42, 27, 61, .18);
  --hero: linear-gradient(135deg, #5b2a86 0%, #a1408f 55%, #ff6b4a 100%);
  --font-display: "Fredoka", "Trebuchet MS", sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --nav-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #160f1f; --surface: #211830; --surface-2: #2a1f3b; --fg: #f6eefa; --muted: #ab9cba; --line: #352847;
    --plum: #b98be6; --plum-ink: #1a1025; --coral: #ff8466; --sun: #ffcc5c; --mint: #45d3ac; --sky: #6aaaf0;
    --mint-soft: #173a31; --sun-soft: #3b3018; --coral-soft: #3e2120; --plum-soft: #33244a; --sky-soft: #1b2e45;
    --ok: #45d3ac; --bad: #ff8466;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
    --hero: linear-gradient(135deg, #4a2370 0%, #84346f 55%, #d4553a 100%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #160f1f; --surface: #211830; --surface-2: #2a1f3b; --fg: #f6eefa; --muted: #ab9cba; --line: #352847;
  --plum: #b98be6; --plum-ink: #1a1025; --coral: #ff8466; --sun: #ffcc5c; --mint: #45d3ac; --sky: #6aaaf0;
  --mint-soft: #173a31; --sun-soft: #3b3018; --coral-soft: #3e2120; --plum-soft: #33244a; --sky-soft: #1b2e45;
  --ok: #45d3ac; --bad: #ff8466;
  --hero: linear-gradient(135deg, #4a2370 0%, #84346f 55%, #d4553a 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font-body); min-height: 100vh; min-height: 100dvh; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--plum); }
button, input, textarea, select { font: inherit; color: inherit; }
.muted { color: var(--muted); } .small { font-size: 0.84rem; } .tiny { font-size: 0.75rem; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- Kerangka ---------- */
.wrap { max-width: 520px; margin: 0 auto; padding: 12px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; }
.appbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding-top: env(safe-area-inset-top, 0px); }
.appbar .in { max-width: 520px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }
.logo svg { width: 30px; height: 30px; flex: none; }
.chip-pts { display: inline-flex; align-items: center; gap: 6px; background: var(--sun-soft); color: var(--fg); padding: 5px 10px 5px 6px; border-radius: 99px; font-weight: 800; font-size: .9rem; border: 0; cursor: pointer; }
.chip-pts .coin { width: 20px; height: 20px; border-radius: 50%; background: var(--sun); display: grid; place-items: center; font-size: .7rem; color: #5a3b00; }
.appbar .right { display: flex; gap: 8px; align-items: center; }

.card { background: var(--surface); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; border: 1.5px solid var(--line); }
.row { display: flex; gap: 10px; align-items: center; min-width: 0; } .row.between { justify-content: space-between; } .row.wrap-r { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; } .stack.tight { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 4px; }
.section-title a, .linkbtn { font-weight: 700; font-size: .85rem; color: var(--plum); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; }

/* ---------- Tombol & input ---------- */
.btn { border: 0; background: var(--plum); color: var(--plum-ink); font-weight: 800; padding: 12px 18px; border-radius: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: transform .12s ease, filter .12s ease; min-height: 44px; }
.btn:active { transform: scale(.97); }
.btn.coral { background: var(--coral); color: #fff; }
.btn.mint { background: var(--mint); color: #fff; }
.btn.wa { background: #1fa855; color: #fff; }
.btn.ghost { background: var(--surface-2); color: var(--fg); }
.btn.outline { background: transparent; color: var(--plum); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.bad { background: var(--coral-soft); color: var(--bad); }
.btn.small { padding: 8px 14px; font-size: .86rem; min-height: 36px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .tabs button:focus-visible, nav button:focus-visible, .icon-btn:focus-visible, .react:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; padding: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: .9rem; }
input[type=text], input[type=tel], input[type=password], input[type=number], textarea, select {
  width: 100%; background: var(--surface-2); border: 1.5px solid transparent; border-radius: 14px; padding: 12px 14px; min-height: 46px; transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--plum); outline: none; }
textarea { resize: vertical; min-height: 96px; }
.otp-input { font-family: var(--font-display); font-size: 1.8rem; letter-spacing: .5em; text-align: center; padding-left: calc(14px + .25em) !important; }

/* ---------- Pil & label ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); white-space: nowrap; }
.pill.ok { background: var(--mint-soft); color: var(--ok); } .pill.bad { background: var(--coral-soft); color: var(--bad); }
.pill.wait { background: var(--sun-soft); color: color-mix(in srgb, var(--fg) 80%, var(--sun)); }
.pill.plum { background: var(--plum-soft); color: var(--plum); }
.pill.sky { background: var(--sky-soft); color: var(--sky); }
.t-ringan { --tc: var(--mint); --tc-soft: var(--mint-soft); }
.t-sedang { --tc: var(--sun); --tc-soft: var(--sun-soft); }
.t-berat { --tc: var(--coral); --tc-soft: var(--coral-soft); }

/* ---------- Login ---------- */
.login { max-width: 460px; margin: 0 auto; min-height: 100dvh; padding: calc(24px + env(safe-area-inset-top, 0px)) 16px 32px; display: flex; flex-direction: column; gap: 20px; }
.login-hero { position: relative; border-radius: 28px; background: var(--hero); color: #fff; padding: 28px 22px 24px; overflow: hidden; display: flex; flex-direction: column; gap: 14px; }
.login-hero h1 { font-size: 2.1rem; }
.login-hero p { opacity: .92; max-width: 30ch; }
.login-hero .float { position: absolute; font-size: 2rem; animation: bob 4s ease-in-out infinite; }
.login-hero .logo svg { width: 44px; height: 44px; }
.feat { display: grid; gap: 10px; }
.feat div { display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, .14); border-radius: 14px; padding: 10px 12px; font-weight: 600; font-size: .92rem; }
.feat span { font-size: 1.3rem; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(6deg); } }

/* ---------- Hero Beranda ---------- */
.hero { background: var(--hero); color: #fff; border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 16px; position: relative; overflow: hidden; box-shadow: 0 16px 32px -18px rgba(91, 42, 134, .7); }
.hero::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .08); right: -70px; top: -90px; }
.hero .greet { font-size: .9rem; opacity: .9; font-weight: 600; }
.hero .name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.hero-main { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--sun) calc(var(--p) * 1%), rgba(255, 255, 255, .2) 0); }
.ring > div { width: 76px; height: 76px; border-radius: 50%; background: rgba(42, 20, 60, .55); display: grid; place-items: center; text-align: center; line-height: 1.05; }
.ring b { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; }
.ring small { font-size: .62rem; opacity: .85; font-weight: 700; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; position: relative; z-index: 1; }
.hero-stats div { background: rgba(255, 255, 255, .15); border-radius: 14px; padding: 8px 10px; }
.hero-stats b { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; display: block; line-height: 1.1; }
.hero-stats span { font-size: .72rem; opacity: .9; font-weight: 600; }
.lvl { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; }
.lvl .bar { height: 10px; background: rgba(255, 255, 255, .22); border-radius: 99px; overflow: hidden; }
.lvl .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), #fff3c4); border-radius: 99px; transition: width .8s ease; }
.lvl .row { font-size: .78rem; font-weight: 700; }

.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--plum); border-radius: 99px; }

/* ---------- Kartu quest ---------- */
.quest { position: relative; overflow: hidden; border-radius: 22px; padding: 16px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.quest::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--tc); }
.quest-head { display: flex; gap: 14px; align-items: flex-start; }
.quest-ico { width: 54px; height: 54px; flex: none; border-radius: 16px; background: var(--tc-soft); display: grid; place-items: center; font-size: 1.7rem; }
.quest .pts { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--fg); white-space: nowrap; }
.quest .tier { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: color-mix(in srgb, var(--tc) 70%, var(--fg)); }
.quest.done { background: color-mix(in srgb, var(--mint-soft) 60%, var(--surface)); }
.quest-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.quest-actions .btn { flex: 1; }
.thumb { width: 100%; max-height: 260px; object-fit: cover; border-radius: 16px; background: var(--surface-2); display: block; }
.mini-quests { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-q { border-radius: 16px; background: var(--tc-soft); padding: 10px; display: flex; flex-direction: column; gap: 4px; min-width: 0; border: 0; text-align: left; cursor: pointer; }
.mini-q .e { font-size: 1.4rem; }
.mini-q b { font-size: .78rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-q .s { font-size: .7rem; font-weight: 800; color: var(--muted); }
.mini-q.ok .s { color: var(--ok); }

/* ---------- Avatar ---------- */
.av { --h: 280; width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; font-size: .9rem; color: #fff; background: hsl(var(--h) 55% 55%); font-family: var(--font-display); position: relative; }
.av.sm { width: 32px; height: 32px; font-size: .75rem; } .av.lg { width: 76px; height: 76px; font-size: 1.6rem; }
.av .st { position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface); font-size: .55rem; display: grid; place-items: center; }

/* ---------- Geng ---------- */
.members { display: flex; flex-direction: column; gap: 4px; }
.member { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.member + .member { border-top: 1px dashed var(--line); }
.invite { background: var(--plum-soft); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.code { font-family: var(--font-display); font-size: 1.7rem; letter-spacing: .18em; font-weight: 600; }
.acc-item { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.acc-item:first-of-type { border-top: 0; padding-top: 0; }

/* ---------- Tab ---------- */
.tabs { display: flex; gap: 4px; background: var(--surface-2); border-radius: 16px; padding: 4px; }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: .84rem; padding: 9px 4px; border-radius: 12px; cursor: pointer; transition: background .15s; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }

/* ---------- Feed ---------- */
.post { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-head .who { flex: 1; min-width: 0; }
.post-head .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.post-quest { display: flex; gap: 12px; align-items: center; background: var(--tc-soft); border-radius: 16px; padding: 10px 12px; }
.post-quest .e { font-size: 1.5rem; }
.post-juara { background: linear-gradient(135deg, var(--sun-soft), var(--coral-soft)); border-radius: 16px; padding: 16px; text-align: center; font-weight: 700; }
.post-juara .e { font-size: 2.4rem; display: block; }
.post-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.react { border: 0; background: var(--surface-2); border-radius: 99px; padding: 6px 11px; font-size: .9rem; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; font-weight: 800; min-height: 34px; transition: transform .12s; }
.react.on { background: var(--sun-soft); box-shadow: inset 0 0 0 1.5px var(--sun); }
.react:active { transform: scale(1.15); }
.react.plain { background: transparent; color: var(--muted); }
.post-foot .sp { flex: 1; }
.kind-tips { --kc: var(--sky); --kc-soft: var(--sky-soft); }
.kind-resep { --kc: var(--coral); --kc-soft: var(--coral-soft); }
.kind-curhat { --kc: var(--plum); --kc-soft: var(--plum-soft); }
.kind-tanya { --kc: var(--mint); --kc-soft: var(--mint-soft); }
.kind-tag { background: var(--kc-soft); color: var(--kc); }
.fab { position: fixed; right: max(16px, calc(50% - 244px)); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 9; border-radius: 99px; padding: 14px 20px; box-shadow: 0 12px 24px -10px rgba(255, 107, 74, .8); }
.kind-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kind-pick label { position: relative; }
.kind-pick input { position: absolute; opacity: 0; pointer-events: none; }
.kind-pick span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; background: var(--surface-2); font-weight: 800; font-size: .78rem; cursor: pointer; }
.kind-pick span i { font-style: normal; font-size: 1.3rem; }
.kind-pick input:checked + span { background: var(--plum-soft); box-shadow: inset 0 0 0 2px var(--plum); color: var(--plum); }
.kind-pick input:focus-visible + span { outline: 3px solid var(--sun); }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment .bubble { background: var(--surface-2); border-radius: 4px 16px 16px 16px; padding: 8px 12px; flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Ranking ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; align-items: end; gap: 8px; padding-top: 8px; }
.podium .p { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.podium .p .nm { font-weight: 800; font-size: .82rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .block { width: 100%; border-radius: 16px 16px 6px 6px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; color: #fff; padding: 8px 0; }
.podium .p1 .block { height: 96px; background: linear-gradient(180deg, #ffcf5a, #f0a500); font-size: 1.8rem; }
.podium .p2 .block { height: 70px; background: linear-gradient(180deg, #c7c2d6, #9b94b0); font-size: 1.4rem; }
.podium .p3 .block { height: 54px; background: linear-gradient(180deg, #f0a37d, #cf7044); font-size: 1.2rem; }
.podium .crown { font-size: 1.4rem; margin-bottom: -6px; }
.rank { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.rank li { display: grid; grid-template-columns: 1.8rem 32px 1fr auto 2.6rem; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; font-variant-numeric: tabular-nums; }
.rank .pos { font-family: var(--font-display); font-weight: 600; color: var(--muted); text-align: center; }
.rank .me { background: var(--plum-soft); }
.rank .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.rank .mv { text-align: right; font-size: .78rem; font-weight: 800; }
.rank .gap { text-align: center; color: var(--muted); padding: 0; display: block; }
.up { color: var(--ok); } .down { color: var(--bad); }

/* ---------- Reward ---------- */
.wallet { background: linear-gradient(135deg, #ffc145, #ff8a4a); color: #3a1f00; border-radius: 24px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 14px 28px -16px rgba(255, 138, 74, .9); }
.wallet b { font-family: var(--font-display); font-size: 2.2rem; font-weight: 600; line-height: 1; }
.wallet .coin-big { font-size: 2.6rem; }
.ticket { display: flex; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; position: relative; }
.ticket .stub { width: 86px; flex: none; background: var(--coral-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 12px 6px; border-right: 2px dashed var(--line); position: relative; }
.ticket .stub::before, .ticket .stub::after { content: ""; position: absolute; right: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); }
.ticket .stub::before { top: -10px; } .ticket .stub::after { bottom: -10px; }
.ticket .stub b { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--coral); line-height: 1; }
.ticket .stub span { font-size: .7rem; font-weight: 800; color: var(--muted); }
.ticket .body { padding: 14px; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ticket.mine .stub { background: var(--mint-soft); }
.ticket.mine .stub b { color: var(--ok); font-size: 1rem; letter-spacing: .08em; }
.ticket.used { opacity: .55; }

/* ---------- Lencana ---------- */
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.badge-it { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; border: 0; background: none; padding: 0; cursor: pointer; }
.badge-it .medal { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: linear-gradient(135deg, var(--sun-soft), var(--coral-soft)); box-shadow: inset 0 0 0 3px var(--sun); position: relative; }
.badge-it.locked .medal { filter: grayscale(1); opacity: .4; box-shadow: inset 0 0 0 2px var(--line); background: var(--surface-2); }
.badge-it .medal .x { position: absolute; right: -4px; top: -4px; background: var(--coral); color: #fff; font-size: .65rem; font-weight: 800; border-radius: 99px; padding: 1px 6px; }
.badge-it span { font-size: .7rem; font-weight: 700; line-height: 1.2; }

/* ---------- Pengaturan ---------- */
.setting { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + i { background: var(--mint); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid var(--sun); outline-offset: 2px; }
.rules { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: .88rem; }
.rules dt { font-weight: 800; } .rules dd { margin: 0; color: var(--muted); }

/* ---------- Nav bawah ---------- */
nav.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface); box-shadow: 0 -8px 24px -16px rgba(42, 27, 61, .35); padding-bottom: env(safe-area-inset-bottom, 0px); border-radius: 22px 22px 0 0; }
nav.bottom .in { display: flex; max-width: 520px; margin: 0 auto; height: var(--nav-h); padding: 0 6px; }
nav.bottom button { flex: 1; background: none; border: 0; color: var(--muted); font-weight: 800; font-size: .7rem; cursor: pointer; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0; }
nav.bottom svg { width: 24px; height: 24px; transition: transform .2s; }
nav.bottom .ic { width: 52px; height: 30px; border-radius: 99px; display: grid; place-items: center; transition: background .2s; }
nav.bottom button[aria-current="page"] { color: var(--plum); }
nav.bottom button[aria-current="page"] .ic { background: var(--plum-soft); }
nav.bottom button[aria-current="page"] svg { transform: translateY(-1px); }
nav.bottom .badge { position: absolute; top: 8px; left: calc(50% + 8px); background: var(--coral); color: #fff; font-size: .62rem; border-radius: 99px; padding: 1px 6px; min-width: 18px; }

/* ---------- Lembar bawah, toast, konfeti ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(22, 12, 32, .5); z-index: 30; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet { background: var(--bg); width: 100%; max-width: 520px; max-height: 88dvh; border-radius: 26px 26px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; overflow: auto; animation: up .25s cubic-bezier(.2, .9, .3, 1.1); }
.sheet .grip { width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 2px; flex: none; }
.sheet.center { text-align: center; align-items: center; }
@keyframes up { from { transform: translateY(40%); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 16px; max-width: min(92%, 480px); z-index: 50; font-weight: 700; box-shadow: var(--shadow); animation: up .25s ease; }
.toast.err { background: var(--bad); color: #fff; }
.callout { background: var(--sun-soft); border-radius: 16px; padding: 12px 14px; font-size: .88rem; }
.callout.plum { background: var(--plum-soft); }
.callout.mint { background: var(--mint-soft); }
.empty { text-align: center; padding: 28px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .e { font-size: 2.6rem; }
.big-pts { font-family: var(--font-display); font-size: 3.4rem; font-weight: 600; color: var(--coral); line-height: 1; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 20px; height: 120px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.view-enter { animation: viewin .25s ease; }
@keyframes viewin { from { opacity: 0; transform: translateY(6px); } }
.install { display: flex; gap: 12px; align-items: center; background: var(--sky-soft); border-radius: 18px; padding: 12px 14px; }
.install .e { font-size: 1.8rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 360px) {
  .badges { grid-template-columns: repeat(3, 1fr); }
  .kind-pick { grid-template-columns: repeat(2, 1fr); }
  .hero-main { flex-direction: column; align-items: stretch; }
  .ring { align-self: center; }
}

/* ---------- Admin ---------- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
td, th { text-align: left; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
