:root {
  --pink: #FF8FB1; --pink-d: #E96A94; --pink-l: #FFE3EC;
  --cream: #FFF8F1; --ink: #6B4436; --ink-l: #A07A6A;
  --mint: #7FD8AE; --mint-d: #4FB487; --gold: #FFC94D;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 10%, #FFE3EC, #FFF1E0 60%, #E9E3FF);
  font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; color: var(--ink);
  overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
button { font: inherit; color: inherit; }
svg { display: block; }

#app {
  position: relative; width: 100%; max-width: 440px; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; background: var(--cream); overflow: hidden;
}
@media (min-width: 500px) {
  #app { height: min(100dvh - 24px, 900px); border-radius: 28px; box-shadow: 0 20px 60px rgba(107, 68, 54, .25); }
}

/* ---------- Thanh trên ---------- */
.topbar { padding: 8px 10px 20px; background: linear-gradient(#FFB7CC, #FFC9D8); position: relative; z-index: 5; }
.hud-row { display: flex; gap: 5px; align-items: center; }
.pill {
  display: flex; align-items: center; gap: 3px; background: #fff; border-radius: 999px; border: 0;
  padding: 2px 9px; font-size: 14px; white-space: nowrap; box-shadow: 0 2px 0 rgba(233, 106, 148, .3);
}
.pill .sep { width: 4px; }
.pill.coins { margin-left: auto; font-size: 15px; }
.pill.rating { cursor: pointer; }
#coinIc svg { width: 19px; height: 19px; }
.icon-btn {
  border: 0; background: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 16px;
  box-shadow: 0 3px 0 rgba(233, 106, 148, .35); cursor: pointer; flex: 0 0 auto;
}
.icon-btn:active, .pill.rating:active { transform: translateY(2px); }
.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.18); } }
.goal { position: relative; flex: 1; height: 16px; background: rgba(255, 255, 255, .65); border-radius: 99px; overflow: hidden; }
.goal-fill { height: 100%; width: 0; background: linear-gradient(90deg, #FFD66E, #FFB347); border-radius: 99px; transition: width .3s; }
.goal-fill.done { background: linear-gradient(90deg, #9FE2BF, #5FD3A0); }
.goal-txt { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #8A4A3A; }

/* ---------- Khung cảnh quán ---------- */
.scene {
  --counter: clamp(112px, 33%, 150px);
  position: relative; flex: 1 1 auto; min-height: 300px; overflow: hidden; margin-top: -14px;
  border-radius: 22px 22px 0 0; z-index: 4; background: var(--floor-a);
  --wall-a: #FFEAF1; --wall-b: #FFF6F9; --trim: #F7C6D4; --floor-a: #FFF1E6; --floor-b: #FBE2D2;
  --ct-top: #FFE1C2; --ct-a: #F6CFA7; --ct-b: #EDB688; --aw-a: #FF9EBB; --aw-b: #fff;
}
.scene[data-tier="1"] {
  --wall-a: #E3F7EE; --wall-b: #F4FCF8; --trim: #9FD9BF; --floor-a: #F6EEE2; --floor-b: #E6D6C0;
  --ct-top: #FFF4E0; --ct-a: #DDB890; --ct-b: #C99F74; --aw-a: #7FD8AE; --aw-b: #fff;
}
.scene[data-tier="2"] {
  --wall-a: #EEE6FF; --wall-b: #F8F4FF; --trim: #E9C46A; --floor-a: #EDE2D2; --floor-b: #D3BFA3;
  --ct-top: #FFF1C9; --ct-a: #CDB2EC; --ct-b: #AE8ED6; --aw-a: #B79CFF; --aw-b: #FFE29A;
}
.wall {
  position: absolute; left: 0; right: 0; top: 0; height: 25%;
  background: repeating-linear-gradient(90deg, var(--wall-a) 0 22px, var(--wall-b) 22px 44px);
  border-bottom: 7px solid var(--trim);
}
.window {
  position: absolute; left: 72%; top: 14%; width: 18%; height: 60%; border-radius: 10px 10px 4px 4px;
  background: linear-gradient(#BDE6FF, #E6F6FF); border: 4px solid #fff;
  box-shadow: inset 0 0 0 2px #F3D3C2;
}
.window::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: #fff; transform: translateX(-50%); }
.window::after { content: ''; position: absolute; left: 14%; top: 22%; width: 26%; height: 16%; background: #fff; border-radius: 99px; opacity: .9; }
.floor {
  position: absolute; left: 0; right: 0; top: 25%; bottom: 0;
  background: conic-gradient(var(--floor-a) 25%, var(--floor-b) 0 50%, var(--floor-a) 0 75%, var(--floor-b) 0) 0 0 / 44px 44px;
}

#decorLayer > div { position: absolute; z-index: 0; }
.d-lamp { top: 0; width: 7%; transform: translateX(-50%); z-index: 2 !important; }
.d-neon { top: 4%; left: 50%; width: 26%; transform: translateX(-50%); }
.d-music { top: 3%; left: 2%; width: 9%; }
.glow { animation: flicker 3s ease-in-out infinite; }
@keyframes flicker { 50% { opacity: .6; } }
.neon-txt { animation: neon 2.4s ease-in-out infinite; }
@keyframes neon { 50% { fill: #FF8FC8; } }
.note { animation: note 1.6s ease-in-out infinite; }
@keyframes note { 50% { transform: translateY(-4px); } }

/* Bàn ghế khu ngồi */
.tables { position: absolute; left: 0; right: 0; top: 3%; height: 26%; z-index: 1; }
.tslot { position: absolute; bottom: 0; width: 19%; height: 100%; transform: translateX(-50%); }
.tslot svg { width: 100%; height: auto; }
.tslot .chair { position: absolute; left: 50%; bottom: 30%; width: 62%; transform: translateX(-50%); }
.tslot .sitter { position: absolute; left: 50%; bottom: 20%; width: 50%; transform: translateX(-50%); animation: bob 3s ease-in-out infinite; }
.tslot .tfront { position: absolute; left: 0; right: 0; bottom: 0; }
.tslot.dirty { cursor: pointer; }
.dirty-mark {
  position: absolute; top: 0; right: 0; font-size: 15px; background: #fff; border-radius: 50%; width: 24px; height: 24px;
  display: grid; place-items: center; box-shadow: 0 2px 0 rgba(233, 106, 148, .3); animation: hop .9s ease-in-out infinite;
}
@keyframes hop { 50% { transform: translateY(-5px); } }
.cleaner {
  position: absolute; top: 10%; left: 93%; width: 10%; z-index: 2; transform: translateX(-50%);
  transition: left .6s ease-in-out; pointer-events: none;
}
.cleaner svg { width: 100%; height: auto; }
.cleaner.hidden { display: none; }
.broom { position: absolute; right: -8px; bottom: -2px; font-size: 16px; transform-origin: 50% 100%; }
.cleaner.working .broom { animation: sweep .35s ease-in-out infinite alternate; }
@keyframes sweep { from { transform: rotate(-25deg); } to { transform: rotate(25deg); } }

/* Khách đứng ở quầy */
.spots { position: absolute; left: 0; right: 0; top: 21%; bottom: calc(var(--counter) - 26px); z-index: 2; }
.spot {
  position: absolute; bottom: 0; top: 0; width: 28%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; cursor: pointer;
}
.spot.s0 { left: 3%; } .spot.s1 { left: 36%; } .spot.s2 { left: 69%; }
.who { flex: 1 1 auto; min-height: 60px; max-height: 170px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.who svg { height: 100%; width: auto; max-width: 100%; }
.spot:not(.empty) .who svg { animation: bob 2.6s ease-in-out infinite; }
.spot.enter .who { animation: walkIn .55s cubic-bezier(.3, 1.4, .5, 1); }
.spot.leave { animation: walkOut .45s ease-in forwards; }
.spot.sel .who svg { filter: drop-shadow(0 0 5px rgba(255, 143, 177, .95)); }
@keyframes walkIn { from { transform: translateY(40px) scale(.9); opacity: 0; } }
@keyframes walkOut { to { transform: translateY(30px); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-3px); } }

.sbubble {
  position: relative; flex: 0 0 auto; background: #fff; border-radius: 14px; padding: 3px 6px 5px; margin-bottom: 6px;
  min-width: 76%; max-width: 100%; border: 3px solid #fff; box-shadow: 0 3px 0 rgba(233, 106, 148, .2);
  transition: border-color .2s;
}
.sbubble::after {
  content: ''; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%);
  border: 7px solid transparent; border-top: 8px solid #fff; border-bottom: 0;
}
.spot.empty .sbubble { display: none; }
.spot.sel .sbubble { border-color: var(--pink); }
.spot.sel .sbubble::before {
  content: '♥'; position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  color: var(--pink-d); font-size: 14px; animation: hop .9s ease-in-out infinite;
}
.spot.claimed .sbubble { border: 3px dashed #7FC8B4; }
.spot.talking .sbubble { animation: popIn .3s cubic-bezier(.3, 1.6, .5, 1); }
.bname { font-size: 11px; font-weight: 800; text-align: center; line-height: 1.15; color: var(--ink-l); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bitems { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin-top: 1px; }
.bi { font-size: 11.5px; font-weight: 700; background: #FFF4F8; border-radius: 99px; padding: 0 6px; line-height: 17px; white-space: nowrap; }
.bi.ok { background: #E7F8EF; color: #3E9C6E; }
.bi.ok::after { content: ' ✓'; }
.spot.vip .sbubble { background: linear-gradient(#FFFBEA, #FFF0BF); border-color: var(--gold); }
.spot.vip.sel .sbubble { border-color: var(--pink); }
.spot.vip .sbubble::after { border-top-color: #FFF0BF; }
.pbar { height: 5px; background: #FFE9EF; border-radius: 9px; margin-top: 3px; overflow: hidden; }
.pbar i { display: block; height: 100%; width: 100%; border-radius: 9px; background: var(--mint); }
.cmt { font-size: 11.5px; font-weight: 700; line-height: 1.2; text-align: center; }
.cmt-stars { text-align: center; color: var(--gold); font-size: 12px; letter-spacing: 1px; line-height: 1.2; }

/* Quầy, máy pha, nhân viên */
.counter {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--counter); z-index: 3;
  border-top: 12px solid var(--ct-top);
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .14) 0 3px, transparent 3px 64px), linear-gradient(var(--ct-a), var(--ct-b));
  box-shadow: 0 -3px 0 rgba(201, 138, 90, .25);
}
#counterDecor > div { position: absolute; z-index: 4; }
#counterDecor svg { width: 100%; height: auto; }
.d-tipjar { left: 3%; bottom: 8px; width: 10%; }
.d-plant { right: 3%; bottom: calc(var(--counter) - 18px); width: 11%; }
.d-cat { left: 2%; bottom: calc(var(--counter) - 16px); width: 13%; }
.tail { transform-origin: 54px 50px; animation: wag 1.4s ease-in-out infinite; }
@keyframes wag { 50% { transform: rotate(-12deg); } }

.station { position: absolute; bottom: 6px; left: 28%; height: calc(var(--counter) - 14px); aspect-ratio: 160 / 120; z-index: 4; }
#machine { position: absolute; inset: 0; }
#machine svg { width: 100%; height: 100%; }
.blink { animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }
.cup-wrap { position: absolute; left: 52%; width: 38%; bottom: 3%; z-index: 2; transform-origin: 50% 100%; }
.cup-wrap svg { width: 100%; height: auto; overflow: visible; }
.cup-wrap.bounce { animation: squish .35s; }
@keyframes squish { 30% { transform: scale(1.1, .9); } 60% { transform: scale(.95, 1.06); } }
.liq.pour { animation: pourIn .5s ease-out; }
@keyframes pourIn { from { transform: translateY(100px); } }
.stream { animation: streamOut .5s linear forwards; }
@keyframes streamOut { 0%, 88% { opacity: .95; } 100% { opacity: 0; } }
.tops.drop, .ice.drop, .lid.drop { animation: drop .45s cubic-bezier(.3, 1.5, .6, 1); }
@keyframes drop { from { transform: translateY(-90px); opacity: 0; } }

.staff { position: absolute; right: 1%; bottom: 0; width: 21%; z-index: 4; pointer-events: none; }
.staff.hidden { display: none; }
.staff svg { width: 100%; height: auto; }
.ring {
  position: absolute; top: -6px; left: 50%; width: 30px; height: 30px; transform: translateX(-50%); border-radius: 50%;
  background: conic-gradient(var(--mint-d) calc(var(--p, 0) * 1%), #fff 0); opacity: 0; transition: opacity .2s; z-index: 1;
}
.ring::after { content: '☕'; position: absolute; inset: 4px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 12px; }
.ring.on { opacity: 1; }

/* ---------- Bảng nguyên liệu ---------- */
.panel {
  background: #fff; border-radius: 26px 26px 0 0; margin-top: -16px; position: relative; z-index: 5;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(233, 106, 148, .15);
}
.ticket { display: flex; gap: 4px; align-items: center; overflow-x: auto; white-space: nowrap; min-height: 28px; padding: 0 2px 2px; scrollbar-width: none; }
.ticket::-webkit-scrollbar, .ing-row::-webkit-scrollbar { display: none; }
.tk-name { font-size: 13px; flex: 0 0 auto; margin-right: 2px; }
.tk-empty { font-size: 13px; color: var(--ink-l); font-weight: 700; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700;
  background: #FFF4F8; border: 2px solid #FFE0EB; border-radius: 999px; padding: 0 7px 0 2px; line-height: 20px;
}
.chip svg { width: 18px; height: 18px; }
.chip.ok { background: #E7F8EF; border-color: var(--mint); color: #3E9C6E; }
.chip.extra { background: #FFF0F0; border-color: #FF9C9C; color: #D05050; }

.ing-row { display: flex; gap: 7px; overflow-x: auto; padding: 8px 4px 4px; scrollbar-width: none; }
.divider { flex: 0 0 3px; background: #FFE0EB; border-radius: 3px; margin: 4px 1px; }
.ing {
  flex: 0 0 auto; width: 62px; height: 64px; border: 3px solid #FFE0EB; background: #FFF9FB; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px;
  cursor: pointer; position: relative; transition: transform .12s, border-color .12s, background .12s;
}
.ing .ic svg { width: 36px; height: 36px; }
.ing .lbl { font-size: 11px; font-weight: 700; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56px; }
.ing:active { transform: scale(.9); }
.ing.on { border-color: var(--pink); background: var(--pink-l); transform: translateY(-3px); }
.ing.on::after {
  content: '✓'; position: absolute; top: -8px; right: -6px; background: var(--pink); color: #fff;
  width: 20px; height: 20px; border-radius: 50%; font-size: 12px; display: grid; place-items: center;
  font-weight: 800; box-shadow: 0 2px 0 var(--pink-d);
}
.ing.locked { opacity: .55; }
.ing.locked .ic { filter: grayscale(.8); }
.ing .lock { position: absolute; top: -7px; right: -4px; font-size: 10px; font-weight: 800; background: #fff; border-radius: 999px; padding: 0 5px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.hint { animation: hintPulse 1s ease-in-out infinite; border-color: var(--gold) !important; z-index: 2; }
@keyframes hintPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 201, 77, .9); }
  50% { box-shadow: 0 0 0 8px rgba(255, 201, 77, 0); transform: translateY(-4px); }
}

.actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.round-btn {
  width: 56px; height: 54px; border-radius: 18px; border: 0; background: #FFF1D6; box-shadow: 0 4px 0 #F1C98A;
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-size: 19px; line-height: 1; flex: 0 0 auto;
}
.round-btn small { font-size: 10px; font-weight: 700; margin-top: 3px; }
.round-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #F1C98A; }
.serve-btn {
  flex: 1; height: 54px; border: 0; border-radius: 18px; background: linear-gradient(#FF9DBB, #FF7BA5);
  color: #fff; font-size: 22px; font-weight: 800; box-shadow: 0 5px 0 var(--pink-d); cursor: pointer;
  text-shadow: 0 2px 0 rgba(200, 60, 110, .35);
}
.serve-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--pink-d); }
.serve-btn.hint { border: 3px solid var(--gold); }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- Hiệu ứng ---------- */
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 8; overflow: hidden; }
.float {
  position: absolute; font-weight: 800; font-size: 24px; white-space: nowrap; color: #fff;
  text-shadow: 0 2px 0 var(--pink-d), 0 0 6px rgba(233, 106, 148, .6); animation: floatUp 1.3s ease-out both;
}
.float.coin { color: #FFD25A; text-shadow: 0 2px 0 #C98422, 0 0 4px rgba(0, 0, 0, .15); font-size: 26px; }
.float.small { font-size: 18px; }
.float.tip { font-size: 17px; color: #7FD8AE; text-shadow: 0 2px 0 #3E9C6E; }
.float.combo { font-size: 19px; color: #B79CFF; text-shadow: 0 2px 0 #7A5CD6; }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -70px) scale(1); }
}
.heart { position: absolute; font-size: 20px; animation: heartUp 1.1s ease-out both; }
@keyframes heartUp {
  0% { opacity: 0; transform: scale(.4); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), -90px) scale(1.2) rotate(var(--rot)); }
}
.toast {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.8);
  background: rgba(255, 255, 255, .97); padding: 6px 18px; border-radius: 999px; font-weight: 800; font-size: 16px;
  color: var(--pink-d); box-shadow: 0 4px 0 rgba(233, 106, 148, .25); opacity: 0; pointer-events: none;
  z-index: 12; max-width: 90%; text-align: center; transition: .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- Hộp thoại ---------- */
.modal {
  position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  background: rgba(107, 68, 54, .35); backdrop-filter: blur(3px); padding: 14px;
}
.modal.hidden { display: none; }
.card {
  position: relative; background: #fff; border-radius: 28px; padding: 18px 16px; width: 100%; max-width: 380px;
  max-height: 94%; overflow: auto; text-align: center; box-shadow: 0 8px 0 rgba(233, 106, 148, .3);
  animation: popIn .35s cubic-bezier(.3, 1.6, .5, 1);
}
@keyframes popIn { from { transform: scale(.6); opacity: 0; } }
.card h2 { margin: 0 0 6px; font-size: 23px; color: var(--pink-d); line-height: 1.15; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  border: 0; border-radius: 18px; padding: 10px 16px; font-weight: 800; font-size: 17px; cursor: pointer;
  color: #fff; background: var(--pink); box-shadow: 0 4px 0 var(--pink-d); width: 100%; margin-top: 10px;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--pink-d); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.ad { background: linear-gradient(#FFD66E, #FFBE3D); box-shadow: 0 4px 0 #E39A1E; color: #7A4A12; }
.btn.ghost { background: #FFF1D6; color: var(--ink); box-shadow: 0 4px 0 #F1C98A; }
.btn.mint { background: var(--mint); box-shadow: 0 4px 0 var(--mint-d); }
.btn.big { font-size: 22px; padding: 12px; }
.btn.small { width: auto; margin: 0; padding: 4px 14px; font-size: 15px; }
.row2 { display: flex; gap: 10px; }
.corner-btn { position: absolute; top: 12px; right: 12px; border: 0; background: #FFF1D6; width: 36px; height: 36px; border-radius: 50%; font-size: 17px; cursor: pointer; }
.coin-txt { display: inline-flex; align-items: center; gap: 3px; }
.coin-txt svg { width: 18px; height: 18px; }

.logo { width: 104px; margin: 0 auto; animation: floaty 3s ease-in-out infinite; }
.logo svg { width: 100%; height: auto; }
@keyframes floaty { 50% { transform: translateY(-8px) rotate(3deg); } }
.title { font-size: 34px; margin: 2px 0 0; color: var(--pink-d); line-height: 1.05; text-shadow: 0 3px 0 #FFE0EB; }
.tag { margin: 2px 0 8px; color: var(--ink-l); }
.gift { background: #FFF7E3; border: 2px dashed var(--gold); border-radius: 18px; padding: 10px; margin: 6px 0; }
.gift .btn { font-size: 15px; }
.tut-pic { width: 110px; margin: 0 auto; }
.tut-pic svg { width: 100%; height: auto; }
.tut { margin: 4px 0; line-height: 1.45; }
.tip-ic { font-size: 40px; line-height: 1; }

.big-stars { font-size: 44px; letter-spacing: 4px; color: #F3E3C2; line-height: 1.1; }
.big-stars .f { color: var(--gold); text-shadow: 0 3px 0 #E39A1E; }
.sum-sub { color: var(--ink-l); font-weight: 700; }
.sum-sub.hit { color: #3E9C6E; }
.ledger { background: #FFF9FB; border-radius: 16px; padding: 8px 12px; margin: 8px 0 0; text-align: left; }
.ledger div { display: flex; justify-content: space-between; align-items: center; padding: 1px 0; }
.ledger .tot { border-top: 2px dashed #FFE0EB; margin-top: 4px; padding-top: 5px; font-size: 18px; }
.neg { color: #E05A6A; }

.balance { display: flex; justify-content: center; font-size: 20px; font-weight: 800; }
.tabs { display: flex; gap: 4px; margin: 6px 0 8px; }
.tab { flex: 1; border: 0; background: #FFF1F5; border-radius: 12px; padding: 6px 2px; font-weight: 800; font-size: 12px; white-space: nowrap; cursor: pointer; }
.tab.on { background: var(--pink); color: #fff; box-shadow: 0 3px 0 var(--pink-d); }
.shop-list { max-height: 50vh; overflow: auto; }
.shop-sec { text-align: left; font-weight: 800; color: var(--pink-d); margin: 10px 0 4px; }
.shop-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 16px; background: #FFF9FB; margin-bottom: 6px; }
.si-ic { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; }
.si-ic svg { width: 42px; height: 42px; }
.si-ic .emoji { font-size: 28px; }
.si-txt { flex: 1; text-align: left; line-height: 1.15; }
.si-txt small { display: block; color: var(--ink-l); }
.btn.buy { width: auto; margin: 0; padding: 5px 12px; font-size: 15px; }
.owned { font-weight: 800; color: #3E9C6E; font-size: 14px; white-space: nowrap; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 2px dashed #FFE0EB; font-weight: 700; }

/* Đánh giá của khách */
.rv-score { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.rv-score > b { font-size: 46px; color: var(--pink-d); line-height: 1; }
.rv-score small { color: var(--ink-l); }
.rv-list { max-height: 46vh; overflow: auto; }
.card .rv-list:not(:last-child) { max-height: 30vh; }
.rv { display: flex; gap: 8px; text-align: left; padding: 7px 8px; background: #FFF9FB; border-radius: 14px; margin-bottom: 6px; }
.rv-av { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; background: #FFE3EC; overflow: hidden; }
.rv-av svg { width: 100%; height: 100%; }
.rv-body { flex: 1; min-width: 0; }
.rv-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.rv-stars { color: var(--gold); font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.rv-stars.big { font-size: 22px; }
.rv-stars.s1, .rv-stars.s2 { color: #FF8FA3; }
.rv-txt { font-size: 13px; line-height: 1.3; }
.rv small { color: var(--ink-l); font-size: 11px; }

.ad-overlay {
  position: absolute; inset: 0; z-index: 20; background: rgba(43, 32, 48, .94); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 20px; gap: 6px;
}
.ad-overlay .count { font-size: 64px; font-weight: 800; }
.ad-overlay small { opacity: .7; }

/* Màn hình thấp (iPhone SE...) thì thu gọn bảng nguyên liệu */
@media (max-height: 720px) {
  .ing { height: 56px; width: 56px; }
  .ing .ic svg { width: 30px; height: 30px; }
  .ing-row { padding-top: 7px; padding-bottom: 2px; }
  .round-btn, .serve-btn { height: 46px; }
  .scene { min-height: 270px; }
}

/* ---------- Cấp quán, nhiệm vụ ---------- */
.bars { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
.lvl { display: flex; align-items: center; gap: 4px; flex: 0 0 30%; }
.lvl-badge {
  background: #B79CFF; color: #fff; font-weight: 800; font-size: 12px; min-width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; box-shadow: 0 2px 0 #7A5CD6;
}
.xp { flex: 1; height: 10px; background: rgba(255, 255, 255, .65); border-radius: 99px; overflow: hidden; }
.xp-fill { height: 100%; width: 0; background: linear-gradient(90deg, #C9B6FF, #9C86D1); border-radius: 99px; transition: width .3s; }
.icon-btn { position: relative; }
.badge {
  position: absolute; top: -4px; right: -4px; background: #FF4F6D; color: #fff; font-size: 10px; font-weight: 800;
  min-width: 17px; height: 17px; border-radius: 99px; display: grid; place-items: center; padding: 0 4px;
}
.badge.hidden { display: none; }
.sum-lv { color: var(--ink-l); font-weight: 700; margin: 6px 0 2px; }
.lvup-box { background: #F3EEFF; border: 2px dashed #B79CFF; border-radius: 14px; padding: 8px; margin: 6px 0; font-size: 14px; line-height: 1.35; }
.m-list { max-height: 52vh; overflow: auto; }
.mission { display: flex; gap: 8px; align-items: center; background: #FFF9FB; border-radius: 14px; padding: 8px 10px; margin-bottom: 6px; text-align: left; }
.mission.done { background: #E7F8EF; }
.m-txt { flex: 1; line-height: 1.2; }
.m-txt small { color: var(--ink-l); display: flex; align-items: center; gap: 4px; }
.m-bar { position: relative; height: 15px; background: #FFE9EF; border-radius: 99px; margin: 4px 0; overflow: hidden; }
.m-bar i { display: block; height: 100%; background: linear-gradient(90deg, #FFD66E, #FFB347); border-radius: 99px; }
.mission.done .m-bar i { background: var(--mint); }
.m-bar span { position: absolute; inset: 0; font-size: 10px; font-weight: 800; display: grid; place-items: center; }

/* Cửa hàng */
.shop-item.locked { opacity: .6; }
.tab { font-size: 11px; line-height: 1.1; padding: 4px 2px; }
.tab span { display: block; font-size: 16px; }
.bal-lv { margin-left: 10px; font-size: 13px; background: #F3EEFF; color: #7A5CD6; border-radius: 99px; padding: 0 10px; align-self: center; }

/* ---------- Máy móc, trang trí, mở rộng ---------- */
.robot { position: absolute; left: 14%; bottom: 6px; width: 14%; z-index: 4; }
.robot.hidden { display: none; }
.robot svg { width: 100%; height: auto; }
.arm-move { animation: arm .7s ease-in-out infinite alternate; }
@keyframes arm { from { transform: rotate(10deg); } to { transform: rotate(-14deg); } }
.steam { animation: steam 1.8s ease-out infinite; }
@keyframes steam { 0% { transform: translateY(8px); opacity: 0; } 40% { opacity: .85; } 100% { transform: translateY(-6px); opacity: 0; } }
.twinkle { animation: flicker 1.2s ease-in-out infinite; }

.d-fairy { top: 0; left: 0; width: 100%; height: 7%; z-index: 2 !important; }
.d-fairy svg { width: 100%; height: 100%; }
.d-lamps { inset: 0; pointer-events: none; }
.d-painting { top: 7%; left: 15%; width: 10%; }
.d-flowers { top: 16.5%; left: 71%; width: 20%; z-index: 1 !important; }
#decorLayer svg { width: 100%; height: auto; }

.awning { position: absolute; left: 0; right: 0; top: 0; height: 0; z-index: 3; pointer-events: none; }
.scene[data-tier="1"] .awning, .scene[data-tier="2"] .awning {
  height: 26px;
  background: repeating-linear-gradient(90deg, var(--aw-a) 0 22px, var(--aw-b) 22px 44px);
  -webkit-mask: radial-gradient(circle 11px at 11px 15px, #000 98%, transparent) 0 0 / 22px 26px repeat-x, linear-gradient(#000, #000) 0 0 / 100% 15px no-repeat;
  mask: radial-gradient(circle 11px at 11px 15px, #000 98%, transparent) 0 0 / 22px 26px repeat-x, linear-gradient(#000, #000) 0 0 / 100% 15px no-repeat;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .06));
}
.scene[data-tier="2"] .d-neon svg rect { fill: #4A3A63; }

/* Đồ vừa mua: phóng to + phát sáng để người chơi thấy ngay */
.newly { animation: newly 1.6s ease-in-out; }
@keyframes newly {
  0%, 100% { scale: 1; filter: none; }
  25% { scale: 1.22; filter: drop-shadow(0 0 10px #FFE066) drop-shadow(0 0 4px #fff); }
  50% { scale: .96; }
  75% { scale: 1.1; filter: drop-shadow(0 0 8px #FFE066); }
}
.scene[data-tier="1"] .d-fairy, .scene[data-tier="2"] .d-fairy { top: 22px; }

/* ---------- Máy dập nắp, nồi topping, máy xay ---------- */
.sealer { position: absolute; left: 66%; bottom: 6px; width: 14%; z-index: 5; pointer-events: none; }
.sealer svg, .cooker svg, .blender svg { width: 100%; height: auto; overflow: visible; }
.sealer.pressing .press { animation: press var(--seal, 1s) ease-in-out; }
@keyframes press { 45%, 60% { transform: translateY(11px); } }
.cooker { position: absolute; left: 1%; bottom: 6px; width: 13%; z-index: 4; cursor: pointer; }
.lid-bounce { animation: lid .35s ease-in-out infinite alternate; }
@keyframes lid { to { transform: translateY(-3px) rotate(-3deg); } }
.flame { animation: flame .3s ease-in-out infinite alternate; transform-origin: 32px 57px; }
@keyframes flame { to { transform: scaleY(1.25); } }
.blender { position: absolute; left: 16%; bottom: calc(var(--counter) - 20px); width: 9%; z-index: 4; pointer-events: none; }
.blender.hidden { display: none; }
.whirl { animation: whirl .25s linear infinite; }
@keyframes whirl { to { transform: rotate(360deg); } }
.jar-shake { animation: jshake .08s linear infinite alternate; }
@keyframes jshake { from { transform: translateX(-1px); } to { transform: translateX(1px); } }

/* Số phần topping còn lại, hết thì đỏ, đang nấu thì có vòng tiến độ */
.ing .stock {
  position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 800;
  background: #fff; border-radius: 99px; padding: 0 6px; line-height: 15px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); white-space: nowrap;
}
.ing.empty { border-color: #FF9C9C; background: #FFF0F0; }
.ing.empty .stock { background: #FF6F6F; color: #fff; }
.ing.cooking { border-color: #FFB36B; background: conic-gradient(rgba(255, 179, 107, .45) calc(var(--cook, 0) * 1%), #FFF9FB 0); }
.ing-row { padding-bottom: 9px; }
