/* ============================================================
   Kiralah! — web remake
   Warm kopitiam palette, chunky game UI, mobile-first
   ============================================================ */
:root {
  --cream: #FFF7E9;
  --cream-2: #FFEFD6;
  --paper: #FFFCF4;
  --paper-2: #FFF6E4;
  --ink: #3B2A1E;
  --ink-2: #5C4433;
  --muted: #9A7F68;
  --line: rgba(59, 42, 30, .11);
  --line-strong: rgba(59, 42, 30, .2);
  --red: #E2543F;
  --red-deep: #B93B2E;
  --green: #2FA36B;
  --green-deep: #1F7F52;
  --green-soft: #DDF3E7;
  --gold: #F6C445;
  --gold-deep: #D49A1D;
  --gold-soft: #FFF3C4;
  --orange: #F08A3C;
  --teal: #2F8F8A;
  --pink: #F27E8E;
  --blue: #4A9FD8;
  --shadow-sm: 0 2px 8px rgba(90, 58, 30, .08);
  --shadow: 0 10px 26px rgba(90, 58, 30, .12);
  --shadow-lg: 0 24px 60px rgba(70, 44, 22, .2);
  --radius: 22px;
  --radius-sm: 14px;
  --display: 'Baloo 2', 'Trebuchet MS', 'Microsoft YaHei', sans-serif;
  --body: 'Nunito', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: #F3D9A8;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
button:focus-visible, input:focus-visible, [role="button"]:focus-visible {
  outline: 3px solid rgba(47, 143, 138, .5);
  outline-offset: 2px;
}
h1, h2, h3, h4, p { margin: 0; }
.ic { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -.18em; flex: none; }
.ic.star-on { color: var(--gold); }
.avatar-svg { display: block; width: 100%; height: auto; }
.scene-svg { display: block; width: 100%; height: 100%; }
.muted { color: var(--muted); }

/* ---------- page / shell ---------- */
#app { min-height: 100dvh; display: flex; align-items: center; justify-content: center; position: relative; }
.page-decor { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.page-decor::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(60vw 60vw at 8% 0%, rgba(255, 244, 205, .9), transparent 60%),
    radial-gradient(50vw 50vw at 100% 20%, rgba(255, 174, 114, .45), transparent 60%),
    radial-gradient(70vw 70vw at 50% 110%, rgba(94, 168, 134, .35), transparent 60%),
    linear-gradient(160deg, #F9E2B6 0%, #F4C98F 50%, #EDAF7C 100%);
}
.pd-blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; }
.pd-blob.b1 { width: 36vw; height: 36vw; left: -10vw; top: 10vh; background: rgba(255, 248, 224, .7); }
.pd-blob.b2 { width: 26vw; height: 26vw; right: -6vw; top: 55vh; background: rgba(226, 84, 63, .18); }
.pd-blob.b3 { width: 30vw; height: 30vw; left: 30vw; bottom: -15vw; background: rgba(47, 143, 138, .18); }
.pd-emoji { position: absolute; font-size: clamp(28px, 4vw, 54px); opacity: .26; filter: drop-shadow(0 6px 10px rgba(90, 58, 30, .2)); animation: bob 7s ease-in-out infinite; }
.pd-emoji.e1 { left: 8%; top: 20%; transform: rotate(-12deg); }
.pd-emoji.e2 { right: 10%; top: 14%; animation-delay: -2s; }
.pd-emoji.e3 { left: 14%; bottom: 14%; animation-delay: -4s; }
.pd-emoji.e4 { right: 12%; bottom: 22%; animation-delay: -1s; }

#shell {
  position: relative; z-index: 2;
  width: min(100%, 540px);
  height: 100dvh;
  background: var(--cream);
  overflow: hidden;
  display: flex; flex-direction: column;
}
#screen-home, #screen-play { flex: 1; min-height: 0; display: flex; flex-direction: column; }

@media (min-width: 760px) {
  #shell {
    height: min(940px, calc(100dvh - 44px));
    border-radius: 34px;
    box-shadow: 0 40px 100px rgba(70, 44, 22, .35), 0 0 0 10px rgba(255, 250, 238, .5);
  }
  .modal-backdrop { align-items: center !important; padding: 24px; }
  .modal { border-radius: 26px !important; max-height: calc(100dvh - 80px) !important; }
  .modal .modal-handle { display: none; }
  .play-overlay { align-items: center; justify-content: center; padding: 24px; }
  .overlay-card {
    border-radius: 24px; margin: 0 auto; width: min(100%, 460px);
    max-height: calc(100dvh - 80px); padding: 20px 20px 18px;
    animation: fadePop .25s cubic-bezier(.2, 1.2, .4, 1);
  }
}
@keyframes fadePop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (max-width: 759px) {
  .page-decor { display: none; }
  #shell { border-radius: 0; }
}

/* ---------- top bar ---------- */
.topbar {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 8px;
  background: linear-gradient(180deg, var(--cream), rgba(255, 247, 233, .86));
  position: relative; z-index: 5;
}
.profile { display: flex; align-items: center; gap: 9px; text-align: left; min-width: 0; border-radius: 16px; }
.avatar-chip {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex: none;
  background: linear-gradient(180deg, #FFE6B0, #F7C979);
  border: 2.5px solid #fff; box-shadow: 0 3px 0 rgba(90, 58, 30, .12);
  display: flex; align-items: flex-end; justify-content: center;
}
.avatar-chip svg { width: 115%; margin-bottom: -10%; }
.avatar-chip.big { width: 64px; height: 64px; }
.profile-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profile-name { font-family: var(--display); font-weight: 800; font-size: 17px; line-height: 1.05; display: flex; align-items: center; gap: 6px; min-width: 0; }
.p-name-text { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-name em {
  flex: none;
  font-style: normal; font-family: var(--body); font-weight: 900; font-size: 9px;
  background: var(--gold-soft); color: #8A6410; border: 1px solid #EFD58C;
  padding: 2px 5px; border-radius: 6px; letter-spacing: .3px;
}
.xpbar { width: 96px; height: 5px; border-radius: 4px; background: #EADAC1; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #64C99B); border-radius: 4px; transition: width .4s; }
.wallet { display: flex; align-items: center; gap: 6px; }
.wallet-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 6px 9px 6px 7px;
  box-shadow: 0 2px 0 rgba(90, 58, 30, .07);
  font-size: 12px; font-weight: 900;
}
.wallet-pill .ic { font-size: 16px; }
.wallet-pill.gems .ic { font-size: 15px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); border: 1.5px solid var(--line); box-shadow: 0 2px 0 rgba(90, 58, 30, .07);
  color: var(--ink-2); transition: transform .12s, background .15s;
}
.icon-btn:hover { background: #fff; }
.icon-btn:active { transform: translateY(1px); }
.icon-btn .ic { width: 18px; height: 18px; }
.daily-btn { position: relative; }
.topbar-badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 8.5px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid var(--cream); box-shadow: 0 2px 5px rgba(226, 84, 63, .35);
}

/* ---------- home ---------- */
.home-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 14px calc(16px + var(--safe-b));
  scrollbar-width: none;
}
.home-scroll::-webkit-scrollbar { display: none; }
.card {
  background: var(--paper);
  border: 1.5px solid rgba(90, 58, 30, .1);
  border-radius: var(--radius);
  box-shadow: 0 2px 0 rgba(255, 255, 255, .8) inset, 0 10px 24px rgba(90, 58, 30, .08);
}
.hero { overflow: hidden; position: relative; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 9px; }
.shop-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: #FFF1D6; color: #8A5A20; border: 1px solid #F0D8A8;
  border-radius: 999px; padding: 5px 10px; font-size: 10.5px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase;
}
.shop-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(47, 163, 107, .18); }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 6px 9px; font-size: 11px; font-weight: 900; color: var(--ink-2);
  box-shadow: 0 2px 0 rgba(90, 58, 30, .08);
}
.ghost-btn .ic { width: 14px; height: 14px; }
.storefront { position: relative; aspect-ratio: 16 / 9.4; max-height: 300px; overflow: hidden; background: #FCE8C0; }
.storefront-art, .storefront-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.storefront::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 40px rgba(120, 78, 30, .16), inset 0 -18px 26px rgba(98, 62, 26, .12);
}
.boss-figure {
  position: absolute; left: 1%; bottom: -2%; width: 19%; max-width: 96px; z-index: 4;
  filter: drop-shadow(0 6px 6px rgba(90, 58, 30, .25));
  animation: bob 4.5s ease-in-out infinite;
}
.scene-chip {
  position: absolute; z-index: 5; top: 9px;
  background: rgba(255, 251, 240, .93); border: 1.5px solid rgba(90, 58, 30, .12);
  border-radius: 999px; padding: 4px 9px; font-size: 10px; font-weight: 900;
  box-shadow: 0 2px 6px rgba(90, 58, 30, .12); color: var(--ink-2);
  backdrop-filter: blur(4px);
}
.day-chip { left: 10px; }
.buzz-chip { right: 10px; background: rgba(255, 240, 198, .95); color: #8A6410; }

.decor-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.decor-item {
  position: absolute; transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 3px rgba(90, 58, 30, .25));
  line-height: 1;
  animation: decorSway 5s ease-in-out infinite;
  will-change: transform;
}
.decor-ceiling { animation: lanternSway 4.5s ease-in-out infinite; }
.decor-wall { transform: translate(-50%, -50%) rotate(-3deg); }
.decor-counter { transform: translate(-50%, -50%); }

.hero-bottom { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px 0; align-items: flex-start; }
.hero-info { min-width: 0; }
.hero-info h1 { font-family: var(--display); font-size: clamp(20px, 5vw, 24px); line-height: 1.05; letter-spacing: .2px; }
.rating-row { margin-top: 3px; display: flex; align-items: center; gap: 6px; font-size: 11px; }
.rating { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; color: var(--ink-2); }
.rating .ic { width: 14px; height: 14px; }
.rating b { font-size: 12px; }
.tagline { margin-top: 4px; font-size: 11px; line-height: 1.35; color: var(--muted); max-width: 250px; }
.target-box {
  flex: none; min-width: 108px; text-align: right;
  background: #FFF4DC; border: 1.5px dashed #EACB8D; border-radius: 14px; padding: 7px 10px;
}
.target-box span { display: block; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; color: #97702A; }
.target-box b { display: block; font-family: var(--display); font-size: 17px; color: #8A5A20; line-height: 1.15; }
.target-box small { font-size: 9px; color: #A98B58; font-weight: 700; }

.open-btn {
  margin: 12px 14px 14px; width: calc(100% - 28px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(180deg, #48C186, #2FA36B);
  color: #fff; border-radius: 16px; padding: 11px 12px 12px 16px;
  box-shadow: 0 5px 0 var(--green-deep), 0 12px 22px rgba(47, 163, 107, .28);
  transition: transform .12s, box-shadow .12s, filter .15s;
  position: relative; overflow: hidden;
}
.open-btn::after {
  content: ''; position: absolute; top: -40%; left: -20%; width: 50%; height: 180%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .18), transparent);
  transform: rotate(18deg); animation: shine 4.5s ease-in-out infinite;
}
.open-btn:hover { filter: brightness(1.03); }
.open-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--green-deep), 0 6px 12px rgba(47, 163, 107, .25); }
.open-btn.resume { background: linear-gradient(180deg, #F6B35A, #EE9436); box-shadow: 0 5px 0 #C4741E, 0 12px 22px rgba(238, 148, 54, .28); }
.open-copy { display: flex; flex-direction: column; text-align: left; position: relative; z-index: 1; }
.open-copy b { font-family: var(--display); font-size: 19px; line-height: 1.05; letter-spacing: .3px; }
.open-copy small { font-size: 10.5px; font-weight: 700; color: rgba(255, 255, 255, .85); margin-top: 2px; }
.open-arrow {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .18);
  display: flex; align-items: center; justify-content: center; flex: none; position: relative; z-index: 1;
}
.open-arrow .ic { width: 18px; height: 18px; color: #fff; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat {
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 1px;
  box-shadow: 0 3px 0 rgba(90, 58, 30, .05);
  min-width: 0;
}
.stat span { font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .55px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b { font-family: var(--display); font-size: 17px; line-height: 1.1; }
.stat small { font-size: 9px; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.quick-row { display: grid; grid-template-columns: 1.1fr 1fr; gap: 8px; margin-top: 10px; }
.quick-card {
  display: flex; align-items: center; gap: 9px; text-align: left;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px; padding: 9px 11px;
  box-shadow: 0 3px 0 rgba(90, 58, 30, .05); position: relative;
  transition: transform .12s, background .15s;
}
.quick-card:active { transform: translateY(1px); }
.quick-card.daily { background: linear-gradient(180deg, #FFF7DD, #FFF0C5); border-color: #EFD48E; }
.q-ico {
  width: 34px; height: 34px; border-radius: 11px; background: #FFE9AE; color: #906719;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.q-ico.shop { background: #E3F2EA; color: var(--green-deep); }
.q-ico .ic { width: 19px; height: 19px; }
.q-txt { display: flex; flex-direction: column; min-width: 0; }
.q-txt b { font-size: 12px; font-weight: 900; line-height: 1.1; }
.q-txt small { font-size: 9.5px; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-badge {
  position: absolute; top: -5px; right: -4px; min-width: 19px; height: 19px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
  border: 2px solid var(--cream); box-shadow: 0 2px 6px rgba(226, 84, 63, .35);
}
.rule-note {
  display: flex; gap: 9px; align-items: flex-start;
  margin-top: 10px; padding: 10px 12px;
  background: rgba(255, 252, 244, .7); border: 1.5px dashed #DFC9A6; border-radius: 14px;
}
.rule-ico { font-size: 18px; line-height: 1; }
.rule-note b { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: #8A5A20; display: block; }
.rule-note p { font-size: 10.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.idle-chip, .streak-line {
  margin-top: 10px; display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 800; color: var(--ink-2);
  background: #EDF7F0; border: 1px solid #CDE8D8; border-radius: 999px; padding: 6px 10px;
  width: fit-content;
}
.idle-chip .ic, .streak-line .ic { color: var(--green); width: 15px; height: 15px; }
.streak-line { background: #FFF1E8; border-color: #F5D4BC; color: #9B4A1E; }
.streak-line .ic { color: var(--orange); }
.home-foot { margin-top: 14px; text-align: center; font-size: 10px; color: #B09678; font-weight: 700; }

/* ---------- tab bar ---------- */
.tabbar {
  flex: none; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--paper); border-top: 1.5px solid var(--line);
  padding: 5px 6px calc(5px + var(--safe-b));
  box-shadow: 0 -8px 20px rgba(90, 58, 30, .05);
  z-index: 6;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 2px 3px; border-radius: 12px; color: #A18A74; transition: color .15s, background .15s;
}
.tab-ico { display: flex; align-items: center; justify-content: center; width: 30px; height: 26px; border-radius: 9px; }
.tab-ico .ic { width: 21px; height: 21px; }
.tab-label { font-size: 9px; font-weight: 900; letter-spacing: .15px; }
.tab.on { color: var(--green-deep); }
.tab.on .tab-ico { background: #E1F3E8; color: var(--green-deep); }
.tab:active { transform: translateY(1px); }

/* ---------- generic buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--paper); color: var(--ink); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 11px 16px; font-weight: 900; font-size: 13px;
  box-shadow: 0 3px 0 rgba(90, 58, 30, .08);
  transition: transform .12s, box-shadow .12s, filter .15s;
}
.btn .ic { width: 17px; height: 17px; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(90, 58, 30, .08); }
.btn.primary { background: linear-gradient(180deg, #48C186, #2FA36B); color: #fff; border-color: transparent; box-shadow: 0 4px 0 var(--green-deep); }
.btn.primary:active { box-shadow: 0 1px 0 var(--green-deep); }
.btn.ghost { background: var(--paper); }
.btn.danger { background: linear-gradient(180deg, #EF6F5C, #D94936); color: #fff; border-color: transparent; box-shadow: 0 4px 0 #A83224; }
.btn.danger-outline { color: var(--red); border-color: rgba(226, 84, 63, .35); background: #FFF3F0; }
.btn.text { background: transparent; border-color: transparent; box-shadow: none; }
.btn.small { padding: 8px 12px; font-size: 11.5px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; box-shadow: none; transform: none; }
.danger-text { color: var(--red); }
.stack-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }

/* ---------- modals / sheets ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(43, 28, 16, .42);
  backdrop-filter: blur(5px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .18s ease-out;
}
.modal-backdrop.no-anim, .modal-backdrop.no-anim .modal { animation: none !important; }
.modal {
  width: min(100%, 540px);
  max-height: 90dvh;
  background: var(--cream);
  border-radius: 26px 26px 0 0;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: sheetUp .3s cubic-bezier(.2, .9, .3, 1);
  overflow: hidden;
}
.modal.small { max-height: 76dvh; }
.modal.summary-modal { width: min(100%, 480px); }
.modal-handle { width: 44px; height: 5px; border-radius: 3px; background: #E4D3BC; margin: 8px auto 0; flex: none; }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 18px 8px; flex: none; position: relative;
}
.mh-text h2 { font-family: var(--display); font-size: 22px; line-height: 1.05; letter-spacing: .2px; }
.mh-text p { margin-top: 3px; font-size: 11px; color: var(--muted); line-height: 1.35; }
.modal-close {
  width: 34px; height: 34px; border-radius: 50%; background: #F2E6D3; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; flex: none;
  transition: transform .12s, background .15s;
}
.modal-close:hover { background: #EBDAC2; }
.modal-close:active { transform: scale(.94); }
.modal-close .ic { width: 16px; height: 16px; }
.modal-body {
  flex: 1 1 auto; min-height: 0;
  padding: 4px 18px calc(22px + var(--safe-b));
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.modal-body::-webkit-scrollbar { display: none; }
.summary-modal .modal-head { display: none; }
.modal-copy { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
body.modal-open #shell { filter: saturate(.98); }

.balance-bar { display: flex; align-items: center; gap: 6px; margin: 4px 0 12px; }
.bb-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 5px 9px; font-size: 11.5px; font-weight: 900;
}
.bb-pill .ic { width: 15px; height: 15px; }
.bb-lv { margin-left: auto; font-size: 10px; font-weight: 900; color: var(--muted); background: #F2E6D3; padding: 4px 8px; border-radius: 999px; }

.section-title {
  font-family: var(--display); font-size: 17px; margin: 16px 0 8px;
  display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
}
.section-title small { font-family: var(--body); font-size: 9.5px; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.fine-print { margin-top: 12px; font-size: 10px; color: var(--muted); line-height: 1.45; text-align: center; }
.reset-note { margin-top: 10px; text-align: center; font-size: 9.5px; color: var(--muted); font-weight: 700; }

/* ---------- decor ---------- */
.vibe-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(135deg, #E9F7EF, #DDF1E6);
  border: 1.5px solid #C6E7D5; border-radius: 16px; padding: 10px 13px;
  margin-bottom: 12px;
}
.vibe-card > div:first-child { display: flex; flex-direction: column; }
.vibe-card span { font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; color: #4D7C64; }
.vibe-card b { font-family: var(--display); font-size: 19px; color: #2A6248; line-height: 1.1; }
.vibe-effect { font-size: 10px; font-weight: 900; color: #2A6248; background: rgba(255, 255, 255, .65); border: 1px solid rgba(42, 98, 72, .14); border-radius: 999px; padding: 4px 8px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 11px; font-size: 10.5px; font-weight: 900; color: var(--ink-2);
}
.chip.on { background: var(--ink); color: #FFF6E6; border-color: var(--ink); }
.decor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
.decor-card {
  position: relative; background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 16px; padding: 12px 7px 9px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 118px;
  box-shadow: 0 3px 0 rgba(90, 58, 30, .05);
  transition: transform .12s, border-color .15s;
}
.decor-card:hover:not(:disabled) { border-color: #DFC08B; transform: translateY(-1px); }
.decor-card:active:not(:disabled) { transform: translateY(1px); }
.decor-card.owned { background: #F2F8F2; border-color: #CDE6D4; }
.decor-card.season-locked { opacity: .72; background: #F6F0E6; }
.decor-emoji { font-size: 36px; line-height: 1.1; filter: drop-shadow(0 3px 2px rgba(90, 58, 30, .16)); }
.decor-name { font-size: 10px; font-weight: 900; line-height: 1.15; }
.decor-vibe { font-size: 9px; color: var(--green-deep); font-weight: 900; }
.decor-card .cost { margin-top: auto; padding-top: 3px; font-size: 9.5px; font-weight: 900; color: #8A5A20; display: inline-flex; align-items: center; gap: 2px; }
.decor-card .cost.poor { color: #C84B3A; }
.decor-card .cost .ic { width: 12px; height: 12px; }
.corner-badge {
  position: absolute; top: 5px; left: 5px; background: var(--green); color: #fff;
  font-size: 7.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .3px;
  padding: 2px 5px; border-radius: 6px;
}
.corner-badge.lock { background: #9A7F68; display: flex; align-items: center; gap: 2px; }
.corner-badge.lock .ic { width: 8px; height: 8px; }

/* ---------- shops / upgrades ---------- */
.rule-callout { background: #FFF3DC; border: 1.5px solid #EED8B2; border-radius: 14px; padding: 10px 12px; }
.rule-callout b { font-family: var(--display); font-size: 14px; }
.rule-callout p { margin-top: 2px; font-size: 10.5px; color: #8A6A44; line-height: 1.4; }
.busy-note { margin-top: 8px; font-size: 10px; font-weight: 800; color: #B06A22; background: #FFF4E2; border-radius: 10px; padding: 7px 10px; text-align: center; }
.upgrade-list { display: flex; flex-direction: column; gap: 7px; }
.upgrade-card, .staff-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px; padding: 9px 10px;
  box-shadow: 0 3px 0 rgba(90, 58, 30, .04);
}
.upgrade-card.owned { background: #F2F8F2; border-color: #CDE6D4; }
.up-icon, .staff-ico {
  width: 42px; height: 42px; border-radius: 13px; background: #FFF2D4;
  display: flex; align-items: center; justify-content: center; font-size: 23px; flex: none;
}
.up-txt, .staff-txt { min-width: 0; flex: 1; }
.up-txt b, .staff-txt b { font-size: 12px; font-weight: 900; display: block; }
.up-txt p, .staff-txt p { font-size: 9.5px; color: var(--muted); line-height: 1.35; margin-top: 1px; }
.buy-btn {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  background: #FFF3D6; border: 1.5px solid #E8CE95; color: #8A5A20;
  border-radius: 10px; padding: 7px 9px; font-size: 10px; font-weight: 900;
  transition: transform .12s;
}
.buy-btn:active:not(:disabled) { transform: translateY(1px); }
.buy-btn:disabled { opacity: .5; }
.buy-btn .ic { width: 12px; height: 12px; }
.owned-chip, .current-chip {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  color: var(--green-deep); background: #E1F3E8; border-radius: 999px; padding: 4px 7px;
  font-size: 9px; font-weight: 900;
}
.owned-chip .ic, .current-chip .ic { width: 11px; height: 11px; }
.shop-list { display: flex; flex-direction: column; gap: 8px; }
.shop-row {
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px; padding: 9px 11px;
}
.shop-row.current { border-color: #9FD5B6; background: #F4FBF6; }
.shop-row.locked { background: #F7F1E7; }
.shop-row-head { display: flex; align-items: center; gap: 8px; }
.shop-row-emoji {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex: none;
}
.shop-row-title { min-width: 0; flex: 1; }
.shop-row-title b { display: block; font-size: 12.5px; font-weight: 900; line-height: 1.15; }
.shop-row-title small { font-size: 9px; color: var(--muted); font-weight: 700; }
.shop-row-rule { margin-top: 5px; font-size: 9.5px; color: #8A6A44; line-height: 1.35; }
.shop-row-meta { margin-top: 4px; font-size: 9px; font-weight: 800; display: flex; align-items: center; gap: 3px; color: var(--muted); }
.shop-row-meta .ic { color: var(--gold); width: 11px; height: 11px; }

/* ---------- missions ---------- */
.goals-top {
  display: flex; align-items: center; gap: 10px; background: #FFF3DC;
  border: 1.5px solid #EED8B2; border-radius: 16px; padding: 11px 13px;
}
.goals-top > .ic { width: 27px; height: 27px; color: #B07A2A; }
.goals-top div { display: flex; flex-direction: column; }
.goals-top b { font-family: var(--display); font-size: 16px; }
.goals-top span { font-size: 10px; color: #8A6A44; }
.mission-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mission {
  display: flex; align-items: center; gap: 9px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px; padding: 10px;
}
.mission.ready { border-color: #A8DABC; background: #F4FBF6; }
.mission.done { opacity: .65; }
.m-ico { width: 34px; height: 34px; border-radius: 10px; background: #FFF2D4; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.m-main { flex: 1; min-width: 0; }
.m-main b { font-size: 11px; font-weight: 900; line-height: 1.2; display: block; }
.mbar { height: 6px; background: #EEE0C9; border-radius: 4px; overflow: hidden; margin: 4px 0 2px; }
.mbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #69CFA2); border-radius: 4px; }
.m-progress { font-size: 8.5px; font-weight: 900; color: var(--muted); }
.m-reward { flex: none; font-size: 9px; font-weight: 900; color: #8A5A20; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.m-reward .ic { width: 11px; height: 11px; }
.m-reward span { display: flex; align-items: center; gap: 2px; color: #4B86A8; }
.claim-btn {
  flex: none; background: var(--green); color: #fff; border-radius: 9px; padding: 6px 9px;
  font-size: 9px; font-weight: 900; box-shadow: 0 2px 0 var(--green-deep);
}
.claim-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--green-deep); }
.m-done { flex: none; color: var(--green); }
.m-done .ic { width: 19px; height: 19px; }
.all-done { text-align: center; margin-top: 12px; font-size: 11px; font-weight: 800; color: var(--green-deep); }
.goals-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.goals-extra .quick-card { padding: 10px; justify-content: center; font-size: 11px; font-weight: 900; }
.goals-extra .quick-card .ic { width: 18px; height: 18px; }

/* ---------- ranking ---------- */
.rank-tabs { display: flex; gap: 4px; background: #F0E3CE; border-radius: 12px; padding: 3px; margin: 4px 0 10px; }
.rank-tab { flex: 1; padding: 7px 4px; border-radius: 9px; font-size: 10px; font-weight: 900; color: var(--muted); }
.rank-tab.on { background: var(--paper); color: var(--ink); box-shadow: 0 2px 0 rgba(90, 58, 30, .08); }
.rank-your { font-size: 9.5px; font-weight: 800; color: var(--muted); margin-bottom: 8px; text-align: center; }
.rank-your span { opacity: .8; }
.rank-list { display: flex; flex-direction: column; gap: 5px; }
.rank-row {
  display: flex; align-items: center; gap: 7px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 13px;
  padding: 6px 7px; min-height: 52px;
}
.rank-row.me { background: #FFF4D6; border-color: #EACB8D; }
.rank-num { width: 22px; text-align: center; font-size: 11px; font-weight: 900; color: var(--muted); flex: none; }
.rank-row:nth-child(1) .rank-num, .rank-row:nth-child(2) .rank-num, .rank-row:nth-child(3) .rank-num { font-size: 17px; }
.rank-av { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: #FCE9C8; flex: none; display: flex; align-items: flex-end; justify-content: center; }
.rank-av svg { width: 110%; margin-bottom: -8%; }
.rank-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.rank-info b { font-size: 10.5px; font-weight: 900; line-height: 1.15; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.you-chip { font-size: 7px; background: var(--green); color: #fff; padding: 1px 4px; border-radius: 4px; letter-spacing: .3px; }
.rank-info small { font-size: 8px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-likes { font-size: 7.5px; color: #C07A8D; font-weight: 900; display: flex; align-items: center; gap: 2px; }
.rank-likes .ic { width: 8px; height: 8px; }
.rank-val { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; }
.rank-val b { font-family: var(--display); font-size: 12px; color: var(--ink); line-height: 1.1; }
.rank-val span { font-size: 7px; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.like-btn {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 0;
  color: #C88B9C; padding: 4px 5px; border-radius: 8px; background: #FFF4F6; border: 1px solid #F3D6DC;
}
.like-btn .ic { width: 13px; height: 13px; }
.like-btn span { font-size: 6.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .2px; }
.like-btn.liked { color: var(--red); background: #FFF0EC; border-color: #F3C6BA; }
.like-btn:disabled { opacity: .55; }
.visit-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding-top: 4px; }
.visit-av { width: 92px; height: 92px; border-radius: 50%; background: linear-gradient(180deg, #FFE7B8, #F7C979); overflow: hidden; display: flex; align-items: flex-end; justify-content: center; border: 3px solid #fff; box-shadow: var(--shadow); }
.visit-av svg { width: 115%; margin-bottom: -10%; }
.visit-card h3 { font-family: var(--display); font-size: 20px; margin-top: 2px; }
.visit-owner { font-size: 11px; color: var(--muted); font-weight: 700; }
.visit-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; margin-top: 8px; }
.visit-stats > div { background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 7px 9px; text-align: left; }
.visit-stats span { display: block; font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.visit-stats b { font-family: var(--display); font-size: 15px; }
.visit-likes { font-size: 10px; font-weight: 900; color: #B06A7C; margin: 4px 0 2px; display: flex; align-items: center; gap: 4px; }
.visit-likes .ic { width: 13px; height: 13px; }
.visit-card .btn { margin-top: 2px; }
.visit-card .btn.is-liked { background: #FFF0EC; color: var(--red); border-color: #F3C6BA; box-shadow: none; }
.visit-card .btn.is-liked .ic { color: var(--red); }

/* ---------- staff ---------- */
.idle-card {
  display: flex; gap: 11px; align-items: center;
  background: linear-gradient(135deg, #E7F6EE, #D5EFE1); border: 1.5px solid #C1E5D2;
  border-radius: 16px; padding: 11px 13px; margin-bottom: 12px;
}
.idle-ico { width: 42px; height: 42px; border-radius: 13px; background: #fff; color: var(--green-deep); display: flex; align-items: center; justify-content: center; flex: none; }
.idle-ico .ic { width: 22px; height: 22px; }
.idle-card > div { display: flex; flex-direction: column; }
.idle-card b { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: #4D7C64; }
.idle-card strong { font-family: var(--display); font-size: 20px; color: #2A6248; line-height: 1.1; }
.idle-card p { font-size: 9px; color: #5D8A72; line-height: 1.35; margin-top: 2px; }
.staff-list { display: flex; flex-direction: column; gap: 8px; }
.staff-rate { font-size: 9px; font-weight: 900; color: #8A5A20; display: flex; align-items: center; gap: 2px; margin-top: 3px; }
.staff-rate .ic { width: 11px; height: 11px; }

/* ---------- daily / login / wheel ---------- */
.daily-section { background: var(--paper); border: 1.5px solid var(--line); border-radius: 18px; padding: 12px; margin-bottom: 10px; }
.ds-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.ds-head h3 { font-family: var(--display); font-size: 16px; }
.ds-sub { font-size: 8.5px; font-weight: 800; color: var(--muted); text-align: right; }
.login-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 10px; }
.login-tile {
  position: relative; border: 1.5px solid var(--line); border-radius: 10px;
  background: #FFFBF2; padding: 5px 2px; min-height: 58px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  text-align: center;
}
.login-tile.done { background: #F1F8F2; border-color: #CDE6D4; }
.login-tile.active { border-color: var(--gold-deep); background: #FFF6D9; box-shadow: 0 0 0 2px rgba(246, 196, 69, .25); }
.lt-day { font-size: 6.5px; font-weight: 900; color: var(--muted); text-transform: uppercase; }
.lt-reward { font-size: 7.5px; font-weight: 900; display: flex; align-items: center; gap: 1px; }
.lt-reward .ic { width: 9px; height: 9px; }
.login-tile small { font-size: 6px; color: #4B86A8; font-weight: 900; }
.lt-check { position: absolute; top: 2px; right: 2px; color: var(--green); }
.lt-check .ic { width: 9px; height: 9px; }
.login-section .btn { margin-top: 2px; }

.wheel-wrap { position: relative; width: 230px; height: 230px; margin: 2px auto 10px; }
.wheel-pointer {
  position: absolute; left: 50%; top: -6px; transform: translateX(-50%); z-index: 4;
  width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent;
  border-top: 20px solid var(--red); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .2));
}
.wheel-rotor {
  position: absolute; inset: 0; border-radius: 50%;
  transition: transform 4s cubic-bezier(.12, .78, .18, 1);
  filter: drop-shadow(0 8px 14px rgba(90, 58, 30, .22));
}
.wheel-rotor.spinning { will-change: transform; }
.wheel-face { position: absolute; inset: 0; border-radius: 50%; border: 5px solid #fff; }
.wheel-face::after {
  content: ''; position: absolute; inset: 7px; border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, .55);
}
.wheel-label {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px;
  display: flex; align-items: center; justify-content: center; gap: 1px;
  font-size: 11px; font-weight: 900; color: #4A3423;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
}
.wheel-label .ic { width: 13px; height: 13px; }
.wheel-hub {
  position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px;
  border-radius: 50%; background: #FFF7E4; border: 4px solid #fff;
  display: flex; align-items: center; justify-content: center; color: var(--gold-deep);
  box-shadow: 0 3px 10px rgba(90, 58, 30, .2);
}
.wheel-hub .ic { width: 23px; height: 23px; }
.wheel-result {
  text-align: center; background: #FFF4D1; border: 1.5px solid #EED08A; border-radius: 11px;
  padding: 7px 9px; font-size: 11px; font-weight: 900; color: #8A5A20; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.wheel-result .ic { width: 14px; height: 14px; }
.mini-mission { display: flex; align-items: center; gap: 7px; padding: 5px 0; border-bottom: 1px dashed #EADCC7; font-size: 10px; }
.mini-mission:last-of-type { border-bottom: 0; }
.mm-title { flex: 1; font-weight: 800; }
.mm-progress { font-size: 8.5px; color: var(--muted); font-weight: 900; }
.mm-wait { font-size: 8px; color: var(--muted); font-weight: 800; }
.mm-done { color: var(--green); display: flex; }
.mm-done .ic { width: 14px; height: 14px; }
.mini-claim { background: var(--green); color: #fff; border-radius: 7px; padding: 3px 7px; font-size: 8px; font-weight: 900; }
.link-btn { font-size: 8.5px; font-weight: 900; color: var(--green-deep); display: flex; align-items: center; gap: 2px; }
.link-btn .ic { width: 10px; height: 10px; }

/* ---------- settings ---------- */
.settings-group { background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px; padding: 11px 12px; margin-bottom: 9px; }
.settings-group h3 { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 7px; }
.profile-edit { display: flex; align-items: center; gap: 11px; }
.name-row { flex: 1; min-width: 0; display: flex; gap: 6px; }
.text-input {
  flex: 1; min-width: 0; background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font-size: 12px; font-weight: 800; outline: none;
}
.text-input:focus { border-color: var(--green); }
.settings-group > .btn { margin-top: 8px; }
.segmented { display: flex; background: #F0E3CE; border-radius: 11px; padding: 3px; gap: 3px; }
.seg { flex: 1; padding: 7px; border-radius: 8px; font-size: 11px; font-weight: 900; color: var(--muted); }
.seg.on { background: var(--paper); color: var(--ink); box-shadow: 0 2px 0 rgba(90, 58, 30, .08); }
.diff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.diff-card { text-align: left; border: 1.5px solid var(--line); border-radius: 11px; padding: 8px; background: #FFFBF2; display: flex; flex-direction: column; gap: 2px; }
.diff-card b { font-size: 11px; font-weight: 900; }
.diff-card small { font-size: 7.5px; line-height: 1.3; color: var(--muted); font-weight: 700; }
.diff-card.on { border-color: var(--green); background: #F0F9F3; box-shadow: 0 0 0 2px rgba(47, 163, 107, .13); }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 11.5px; font-weight: 800; }
.toggle { min-width: 48px; padding: 5px 9px; border-radius: 999px; background: #F0E3CE; color: var(--muted); font-size: 9px; font-weight: 900; }
.toggle.on { background: var(--green); color: #fff; }
.settings-group.about p { font-size: 9.5px; line-height: 1.5; color: var(--muted); }
.version { display: inline-block; margin-top: 6px; font-size: 8px; font-weight: 900; color: #B09678; letter-spacing: .4px; }
.settings-group.danger-zone { border-color: rgba(226, 84, 63, .2); background: #FFF7F4; }

/* ---------- cloud / auth / live rank ---------- */
.cloud-banner {
  width: 100%; margin-top: 10px; display: flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, #EDF8FF, #E3F3FB);
  border: 1.5px solid #CBE7F4; border-radius: 16px; padding: 9px 11px;
  text-align: left; box-shadow: 0 3px 0 rgba(90, 58, 30, .05);
  transition: transform .12s, filter .15s;
}
.cloud-banner:active { transform: translateY(1px); }
.cloud-banner:hover { filter: brightness(1.015); }
.cloud-ico {
  width: 36px; height: 36px; border-radius: 11px; background: rgba(255, 255, 255, .8);
  color: #3D86A8; display: flex; align-items: center; justify-content: center; flex: none;
}
.cloud-ico .ic { width: 20px; height: 20px; }
.cloud-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cloud-txt b { font-size: 11.5px; font-weight: 900; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cloud-txt small { font-size: 9px; color: #5C8FA5; font-weight: 800; display: flex; align-items: center; gap: 4px; }
.cloud-cta {
  flex: none; font-size: 9px; font-weight: 900; color: #2F7592;
  background: #fff; border: 1px solid #CBE7F4; border-radius: 999px; padding: 4px 8px;
}
.cloud-chev { color: #7FA3B5; display: flex; flex: none; }
.cloud-chev .ic { width: 15px; height: 15px; }
.cloud-rank {
  flex: none; font-family: var(--display); font-size: 13px; color: var(--green-deep);
  background: #fff; border: 1px solid #C9E8D7; border-radius: 8px; padding: 3px 6px;
}
.cloud-banner.signed { background: linear-gradient(135deg, #F0FBF5, #E5F7ED); border-color: #C9E8D7; }
.cloud-banner.signed .cloud-ico { color: var(--green-deep); }
.cloud-banner.signed .cloud-txt small { color: #4D7C64; }
.cloud-banner.offline { background: #FFF8E8; border-color: #EED9A6; }
.cloud-banner.offline .cloud-txt small { color: #A06B1C; }
.cloud-banner.syncing { background: #FFF9E9; border-color: #EFD9AC; }
.cloud-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #B9C7CE; display: inline-block; flex: none;
}
.cloud-dot.saved { background: var(--green); }
.cloud-dot.syncing { background: var(--gold-deep); animation: blink 1s ease-in-out infinite; }
.cloud-dot.offline { background: var(--orange); }
.cloud-dot.local { background: #B9C7CE; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.cloud-group { background: linear-gradient(135deg, #EDF8FF, #E5F4FB); border-color: #CBE7F4; }
.cloud-group.signed { background: linear-gradient(135deg, #EFFBF5, #E4F6EC); border-color: #C9E8D7; }
.cloud-group h3 { color: #3D7C97; }
.cloud-group.signed h3 { color: #4D7C64; }
.cloud-copy { font-size: 9.5px; color: #5C8FA5; line-height: 1.45; }
.cloud-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.cloud-row { display: flex; align-items: center; gap: 9px; margin-top: 2px; }
.cloud-row-ico {
  width: 38px; height: 38px; border-radius: 12px; background: #fff; color: var(--green-deep);
  display: flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 2px 6px rgba(77, 124, 100, .12);
}
.cloud-row-ico .ic { width: 21px; height: 21px; }
.cloud-row-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cloud-row-txt b { font-size: 13px; font-weight: 900; line-height: 1.1; }
.cloud-row-txt small { font-size: 8.5px; color: var(--muted); font-weight: 700; }
.cloud-status { display: inline-flex; align-items: center; gap: 4px; font-size: 8.5px; font-weight: 900; color: #4D7C64; }
.cloud-note { font-size: 8.5px; color: #5D8A72; line-height: 1.4; margin-top: 6px; }
.reset-warning { margin-top: 8px; font-size: 9.5px; font-weight: 800; color: #B4542A; background: #FFF2E6; border-radius: 9px; padding: 7px 9px; line-height: 1.4; }

.auth-tabs { display: flex; background: #F0E3CE; border-radius: 11px; padding: 3px; gap: 3px; margin: 4px 0 10px; }
.auth-tab { flex: 1; padding: 7px; border-radius: 8px; font-size: 10px; font-weight: 900; color: var(--muted); }
.auth-tab.on { background: var(--paper); color: var(--ink); box-shadow: 0 2px 0 rgba(90, 58, 30, .08); }
.auth-intro { font-size: 9.5px; color: var(--muted); line-height: 1.45; margin-bottom: 10px; }
.auth-field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 9px; }
.auth-field > span { font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.auth-field small { font-size: 8px; color: var(--muted); line-height: 1.35; }
.auth-input { background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 10px; font-size: 12px; font-weight: 800; outline: none; width: 100%; }
.auth-input:focus { border-color: var(--green); }
.auth-error { background: #FFF0EC; border: 1px solid #F3C6BA; color: #A83224; border-radius: 10px; padding: 7px 9px; font-size: 9.5px; font-weight: 800; margin-bottom: 9px; line-height: 1.35; }
.auth-submit { margin-top: 2px; }
.auth-switch { text-align: center; margin-top: 9px; }
.auth-switch .link-btn { font-size: 9.5px; color: var(--green-deep); display: inline-flex; }
.auth-fine { text-align: center; font-size: 8px; color: var(--muted); margin-top: 7px; line-height: 1.4; }

.cloud-loading {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 34px 0; font-size: 10px; color: var(--muted); font-weight: 800;
}
.spinner {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid #EADCC7; border-top-color: var(--green);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.rank-sep {
  display: flex; align-items: center; gap: 7px; padding: 4px 4px 2px;
  font-size: 8px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; color: var(--muted);
}
.rank-sep::before, .rank-sep::after { content: ''; height: 1px; flex: 1; background: #E7D8C0; }
.rank-row.pinned { border-style: dashed; }
.rank-empty { text-align: center; font-size: 10px; color: var(--muted); padding: 18px 0; font-weight: 700; }
.visit-you { font-size: 9.5px; font-weight: 800; color: var(--green-deep); background: #EFFAF3; border-radius: 9px; padding: 7px 10px; margin-top: 4px; }

/* ---------- intro / offline / summary ---------- */
.intro-modal { max-height: 92dvh; }
.intro-card { text-align: center; padding-top: 12px; }
.intro-mascot { position: relative; width: 140px; height: 140px; margin: 0 auto 6px; }
.intro-avatar { display: block; width: 120px; height: 120px; margin: 0 auto; }
.intro-avatar svg { width: 100%; }
.intro-bowl { position: absolute; right: -6px; bottom: 6px; font-size: 42px; filter: drop-shadow(0 4px 4px rgba(90, 58, 30, .25)); transform: rotate(-8deg); }
.intro-spark { position: absolute; left: 2px; top: 4px; font-size: 22px; animation: twinkle 2.2s ease-in-out infinite; }
.intro-card h2 { font-family: var(--display); font-size: 30px; line-height: 1; color: var(--red-deep); }
.intro-sub { margin-top: 4px; font-size: 12px; color: var(--muted); font-weight: 700; }
.intro-steps { display: flex; flex-direction: column; gap: 7px; margin: 14px 0 10px; text-align: left; }
.intro-step { display: flex; gap: 9px; align-items: flex-start; background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 9px 10px; }
.is-ico { width: 24px; height: 24px; border-radius: 8px; background: var(--gold-soft); color: #8A6410; font-size: 11px; font-weight: 900; display: flex; align-items: center; justify-content: center; flex: none; }
.intro-step b { font-size: 11.5px; font-weight: 900; }
.intro-step p { font-size: 9.5px; line-height: 1.4; color: var(--muted); margin-top: 1px; }
.intro-tip { font-size: 9.5px; font-weight: 800; color: #8A5A20; background: #FFF3D6; border-radius: 10px; padding: 7px 9px; margin-bottom: 10px; text-align: left; }
.offline-card { text-align: center; padding: 4px 2px 2px; }
.offline-ico { width: 66px; height: 66px; border-radius: 50%; background: var(--gold-soft); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.offline-ico .ic { width: 35px; height: 35px; }
.offline-card h3 { font-family: var(--display); font-size: 21px; }
.offline-card p { font-size: 11.5px; color: var(--ink-2); line-height: 1.45; margin: 6px 0; }
.offline-note { display: block; font-size: 9px; color: var(--muted); margin-bottom: 12px; }

.summary-modal .modal-body { padding: 22px 18px calc(18px + var(--safe-b)); }
.summary { text-align: center; }
.summary-stars { display: flex; justify-content: center; gap: 6px; margin: 2px 0 2px; }
.summary-star { width: 64px; height: 64px; opacity: 0; transform: scale(.4) rotate(-15deg); animation: starPop .55s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.summary-star .ic { width: 100%; height: 100%; }
.summary-star.on { color: var(--gold); filter: drop-shadow(0 5px 0 #D49A1D) drop-shadow(0 10px 10px rgba(212, 154, 29, .3)); }
.summary-star.off { color: #E4D5C0; }
.summary-sub { font-size: 9px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 900; }
.summary-title { font-family: var(--display); font-size: 23px; line-height: 1.05; margin-top: 2px; }
.summary-revenue { margin-top: 9px; display: flex; flex-direction: column; }
.summary-revenue span { font-size: 9px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 900; }
.summary-revenue b { font-family: var(--display); font-size: 36px; line-height: 1; color: var(--green-deep); }
.summary.fail .summary-revenue b { color: var(--red); }
.summary-target { font-size: 10px; color: var(--muted); font-weight: 800; margin-top: 2px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 14px 0 10px; }
.summary-grid > div { background: var(--paper); border: 1.5px solid var(--line); border-radius: 11px; padding: 6px 4px; display: flex; flex-direction: column; gap: 1px; }
.summary-grid span { font-size: 7px; font-weight: 900; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
.summary-grid b { font-family: var(--display); font-size: 13px; }
.coin-text { color: var(--gold-deep); }
.summary-rewards { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.xp-pill, .coin-pill, .gem-pill, .levelup-pill, .best-pill {
  display: inline-flex; align-items: center; gap: 3px; border-radius: 999px;
  padding: 4px 9px; font-size: 9.5px; font-weight: 900;
}
.xp-pill { background: #E7F2FB; color: #2F6F9C; }
.coin-pill { background: var(--gold-soft); color: #8A6410; }
.coin-pill .ic, .gem-pill .ic, .levelup-pill .ic, .best-pill .ic { width: 12px; height: 12px; }
.gem-pill { background: #E3F7FB; color: #2A8AA6; }
.levelup-pill { background: #E7F9EF; color: var(--green-deep); margin-top: 5px; }
.best-pill { background: #FFF1DA; color: #A8641C; margin-top: 5px; }
.unlock-note { font-size: 9.5px; color: var(--green-deep); font-weight: 900; margin-top: 6px; }
.fail-hint { font-size: 9.5px; color: var(--muted); line-height: 1.4; margin: 9px auto 0; max-width: 290px; }
.summary-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.next-target { font-size: 9px; color: var(--muted); font-weight: 800; }

/* ============================================================
   PLAY
   ============================================================ */
#screen-play { background: var(--cream); position: relative; overflow: hidden; }
.play-top {
  flex: none; display: flex; align-items: center; gap: 9px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  background: var(--paper); border-bottom: 1.5px solid var(--line);
  position: relative; z-index: 6;
}
.back-btn { width: 32px; height: 32px; border-radius: 10px; }
.play-meta { display: flex; flex-direction: column; line-height: 1.05; min-width: 52px; }
.play-meta b { font-family: var(--display); font-size: 13px; }
.play-meta span { font-size: 9px; font-weight: 800; color: var(--muted); }
.play-target { flex: 1; min-width: 0; }
.pt-labels { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 8.5px; font-weight: 900; color: var(--muted); }
.pt-labels b { font-size: 11px; color: var(--ink); }
.pt-labels b.hit { color: var(--green-deep); }
.targetbar { height: 9px; background: #EDE0CB; border-radius: 6px; overflow: hidden; margin-top: 3px; position: relative; }
.targetbar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #6ACB9E, var(--green)); transition: width .45s cubic-bezier(.2, .8, .3, 1); }
.targetbar i.full { background: linear-gradient(90deg, #F6C445, #E9A52E); }

.play-scene { flex: 1 1 auto; min-height: 132px; position: relative; overflow: hidden; background: #F6E3C3; }
.scene-bg { position: absolute; inset: 0; }
.scene-bg svg { width: 100%; height: 100%; display: block; }
.scene-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(90, 58, 30, .12)); pointer-events: none; }
.play-scene .decor-layer { z-index: 2; }
.customer-scene { position: absolute; left: 3%; bottom: 3%; width: 44%; z-index: 4; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.bubble {
  position: relative; background: #fff; border: 2px solid rgba(90, 58, 30, .1); border-radius: 14px;
  padding: 5px 8px 6px; box-shadow: 0 5px 14px rgba(90, 58, 30, .14);
  max-width: 192px; min-width: 96px; text-align: left; margin-bottom: 5px;
  animation: bubblePop .3s cubic-bezier(.2, 1.3, .4, 1);
}
.bubble-name { display: block; font-size: 7px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; color: #B07A2A; }
.bubble-text { display: block; font-size: 10px; font-weight: 800; line-height: 1.22; color: var(--ink); }
.bubble-tail {
  position: absolute; left: 26px; bottom: -7px; width: 12px; height: 12px; background: #fff;
  border-right: 2px solid rgba(90, 58, 30, .1); border-bottom: 2px solid rgba(90, 58, 30, .1);
  transform: rotate(45deg); border-bottom-right-radius: 3px;
}
.customer-avatar { width: clamp(70px, 18vw, 98px); filter: drop-shadow(0 6px 5px rgba(90, 58, 30, .22)); animation: bob 3.6s ease-in-out infinite; }
.customer-id { display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 251, 240, .92); border: 1px solid rgba(90, 58, 30, .1); border-radius: 999px; padding: 3px 7px; margin-top: -3px; box-shadow: 0 2px 6px rgba(90, 58, 30, .1); }
.cust-name { font-size: 8.5px; font-weight: 900; }
.cust-type { font-size: 8px; color: var(--muted); font-weight: 800; }

.table-scene { position: absolute; right: 2.5%; top: 41%; width: 46%; z-index: 3; pointer-events: none; }
.table-label { font-size: 7px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; color: #8A6A44; background: rgba(255, 249, 235, .7); border-radius: 999px; padding: 2px 6px; display: block; width: fit-content; margin: 0 auto 3px; }
.table-cloth {
  width: fit-content; max-width: 100%; margin: 0 auto;
  background: linear-gradient(160deg, #D9A468, #C68C50);
  border: 3px solid #A9713F; border-radius: 16px; padding: 7px 8px 6px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), 0 8px 16px rgba(90, 58, 30, .22);
  transform: rotate(-1.2deg);
}
.seat-row { display: flex; justify-content: center; align-items: flex-start; gap: 4px; }
.seat { display: flex; flex-direction: column; align-items: center; min-width: 40px; max-width: 58px; flex: 0 1 auto; }
.seat-avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: #FCE7C4; border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 2px 4px rgba(90, 58, 30, .2); display: flex; align-items: flex-end; justify-content: center; }
.seat-avatar svg { width: 118%; margin-bottom: -12%; }
.seat.active .seat-avatar { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246, 196, 69, .35), 0 2px 4px rgba(90, 58, 30, .2); }
.seat-name { font-size: 7px; font-weight: 900; color: #FFF6E6; text-shadow: 0 1px 1px rgba(90, 58, 30, .45); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paid-chip { margin-top: 1px; background: #FFF7E6; border-radius: 5px; padding: 1px 4px; font-size: 7px; font-weight: 900; color: #8A5A20; box-shadow: 0 1px 2px rgba(90, 58, 30, .18); white-space: nowrap; }
.paid-chip.q { background: rgba(255, 247, 230, .55); color: #7A5C3A; }
.paid-chip.x { background: #F7C0B4; color: #8E2F1E; }
.seat.rejected { opacity: .75; }

.tray-panel { flex: none; background: var(--paper); padding: 6px 10px 2px; border-top: 1.5px solid var(--line); position: relative; }
.tray-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 14px; }
.tray-title { font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.tray-note { font-size: 7.5px; font-weight: 800; color: var(--muted); }
.tray-note.calc-on { color: var(--green-deep); }
.tray { display: flex; gap: 6px; overflow-x: auto; padding: 5px 1px 5px; scrollbar-width: none; }
.tray::-webkit-scrollbar { display: none; }
.dish {
  flex: none; width: 76px; background: #FFFBF2; border: 1.5px solid var(--line);
  border-radius: 12px; padding: 3px 3px 4px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  box-shadow: 0 2px 0 rgba(90, 58, 30, .05); transition: transform .12s;
}
.dish:active { transform: translateY(1px); }
.dish.pulse { animation: dishPulse .3s ease-out; }
.dish-art { position: relative; width: 100%; height: 34px; display: flex; align-items: flex-end; justify-content: center; }
.plate-shape {
  position: absolute; bottom: 1px; width: 46px; height: 19px; border-radius: 50%;
  background: var(--plate, #F3F1EA); border: 1.5px solid rgba(90, 58, 30, .13);
  box-shadow: inset 0 -3px 0 rgba(90, 58, 30, .08), 0 2px 3px rgba(90, 58, 30, .12);
}
.dish.drink .plate-shape { width: 24px; height: 28px; border-radius: 5px 5px 9px 9px; background: #DCEFEF; border-color: rgba(90, 58, 30, .18); box-shadow: inset 0 -4px 0 rgba(90, 58, 30, .06); }
.dish-emoji { position: relative; z-index: 1; font-size: 25px; line-height: 1; margin-bottom: 3px; filter: drop-shadow(0 2px 1px rgba(90, 58, 30, .18)); }
.dish.drink .dish-emoji { font-size: 22px; }
.dish-name { font-size: 8.5px; font-weight: 800; color: var(--ink-2); line-height: 1.1; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-tag { background: #FFF1CC; color: #8A5A20; border-radius: 5px; padding: 1px 5px; font-size: 8.5px; font-weight: 900; }
.combo-badge {
  display: flex; align-items: center; gap: 5px; background: #FFF0D4; border: 1px dashed #E8C27C;
  border-radius: 8px; padding: 3px 7px; font-size: 8px; font-weight: 900; color: #9A5A12;
  margin: 0 1px 4px; width: fit-content;
}
.combo-badge span { font-size: 11px; }

.quote-panel {
  flex: none; background: linear-gradient(180deg, #FFFBF2, #FFF5E4);
  border-top: 1.5px solid var(--line); padding: 7px 10px calc(8px + var(--safe-b));
  position: relative; z-index: 5;
}
.quote-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 7px; }
.quote-row.no-guide .quote-display { width: 100%; }
.quote-display {
  width: 37%; flex: none; background: var(--ink); color: #FFF4D9;
  border-radius: 12px; padding: 5px 10px 6px; display: flex; flex-direction: column; justify-content: center;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
}
.q-label { font-size: 7px; text-transform: uppercase; letter-spacing: .6px; font-weight: 900; color: rgba(255, 244, 217, .6); }
.q-amount { font-family: var(--display); font-size: clamp(19px, 5vw, 24px); line-height: 1.05; letter-spacing: .3px; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-amount.shake { animation: shake .3s; }
.meter { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 1px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; font-size: 7.5px; font-weight: 900; color: var(--muted); }
.meter-head b { font-size: 8px; }
.meter-head b.low { color: #6D8A9C; }
.meter-head b.bargain { color: var(--green-deep); }
.meter-head b.fair { color: var(--green-deep); }
.meter-head b.steep { color: #C4841D; }
.meter-head b.high { color: var(--red); }
.meter-track {
  position: relative; height: 9px; border-radius: 6px; margin-top: 4px;
  background: linear-gradient(90deg, #BFD3DF 0%, #BFD3DF 26%, #6ACB9E 32%, #3DB47C 46%, #F2C14E 55%, #EF8B48 64%, #E2543F 74%, #C7402F 100%);
  box-shadow: inset 0 1px 2px rgba(59, 42, 30, .18);
}
.meter-zone { position: absolute; top: -2px; bottom: -2px; left: 31%; width: 20%; border-radius: 5px; border: 1.5px solid rgba(255, 255, 255, .6); }
.meter-needle {
  position: absolute; top: -3px; width: 3px; height: 15px; border-radius: 2px;
  background: #fff; box-shadow: 0 0 0 1.5px rgba(59, 42, 30, .35), 0 1px 3px rgba(0, 0, 0, .25);
  transform: translateX(-50%); transition: left .12s ease-out, opacity .15s;
  left: 8%; opacity: .35;
}
.meter-needle.low { background: #DCEBF4; }
.meter-needle.bargain, .meter-needle.fair { background: #E9FFF2; }
.meter-needle.steep { background: #FFF1CE; }
.meter-needle.high { background: #FFDCD6; }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: clamp(37px, 6.2dvh, 51px); gap: 5px; }
.key {
  background: #fff; border: 1.5px solid #E3D3BC; border-radius: 11px;
  font-family: var(--display); font-size: clamp(16px, 4.4vw, 21px); font-weight: 700; color: var(--ink);
  box-shadow: 0 2.5px 0 #DAC7AC; transition: transform .08s, box-shadow .08s, background .12s;
  display: flex; align-items: center; justify-content: center; user-select: none;
}
.key:hover { background: #FFFDF8; }
.key:active { transform: translateY(2px); box-shadow: 0 0 0 #DAC7AC; background: #F7EEDF; }
.key.util { color: #8A6A44; font-size: 16px; background: #F9EFDD; }
.key.util .ic { width: 20px; height: 20px; }
.key.quote {
  grid-column: 4; grid-row: 3 / span 2;
  background: linear-gradient(180deg, #48C186, #2FA36B); color: #fff; border-color: transparent;
  font-family: var(--body); font-size: clamp(12px, 3.3vw, 15px); font-weight: 900;
  box-shadow: 0 4px 0 var(--green-deep); letter-spacing: .3px;
}
.key.quote:active { box-shadow: 0 1px 0 var(--green-deep); background: #2A9561; }
.key.quote:disabled { opacity: .4; box-shadow: none; }
.keypad.dim { opacity: .5; pointer-events: none; }

.play-overlay { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: flex-end; }
.overlay-dim { position: absolute; inset: 0; background: rgba(43, 28, 16, .42); backdrop-filter: blur(3px); animation: fadeIn .2s; }
.overlay-card {
  position: relative; background: var(--cream); border-radius: 24px 24px 0 0;
  padding: 16px 16px calc(16px + var(--safe-b)); margin-top: auto;
  box-shadow: 0 -20px 50px rgba(43, 28, 16, .3); animation: sheetUp .3s cubic-bezier(.2, .9, .3, 1);
  max-height: 92%; overflow-y: auto;
}
.reaction-head { display: flex; gap: 11px; align-items: center; }
.ov-avatar { width: 84px; height: 84px; flex: none; border-radius: 50%; overflow: hidden; background: linear-gradient(180deg, #FFE7B8, #F7C979); display: flex; align-items: flex-end; justify-content: center; border: 3px solid #fff; box-shadow: var(--shadow-sm); }
.ov-avatar svg { width: 116%; margin-bottom: -11%; }
.reaction-copy { min-width: 0; }
.kicker { font-size: 8.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; color: #B07A2A; display: block; }
.reaction-copy h3 { font-family: var(--display); font-size: 21px; line-height: 1.05; margin-top: 1px; }
.reaction-copy p { font-size: 11px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.result-money { display: flex; align-items: center; gap: 7px; margin-top: 11px; flex-wrap: wrap; }
.sold-pill { background: var(--gold-soft); color: #8A5A20; border-radius: 9px; padding: 5px 10px; font-family: var(--display); font-size: 18px; font-weight: 800; }
.tip-pill { background: #E7F9EF; color: var(--green-deep); border-radius: 999px; padding: 4px 9px; font-size: 10px; font-weight: 900; }
.result-stars { display: flex; align-items: center; gap: 3px; margin-top: 7px; }
.result-stars span:not(.star) { font-size: 9px; font-weight: 800; color: var(--muted); margin-left: 4px; }
.star { display: inline-flex; color: #DCCDB8; }
.star.on { color: var(--gold); }
.star .ic { width: 15px; height: 15px; }
.star.sm .ic { width: 13px; height: 13px; }
.fair-reveal { font-size: 9.5px; color: var(--muted); font-weight: 700; margin-top: 6px; }
.fine-pill { margin-top: 10px; background: #FFE9E3; color: #A83224; border-radius: 9px; padding: 7px 10px; font-size: 12px; font-weight: 900; text-align: center; }
.result-reject { margin-top: 9px; font-size: 9.5px; color: var(--muted); font-weight: 700; }
.overlay-card .btn.wide { margin-top: 12px; }
.haggle-card { text-align: center; display: flex; flex-direction: column; align-items: center; }
.haggle-card .ov-avatar { width: 76px; height: 76px; margin-bottom: 2px; }
.haggle-card h3 { font-family: var(--display); font-size: 20px; margin-top: 2px; }
.your-price { font-size: 10px; color: var(--muted); margin-top: 2px; }
.your-price s { color: var(--ink-2); }
.offer-pill {
  margin-top: 9px; background: #FFF3D6; border: 1.5px solid #E8CE95; border-radius: 14px;
  padding: 7px 14px; display: flex; align-items: center; gap: 8px;
}
.offer-pill span { font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; color: #8A6A44; }
.offer-pill b { font-family: var(--display); font-size: 21px; color: #8A5A20; line-height: 1; }
.overlay-actions { display: flex; flex-direction: column; gap: 7px; width: 100%; margin-top: 12px; }

/* ---------- toast / fx ---------- */
#toast-root {
  position: fixed; left: 50%; top: 20%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none; width: min(92vw, 440px);
}
.toast {
  display: flex; align-items: center; gap: 6px;
  background: rgba(49, 33, 21, .94); color: #FFF8EA;
  border-radius: 999px; padding: 8px 14px; font-size: 10.5px; font-weight: 800;
  box-shadow: 0 8px 24px rgba(40, 24, 12, .3);
  animation: toastIn .25s cubic-bezier(.2, 1.2, .4, 1);
  max-width: 100%;
}
.toast .ic { width: 15px; height: 15px; color: var(--gold); flex: none; }
.toast.error .ic { color: #FF9C86; }
.toast.star .ic { color: var(--gold); }
.toast.out { animation: toastOut .3s forwards; }
#fx-root { position: fixed; inset: 0; pointer-events: none; z-index: 250; overflow: hidden; }
.float-text {
  position: absolute; font-family: var(--display); font-size: 16px; font-weight: 800; color: var(--green-deep);
  text-shadow: 0 1px 0 #fff, 0 2px 6px rgba(255, 255, 255, .8);
  animation: floatUp 1s ease-out forwards; z-index: 260;
}
.confetti { position: absolute; top: -20px; border-radius: 2px; opacity: .9; animation: confettiFall linear forwards; }

/* ---------- animations ---------- */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes lanternSway { 0%, 100% { transform: translate(-50%, -50%) rotate(-3deg); } 50% { transform: translate(-50%, -50%) rotate(3deg); } }
@keyframes decorSway { 0%, 100% { transform: translate(-50%, -50%) rotate(-2deg); } 50% { transform: translate(-50%, -50%) rotate(2deg); } }
@keyframes shine { 0%, 55% { left: -60%; } 75%, 100% { left: 120%; } }
@keyframes twinkle { 0%, 100% { opacity: .4; transform: scale(.85) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(12deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
@keyframes bubblePop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes starPop { to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-8px); opacity: 0; } }
@keyframes floatUp { from { transform: translateY(0) scale(1); opacity: 1; } to { transform: translateY(-42px) scale(1.1); opacity: 0; } }
@keyframes confettiFall { from { transform: translateY(-20px) rotate(0); opacity: 1; } to { transform: translateY(110vh) rotate(720deg); opacity: .8; } }
@keyframes dishPulse { 0% { transform: scale(1); } 40% { transform: scale(1.07); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .customer-avatar, .boss-figure, .decor-item, .pd-emoji { animation: none !important; }
}

/* ---------- small screens ---------- */
@media (max-width: 380px) {
  .profile-name em { display: none; }
  .xpbar { width: 64px; }
}
@media (max-width: 370px) {
  .topbar { padding-left: 11px; padding-right: 11px; }
  .home-scroll { padding-left: 11px; padding-right: 11px; }
  .profile-name { font-size: 15px; }
  .xpbar { width: 74px; }
  .wallet-pill { padding: 5px 7px; font-size: 11px; }
  .stat { padding: 7px 8px; }
  .stat b { font-size: 15px; }
  .quick-card { padding: 8px; gap: 7px; }
  .q-ico { width: 30px; height: 30px; }
  .q-txt b { font-size: 11px; }
  .target-box { min-width: 98px; }
  .hero-info h1 { font-size: 19px; }
  .dish { width: 68px; }
  .login-grid { gap: 3px; }
  .login-tile { min-height: 54px; padding: 4px 1px; }
  .summary-grid { gap: 4px; }
  .summary-grid b { font-size: 12px; }
}
@media (max-height: 760px) {
  .storefront { aspect-ratio: 16 / 7.6; max-height: 220px; }
  .tagline { display: none; }
  .hero-bottom { padding-top: 9px; }
  .open-btn { margin-top: 9px; }
  .intro-card { padding-top: 4px; }
  .intro-mascot { width: 108px; height: 108px; margin-bottom: 2px; }
  .intro-avatar { width: 94px; height: 94px; }
  .intro-bowl { font-size: 33px; right: 2px; bottom: 8px; }
  .intro-spark { font-size: 18px; }
  .intro-card h2 { font-size: 26px; }
  .intro-sub { margin-top: 2px; font-size: 11px; }
  .intro-steps { gap: 5px; margin: 10px 0 8px; }
  .intro-step { padding: 7px 9px; }
  .intro-step p { font-size: 9px; }
  .intro-tip { padding: 6px 8px; margin-bottom: 8px; }
}
@media (max-height: 600px) {
  .play-scene { min-height: 105px; }
  .bubble { padding: 4px 7px; margin-bottom: 4px; }
  .bubble-text { font-size: 9.5px; }
  .customer-avatar { width: clamp(74px, 21vw, 104px); }
  .seat-avatar { width: 32px; height: 32px; }
  .tray-panel { padding-top: 4px; }
  .dish { width: 68px; }
  .dish-art { height: 30px; }
  .dish-emoji { font-size: 22px; }
  .quote-panel { padding-top: 5px; }
  .quote-row { margin-bottom: 5px; }
  .keypad { grid-auto-rows: clamp(33px, 5.6dvh, 44px); }
  .q-label { display: none; }
  .q-amount { font-size: 19px; }
}
