:root {
  --leaf: #2f6b4a; --leaf-2: #4fae7c; --moss: #e8f4e6; --cream: #fff8ec; --bark: #7a5236; --bark-2: #a8764a; --pink: #adeac6; --pink-2: #e9faf0; --ink: #3b2a20; --muted: #8a6f5c; --gold: #f2c14e; --err: #c8453d;
  --glass: rgba(255, 248, 236, .92); --line: rgba(122, 82, 54, .18);
  --f-head: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif; --f-body: 'Quicksand', 'Trebuchet MS', system-ui, sans-serif;
}
body.night { --glass: rgba(38, 44, 80, .92); --cream: #2a3158; --ink: #f3efe6; --muted: #b9b3cf; --line: rgba(255, 255, 255, .14); --moss: #1f2a4a; --pink-2: #3a2f58; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfe9d6; }
body { font-family: var(--f-body); font-weight: 600; color: var(--ink); -webkit-font-smoothing: antialiased; }
#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; outline: none; }
#world:active { cursor: grabbing; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
h2, h3, h4 { font-family: var(--f-head); margin: 0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }

#fallback { display: none; position: fixed; inset: 0; background: linear-gradient(#bfe6f7, #e8f7e4 60%, #7fbf7a); overflow: hidden; }
body.no3d #fallback { display: block; }
body.no3d #world { display: none; }
#fallback span { position: absolute; bottom: 12%; font-size: 64px; animation: walk 18s linear infinite; }
#fallback span:nth-child(2) { bottom: 18%; animation-duration: 24s; animation-delay: -6s; font-size: 44px; }
#fallback span:nth-child(3) { bottom: 8%; animation-duration: 30s; animation-delay: -12s; font-size: 90px; }
#fallback span:nth-child(4) { bottom: 22%; animation-duration: 21s; animation-delay: -3s; }
@keyframes walk { from { left: -12%; } to { left: 108%; } }

#loader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: linear-gradient(#bfe6f7, #dff3e8); transition: opacity .6s; }
#loader.gone { opacity: 0; pointer-events: none; }
.lo { text-align: center; font-family: var(--f-head); font-size: 1.2rem; color: var(--leaf); }
.leaf { font-size: 56px; animation: sway 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes sway { 50% { transform: rotate(14deg); } 0%, 100% { transform: rotate(-14deg); } }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud > * { pointer-events: auto; }
body.calm #hud > :not(.tools) , body.calm #panel { opacity: 0; pointer-events: none; }
.brand { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; display: flex; gap: 10px; align-items: center; background: var(--glass); border: 2px solid var(--line); border-radius: 18px; padding: 6px 14px 6px 8px; backdrop-filter: blur(8px); box-shadow: 0 4px 0 var(--line); }
.brand img { border-radius: 10px; object-fit: cover; }
.brand b { font-family: var(--f-head); font-size: 1.05rem; display: block; line-height: 1.1; }
.brand small { color: var(--muted); font-size: .75rem; display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tools { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; display: flex; gap: 8px; align-items: center; }
.tb { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--glass); font-size: 20px; box-shadow: 0 3px 0 var(--line); backdrop-filter: blur(8px); transition: transform .15s; }
.tb:hover { transform: translateY(-2px) rotate(-6deg); }
.windbox { display: flex; align-items: center; gap: 6px; }
.windbox input { width: 0; opacity: 0; transition: width .25s, opacity .2s; accent-color: var(--leaf-2); }
.windbox:hover input, .windbox.open input { width: 96px; opacity: 1; }
.tip { position: fixed; z-index: 9; background: var(--glass); border: 2px solid var(--line); border-radius: 12px; padding: 6px 12px; pointer-events: none !important; box-shadow: 0 3px 0 var(--line); }
.tip b { display: block; font-family: var(--f-head); } .tip small { color: var(--muted); }
.followchip { position: absolute; left: 50%; transform: translateX(-50%); bottom: 92px; background: var(--glass); border: 2px solid var(--line); border-radius: 999px; padding: 6px 8px 6px 16px; display: flex; gap: 10px; align-items: center; box-shadow: 0 3px 0 var(--line); }
.followchip button { border: 0; background: var(--leaf-2); color: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 700; }
.hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: 96px; margin: 0; padding: 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, .35); color: #fff; font-size: .8rem; text-align: center; max-width: 92vw; transition: opacity 1s; pointer-events: none !important; }
.hint.fade { opacity: 0; }
body.panel-open .hint { display: none; }
.dock { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom)); display: flex; gap: 2px; background: var(--glass); border: 2px solid var(--line); border-radius: 26px; padding: 6px; box-shadow: 0 5px 0 var(--line); backdrop-filter: blur(10px); max-width: calc(100vw - 16px); }
.dock button { position: relative; border: 0; background: transparent; border-radius: 20px; padding: 6px 12px; display: grid; justify-items: center; gap: 0; min-width: 58px; transition: background .2s, transform .15s; }
.dock button i { font-style: normal; font-size: 22px; line-height: 1.2; }
.dock button span { font-size: .68rem; font-weight: 700; }
.dock button.on { background: var(--leaf-2); color: #fff; transform: translateY(-3px); }
.dock b { position: absolute; top: 2px; right: 8px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--err); color: #fff; font-size: .68rem; display: grid; place-items: center; padding: 0 4px; }
.dock b[data-flashdot] { min-width: 10px; width: 10px; height: 10px; background: var(--gold); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .6; } }

/* panel */
#panel { position: fixed; z-index: 8; top: 70px; right: 14px; bottom: 92px; width: min(460px, calc(100vw - 28px)); background: var(--glass); border: 2px solid var(--line); border-radius: 26px; box-shadow: 0 8px 0 var(--line), 0 20px 50px rgba(0, 0, 0, .25); backdrop-filter: blur(14px); display: flex; flex-direction: column; transform: translateX(120%); opacity: 0; transition: transform .35s cubic-bezier(.2, .9, .3, 1.1), opacity .25s; pointer-events: none; }
#panel.open { transform: none; opacity: 1; pointer-events: auto; }
#panel > header { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; border-bottom: 2px dashed var(--line); }
#panel h2 { flex: 1; font-size: 1.25rem; color: var(--leaf); }
body.night #panel h2 { color: #9be3b8; }
#panel > header button { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); background: var(--cream); font-size: 16px; }
#pbody { flex: 1; overflow-y: auto; padding: 14px; overscroll-behavior: contain; }
@media (max-width: 720px) {
  #panel { top: auto; right: 8px; left: 8px; width: auto; bottom: 86px; height: min(68vh, 560px); transform: translateY(120%); border-radius: 24px; }
  .brand small { display: none; }
  .tb { width: 40px; height: 40px; font-size: 18px; }
  .dock button { min-width: 50px; padding: 5px 7px; }
  .hint { bottom: 94px; }
}

/* komponen */
.btn { border: 2px solid var(--leaf); background: var(--leaf-2); color: #fff; font-weight: 700; border-radius: 14px; padding: 10px 16px; box-shadow: 0 3px 0 var(--leaf); text-decoration: none; display: inline-block; text-align: center; transition: transform .1s; }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--leaf); }
.btn.sm { padding: 6px 12px; font-size: .85rem; border-radius: 12px; }
.btn.block { display: block; width: 100%; margin-top: 10px; }
.btn.ghost { background: var(--cream); color: var(--ink); border-color: var(--line); box-shadow: 0 3px 0 var(--line); }
.btn.wa { background: #3fbf6e; border-color: #2a9a54; box-shadow: 0 3px 0 #2a9a54; }
.linkbtn { border: 0; background: none; color: var(--leaf); text-decoration: underline; padding: 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; border: 2px solid var(--line); background: var(--cream); border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: .85rem; }
.chip.on { background: var(--leaf-2); color: #fff; border-color: var(--leaf); }
.search input, .field input, .field select, .field textarea, .promo input, .stepper input { width: 100%; padding: 10px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--cream); color: var(--ink); font: inherit; }
.search { margin-bottom: 6px; }
.field { display: block; margin: 8px 0; } .field > span { display: block; font-size: .8rem; margin-bottom: 3px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; font-size: .88rem; }
.form-err { color: var(--err); min-height: 1.2em; margin: 6px 0; font-size: .88rem; }
.note { background: var(--moss); border-radius: 12px; padding: 8px 12px; font-size: .88rem; margin: 8px 0; }
.note.err { background: #fbe3e0; color: #9a2f28; } .note.ok { background: #dff5e6; color: #1f6b3d; }
body.night .note.err { background: #2d4137; color: #ffb8b0; } body.night .note.ok { background: #1f4434; color: #b6f0cd; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.empty { text-align: center; padding: 28px 10px; } .empty-e { font-size: 52px; } .empty p { color: var(--muted); }
.skel { height: 70px; border-radius: 16px; margin: 8px 0; background: linear-gradient(90deg, var(--moss), var(--cream), var(--moss)); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
details { margin: 8px 0; background: var(--moss); border-radius: 12px; padding: 8px 12px; } summary { cursor: pointer; font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pcard { position: relative; background: var(--cream); border: 2px solid var(--line); border-radius: 18px; padding: 10px; text-align: center; box-shadow: 0 3px 0 var(--line); }
.pcard.out { opacity: .6; }
.pimg { border: 0; background: var(--moss); border-radius: 14px; width: 100%; aspect-ratio: 1.3; display: grid; place-items: center; position: relative; padding: 6px; }
.pimg img { width: 64px; height: 64px; object-fit: contain; }
.tag { position: absolute; top: 4px; left: 4px; font-style: normal; font-size: .65rem; padding: 2px 7px; border-radius: 999px; background: var(--gold); color: #5a3b00; }
.tag.flash { background: #ff7a3c; color: #fff; }
.heart { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .85); color: var(--pink); font-size: 16px; }
.heart.on { color: #67d394; } .heart.big { position: static; width: 38px; height: 38px; margin-left: auto; background: var(--pink-2); }
.pname { display: block; margin-top: 6px; font-family: var(--f-head); font-size: .95rem; } .pprice { font-size: .8rem; color: var(--muted); }

.phead { display: flex; gap: 12px; align-items: center; } .plogo { width: 64px; height: 64px; object-fit: contain; background: var(--moss); border-radius: 16px; padding: 8px; }
.desc { color: var(--muted); font-size: .92rem; }
.vlist, .lines { list-style: none; margin: 0; padding: 0; }
.vrow { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 2px dashed var(--line); }
.vrow.off { opacity: .55; } .vrow small { display: block; color: var(--muted); font-weight: 600; } .flashnote { color: #e0621f !important; }
.vprice { text-align: right; } .vprice s { display: block; color: var(--muted); font-size: .78rem; } .vprice b { color: var(--leaf); }
body.night .vprice b { color: #9be3b8; }
.frow { display: flex; gap: 8px; align-items: center; } .fimg { width: 40px; height: 40px; object-fit: contain; }
.flashhead { text-align: center; background: linear-gradient(135deg, #ffe08a, #ffb36b); color: #4a2b00; border-radius: 18px; padding: 12px; margin-bottom: 8px; }
.flashhead h3 { color: #4a2b00; } .cd { font-size: 1.8rem; font-weight: 700; }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 2px dashed var(--line); align-items: center; }
.lthumb { width: 56px; height: 56px; object-fit: contain; background: var(--moss); border-radius: 12px; padding: 6px; }
.lmain small { display: block; color: var(--muted); } .lside { text-align: right; display: grid; gap: 6px; justify-items: end; }
.x { border: 0; background: none; color: var(--muted); }
.qty { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; } .qty button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--cream); line-height: 1; }
.promo { display: flex; gap: 8px; margin: 12px 0; }
.srow { display: flex; justify-content: space-between; padding: 4px 0; } .srow.disc { color: #1f8a4c; } .srow.total { border-top: 2px dashed var(--line); margin-top: 4px; padding-top: 8px; font-size: 1.15rem; font-family: var(--f-head); }
.sumbox { background: var(--moss); border-radius: 16px; padding: 10px 14px; margin-bottom: 8px; }
.terms { margin: 6px 0 0; padding-left: 20px; font-size: .85rem; }
.done { text-align: center; } .big { font-size: 1.3rem; margin: 4px 0; }
.steps { padding-left: 20px; } .steps li { margin: 6px 0; }
.receipt { white-space: pre-wrap; font-size: .75rem; background: var(--cream); padding: 10px; border-radius: 10px; overflow-x: auto; }

.ocard { border: 2px solid var(--line); border-radius: 18px; margin: 8px 0; background: var(--cream); overflow: hidden; }
.ohead { width: 100%; border: 0; background: none; display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; text-align: left; }
.ohead small, .oname { display: block; color: var(--muted); font-size: .8rem; } .oright { text-align: right; display: grid; gap: 4px; justify-items: end; }
.st { font-size: .72rem; padding: 2px 9px; border-radius: 999px; background: var(--gold); color: #5a3b00; }
.st.st-sky { background: #bfe6f7; color: #1b4a66; } .st.st-lav { background: #d5bdf0; color: #4a2b7a; } .st.st-mint { background: #cdebc8; color: #1f5a2a; } .st.st-pink { background: #ccf1db; color: #3c6852; }
.obody { padding: 0 12px 12px; } .olines { list-style: none; padding: 0; margin: 0 0 6px; } .olines li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; } .olines em { color: var(--muted); font-style: normal; }
.obtns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.acct { background: var(--moss); border-radius: 12px; padding: 8px 12px; margin: 8px 0; } .acct pre { white-space: pre-wrap; margin: 4px 0; font-size: .85rem; }
.prof { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; } .avatar, .av { width: 48px; height: 48px; border-radius: 50%; background: var(--pink); display: grid; place-items: center; font-family: var(--f-head); font-size: 1.3rem; color: #fff; flex: none; }
.av { width: 36px; height: 36px; font-size: 1rem; }
.lvl, .stamps { background: var(--moss); border-radius: 16px; padding: 10px 14px; margin: 8px 0; } .lvl small, .stamps small { display: block; color: var(--muted); }
.sgrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: 6px 0; } .stamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; } .stamp.on { border-style: solid; background: var(--pink-2); }
.vc { display: flex; justify-content: space-between; gap: 8px; align-items: center; border: 2px dashed var(--leaf-2); border-radius: 16px; padding: 10px 12px; margin: 8px 0; background: var(--cream); } .vc span, .vc small { display: block; } .vc.used, .vc.expired, .vc.off { opacity: .5; border-color: var(--line); }
.tsum { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; background: var(--moss); border-radius: 16px; padding: 10px 14px; margin-bottom: 8px; } .tsum b { font-size: 1.8rem; font-family: var(--f-head); grid-row: span 2; } .tsum .btn { grid-row: span 2; }
.star { color: var(--gold); letter-spacing: 1px; }
.tcard { border: 2px solid var(--line); border-radius: 16px; padding: 10px 12px; margin: 8px 0; background: var(--cream); } .thead { display: flex; justify-content: space-between; } .tcard p { margin: 4px 0; } .tcard small { color: var(--muted); } .timg { width: 100%; border-radius: 10px; margin-top: 6px; }
.rate { display: flex; gap: 4px; } .rs { border: 0; background: none; font-size: 32px; color: var(--line); } .rs.on { color: var(--gold); }
.mrow { display: flex; gap: 12px; align-items: center; width: 100%; border: 2px solid var(--line); background: var(--cream); border-radius: 16px; padding: 10px 14px; margin: 6px 0; text-align: left; text-decoration: none; color: inherit; } .mrow > span { font-size: 26px; } .mrow small { display: block; color: var(--muted); }
.faq p { margin: 6px 0 0; }
.stepper { display: flex; gap: 6px; } .stepper button { border: 2px solid var(--line); background: var(--cream); border-radius: 12px; padding: 0 10px; white-space: nowrap; } .stepper input { text-align: center; }
.calc { text-align: center; }
.racc, .rrow { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 2px solid var(--line); border-radius: 14px; background: var(--cream); padding: 8px 12px; margin: 6px 0; } .racc small, .rrow small { display: block; color: var(--muted); } .racc .btn { margin-left: auto; }

#toasts { position: fixed; z-index: 30; top: 72px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; width: min(92vw, 420px); }
.toast { background: #2f6b4a; color: #fff; border-radius: 14px; padding: 10px 16px; text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); opacity: 0; transform: translateY(-10px); transition: .3s; }
.toast.in { opacity: 1; transform: none; } .toast.err { background: var(--err); } .toast.cart { background: #67c68f; }
body.no3d #hud .hint { display: none; }
@media (prefers-reduced-motion: reduce) { .leaf, #fallback span, .dock b[data-flashdot] { animation: none; } }
[hidden] { display: none !important; }
@media (max-width: 520px) { .brand div { display: none; } .brand { padding: 6px; } .tools { gap: 5px; } .tb { width: 38px; height: 38px; } }

.timeline { list-style: none; padding: 0 0 0 14px; margin: 8px 0; border-left: 3px solid var(--leaf-2); } .timeline li { margin: 0 0 8px 10px; } .timeline small { display: block; color: var(--muted); } .timeline p { margin: 2px 0; }
.chatbox { display: flex; flex-direction: column; height: 100%; min-height: 320px; } .cmsgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px; min-height: 240px; max-height: 52vh; }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 16px; } .msg p { margin: 0; } .msg small { opacity: .6; font-size: .7rem; } .msg.me { align-self: flex-end; background: var(--leaf-2); color: #fff; border-bottom-right-radius: 4px; } .msg.adm { align-self: flex-start; background: var(--moss); border-bottom-left-radius: 4px; }
.pf { display: grid; grid-template-columns: 110px 1fr; gap: 10px; border: 2px solid var(--line); border-radius: 16px; padding: 8px; margin: 8px 0; background: var(--cream); } .pf img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; } .pf small { display: block; color: var(--muted); }
.center { text-align: center; }

.tb.active { background: var(--leaf-2); color: #fff; }
