/* Chợ Đêm: game page. Her palette: pinks #EC4899 / #DB2777 / #F472B6, soft #FDF2F8 / #FBCFE8, cream #FFF5F6,
   rounded pills; over a warm night. */
:root {
  --pink: #ec4899; --pink-d: #db2777; --pink-l: #f472b6; --pink-s: #fdf2f8; --pink-b: #fbcfe8; --cream: #fff5f6;
  --ink: #3b2a3a; --muted: #8a7486; --night: #1b1433; --gold: #f5b427;
  --glass: rgba(255, 245, 250, 0.94); --glass-d: rgba(30, 18, 44, 0.8);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--ink); font-family: var(--font); }
body { -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
input, textarea { -webkit-user-select: text; user-select: text; font-family: inherit; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }

.cd-stage { position: fixed; inset: 0; touch-action: none; }
.cd-stage canvas { display: block; }
.cd-stage::after { /* soft vignette for depth */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(10, 6, 24, 0.55) 100%);
}
.cd-labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.cd-label {
  position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 11px; font-weight: 700; color: #fff;
  padding: 2px 8px; border-radius: 999px; background: rgba(30, 18, 44, 0.55); backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px); text-shadow: 0 1px 2px rgba(0,0,0,.4); will-change: transform; max-width: 40vw;
  overflow: hidden; text-overflow: ellipsis;
}
.cd-label.me { background: rgba(236, 72, 153, 0.85); }
.cd-label-badge { margin-right: 3px; }
.cd-stall-tag {
  position: absolute; left: 0; top: 0; pointer-events: auto; white-space: nowrap; display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 12px; border-radius: 18px; background: var(--glass); color: var(--ink); border: 1px solid var(--pink-b);
  box-shadow: 0 8px 24px rgba(236, 72, 153, .28); font-size: 12px; font-weight: 800; will-change: transform;
  transition: opacity .25s; cursor: pointer; max-width: min(78vw, 340px);
}
.cd-stall-tag .nm { overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.cd-stall-tag .th { display: flex; gap: 4px; }
.cd-stall-tag img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; background: #f3e8ee; }
.cd-stall-tag .go { background: var(--pink); color: #fff; border-radius: 999px; padding: 9px 14px; font-size: 13px; }

/* joystick */
.cd-joy { position: fixed; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; z-index: 6;
  background: radial-gradient(circle, rgba(255,255,255,.14), rgba(255,255,255,.05)); border: 2px solid rgba(255,255,255,.35);
  opacity: 0; transform: scale(.8); transition: opacity .15s, transform .15s; pointer-events: none;
  left: 76px; top: calc(100% - 200px - var(--safe-b)); }
.cd-joy.on { opacity: 1; transform: scale(1); transition: opacity .15s, transform .15s; }
/* On touch screens the joystick rests visibly in the lower left (drag anywhere also works). */
@media (pointer: coarse) { .cd-joy { opacity: .55; transform: scale(.85); } }
.cd-joy::after { content: "✥"; position: absolute; left: 50%; top: -26px; transform: translateX(-50%); color: rgba(255,255,255,.7); font-size: 14px; }
.cd-joy.on::after { display: none; }
.cd-hint { position: fixed; left: 50%; top: calc(104px + var(--safe-t)); transform: translate(-50%, 0); z-index: 9; pointer-events: none; display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 999px; background: rgba(32,20,48,.78); color: #fff; font-weight: 800; font-size: 14px;
  border: 1px solid rgba(251,207,232,.4); box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: cdHint 1.6s ease-in-out infinite; transition: opacity .4s; max-width: calc(100vw - 32px); text-align: center; }
.cd-hint.gone { opacity: 0; }
.cd-hint .hand { font-size: 22px; display: inline-block; animation: cdHand 1.6s ease-in-out infinite; }
@keyframes cdHint { 50% { transform: translate(-50%, -4px); } }
@keyframes cdHand { 0%, 100% { transform: translateX(-8px); } 50% { transform: translateX(10px) translateY(-6px); } }
.cd-joy-knob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%;
  background: linear-gradient(180deg, #f9a8d4, var(--pink)); box-shadow: 0 4px 14px rgba(236,72,153,.6); }

/* top HUD */
.cd-hud-top { position: fixed; left: 0; right: 0; top: 0; z-index: 10; padding: calc(10px + var(--safe-t)) 12px 0;
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; pointer-events: none; }
.cd-hud-top > * { pointer-events: auto; }
.cd-brand { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 11px; border-radius: 999px; flex: none; font-weight: 900;
  letter-spacing: .06em; text-transform: uppercase; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--pink), #f97316); box-shadow: 0 6px 20px rgba(236,72,153,.45); }
.cd-brand-lantern { width: 16px; height: 20px; border-radius: 50% 50% 46% 46%; background: radial-gradient(circle at 50% 40%, #ffe7a3, #ff6b3d 70%);
  box-shadow: 0 0 12px #ffb057; position: relative; }
.cd-counts { display: flex; gap: 2px; align-items: center; height: 44px; padding: 0 6px; border-radius: 22px; background: var(--glass-d); font: inherit; cursor: pointer;
  border: 1px solid rgba(251,207,232,.25); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); white-space: nowrap; min-width: 0; }
.cd-count { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 0 7px; font-size: 13px; color: #fde7f3; font-weight: 700; line-height: 1.05; }
.cd-count .v { display: inline-flex; align-items: center; gap: 3px; }
.cd-count .l { font-size: 9.5px; font-weight: 700; color: #f3c9de; letter-spacing: .01em; margin-top: 1px; }
.cd-count b { color: #fff; font-size: 14px; }
.cd-count small { opacity: .7; font-size: 11px; }
.cd-count + .cd-count { border-left: 1px solid rgba(251,207,232,.2); }
.cd-count.bump b { animation: cdBump .5s; }
.cd-top-right { margin-left: auto; display: flex; gap: 6px; flex: none; }
.cd-hud-top { flex-wrap: nowrap; align-items: center; }
.cd-top-right .cd-btn { min-height: 44px; height: 44px; }
.cd-top-right .cd-icon { width: 44px; }
.cd-pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--glass-d); color: #fde7f3; border: 1px solid rgba(251, 207, 232, .25); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); white-space: nowrap; }
.cd-pill b { color: #fff; font-size: 13px; }
.cd-pill small { opacity: .75; }
.cd-btn { border: 1px solid rgba(251,207,232,.4); }
.cd-icon { width: 44px; justify-content: center; padding: 0; }
.cd-btn { min-height: 44px; padding: 0 14px; }
.cd-dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); animation: cdPulse 2s infinite; }
@keyframes cdPulse { 50% { box-shadow: 0 0 0 6px rgba(52,211,153,0); } }
.cd-pill.bump b { animation: cdBump .5s; }
@keyframes cdBump { 40% { transform: scale(1.35); color: #ffd1e8; } }
@media (max-width: 420px) {
  .cd-brand-text { display: none; }
  .cd-brand { padding: 0; width: 44px; height: 44px; justify-content: center; background: rgba(30,18,44,.8); border: 1px solid rgba(251,207,232,.35); box-shadow: 0 4px 14px rgba(0,0,0,.3); }
}
.cd-logo { width: 22px; height: 27px; flex: none; filter: drop-shadow(0 0 6px rgba(255,140,90,.8)); }
.cd-brand-lantern { display: none; }

.cd-police-hud { position: fixed; left: 50%; top: calc(58px + var(--safe-t)); transform: translateX(-50%); z-index: 11;
  padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #1e3a8a; background: #eff6ff;
  border: 1px solid #bfdbfe; box-shadow: 0 6px 18px rgba(59,130,246,.3); white-space: nowrap; }
.cd-police-hud.warn { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.cd-police-hud.danger { color: #fff; background: linear-gradient(90deg, #dc2626, #2563eb); border-color: transparent; animation: cdSiren 1s infinite; }
@keyframes cdSiren { 50% { filter: brightness(1.25); } }


.cd-toast { position: fixed; left: 50%; top: calc(98px + var(--safe-t)); transform: translate(-50%, -8px); z-index: 30; opacity: 0;
  pointer-events: none; width: max-content; max-width: min(92vw, 420px); text-align: center; padding: 10px 16px; border-radius: 18px;
  background: #fff; color: var(--pink-d); border: 1px solid var(--pink-b); font-weight: 800; font-size: 13px;
  box-shadow: 0 10px 30px rgba(236,72,153,.3); transition: opacity .25s, transform .25s; }
.cd-toast.show { opacity: 1; transform: translate(-50%, 0); }
.cd-toast.police { color: #fff; background: linear-gradient(90deg, #dc2626, #1d4ed8); border: 0; pointer-events: auto; }
.cd-toast.error { color: #b91c1c; border-color: #fecaca; }

/* bottom HUD: (near-stall card) + one bar: map, my stall | zoom, rotate */
.cd-hud-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 0 12px calc(12px + var(--safe-b));
  display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.cd-hud-bottom > * { pointer-events: auto; }
.cd-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; pointer-events: none; }
.cd-bar > * { pointer-events: auto; }
.cd-actions { display: flex; gap: 8px; align-items: center; min-width: 0; flex-wrap: wrap; }
.cd-cam { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.cd-round { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--pink-b); background: rgba(255,255,255,.92); color: var(--pink);
  font-size: 18px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.25);
  transition: transform .1s; }
.cd-round:active { transform: scale(.9); }
.cd-round-sm { width: 44px; height: 32px; font-size: 15px; opacity: .85; }
.cd-cta { border: 0; border-radius: 999px; padding: 0 18px; min-height: 46px; font-weight: 800; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--pink-d)); box-shadow: 0 8px 22px rgba(236,72,153,.45); transition: transform .12s, filter .2s;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-cta:active { transform: scale(.96); }
.cd-cta:disabled { filter: grayscale(.6) brightness(.9); opacity: .6; cursor: default; }
.cd-cta.cd-ghost { background: #fff; color: var(--pink); border: 1px solid var(--pink-b); box-shadow: none; }
.cd-ghost-dark { background: var(--glass-d); color: #fff; border: 1px solid rgba(251,207,232,.35); box-shadow: 0 6px 18px rgba(0,0,0,.3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cd-cta-big { width: 100%; font-size: 16px; padding: 14px 20px; }
/* the near-stall card (replaces the floating tag and the "visit" button) */
.cd-near { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 460px; align-self: center; text-align: left; color: var(--ink);
  background: var(--glass); border: 1px solid var(--pink-b); border-radius: 22px; padding: 8px 8px 8px 8px; box-shadow: 0 12px 34px rgba(0,0,0,.35);
  animation: cdNear .3s cubic-bezier(.2,.9,.25,1); min-height: 64px; }
@keyframes cdNear { from { transform: translateY(16px); opacity: 0; } }
.cd-near-photos { display: flex; flex: none; }
.cd-near-photos img { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: #f3e8ee; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.cd-near-photos img + img { margin-left: -14px; }
.cd-near-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cd-near-text b { font-size: 14px; font-weight: 900; color: var(--pink-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-near-text small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-near-go { flex: none; background: linear-gradient(135deg, #f59e0b, var(--pink)); color: #fff; font-weight: 900; font-size: 14px; border-radius: 999px; padding: 0 16px;
  min-height: 44px; display: inline-flex; align-items: center; }
/* the card sits at the top, under the counters: the bottom of the screen belongs to the thumb that walks */
.cd-hud-bottom .cd-near { position: fixed; left: 50%; top: calc(62px + var(--safe-t)); transform: translateX(-50%); width: calc(100% - 24px);
  z-index: 11; animation-name: cdNearTop; }
@keyframes cdNearTop { from { transform: translate(-50%, -14px); opacity: 0; } }
body.has-near .cd-hint, body.has-near .cd-police-hud { top: calc(136px + var(--safe-t)); }
body.has-near .cd-toast { top: calc(176px + var(--safe-t)); }
/* desktop corner minimap */
.cd-corner-map { display: none; position: fixed; right: 12px; top: calc(62px + var(--safe-t)); z-index: 9; padding: 0; border: 2px solid rgba(251,207,232,.6);
  border-radius: 18px; overflow: hidden; background: #1b1433; box-shadow: 0 10px 30px rgba(0,0,0,.4); cursor: pointer; }
.cd-corner-map canvas { display: block; }
@media (min-width: 900px) and (pointer: fine) { .cd-corner-map { display: block; } }
/* the big map sheet */
.cd-map-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cd-map-wrap canvas { border-radius: 20px; box-shadow: 0 6px 20px rgba(0,0,0,.25); cursor: pointer; touch-action: manipulation; }
.cd-map-legend { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: var(--muted); font-weight: 700; }
.cd-map-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.cd-map-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.cd-map-legend .lg-open { background: #f5b427; box-shadow: 0 0 0 2px rgba(60,35,10,.85); width: 9px; height: 9px; }
.cd-map-legend .lg-free { background: rgba(120,112,135,.75); border-radius: 2px; width: 9px; height: 9px; }
.cd-map-legend .lg-people { background: #67e8f9; width: 8px; height: 8px; }
.cd-map-legend .lg-me { width: 0; height: 0; border-radius: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 12px solid #fff;
  filter: drop-shadow(0 0 1.5px #ec4899) drop-shadow(0 0 1px #ec4899); }
.cd-map-legend .lg-star { font-size: 13px; }
.cd-map-quick { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.cd-map-quick button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--pink-b); background: #fff; color: var(--pink-d); font-weight: 800; font-size: 13px; }

.cd-place-bar { position: fixed; left: 12px; right: 12px; bottom: calc(14px + var(--safe-b)); z-index: 12; padding: 14px; border-radius: 22px;
  background: var(--glass); border: 1px solid var(--pink-b); box-shadow: 0 12px 40px rgba(0,0,0,.35); max-width: 460px; margin: 0 auto; }
.cd-place-bar p { margin: 0 0 10px; font-size: 13px; font-weight: 700; text-align: center; }
.cd-row { display: flex; gap: 8px; }
.cd-row > * { flex: 1; }

/* bottom sheet */
.cd-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(15, 8, 30, .45); animation: cdFade .25s; }
@keyframes cdFade { from { opacity: 0; } }
.cd-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 86dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--cream); border-radius: 26px 26px 0 0; box-shadow: 0 -16px 50px rgba(0,0,0,.4); padding: 8px 16px calc(18px + var(--safe-b));
  transform: translateY(105%); transition: transform .38s cubic-bezier(.2,.9,.25,1); max-width: 560px; margin: 0 auto; -webkit-user-select: text; user-select: text; }
.cd-sheet.open { transform: translateY(0); }
.cd-sheet-grab { width: 44px; height: 5px; border-radius: 9px; background: var(--pink-b); margin: 2px auto 8px; }
.cd-sheet-close { position: absolute; right: 10px; top: 8px; width: 44px; height: 44px; font-size: 16px; border-radius: 999px; border: 1px solid var(--pink-b);
  background: #fff; color: var(--pink); font-weight: 900; }
.cd-sh-head { padding-right: 40px; }
.cd-sh-title { margin: 2px 0 2px; font-size: 19px; font-weight: 900; color: var(--pink-d); line-height: 1.25; word-break: break-word; }
.cd-sh-sub { margin: 0 0 10px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cd-badge { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800;
  background: var(--pink-s); color: var(--pink-d); border: 1px solid var(--pink-b); }
.cd-badge.demo { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.cd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 480px) { .cd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cd-prod { background: #fff; border: 1px solid var(--pink-b); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 2px 8px rgba(236,72,153,.08); animation: cdRise .35s both; }
@keyframes cdRise { from { transform: translateY(12px); opacity: 0; } }
.cd-prod img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f6e9ef; display: block; }
.cd-prod .pi { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cd-prod .pn { font-size: 13px; font-weight: 700; line-height: 1.25; word-break: break-word; }
.cd-prod .pp { font-size: 14px; font-weight: 900; color: var(--pink); }
.cd-qty { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.cd-qty button { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--pink-b); background: var(--pink-s); color: var(--pink); font-weight: 900; font-size: 16px; }
.cd-qty button.add { width: auto; flex: 1; padding: 0 10px; background: var(--pink); color: #fff; border: 0; font-size: 13px; }
.cd-qty span { min-width: 20px; text-align: center; font-weight: 900; }
.cd-cartbar { position: sticky; bottom: calc(-18px - var(--safe-b)); margin: 12px -16px calc(-18px - var(--safe-b)); padding: 12px 16px calc(14px + var(--safe-b));
  background: linear-gradient(180deg, rgba(255,245,246,0), var(--cream) 30%); display: flex; gap: 10px; align-items: center; }
.cd-cartbar .sum { flex: 1; font-size: 12px; color: var(--muted); font-weight: 700; }
.cd-cartbar .sum b { display: block; color: var(--pink-d); font-size: 17px; }
.cd-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.cd-field input, .cd-field textarea { border: 1px solid var(--pink-b); border-radius: 14px; padding: 11px 12px; font-size: 16px; color: var(--ink); background: #fff; }
.cd-field textarea { min-height: 64px; resize: vertical; }
.cd-pay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.cd-pay label { border: 2px solid var(--pink-b); border-radius: 16px; padding: 10px; background: #fff; font-size: 13px; font-weight: 800; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; }
.cd-pay label small { font-weight: 600; color: var(--muted); font-size: 11px; }
.cd-pay input { position: absolute; opacity: 0; pointer-events: none; }
.cd-pay label:has(input:checked) { border-color: var(--pink); background: var(--pink-s); box-shadow: 0 0 0 3px rgba(236,72,153,.15); }
.cd-pay label.off { opacity: .45; cursor: not-allowed; }
.cd-err { color: #b91c1c; font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.cd-check { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin: -2px 0 12px; }
.cd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.cd-done { text-align: center; }
.cd-done h3 { color: var(--pink-d); font-size: 20px; margin: 6px 0; }
.cd-code { display: inline-block; font-size: 22px; font-weight: 900; letter-spacing: .12em; color: var(--pink-d); background: #fff;
  border: 2px dashed var(--pink-l); border-radius: 14px; padding: 6px 14px; margin: 6px 0; -webkit-user-select: all; user-select: all; }
.cd-qr { width: min(70vw, 260px); border-radius: 16px; border: 1px solid var(--pink-b); background: #fff; display: block; margin: 8px auto; }
.cd-note { font-size: 12px; color: var(--muted); line-height: 1.5; }
.cd-help h3 { color: var(--pink-d); margin: 4px 0 8px; }
.cd-help li { margin: 6px 0; font-size: 13px; line-height: 1.45; }

/* intro */
.cd-intro { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 18px;
  background: radial-gradient(120% 80% at 50% 0%, #5a2a6e 0%, #241640 45%, #120c24 100%); transition: opacity .6s, visibility .6s; }
.cd-intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.cd-intro-sky i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: .7; animation: cdTw 3s infinite; }
.cd-intro-sky i:nth-child(1) { left: 12%; top: 14%; } .cd-intro-sky i:nth-child(2) { left: 78%; top: 9%; animation-delay: .6s; }
.cd-intro-sky i:nth-child(3) { left: 40%; top: 22%; animation-delay: 1.2s; } .cd-intro-sky i:nth-child(4) { left: 88%; top: 30%; animation-delay: 1.8s; }
.cd-intro-sky i:nth-child(5) { left: 22%; top: 34%; animation-delay: .3s; } .cd-intro-sky i:nth-child(6) { left: 62%; top: 16%; animation-delay: 2.1s; }
.cd-intro-sky i:nth-child(7) { left: 6%; top: 46%; animation-delay: 1s; } .cd-intro-sky i:nth-child(8) { left: 94%; top: 52%; animation-delay: 1.5s; }
@keyframes cdTw { 50% { opacity: .15; } }
.cd-intro-card { position: relative; width: min(100%, 380px); text-align: center; color: #fff; }
.cd-intro-lanterns { display: flex; justify-content: center; gap: 22px; margin-bottom: 6px; }
.cd-intro-lanterns span { width: 34px; height: 44px; border-radius: 50% 50% 46% 46%; background: radial-gradient(circle at 50% 40%, #fff1b8, #ff5a3d 72%);
  box-shadow: 0 0 30px #ff8a4f, 0 0 60px rgba(255,120,80,.5); position: relative; animation: cdSway 3s ease-in-out infinite; transform-origin: 50% -30px; }
.cd-intro-lanterns span:nth-child(2) { background: radial-gradient(circle at 50% 40%, #ffe3f1, #ec4899 72%); box-shadow: 0 0 30px #f472b6, 0 0 60px rgba(236,72,153,.5); animation-delay: -1s; width: 42px; height: 54px; }
.cd-intro-lanterns span:nth-child(3) { animation-delay: -2s; background: radial-gradient(circle at 50% 40%, #fff6c8, #f59e0b 72%); box-shadow: 0 0 30px #fbbf24; }
.cd-intro-lanterns span::before { content: ""; position: absolute; left: 50%; top: -30px; width: 1px; height: 30px; background: rgba(255,255,255,.35); }
.cd-intro-lanterns span::after { content: ""; position: absolute; left: 50%; bottom: -12px; width: 3px; height: 12px; margin-left: -1px; background: #ffcf5a; border-radius: 2px; }
@keyframes cdSway { 50% { transform: rotate(6deg); } }
.cd-intro-title { margin: 14px 0 4px; font-size: 44px; font-weight: 900; letter-spacing: .04em;
  background: linear-gradient(180deg, #fff, #ffd1e8 60%, #f9a8d4); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(236,72,153,.35); }
.cd-intro-sub { margin: 0 0 18px; color: #f3d9ea; font-size: 14px; }
.cd-intro-loading { display: inline-flex; gap: 10px; align-items: center; color: #fbcfe8; font-weight: 700; font-size: 13px; }
.cd-spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(251,207,232,.3); border-top-color: var(--pink-l); animation: cdSpin 1s linear infinite; }
@keyframes cdSpin { to { transform: rotate(360deg); } }
.cd-intro-form { margin-top: 74px; background: var(--cream); color: var(--ink); border-radius: 26px; padding: 16px; text-align: left; box-shadow: 0 20px 60px rgba(0,0,0,.45); animation: cdRise .4s both; }
.cd-avatar-pick { position: relative; width: 120px; height: 120px; margin: -64px auto 8px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #fff, #fce7f3);
  border: 4px solid #fff; box-shadow: 0 8px 26px rgba(236,72,153,.4); }
.cd-avatar-pick canvas { width: 100%; height: 100%; border-radius: 50%; }
.cd-dice { position: absolute; right: -10px; bottom: -4px; width: 40px; height: 40px; font-size: 18px; }
.cd-intro-seller { font-size: 12px; font-weight: 700; color: var(--pink-d); background: var(--pink-s); border-radius: 12px; padding: 8px 10px; margin: 0 0 10px; }
.cd-noscript { position: fixed; inset: auto 0 40% 0; text-align: center; color: #fff; z-index: 99; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* round 2: checkout, alerts, loading, fallback */
.cd-back { min-height: 44px; margin-bottom: 8px; }
.cd-bag { display: grid; gap: 8px; margin: 6px 0; }
.cd-bag-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--pink-b); border-radius: 16px; padding: 6px; }
.cd-bag-row img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: #f6e9ef; }
.cd-bag-row .pn { font-size: 13px; font-weight: 700; line-height: 1.25; word-break: break-word; }
.cd-bag-row .pp { font-size: 12px; color: var(--pink); font-weight: 800; }
.cd-total { margin: 6px 2px 4px; font-size: 14px; color: var(--muted); }
.cd-total b { color: var(--pink-d); font-size: 18px; }
.cd-step { margin: 14px 0 8px; font-size: 14px; font-weight: 900; color: var(--pink-d); }
.cd-field.invalid input, .cd-field.invalid textarea { border-color: #f87171; background: #fff7f7; }
.cd-field-msg { color: #b91c1c; font-size: 12px; font-weight: 700; min-height: 0; }
.cd-field-msg:empty { display: none; }
.cd-cta.busy { position: relative; color: transparent; }
.cd-cta.busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px; border-radius: 50%; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; animation: cdSpin 1s linear infinite; }
.cd-done-icon { font-size: 40px; animation: cdPop .5s ease-out; }
.cd-copyrow { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 4px 0; }
.cd-small { min-height: 44px; padding: 0 16px; font-size: 13px; }
.cd-paybox { background: #fff; border: 1px solid var(--pink-b); border-radius: 20px; padding: 14px; margin: 12px 0; }
.cd-paybox h4 { margin: 0 0 6px; color: var(--pink-d); }
.cd-amount { font-size: 24px; font-weight: 900; color: var(--pink-d); }
.cd-code-sm { font-size: 18px; }
.cd-link { font-size: 11px; letter-spacing: 0; word-break: break-all; }
.cd-findlink { display: block; margin: 10px 0 0; color: var(--pink-d); font-weight: 700; }
#mine-btn[data-badge]:not([data-badge=""])::after { content: attr(data-badge); position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: #f59e0b; color: #fff; font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
#mine-btn { position: relative; overflow: visible; }
.cd-intro-loading { flex-direction: column; gap: 10px; width: min(80vw, 280px); }
.cd-intro-loading > div:last-child { display: inline-flex; gap: 10px; align-items: center; }
.cd-intro-bar { width: 100%; height: 8px; border-radius: 999px; background: rgba(251,207,232,.18); overflow: hidden; }
.cd-intro-bar i { display: block; height: 100%; width: 5%; border-radius: 999px; background: linear-gradient(90deg, #f9a8d4, #ec4899, #f59e0b); transition: width .35s ease; }
.cd-intro.fallback { align-items: flex-start; overflow: auto; }
.cd-fallback { background: var(--cream); color: var(--ink); border-radius: 24px; padding: 16px; text-align: left; margin-top: 12px; }
.cd-fallback h3 { color: var(--pink-d); margin: 10px 0 8px; }
.cd-fb-stall { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: #fff; border: 1px solid var(--pink-b); border-radius: 16px; padding: 8px; margin-bottom: 8px; min-height: 64px; color: inherit; }
.cd-fb-stall img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.cd-fb-stall b { display: block; }
.cd-fb-stall small { color: var(--muted); }
body:has(.cd-intro.fallback) .cd-sheet { z-index: 71; }
body:has(.cd-intro.fallback) .cd-backdrop { z-index: 70; }
body:has(.cd-intro.fallback) .cd-toast { z-index: 72; }
body.placing .cd-joy:not(.on), body.placing .cd-hint { opacity: 0 !important; }
.cd-cta.done, .cd-cta.done:disabled { background: linear-gradient(135deg, #10b981, #059669); opacity: 1; filter: none; box-shadow: 0 6px 16px rgba(5,150,105,.3); }
/* phone header: logo · counters · VN · ? must fit in 390 px */
.cd-counts { flex: 0 1 auto; min-width: 0; overflow: hidden; }
@media (max-width: 420px) {
  .cd-hud-top { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .cd-count { padding: 0 5px; }
  .cd-count .l { font-size: 9px; }
  .cd-count small { font-size: 10px; }
  .cd-top-right { gap: 5px; }
  .cd-top-right .cd-btn:not(.cd-icon) { padding: 0 10px; }
}
/* header: logo | counters (takes the remaining width, never more) | VN ? — no overlap at any width or digit count */
.cd-hud-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 6px; }
.cd-hud-top > .cd-police-hud, .cd-hud-top > .cd-toast { grid-column: 1 / -1; }
.cd-counts { width: 100%; max-width: 330px; justify-self: start; justify-content: space-around; overflow: hidden; padding: 0 4px; }
.cd-count { flex: 1 1 0; min-width: 0; padding: 0 3px; }
.cd-count .v, .cd-count .l { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-count .v { justify-content: center; }
.cd-top-right { margin-left: 0; }
@media (max-width: 400px) {
  .cd-count b { font-size: 13px; }
  .cd-count small { font-size: 9.5px; }
  .cd-count .l { font-size: 8.5px; letter-spacing: 0; }
  .cd-count .v > span[aria-hidden], .cd-count .cd-dot { display: none; }   /* the labels say it; numbers get the room */
  .cd-top-right .cd-btn:not(.cd-icon) { padding: 0 8px; }
}
