:root {
  --ink: #3b2314;
  --muted: #8b6b55;
  --paper: #fffaf0;
  --red: #e63946;
  --red-d: #a8202c;
  --gold: #ffc93c;
  --gold-d: #d18f00;
  --green: #2fb34f;
  --wood1: #c07a3c;
  --wood2: #7a4519;
  --cell1: #27345a;
  --cell2: #2f3e69;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background-color: #fde7d3;
  /* taplak meja kotak-kotak ala warung */
  background-image:
    radial-gradient(ellipse at center, transparent 40%, rgba(120, 50, 20, .28) 100%),
    linear-gradient(90deg, rgba(230, 57, 70, .16) 50%, transparent 50%),
    linear-gradient(rgba(230, 57, 70, .16) 50%, transparent 50%);
  background-size: 100% 100%, 56px 56px, 56px 56px;
  background-attachment: fixed;
  overflow-x: hidden;
}

h1, h2, .btn, .hud-title, .stat b, .toast, .score-pop, .dlg-name, .sign small, .page-title, .rank b {
  font-family: 'Fredoka', 'Nunito', sans-serif;
}

#app { max-width: 1060px; margin: 0 auto; padding: 16px; }
.screen { display: none; min-height: calc(100vh - 32px); }
.screen.active { display: flex; animation: screenIn .35s ease-out; }

/* ---------- Ikon bahan ---------- */
.ico { display: inline-block; width: 1.6em; height: 1.6em; background: center / contain no-repeat; vertical-align: middle; }

/* ---------- Tombol ---------- */
.btn {
  font-size: calc(17px * var(--fs, 1)); font-weight: 600; letter-spacing: .2px;
  border: none; border-radius: 16px; padding: 12px 24px; cursor: pointer;
  color: #fff; background: linear-gradient(#ff6b6b, var(--red));
  box-shadow: 0 5px 0 var(--red-d), 0 8px 16px rgba(120, 30, 20, .25);
  transition: transform .1s, box-shadow .1s, filter .15s;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .2);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--red-d), 0 3px 8px rgba(120, 30, 20, .2); }
.btn.secondary { background: linear-gradient(#ffe07a, var(--gold)); color: var(--ink); text-shadow: none; box-shadow: 0 5px 0 var(--gold-d), 0 8px 16px rgba(120, 80, 0, .25); }
.btn.secondary:active { box-shadow: 0 1px 0 var(--gold-d); }
.btn.big { font-size: calc(20px * var(--fs, 1)); padding: 15px 28px; min-width: 260px; }
.btn.small { font-size: calc(14px * var(--fs, 1)); padding: 7px 14px; border-radius: 12px; }
.btn.ghost { background: rgba(255, 255, 255, .55); color: var(--muted); box-shadow: none; text-shadow: none; }
.btn.ghost:active { transform: translateY(1px); }

/* ---------- Menu utama ---------- */
#home { position: relative; align-items: center; justify-content: center; }
.awning {
  position: fixed; top: 0; left: 0; right: 0; height: 64px; z-index: 1;
  background: repeating-linear-gradient(90deg, var(--red) 0 48px, #fff 48px 96px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .15);
}
.awning::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -22px; height: 24px;
  background:
    radial-gradient(circle at 24px 0, var(--red) 23px, transparent 24px) 0 0 / 96px 24px repeat-x,
    radial-gradient(circle at 72px 0, #fff 23px, transparent 24px) 0 0 / 96px 24px repeat-x;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .12));
}
.floaters { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.floaters .ico { position: absolute; opacity: .9; animation: floaty 6s ease-in-out infinite; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .18)); }
.home-card {
  position: relative; z-index: 2; margin-top: 60px;
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
  background: rgba(255, 250, 240, .92); backdrop-filter: blur(4px);
  padding: 34px 30px 26px; border-radius: 28px; max-width: 470px; width: 100%;
  box-shadow: 0 20px 50px rgba(90, 40, 15, .25), inset 0 0 0 3px rgba(255, 255, 255, .7);
}
.sign {
  background: linear-gradient(var(--wood1), var(--wood2)); color: #fff6e3;
  padding: 12px 30px 16px; border-radius: 18px; margin-top: -70px;
  box-shadow: 0 8px 0 #5a300f, 0 14px 24px rgba(0, 0, 0, .25), inset 0 2px 0 rgba(255, 255, 255, .3);
  transform: rotate(-2deg);
}
.sign small { display: block; font-size: calc(16px * var(--fs, 1)); letter-spacing: 6px; text-transform: uppercase; opacity: .85; }
.sign h1 { margin: 0; font-size: calc(clamp(30px, 7vw, 44px) * var(--fs, 1)); line-height: 1.05; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.tagline { color: var(--muted); line-height: 1.6; margin: 6px 0 4px; font-weight: 700; }
.hs { margin: 4px 0 0; color: var(--muted); font-weight: 700; }
.hs b { color: var(--red); font-size: calc(18px * var(--fs, 1)); }

/* ---------- Buku resep ---------- */
#map, #shop { justify-content: center; }
.map-wrap { width: 100%; max-width: 580px; display: flex; flex-direction: column; gap: 12px; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rank { display: flex; flex-direction: column; align-items: flex-end; font-weight: 800; color: var(--muted); }
.rank b { color: var(--ink); font-size: calc(18px * var(--fs, 1)); }
.page-title { font-size: calc(32px * var(--fs, 1)); text-align: center; margin: 4px 0 6px; text-shadow: 0 2px 0 #fff; }
#recipeList { display: flex; flex-direction: column; gap: 12px; }
.recipe-card {
  display: flex; align-items: center; gap: 16px; text-align: left; width: 100%;
  font: inherit; color: inherit; cursor: pointer;
  background: var(--paper); border: none; border-radius: 20px; padding: 14px 18px;
  box-shadow: 0 6px 0 #e9cfae, 0 10px 20px rgba(90, 40, 15, .12);
  transition: transform .15s;
  animation: cardIn .4s ease-out backwards;
}
.recipe-card:hover:not(:disabled) { transform: translateY(-3px) rotate(-.4deg); }
.recipe-card.locked { opacity: .6; cursor: not-allowed; filter: grayscale(.7); }
.recipe-card.boss { background: linear-gradient(120deg, #fff1e0, #ffe0d6); box-shadow: 0 6px 0 #f0a58f, 0 10px 20px rgba(160, 40, 20, .18); }
.rc-dish { font-size: calc(34px * var(--fs, 1)); width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: inset 0 0 0 3px #f3dfc3; flex: none; }
.rc-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.rc-info b { font-size: calc(17px * var(--fs, 1)); }
.rc-info small { color: var(--muted); font-weight: 700; }
.rc-goals { display: flex; gap: 6px; flex-wrap: wrap; font-size: calc(13px * var(--fs, 1)); font-weight: 800; color: var(--muted); }
.rc-goals span { display: inline-flex; align-items: center; gap: 2px; }
.rc-goals .ico { width: 20px; height: 20px; }
.rc-stars { color: var(--gold); font-size: calc(22px * var(--fs, 1)); letter-spacing: 1px; white-space: nowrap; text-shadow: 0 2px 0 var(--gold-d); }
.rc-stars .off { color: #e7d6bf; text-shadow: none; }

/* ---------- Dialog ---------- */
#dialog { align-items: center; justify-content: center; }
.dialog-card {
  background: var(--paper); border-radius: 28px; padding: 28px 26px; max-width: 470px; width: 100%; text-align: center;
  box-shadow: 0 20px 50px rgba(90, 40, 15, .25);
  display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.avatar { font-size: calc(58px * var(--fs, 1)); width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(#fff3d6, #ffd9a8); box-shadow: 0 0 0 5px #fff, 0 8px 18px rgba(90, 40, 15, .2); animation: bob 2.6s ease-in-out infinite; }
.dlg-name { font-weight: 600; font-size: calc(19px * var(--fs, 1)); }
.bubble { position: relative; background: #fff; border-radius: 18px; padding: 14px 18px; box-shadow: 0 4px 0 #f0dcc0; }
.bubble::before { content: ""; position: absolute; top: -10px; left: 50%; margin-left: -10px; border: 10px solid transparent; border-top: 0; border-bottom-color: #fff; }
#dlgText { margin: 0; line-height: 1.65; font-weight: 700; }
.order { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 2px 0 6px; }
.order-title {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 4px;
  background: linear-gradient(#fff6cf, #ffe38a); color: var(--ink); border-radius: 18px; padding: 10px 14px 12px;
  border: 3px dashed #e0a500; box-shadow: 0 6px 16px rgba(200, 140, 0, .2);
}
.order-title small { font-size: calc(12px * var(--fs, 1)); font-weight: 800; letter-spacing: 3px; color: #a86a00; }
.order-title .od-dish { font-size: calc(34px * var(--fs, 1)); line-height: 1.1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.order-title b { font-family: 'Fredoka', sans-serif; font-size: calc(22px * var(--fs, 1)); font-weight: 600; text-shadow: 0 2px 0 #fff; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #fff; border-radius: 999px; padding: 4px 12px 4px 6px; font-size: calc(14px * var(--fs, 1)); font-weight: 800; box-shadow: 0 3px 0 #f0dcc0; }
.chip .ico { width: 26px; height: 26px; }
.chip.warn { color: var(--red); padding-left: 12px; }

/* ---------- Layar permainan ---------- */
#game { flex-wrap: wrap; gap: 28px; align-items: center; justify-content: center; align-content: center; }
.hud {
  position: relative; width: 280px; background: var(--paper); border-radius: 20px 20px 4px 4px; padding: 16px 18px 20px;
  display: flex; flex-direction: column; gap: 14px; transform: rotate(-1.2deg);
  box-shadow: 0 14px 30px rgba(90, 40, 15, .2);
}
.hud::after { /* tepi bergerigi seperti struk pesanan */
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px;
  background: linear-gradient(-45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x,
              linear-gradient(45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x;
}
.hud-top { display: flex; justify-content: space-between; }
.hud-title { font-size: calc(21px * var(--fs, 1)); font-weight: 600; border-bottom: 2px dashed #ead6ba; padding-bottom: 10px; }
.hud-stats { display: flex; gap: 8px; }
.stat { flex: 1; background: #fff; border-radius: 14px; padding: 8px 6px; text-align: center; box-shadow: 0 3px 0 #f0dcc0; }
.stat span { display: block; font-size: calc(11px * var(--fs, 1)); font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stat b { font-size: calc(26px * var(--fs, 1)); font-weight: 700; display: inline-block; }
.stat.badge { background: linear-gradient(#ff7a7a, var(--red)); color: #fff; box-shadow: 0 3px 0 var(--red-d); }
.stat.badge span { color: #ffe1e1; }
.stat.warn b { animation: beat .7s ease-in-out infinite; }
.bump { animation: bump .3s ease-out; }
.goals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.goal { position: relative; display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 14px; padding: 6px 10px; box-shadow: 0 3px 0 #f0dcc0; overflow: hidden; font-weight: 800; }
.goal .ico { width: 34px; height: 34px; }
.goal b { font-family: 'Fredoka', sans-serif; font-size: calc(20px * var(--fs, 1)); }
.goal .prog { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--green); transition: width .3s; }
.goal.done { background: #e4f8de; }
.goal.done b { color: var(--green); }
.time-wrap { height: 16px; background: #f1dfc6; border-radius: 99px; overflow: hidden; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .12); }
#timeBar { height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(#8be36f, #3fae3b); transition: width .1s linear; }
#timeBar.low { background: linear-gradient(#ff8a7a, var(--red)); }
.hud-note { margin: 0; font-size: calc(13px * var(--fs, 1)); color: var(--muted); line-height: 1.5; font-weight: 700; }

/* ---------- Papan ---------- */
.board-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.board {
  --size: min(92vw, 520px);
  --pad: calc(var(--size) * .025);
  position: relative; width: var(--size); height: var(--size);
  border-radius: 26px;
  background: linear-gradient(150deg, var(--wood1), var(--wood2));
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .3), inset 0 -5px 0 rgba(0, 0, 0, .25), 0 22px 44px rgba(70, 30, 10, .4);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.layer, .fx { position: absolute; inset: var(--pad); border-radius: 16px; }
.layer {
  overflow: hidden;
  /* grid sebagai latar: kotak-kotak bergantian, tanpa bingkai per bahan */
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .1), transparent 60%),
    repeating-conic-gradient(var(--cell1) 0 25%, var(--cell2) 0 50%) 0 0 / 25% 25%;
  box-shadow: inset 0 4px 14px rgba(0, 0, 0, .5);
  transition: filter .3s;
}
.layer.paused { filter: blur(10px) saturate(.6); }
.fx { pointer-events: none; z-index: 3; }

.piece { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; will-change: transform; }
.ic {
  position: absolute; inset: 9%;
  background: center / contain no-repeat;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .4));
  transform-origin: 50% 85%;
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1);
}
.ic.sel { transform: scale(1.18); filter: drop-shadow(0 0 7px rgba(255, 230, 120, .95)) drop-shadow(0 3px 2px rgba(0, 0, 0, .4)); }
.ic.hint { animation: wiggle 1s ease-in-out infinite; }
.piece:hover .ic:not(.sel) { transform: scale(1.06); }

.cursor {
  position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%;
  border-radius: 14px; opacity: 0;
  box-shadow: inset 0 0 0 3px rgba(255, 230, 120, .9), 0 0 18px rgba(255, 220, 90, .5);
  background: rgba(255, 230, 120, .12);
  transition: opacity .15s, transform .15s ease-out;
}
.cursor.on { opacity: 1; }

.particle { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; }
.score-pop {
  position: absolute; transform: translate(-50%, -50%); font-size: calc(24px * var(--fs, 1)); font-weight: 700; color: #fff; white-space: nowrap;
  text-shadow: 0 2px 0 #b65c00, 0 0 8px rgba(0, 0, 0, .35); -webkit-text-stroke: 1px #b65c00;
}
.slash { position: absolute; background: linear-gradient(90deg, transparent, #fff8c8, #fff, #fff8c8, transparent); box-shadow: 0 0 16px #ffe46b; border-radius: 99px; }

.toast {
  position: absolute; left: 50%; top: 42%; z-index: 5;
  transform: translate(-50%, -50%) scale(.6);
  background: linear-gradient(#ffe07a, var(--gold)); color: var(--ink);
  font-weight: 700; font-size: calc(24px * var(--fs, 1)); padding: 10px 24px; border-radius: 999px;
  box-shadow: 0 5px 0 var(--gold-d), 0 10px 22px rgba(0, 0, 0, .3);
  opacity: 0; pointer-events: none; white-space: nowrap;
  transition: opacity .2s, transform .3s cubic-bezier(.3, 1.8, .5, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.help { margin: 0; color: var(--muted); font-size: calc(13px * var(--fs, 1)); font-weight: 700; text-align: center; max-width: 520px; }
.help .ico { width: 22px; height: 22px; }

/* ---------- Hasil ---------- */
.overlay { position: fixed; inset: 0; background: rgba(50, 20, 8, .6); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.overlay.show { display: flex; }
.result-card { background: var(--paper); border-radius: 28px; padding: 28px; max-width: 430px; width: 100%; text-align: center; animation: popIn .45s cubic-bezier(.3, 1.6, .5, 1); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.res-icon { font-size: calc(66px * var(--fs, 1)); animation: bob 2.4s ease-in-out infinite; }
.result-card h2 { font-size: calc(30px * var(--fs, 1)); }
.stars { display: flex; justify-content: center; gap: 8px; min-height: 0; }
.star { font-size: calc(46px * var(--fs, 1)); color: #ead9c1; }
.star.on { color: var(--gold); text-shadow: 0 3px 0 var(--gold-d); animation: starIn .5s cubic-bezier(.3, 1.8, .5, 1) backwards; }
#resText { line-height: 1.6; font-weight: 700; }
.res-score { font-weight: 800; color: var(--muted); }
.res-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Tambahan: toko, koin, booster, modal ---------- */
.btn.green { background: linear-gradient(#6fe08a, var(--green)); box-shadow: 0 5px 0 #1d7a35, 0 8px 16px rgba(20, 90, 30, .25); }
.btn.green:active { box-shadow: 0 1px 0 #1d7a35; }
.btn.danger { background: linear-gradient(#ff6b6b, #c81e2c); }
.danger-text { color: var(--red) !important; }
.home-stats { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-weight: 800; color: var(--muted); }
.home-stats b { color: var(--red); font-size: calc(18px * var(--fs, 1)); }
.home-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.storage-warn { margin: 0; font-size: calc(13px * var(--fs, 1)); color: #a8202c; background: #ffe3e3; border-radius: 12px; padding: 8px 12px; font-weight: 700; }
.shop-link { align-self: center; }
.sub { text-align: center; color: var(--muted); font-weight: 700; margin: 0 0 4px; line-height: 1.5; }
.coin-pill { background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 800; box-shadow: 0 3px 0 #f0dcc0; }
.coin-pill b { font-family: 'Fredoka', sans-serif; font-size: calc(20px * var(--fs, 1)); color: var(--gold-d); }

.shop-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shop-item { background: var(--paper); border-radius: 20px; padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; box-shadow: 0 6px 0 #e9cfae, 0 10px 20px rgba(90, 40, 15, .12); }
.shop-item .big-ico { font-size: calc(42px * var(--fs, 1)); }
.shop-item h4 { margin: 0; font-family: 'Fredoka', sans-serif; font-size: calc(18px * var(--fs, 1)); }
.shop-item p { margin: 0; font-size: calc(13px * var(--fs, 1)); color: var(--muted); font-weight: 700; line-height: 1.4; flex: 1; }
.shop-item .owned { font-size: calc(13px * var(--fs, 1)); font-weight: 800; }
.shake { animation: shakeX .35s; }

.info-card { background: rgba(255, 250, 240, .92); border-radius: 20px; padding: 16px 18px; box-shadow: 0 6px 16px rgba(90, 40, 15, .1); }
.info-card h3 { margin: 0 0 6px; font-family: 'Fredoka', sans-serif; }
.info-card p { margin: 0 0 8px; color: var(--muted); font-weight: 700; font-size: calc(14px * var(--fs, 1)); }
.tier-table { width: 100%; border-collapse: collapse; font-weight: 800; }
.tier-table td { padding: 6px 8px; border-bottom: 1px dashed #ead6ba; }
.tier-table td:last-child { text-align: right; color: var(--gold-d); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.legend div { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 14px; padding: 6px 10px; font-size: calc(13px * var(--fs, 1)); font-weight: 800; }
.legend .ico { width: 38px; height: 38px; flex: none; }
.legend small { display: block; color: var(--muted); font-weight: 700; }

.tier { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: calc(12px * var(--fs, 1)); font-weight: 800; letter-spacing: .5px; }
.tier.normal { background: #ddf6d6; color: #23803a; }
.tier.medium { background: #fff1c2; color: #a86a00; }
.tier.hard { background: #ffd6d6; color: #b3162a; }
.recipe-card.medium { box-shadow: 0 6px 0 #f3d27a, 0 10px 20px rgba(160, 110, 0, .15); }
.recipe-card.hard { background: linear-gradient(120deg, #fff1e0, #ffe0d6); box-shadow: 0 6px 0 #f0a58f, 0 10px 20px rgba(160, 40, 20, .18); }

.boosters { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.booster {
  position: relative; width: 74px; padding: 8px 4px 6px; border: none; border-radius: 18px; cursor: pointer;
  background: var(--paper); font: inherit; color: var(--ink);
  box-shadow: 0 5px 0 #e2c7a2, 0 8px 14px rgba(90, 40, 15, .15);
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .1s;
}
.booster:active { transform: translateY(3px); box-shadow: 0 2px 0 #e2c7a2; }
.booster .ico { width: 40px; height: 40px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2)); }
.shop-item .ico.big { width: 72px; height: 72px; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .2)); }
.booster small { font-size: calc(11px * var(--fs, 1)); font-weight: 800; color: var(--muted); }
.booster .cnt { position: absolute; top: -6px; right: -6px; min-width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; background: var(--red); color: #fff; font-size: calc(13px * var(--fs, 1)); font-weight: 800; box-shadow: 0 2px 0 var(--red-d); }
.booster.empty { opacity: .55; }
.booster.empty .cnt { background: #b9a48d; box-shadow: none; }
.booster.active { background: #fff3b0; box-shadow: 0 5px 0 var(--gold-d), 0 0 0 3px var(--gold), 0 8px 18px rgba(200, 140, 0, .35); animation: beat 1s ease-in-out infinite; }
.board.targeting .layer { cursor: crosshair; box-shadow: inset 0 0 0 4px rgba(255, 210, 60, .8), inset 0 4px 14px rgba(0, 0, 0, .5); }

.time-wrap { position: relative; }
#timeText { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(11px * var(--fs, 1)); font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.time-wrap { height: 20px; }

.ring { position: absolute; transform: translate(-50%, -50%); border-radius: 18px; border: 4px solid #ffd27a; box-shadow: 0 0 24px #ff9a3c, inset 0 0 24px #ffb35c; }
.flash { position: absolute; inset: 0; border-radius: 16px; background: radial-gradient(circle, #fffbe0, rgba(255, 210, 60, .7) 50%, transparent 80%); }
.flyer { position: fixed; z-index: 50; pointer-events: none; background: center / contain no-repeat; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }

.res-coins { font-family: 'Fredoka', sans-serif; font-size: calc(20px * var(--fs, 1)); color: var(--gold-d); margin: 0 0 14px; }
.res-coins:empty { display: none; }
#mText { line-height: 1.6; font-weight: 700; }

.notice {
  position: fixed; left: 50%; top: 18px; z-index: 60; max-width: min(92vw, 460px);
  transform: translate(-50%, -150%); opacity: 0; visibility: hidden; transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), opacity .2s, visibility .35s;
  background: #2f2a26; color: #fff; padding: 12px 18px; border-radius: 16px; font-weight: 800; text-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
}
.notice.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.notice.err { background: #b3162a; }
.notice.ok { background: #1f8a3c; }

@keyframes shakeX { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ---------- Animasi ---------- */
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } }
@keyframes starIn { from { transform: scale(0) rotate(-120deg); } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-18px) rotate(8deg); } }
@keyframes wiggle { 0%, 100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.12) rotate(-9deg); } 75% { transform: scale(1.12) rotate(9deg); } }
@keyframes beat { 50% { transform: scale(1.18); } }
@keyframes bump { 40% { transform: scale(1.3); } }

@media (max-width: 860px) {
  .hud { width: min(92vw, 520px); transform: none; }
  .goals { grid-template-columns: repeat(4, 1fr); }
  .goal { flex-direction: column; gap: 0; padding: 6px 4px; }
  .goals { grid-template-columns: repeat(5, 1fr); }
  .booster { width: 66px; }
}
@media (max-width: 480px) {
  .shop-list, .legend { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .floaters .ico, .avatar, .res-icon { animation: none; }
}

/* ---------- Menu utama bergaya struk ---------- */
.home-card.receipt {
  background: var(--paper); backdrop-filter: none;
  border-radius: 22px 22px 4px 4px; padding-bottom: 30px; gap: 12px;
  box-shadow: 0 20px 50px rgba(90, 40, 15, .25);
}
.home-card.receipt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px;
  background: linear-gradient(-45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x,
              linear-gradient(45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x;
}
.dash { width: 100%; border-top: 2px dashed #ead6ba; margin: 2px 0; }
.home-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.home-row .coin-pill { font-size: calc(15px * var(--fs, 1)); }
.home-row .btn.small { font-size: calc(15px * var(--fs, 1)); padding: 8px 16px; }
.hs-box { display: flex; flex-direction: column; align-items: center; line-height: 1.15; margin-top: 2px; }
.hs-box span { font-size: calc(14px * var(--fs, 1)); font-weight: 800; color: var(--muted); }
.hs-box b { font-family: 'Fredoka', sans-serif; font-size: calc(34px * var(--fs, 1)); color: var(--red); }

/* ---------- Header buku resep diberi latar ---------- */
.rank { background: var(--paper); padding: 8px 14px; border-radius: 16px; box-shadow: 0 3px 0 #ead2b2, 0 6px 14px rgba(90, 40, 15, .12); }

/* ---------- Hasil: rincian skor ---------- */
.res-note { margin: -4px 0 10px; font-weight: 800; color: var(--green); }
.res-note:empty { display: none; }
.score-box {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; border-radius: 16px; padding: 12px 16px; margin: 0 auto 10px; max-width: 260px;
  box-shadow: 0 3px 0 #f0dcc0; border: 2px dashed #ead6ba;
}
.score-box .lbl { font-size: calc(13px * var(--fs, 1)); font-weight: 800; color: var(--muted); letter-spacing: 1px; }
.score-box .base { font-family: 'Fredoka', sans-serif; font-size: calc(24px * var(--fs, 1)); font-weight: 600; }
.score-box .bonus { font-weight: 800; color: var(--green); font-size: calc(15px * var(--fs, 1)); }
.score-box .total { font-family: 'Fredoka', sans-serif; font-size: calc(34px * var(--fs, 1)); font-weight: 700; color: var(--red); margin-top: 4px; padding-top: 6px; border-top: 2px dashed #ead6ba; width: 100%; text-align: center; }
.res-coins { margin: 0 0 14px; }

/* ---------- Jendela jeda di atas papan ---------- */
.pause-panel {
  position: absolute; inset: var(--pad); z-index: 6; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(30, 24, 40, .45);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.pause-panel.show { opacity: 1; visibility: visible; }
.pause-card {
  background: var(--paper); border-radius: 22px; padding: 22px 26px; width: min(80%, 300px); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35); transform: scale(.85); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.pause-panel.show .pause-card { transform: scale(1); }
.pause-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: calc(28px * var(--fs, 1)); background: linear-gradient(#ffe07a, var(--gold)); box-shadow: 0 4px 0 var(--gold-d); }
.pause-card h3 { margin: 0; font-family: 'Fredoka', sans-serif; font-size: calc(22px * var(--fs, 1)); }
.pause-card p { margin: 0; color: var(--muted); font-weight: 700; font-size: calc(14px * var(--fs, 1)); line-height: 1.5; }
.pause-card .btn.green { min-width: 170px; }
.hud-top .btn.small { font-size: calc(14px * var(--fs, 1)); }

/* ---------- Kartu hasil bergaya struk ---------- */
#result .result-card {
  position: relative; border-radius: 22px 22px 4px 4px; padding-bottom: 30px;
}
#result .result-card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px;
  background: linear-gradient(-45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x,
              linear-gradient(45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x;
}
#result .result-card h2 { padding-bottom: 10px; border-bottom: 2px dashed #ead6ba; }
#result .score-box {
  background: transparent; box-shadow: none; border: none; border-radius: 0;
  border-top: 2px dashed #ead6ba; border-bottom: 2px dashed #ead6ba;
  max-width: none; padding: 12px 0; margin: 0 0 12px;
}
#result .score-box .total { border-top: 1px dotted #d9c2a2; }
#result .res-coins { padding-bottom: 12px; border-bottom: 2px dashed #ead6ba; }

.res-back { margin-top: 12px; }

/* ---------- Header Buku Resep tetap terlihat saat scroll ---------- */
.map-head {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-direction: column; gap: 8px; align-items: stretch;
  margin: -16px -12px 0; padding: 16px 12px 14px;
  background: rgba(253, 231, 211, .98); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 0 0 22px 22px; box-shadow: 0 8px 18px rgba(90, 40, 15, .12);
}
.map-head .page-title { margin: 0; }

/* ---------- Header Buku Resep bergaya struk ---------- */
.map-head {
  background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none;
  border-radius: 0; padding: 22px 20px 24px; gap: 12px; margin-bottom: 16px;
  box-shadow: 0 10px 20px rgba(90, 40, 15, .14);
}
.map-head::after { /* tepi bawah bergerigi seperti struk sobek */
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px;
  background: linear-gradient(-45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x,
              linear-gradient(45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x;
}
.map-head .page-title { padding: 6px 0 10px; border-top: 2px dashed #ead6ba; border-bottom: 2px dashed #ead6ba; text-shadow: none; }
.map-head .rank { box-shadow: 0 3px 0 #ead2b2; background: #fff; }
.map-head .btn.ghost { background: #fff; box-shadow: 0 3px 0 #ead2b2; }

/* ---------- Header Buku Resep bergaya struk ---------- */
.map-head {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  margin: -16px 0 14px; padding: 26px 20px 28px;
  background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none;
  border-radius: 0 0 4px 4px; box-shadow: 0 10px 22px rgba(90, 40, 15, .18);
}
.map-head::after { /* tepi bawah bergerigi */
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px;
  background: linear-gradient(-45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x,
              linear-gradient(45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x;
}
.mh-menu { align-self: start; }
.mh-title { display: flex; flex-direction: column; align-items: center; text-align: center; }
.mh-title small { font-size: calc(12px * var(--fs, 1)); font-weight: 800; letter-spacing: 4px; color: var(--muted); }
.map-head .page-title { margin: 2px 0 0; font-size: calc(30px * var(--fs, 1)); }
.mh-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.map-head .rank { box-shadow: 0 3px 0 #f0dcc0; background: #fff; }
@media (max-width: 560px) {
  .map-head { grid-template-columns: 1fr auto; padding: 18px 14px 26px; }
  .mh-title { grid-column: 1 / -1; grid-row: 2; }
  .map-head .page-title { font-size: calc(24px * var(--fs, 1)); }
}
.map-head .page-title { white-space: nowrap; font-size: calc(clamp(22px, 2.6vw, 30px) * var(--fs, 1)); padding-left: 10px; padding-right: 10px; }
.mh-menu { justify-self: start; }
#map .map-wrap { max-width: 700px; }
.map-head .rank, .map-head .rank span { white-space: nowrap; }
#shop .map-wrap { max-width: 700px; }
#shop .map-head .rank { align-items: center; }
#shop .map-head .rank span span { font-family: 'Fredoka', sans-serif; font-size: calc(20px * var(--fs, 1)); color: var(--gold-d); }

/* ===================== Pengaturan ===================== */
#settings, #howto { z-index: 30; }
#modal { z-index: 40; }
.settings-card { text-align: left; display: flex; flex-direction: column; gap: 4px; position: relative; border-radius: 22px 22px 4px 4px; padding-bottom: 30px; }
.settings-card::after, .howto-card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px;
  background: linear-gradient(-45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x,
              linear-gradient(45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x;
}
.settings-card h2 { text-align: center; padding-bottom: 10px; border-bottom: 2px dashed #ead6ba; margin-bottom: 6px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px dashed #ead6ba; font-weight: 800; }
.set-row > :first-child { flex: 1; }
.set-row small { color: var(--muted); font-weight: 700; }
.set-row input[type=range] { width: 140px; accent-color: var(--red); cursor: pointer; }
.set-val { width: 42px; text-align: right; font-family: 'Fredoka', sans-serif; color: var(--red); }
.seg { display: flex; background: #f1dfc6; border-radius: 999px; padding: 3px; }
.seg button { font: inherit; font-weight: 800; font-size: calc(13px * var(--fs, 1)); border: none; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 0 #e2c7a2; }
.switch { position: relative; width: 52px; height: 30px; border: none; border-radius: 999px; background: #d9c6ad; cursor: pointer; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(22px); }
.set-actions { display: flex; justify-content: space-between; gap: 8px; margin: 12px 0 8px; flex-wrap: wrap; }
.settings-card > .btn.primary { align-self: center; min-width: 180px; }

/* ===================== Cara Bermain ===================== */
.howto-card { position: relative; border-radius: 22px 22px 4px 4px; padding-bottom: 30px; max-width: 480px; }
.howto-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 2px dashed #ead6ba; }
.howto-head small { font-weight: 800; letter-spacing: 3px; color: var(--muted); }
.howto-head span { font-family: 'Fredoka', sans-serif; color: var(--red); }
.how-slide { min-height: 260px; padding: 14px 4px 6px; }
.how-slide h3 { margin: 8px 0 6px; font-family: 'Fredoka', sans-serif; font-size: calc(24px * var(--fs, 1)); }
.how-slide p { margin: 0; line-height: 1.65; font-weight: 700; color: #5a3d2a; }
.how-vis { display: flex; justify-content: center; align-items: center; gap: 8px; background: linear-gradient(150deg, var(--cell2), var(--cell1)); border-radius: 18px; padding: 14px; min-height: 88px; box-shadow: inset 0 3px 10px rgba(0, 0, 0, .4), 0 0 0 5px #b8763a; }
.how-vis .ico { width: 56px; height: 56px; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .4)); }
.how-arrow, .how-swap { color: #ffe07a; font-size: calc(28px * var(--fs, 1)); font-weight: 800; }
.how-dish, .how-big { font-size: calc(40px * var(--fs, 1)); color: #fff; font-family: 'Fredoka', sans-serif; }
.how-stars { color: var(--gold); font-size: calc(54px * var(--fs, 1)); letter-spacing: 6px; text-shadow: 0 3px 0 var(--gold-d); }
.how-dots { display: flex; justify-content: center; gap: 8px; margin: 10px 0 12px; }
.how-dots span { width: 10px; height: 10px; border-radius: 50%; background: #e3cfb4; cursor: pointer; transition: transform .2s, background .2s; }
.how-dots span.on { background: var(--red); transform: scale(1.3); }
.howto-card > .btn.ghost { margin-top: 10px; }
.mech-vis { display: flex; justify-content: center; align-items: center; gap: 6px; margin-bottom: 12px; }
.mech-vis .ico { width: 54px; height: 54px; }
#mText .how-arrow { color: var(--gold-d); }

/* ===================== Tutorial ===================== */
.coach {
  display: flex; gap: 12px; align-items: flex-start; width: min(92vw, 520px);
  background: var(--paper); border-radius: 18px; padding: 12px 14px; border: 3px solid var(--gold);
  box-shadow: 0 8px 20px rgba(90, 40, 15, .2);
}
.coach[hidden] { display: none; }
.coach-ava { font-size: calc(34px * var(--fs, 1)); width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(#fff3d6, #ffd9a8); flex: none; }
.coach-body { flex: 1; }
.coach-body b { font-family: 'Fredoka', sans-serif; }
.coach-body p { margin: 2px 0 8px; line-height: 1.55; font-weight: 700; font-size: calc(14px * var(--fs, 1)); }
.coach-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.finger {
  position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; z-index: 4; opacity: 0; pointer-events: none;
}
.finger.on { opacity: 1; }
.finger::before { /* titik sentuh */
  content: ""; position: absolute; left: 50%; top: 50%; width: 46%; height: 46%; margin: -23% 0 0 -23%;
  border-radius: 50%; background: rgba(255, 255, 255, .9); box-shadow: 0 0 0 6px rgba(255, 224, 122, .7), 0 0 22px 6px rgba(255, 210, 60, .8);
}
.tut-focus { position: relative; z-index: 2; border-radius: 16px; animation: tutGlow 1.2s ease-in-out infinite; }
@keyframes tutGlow { 50% { box-shadow: 0 0 0 4px var(--gold), 0 0 22px 6px rgba(255, 201, 60, .7); } }
.hud-top { gap: 6px; }
.hud-top #btnQuit { margin-right: auto; }

/* Keterangan toko diberi latar kartu agar mudah dibaca di atas taplak */
.shop-note {
  background: var(--paper); color: #6b4a33; border-radius: 16px; padding: 12px 18px; margin: 0 0 4px;
  box-shadow: 0 4px 0 #ead2b2, 0 8px 16px rgba(90, 40, 15, .12); border-left: 6px solid var(--gold);
}

/* ===================== Halaman Kredit ===================== */
#credits { justify-content: center; align-items: flex-start; padding-top: 10px; }
.credits-card {
  position: relative; width: 100%; max-width: 520px; margin-bottom: 30px;
  background: var(--paper); border-radius: 22px 22px 4px 4px; padding: 26px 26px 30px;
  box-shadow: 0 20px 50px rgba(90, 40, 15, .25); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.credits-card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px;
  background: linear-gradient(-45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x,
              linear-gradient(45deg, transparent 8px, var(--paper) 0) 0 0 / 16px 12px repeat-x;
}
.cr-head { width: 100%; padding-bottom: 14px; border-bottom: 2px dashed #ead6ba; }
.cr-head small { font-weight: 800; letter-spacing: 4px; color: var(--muted); }
.cr-head h2 { font-family: 'Fredoka', sans-serif; font-size: calc(32px * var(--fs, 1)); margin: 4px 0 2px; }
.cr-ver { font-size: calc(13px * var(--fs, 1)); font-weight: 800; color: var(--muted); }
.cr-icons { display: flex; justify-content: center; gap: 6px; margin: 10px 0 4px; }
.cr-icons .ico { width: 34px; height: 34px; animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .2)); }
.cr-icons .ico:nth-child(2n) { animation-delay: -.6s; }
.cr-icons .ico:nth-child(3n) { animation-delay: -1.2s; }
.cr-block { width: 100%; padding: 14px 0; border-bottom: 2px dashed #ead6ba; }
.cr-block h3 { margin: 0 0 6px; font-size: calc(12px * var(--fs, 1)); font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: var(--red); }
.cr-block p { margin: 2px 0; font-weight: 700; color: #5a3d2a; line-height: 1.5; }
.cr-big { font-family: 'Fredoka', sans-serif; font-size: calc(22px * var(--fs, 1)); color: var(--ink) !important; }
.cr-role { font-size: calc(13px * var(--fs, 1)); color: var(--muted) !important; margin-top: 6px !important; }
.cr-table { width: 100%; border-collapse: collapse; text-align: left; font-size: calc(14px * var(--fs, 1)); }
.cr-table td { padding: 7px 4px; border-bottom: 1px dotted #e3cfb4; vertical-align: top; font-weight: 700; }
.cr-table tr:last-child td { border-bottom: none; }
.cr-table td:first-child { color: var(--muted); width: 46%; }
.cr-table td:last-child { color: var(--ink); text-align: right; }
.cr-table small { color: var(--muted); font-weight: 700; }
.cr-thanks { font-family: 'Fredoka', sans-serif; font-size: calc(20px * var(--fs, 1)); margin: 16px 0 10px; }

/* ===================== Pesan Antar (HP warung) ===================== */
.home-btns { display: flex; gap: 8px; }
.mh-right .btn.small { width: 100%; }
.phone-btn { position: relative; }
.phone-btn .badge, .pa-ct .badge {
  background: var(--red); color: #fff; border-radius: 10px; min-width: 20px; height: 20px; padding: 0 5px;
  display: inline-grid; place-items: center; font-size: calc(11px * var(--fs, 1)); font-weight: 800; box-shadow: 0 0 0 2px #fff;
}
.phone-btn .badge { position: absolute; top: -8px; right: -8px; }
.phone-btn .badge[hidden] { display: none; }
.rank .rv { display: block; color: #2f7fd1; margin-top: 2px; }
.rank .rv[hidden] { display: none; }
.tier.order { background: #ffe0e0; color: #b3162a; }
.goal .gico { font-size: calc(26px * var(--fs, 1)); line-height: 1; }
.goal.forbid { background: #fff0f0; box-shadow: 0 3px 0 #f3c9c9; }
.goal.forbid .no { position: absolute; top: 2px; right: 4px; font-size: calc(12px * var(--fs, 1)); }
.goal.forbid.over { background: #ffd6d6; color: var(--red); }

#phone { z-index: 26; }
.pa-phone {
  position: relative; width: min(390px, 94vw); height: min(740px, 92vh); border-radius: 46px; background: #2b211b; padding: 12px;
  box-shadow: 0 30px 60px rgba(40, 15, 5, .45), inset 0 0 0 2px #4a3a30; animation: popIn .35s cubic-bezier(.3, 1.4, .5, 1);
}
.pa-scr { position: relative; width: 100%; height: 100%; border-radius: 36px; overflow: hidden; background: #fff6ea; display: flex; flex-direction: column; }
.pa-notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 120px; height: 26px; background: #2b211b; border-radius: 0 0 16px 16px; z-index: 3; }
.pa-sbar { height: 32px; flex: none; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 26px 3px; font-size: calc(12px * var(--fs, 1)); font-weight: 800; color: #3b2314; background: #ff7a6b; color: #fff; }
.pa-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pa-close { position: absolute; top: -10px; right: -10px; width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer; background: #fff; color: var(--ink); font-size: calc(18px * var(--fs, 1)); font-weight: 800; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }
.pa-head { background: linear-gradient(#ff7a6b, var(--red)); color: #fff; padding: 8px 16px 0; flex: none; }
.pa-head h3 { margin: 0; font-family: 'Fredoka', sans-serif; font-size: calc(22px * var(--fs, 1)); }
.pa-head small { font-weight: 700; opacity: .92; font-size: calc(12px * var(--fs, 1)); }
.pa-tabs { display: flex; margin-top: 8px; }
.pa-tabs button { flex: 1; font: inherit; font-weight: 800; font-size: calc(13px * var(--fs, 1)); color: #fff; background: none; border: none; border-bottom: 3px solid transparent; padding: 8px 0; opacity: .75; cursor: pointer; }
.pa-tabs button.on { opacity: 1; border-color: #fff; }
.pa-list { flex: 1; overflow-y: auto; }
.pa-ct { width: 100%; display: flex; gap: 10px; align-items: center; padding: 11px 14px; border: none; border-bottom: 1px dashed #ecd8bd; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.pa-ct:hover { background: #fff1de; }
.pa-av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: calc(25px * var(--fs, 1)); background: linear-gradient(#fff3d6, #ffd9a8); flex: none; }
.pa-ct .mid, .pa-daily .mid { flex: 1; min-width: 0; }
.pa-ct b { font-size: calc(14px * var(--fs, 1)); }
.pa-ct p { margin: 2px 0 0; font-size: calc(12px * var(--fs, 1)); color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-ct .rt { color: var(--green); font-weight: 800; }
.pa-tag { font-size: calc(10px * var(--fs, 1)); background: #fff1c2; color: #a86a00; border-radius: 8px; padding: 1px 6px; font-weight: 800; }
.pa-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; gap: 10px; }
.pa-empty .big { font-size: calc(64px * var(--fs, 1)); }
.pa-empty b { font-family: 'Fredoka', sans-serif; font-size: calc(20px * var(--fs, 1)); }
.pa-empty p { margin: 0; font-size: calc(13px * var(--fs, 1)); font-weight: 700; color: var(--muted); line-height: 1.5; }
.pa-chathead { display: flex; align-items: center; gap: 10px; background: linear-gradient(#ff7a6b, var(--red)); color: #fff; padding: 8px 14px; flex: none; }
.pa-chathead button { background: none; border: none; color: #fff; font-size: calc(22px * var(--fs, 1)); cursor: pointer; padding: 0 4px; }
.pa-chathead .pa-av { width: 38px; height: 38px; font-size: calc(21px * var(--fs, 1)); }
.pa-chathead b { font-family: 'Fredoka', sans-serif; font-size: calc(16px * var(--fs, 1)); }
.pa-chathead small { display: block; font-size: calc(11px * var(--fs, 1)); font-weight: 700; opacity: .9; }
.pa-chat { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: repeating-linear-gradient(45deg, #fff6ea 0 14px, #fdf0dd 14px 28px); }
.pa-bub { max-width: 80%; padding: 8px 12px; border-radius: 16px; font-size: calc(13px * var(--fs, 1)); font-weight: 700; line-height: 1.45; box-shadow: 0 2px 0 rgba(0, 0, 0, .06); animation: bubIn .25s ease-out; }
.pa-bub.l { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; }
.pa-bub.r { background: #d9f7c9; align-self: flex-end; border-bottom-right-radius: 4px; }
.pa-typing { align-self: flex-start; background: #fff; border-radius: 16px; padding: 10px 14px; display: flex; gap: 4px; }
.pa-typing i { width: 7px; height: 7px; border-radius: 50%; background: #c9b49a; animation: typing 1s infinite; }
.pa-typing i:nth-child(2) { animation-delay: .15s; } .pa-typing i:nth-child(3) { animation-delay: .3s; }
.pa-sys { align-self: center; font-size: calc(11px * var(--fs, 1)); font-weight: 800; color: var(--muted); background: #f3e3cc; border-radius: 999px; padding: 4px 12px; text-align: center; }
.pa-order { align-self: flex-start; width: 86%; background: #fffaf0; border: 2px dashed #e0a500; border-radius: 14px; padding: 10px 12px; animation: bubIn .25s ease-out; }
.pa-order small { display: block; letter-spacing: 2px; color: #a86a00; font-size: calc(10px * var(--fs, 1)); font-weight: 800; }
.pa-order .ttl { font-family: 'Fredoka', sans-serif; font-size: calc(16px * var(--fs, 1)); margin: 2px 0 6px; }
.pa-chips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.pa-order .pa-chips { justify-content: flex-start; }
.pa-chip { display: inline-flex; align-items: center; gap: 3px; background: #fff; border-radius: 999px; padding: 2px 8px 2px 3px; font-size: calc(12px * var(--fs, 1)); font-weight: 800; box-shadow: 0 2px 0 #f0dcc0; }
.pa-chip .ico { width: 22px; height: 22px; }
.pa-chip .gico { font-size: calc(16px * var(--fs, 1)); padding-left: 4px; }
.pa-chip.no { background: #fff0f0; color: var(--red); }
.pa-choices { flex: none; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: #fff6ea; border-top: 2px dashed #ecd8bd; animation: bubIn .3s ease-out; }
.pa-choices .hint { font-size: calc(11px * var(--fs, 1)); font-weight: 800; color: var(--muted); text-align: center; letter-spacing: 1px; }
.pa-choice { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; font: inherit; color: inherit; background: #fff; border: 2px solid transparent; border-radius: 16px; padding: 9px 12px; box-shadow: 0 4px 0 #e2c7a2; cursor: pointer; transition: transform .1s, border-color .15s; }
.pa-choice:hover { border-color: var(--gold); transform: translateY(-1px); }
.pa-choice .e { font-size: calc(24px * var(--fs, 1)); }
.pa-choice b { font-size: calc(13px * var(--fs, 1)); display: block; }
.pa-choice span { font-size: calc(11px * var(--fs, 1)); color: var(--muted); font-weight: 800; }
.pa-choice .rw { margin-left: auto; font-family: 'Fredoka', sans-serif; color: var(--gold-d); font-size: calc(14px * var(--fs, 1)); white-space: nowrap; }
.pa-link { background: none; border: none; font: inherit; font-size: calc(12px * var(--fs, 1)); font-weight: 800; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 4px; }
.pa-chal { align-self: stretch; background: #fffaf0; border-radius: 16px; padding: 12px 14px; box-shadow: 0 4px 0 #e2c7a2; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: bubIn .3s ease-out; }
.pa-chal .kind { display: inline-block; background: #fff1c2; color: #a86a00; border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: calc(12px * var(--fs, 1)); }
.pa-chal h4 { font-family: 'Fredoka', sans-serif; font-size: calc(18px * var(--fs, 1)); margin: 4px 0; }
.pa-chal p { margin: 2px 0; font-size: calc(12px * var(--fs, 1)); font-weight: 700; color: #5a3d2a; line-height: 1.45; }
.pa-chal .rw { color: var(--gold-d); font-weight: 800; }
.pa-chal .meta { display: flex; justify-content: center; gap: 12px; font-size: calc(12px * var(--fs, 1)); font-weight: 800; color: var(--red); margin: 4px 0; }
.pa-chal .btn.primary { margin-top: 6px; }
.pa-review { align-self: stretch; background: #fff; border-radius: 16px; padding: 12px; box-shadow: 0 4px 0 #e2c7a2; text-align: center; }
.pa-review small { letter-spacing: 2px; color: var(--muted); font-weight: 800; font-size: calc(10px * var(--fs, 1)); }
.pa-review .st { color: var(--gold); font-size: calc(26px * var(--fs, 1)); letter-spacing: 2px; text-shadow: 0 2px 0 var(--gold-d); }
.pa-review .st .off { color: #ead9c1; text-shadow: none; }
.pa-review q { display: block; font-size: calc(13px * var(--fs, 1)); font-weight: 700; margin: 4px 0 8px; }
.pa-wait { flex: none; text-align: center; font-size: calc(12px * var(--fs, 1)); font-weight: 800; color: var(--muted); padding: 12px; border-top: 2px dashed #ecd8bd; }
.pa-list.harian { padding-bottom: 10px; }
.pa-streak { margin: 10px; background: #fff; border-radius: 16px; padding: 10px; box-shadow: 0 3px 0 #e2c7a2; }
.pa-streak h5 { margin: 0 0 8px; font-family: 'Fredoka', sans-serif; font-size: calc(15px * var(--fs, 1)); display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.pa-streak h5 span { font-size: calc(10px * var(--fs, 1)); color: var(--muted); font-family: 'Nunito', sans-serif; font-weight: 800; text-align: right; }
.pa-days { display: flex; gap: 4px; }
.pa-day { flex: 1; border-radius: 10px; background: #f3e3cc; text-align: center; padding: 5px 0; font-size: calc(10px * var(--fs, 1)); font-weight: 800; color: var(--muted); }
.pa-day b { display: block; font-size: calc(11px * var(--fs, 1)); color: var(--ink); }
.pa-day.done { background: #d9f7c9; } .pa-day.done b { color: #1f8a3c; }
.pa-day.today { background: #fff1c2; box-shadow: 0 0 0 2px var(--gold); }
.pa-daily { margin: 0 10px 8px; background: #fff; border-radius: 14px; padding: 9px 11px; display: flex; gap: 10px; align-items: center; box-shadow: 0 3px 0 #e2c7a2; }
.pa-daily .pa-av { width: 38px; height: 38px; font-size: calc(20px * var(--fs, 1)); }
.pa-daily b { font-size: calc(13px * var(--fs, 1)); } .pa-daily p { margin: 1px 0 0; font-size: calc(11px * var(--fs, 1)); font-weight: 800; color: var(--muted); }
.pa-daily.done p { color: var(--gold-d); }
.pa-k { font-size: calc(10px * var(--fs, 1)); background: #ffe0e0; color: #b3162a; border-radius: 8px; padding: 1px 6px; font-weight: 800; }
.pa-foot { text-align: center; font-size: calc(11px * var(--fs, 1)); font-weight: 800; color: var(--muted); padding: 4px; }
@keyframes bubIn { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes typing { 50% { transform: translateY(-3px); background: #a8957d; } }
@media (max-width: 480px) { .home-row { flex-wrap: wrap; justify-content: center; } }
/* Rapikan baris koin + tombol di menu utama dan judul bonus beruntun */
.home-row .coin-pill, .home-btns .btn { white-space: nowrap; }
.home-row .coin-pill { padding: 6px 12px; }
.home-btns .btn.small { font-size: calc(14px * var(--fs, 1)); padding: 8px 12px; }
.pa-streak h5 { display: block; }
.pa-streak h5 span { display: block; text-align: left; margin-top: 2px; }

/* Kunci scroll halaman saat ada jendela overlay (HP, pengaturan, hasil, dialog) */
html { scrollbar-gutter: stable; }
html.scroll-lock, html.scroll-lock body { overflow: hidden; }
.overlay { overscroll-behavior: contain; }
.pa-chat, .pa-list, .pa-view { overscroll-behavior: contain; }

/* Ukuran teks (Pengaturan): seluruh teks diskalakan lewat --fs, papan & ikon bahan tidak */
:root { --fs: 1; }
.set-row.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.seg.full { width: 100%; }
.seg.full button { flex: 1; padding: 7px 4px; }
.seg button[data-fs="0.9"] { font-size: calc(12px * var(--fs, 1)); }
.seg button[data-fs="1.15"] { font-size: calc(15px * var(--fs, 1)); }
.seg button[data-fs="1.3"] { font-size: calc(14px * var(--fs, 1)); }
.seg.full button, .mh-menu, .hud-top .btn, .rank b { white-space: nowrap; }
#map .map-wrap, #shop .map-wrap { max-width: min(100%, calc(700px * var(--fs, 1))); }
@media (max-width: 560px) {
  .map-head { grid-template-columns: auto minmax(0, 1fr); }
  .mh-right { min-width: 0; }
  .map-head .rank, .map-head .rank b, .map-head .rank span { white-space: normal; }
  .map-head .page-title { white-space: normal; }
}

/* Ukuran teks besar: tombol Toko Bumbu & Pesan Antar di menu utama atas-bawah */
html[data-fs="big"] .home-btns { flex-direction: column; }
html[data-fs="big"] .home-btns .btn { width: 100%; }

/* Bonus masuk harian & hadiah 3/3 */
.pa-claim { width: 100%; margin-top: 10px; }
.pa-claimed { margin-top: 10px; text-align: center; font-size: calc(12px * var(--fs, 1)); font-weight: 800; color: var(--green); background: #e4f8de; border-radius: 10px; padding: 7px; }
.pa-prize { margin: 0 10px 10px; display: flex; gap: 10px; align-items: center; background: linear-gradient(120deg, #fff6d6, #ffe7a8); border: 2px dashed #e0a500; border-radius: 14px; padding: 9px 12px; }
.pa-prize > span { font-size: calc(26px * var(--fs, 1)); }
.pa-prize b { display: block; font-size: calc(13px * var(--fs, 1)); }
.pa-prize small { font-size: calc(11px * var(--fs, 1)); font-weight: 800; color: #a86a00; }
.pa-prize.done { background: #e4f8de; border-color: var(--green); }
.pa-prize.done small { color: var(--green); }
.pa-dot { background: #fff; color: var(--red); border-radius: 999px; padding: 1px 7px; font-size: calc(10px * var(--fs, 1)); margin-left: 4px; animation: beat 1.2s ease-in-out infinite; display: inline-block; }

/* Carousel hadiah */
#spin { z-index: 45; }
.spin-card { max-width: 400px; }
.spin-sub { margin: 0 0 12px; font-weight: 800; color: var(--muted); }
.spin-window { position: relative; height: 120px; overflow: hidden; border-radius: 18px; background: linear-gradient(150deg, var(--cell2), var(--cell1)); box-shadow: inset 0 4px 12px rgba(0, 0, 0, .45), 0 0 0 5px #b8763a; }
.spin-window::before, .spin-window::after { content: ""; position: absolute; top: 0; bottom: 0; width: 60px; z-index: 2; pointer-events: none; }
.spin-window::before { left: 0; background: linear-gradient(90deg, #27345a, transparent); }
.spin-window::after { right: 0; background: linear-gradient(-90deg, #27345a, transparent); }
.spin-strip { display: flex; height: 100%; will-change: transform; }
.spin-item { flex: none; width: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.spin-item .ico { width: 58px; height: 58px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .4)); }
.spin-item small { color: #fff; font-weight: 800; font-size: calc(11px * var(--fs, 1)); text-align: center; line-height: 1.2; }
.spin-item.won .ico { animation: wonPop .6s cubic-bezier(.3, 1.8, .5, 1) 2; }
.spin-pointer { position: absolute; top: 6px; bottom: 6px; left: 50%; width: 96px; margin-left: -48px; border-radius: 14px; box-shadow: inset 0 0 0 3px var(--gold), 0 0 18px rgba(255, 201, 60, .6); z-index: 3; pointer-events: none; }
.spin-result { min-height: 1.6em; margin: 14px 0 12px; font-weight: 800; font-size: calc(16px * var(--fs, 1)); }
#spinOk:disabled { opacity: .55; cursor: default; }
@keyframes wonPop { 50% { transform: scale(1.3); } }
