/* Vila Sabor — game UI (v4 look, minimal HUD per docs/UX.md).
   Builds on hud-v4.css (tokens, glossy/press primitives, plaque, dock, cards, panels, toasts) and adds
   what the real game needs: boot + login, decorate dock panel, popovers, tooltip, drawer, quests,
   settings, forms, floating texts and the phone layout. */

/* ---- base ---------------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2b1a10; }
body { font-family: var(--vs-font); color: var(--vs-ink); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex: none; }
#app { position: fixed; inset: 0; }
.stage { position: absolute; inset: 0; background: linear-gradient(#BFE3F2, #FCE9D2); touch-action: none; }
.stage canvas { display: block; outline: none; }
.stage.pointer canvas { cursor: pointer; }
body.paint-mode .stage canvas { cursor: crosshair; }
.vs-ico.is-sm { --s: 1.1em; }
.sheet-host, .popover-host, .modal-host { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.sheet-host > *, .popover-host > *, .modal-host > * { pointer-events: auto; }
.modal-host { z-index: 70; }
.popover-host { z-index: 30; }
.vs-hud .vs-tool[disabled] { opacity: .45; pointer-events: none; }
.vs-hud .vs-tool.is-off .vs-tool-disc { filter: grayscale(.8) brightness(.95); }

/* ---- boot ---------------------------------------------------------------------------------------------------- */
.vs-boot {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 38%, #FFD98A, #FF9F43 45%, #C9562A 100%);
  transition: opacity .38s ease;
}
.vs-boot.fade { opacity: 0; pointer-events: none; }
.vs-boot-card { display: grid; justify-items: center; gap: 14px; padding: 24px; text-align: center; }
.vs-boot-card p { margin: 0; font-size: 24px; font-weight: 700; }
.vs-boot-logo { filter: drop-shadow(0 5px 0 rgba(58, 36, 24, .5)); animation: vs-bob 1.6s ease-in-out infinite; }
.noscript { position: fixed; inset: 20%; padding: 24px; background: #FFF7E8; border: 4px solid var(--vs-ink); border-radius: 24px; }

/* ---- HUD additions ------------------------------------------------------------------------------------------- */
.vs-net { --vs-lift: 2px; color: #fff; text-shadow: var(--vs-ts-sm); }
.vs-net > .vs-ico { --s: 28px; }
.vs-coins.is-bump, .vs-lvl-star.is-bump { animation: vs-bump .45s var(--vs-ease-pop); }
.vs-coins.is-drop.is-bump { animation: vs-wiggle .4s var(--vs-ease); }
.vs-plaque-owner { font-size: 12.5px; font-weight: 600; color: var(--vs-ink-2); white-space: nowrap; }
.vs-like { align-self: flex-end; min-height: 40px; --vs-lift: 3px; }
.vs-like .vs-ico { --s: 26px; margin-left: -6px; }
.vs-like.is-liked { filter: saturate(.7) brightness(1.05); }
.vs-tr { align-items: flex-end; }
.vs-watchers .vs-faces { display: inline-flex; }
.vs-watchers .vs-faces > .vs-ico { --s: 26px; margin-left: -6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--vs-ink); }
.vs-watchers .vs-faces > .vs-ico:first-child { margin-left: 0; }
/* on a dock button only the disc bobs, so its label stays on the same baseline as the others; it stays under the
   plate's glaze line (6px above the disc: a 3px lift + 4% growth), and an active disc only breathes, so its ring
   (5px) never crosses the line */
.is-hint:not(.vs-tool) { animation: vs-hint 1.1s var(--vs-ease) infinite; }
.vs-tool.is-hint .vs-tool-disc { animation: vs-hint-disc 1.1s var(--vs-ease) infinite; }
.vs-tool.is-hint.is-active .vs-tool-disc, .vs-tool.is-hint[aria-pressed="true"] .vs-tool-disc { animation-name: vs-hint-ring; }
@keyframes vs-hint-disc { 0%, 100% { transform: none; } 50% { transform: translateY(-3px) scale(1.04); } }
@keyframes vs-hint-ring { 0%, 100% { transform: none; } 50% { transform: scale(1.025); } }
.vs-tool.is-hint::before {
  content: ""; position: absolute; left: 50%; top: -30px; z-index: 4; width: 0; height: 0; margin-left: -11px; /* centred: vs-bob owns transform */
  border: 11px solid transparent; border-top: 16px solid #FFC531;
  filter: drop-shadow(0 3px 0 var(--vs-ink)); animation: vs-bob .8s ease-in-out infinite;
}
@keyframes vs-hint { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.06); } }
/* the active tool's ring lives in hud-v4.css (.vs-tool.is-active) */
.vs-dock { gap: 6px; }
.vs-buildbar .vs-tool { width: 74px; }

/* decorate / help banner */
.vs-mode {
  position: absolute; left: 50%; top: calc(var(--vs-top) + 74px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; max-width: min(640px, calc(100vw - 2 * var(--vs-gutter)));
  padding: 6px 6px 6px 18px; border-radius: 999px; --vs-lift: 3px;
  color: #fff; text-shadow: var(--vs-ts-sm); font-size: 15px; font-weight: 600; line-height: 1.2;
  animation: vs-drop-in .35s var(--vs-ease-pop) both;
}
.vs-mode-close { --vs-cam: 34px; flex: none; }
.vs-hud.is-build .vs-level, .vs-hud.is-build .vs-tr { opacity: .92; }
.vs-hud.is-build ~ .vs-toasts { top: calc(var(--vs-top) + 128px); }

/* ---- floating texts ------------------------------------------------------------------------------------------- */
.floats { position: fixed; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.float { position: absolute; left: 0; top: 0; will-change: transform; }
.float-inner {
  display: block; transform: translate(-50%, -100%); font: 700 24px/1 var(--vs-font); color: #FFE27A; white-space: nowrap;
  -webkit-text-stroke: 5px var(--vs-ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--vs-ink);
  animation: float-rise 1.1s var(--vs-ease) forwards;
}
.float.xp .float-inner { color: #6BE6DC; font-size: 21px; }
.float.fame .float-inner { color: #FF97AE; font-size: 26px; }
.float.help .float-inner { color: #96E668; font-size: 21px; }
.float.bad .float-inner { color: #FF8371; font-size: 20px; }
.float.small .float-inner { font-size: 17px; -webkit-text-stroke-width: 4px; }
.float.slow .float-inner { animation-duration: 1.5s; }
@keyframes float-rise {
  0% { opacity: 0; transform: translate(-50%, -100%) scale(.6); }
  20% { opacity: 1; transform: translate(-50%, -120%) scale(1.15); }
  35% { transform: translate(-50%, -130%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, calc(-100% - 52px)) scale(1); }
}

/* ---- tooltip (hoverinfo) -------------------------------------------------------------------------------------- */
.vs-tip {
  position: fixed; left: 0; top: 0; z-index: 35; pointer-events: none; display: grid; gap: 1px; max-width: 280px;
  padding: 6px 12px 7px; border-radius: 14px; border: 2.5px solid var(--vs-ink);
  background: linear-gradient(180deg, #FFFFFF, #FFF1D6); box-shadow: 0 3px 0 var(--vs-ink), var(--vs-soft);
  font: 600 14px/1.2 var(--vs-font); color: var(--vs-ink);
}
.vs-tip small { font-size: 12px; font-weight: 500; color: var(--vs-ink-2); }
.vs-tip.bad { background: linear-gradient(180deg, #FFE1DC, #FFC2B8); }

/* ---- popover (world anchored) --------------------------------------------------------------------------------- */
.vs-pop {
  position: fixed; left: 0; top: 0; z-index: 30; display: grid; gap: 6px; min-width: 190px; max-width: 270px;
  padding: 10px 12px 12px; border-radius: 20px; border: 3px solid var(--vs-ink);
  background: linear-gradient(180deg, #FFFFFF, #FFF1D6); box-shadow: 0 4px 0 var(--vs-ink), var(--vs-soft);
  font-family: var(--vs-font); color: var(--vs-ink); animation: vs-fade .18s ease both;
}
.vs-pop::after {
  content: ""; position: absolute; left: var(--arrow-x, 50%); bottom: -12px; width: 18px; height: 18px; margin-left: -9px;
  background: #FFF1D6; border: 3px solid var(--vs-ink); border-top: 0; border-left: 0; transform: rotate(45deg); border-radius: 0 0 5px 0;
}
.vs-pop.below::after { bottom: auto; top: -12px; transform: rotate(-135deg); background: #fff; }
.vs-pop-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; display: grid; place-items: center; }
.vs-pop-x .vs-ico { --s: 26px; }
.vs-pop-title { padding-right: 26px; font-size: 17px; font-weight: 700; line-height: 1.1; }
.vs-pop-sub { font-size: 13.5px; font-weight: 500; color: var(--vs-ink-2); line-height: 1.25; }
.vs-pop-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.vs-pop-actions .vs-btn { flex: 1 1 auto; }
.vs-tints { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 2px 0; }
.vs-tint { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 3px solid var(--vs-ink); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18); cursor: pointer; }
.vs-tint.is-on { outline: 3px solid #FFB020; outline-offset: 2px; }
.vs-tint-note { margin: 0; text-align: center; font-size: 13.5px; font-weight: 600; }
.vs-tint-note .vs-ico { --s: 1.1em; vertical-align: -0.15em; }
.vs-shop-cols { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.vs-shop-cols .vs-btn { flex: 0 0 auto; white-space: nowrap; }
/* Depósito and Álbum cards (shop.js) */
.vs-tint-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--vs-ink); margin-right: 3px; vertical-align: -1px; }
.vs-album-art { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.vs-album-n { font-weight: 900; font-size: 22px; line-height: 1; color: var(--vs-ink); text-shadow: 0 2px 0 #fff8; }
.vs-album-bar { width: 78%; height: 9px; border-radius: 9px; background: #fff9; border: 2px solid var(--vs-ink); overflow: hidden; }
.vs-album-bar > i { display: block; height: 100%; background: var(--vs-leaf, #5ab552); }
.vs-album-marks li { opacity: .45; }
.vs-album-marks li.is-on { opacity: 1; }
.vs-panel.is-dock .vs-album-marks li:nth-child(n+3) { display: flex; }
.vs-prog { position: relative; height: 16px; border-radius: 999px; border: 2.5px solid var(--vs-ink); background: #F3DDB8; overflow: hidden; }
.vs-prog > i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(180deg, #96E668, #52B848 60%, #2E8A2B); transition: width .2s linear; }
.vs-prog.is-ready > i { background: linear-gradient(180deg, #FFE88A, #FFC531 60%, #E58E0E); }
.vs-prog.is-spoil > i { background: linear-gradient(180deg, #FF8371, #E8453C 60%, #B8261F); }
.vs-prog-row { font-size: 13px; font-weight: 600; color: var(--vs-ink-2); }

/* ---- panels: variants ----------------------------------------------------------------------------------------- */
/* sheets with tabs: as tall as their max-height allows, whatever the tab shows (max-height clamps this) */
.vs-panel.is-fixed { height: 100vh; height: 100dvh; }
.vs-panel.is-wide { width: min(960px, calc(100vw - 2 * var(--vs-gutter))); }
.vs-panel.is-narrow { width: min(520px, calc(100vw - 2 * var(--vs-gutter))); }
/* tablets and small laptops: a centred side sheet (Missões, Menu…) would reach down onto the bottom-right dock, so it is
   centred in the band between the wallet row and the dock's top instead (same pop-in; the -48% centring is kept).
   Below 1340px the 520px sheet and the 384px dock overlap horizontally; short screens keep the full height. */
@media (min-width: 641px) and (max-width: 1339px) and (min-height: 561px) {
  .vs-panel.is-narrow {
    --band: calc(100vh - var(--vs-top) - 52px - var(--vs-bottom) - var(--vs-dock-h) - 12px);
    top: calc(var(--vs-top) + 52px + .48 * var(--band));
    max-height: min(620px, var(--band));
  }
}
/* decorate-mode shop: centred, narrow enough to clear the zoom rail on the right; it stands --dock-gap above the
   build bar (room for the tutorial arrow over Loja) and reaches up to just under the warning banner (top + 74px,
   52px tall), never taller than 760px. Categories are a side menu on the left, the cards scroll on the right. */
.vs-panel.is-dock {
  --dock-gap: 40px;
  --dock-top: calc(var(--vs-top) + 136px);
  top: auto; bottom: calc(var(--vs-bottom) + var(--vs-dock-h) + var(--dock-gap)); transform: translateX(-50%);
  width: min(980px, calc(100vw - 2 * var(--vs-gutter) - 2 * var(--vs-cam) - 40px));
  max-height: min(760px, calc(100vh - var(--dock-top) - var(--vs-bottom) - var(--vs-dock-h) - var(--dock-gap)));
  max-height: min(760px, calc(100dvh - var(--dock-top) - var(--vs-bottom) - var(--vs-dock-h) - var(--dock-gap)));
  display: grid; grid-template-columns: 176px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  animation: vs-rise .32s var(--vs-ease-pop) both; z-index: 20;
}
.vs-panel.is-dock > .vs-panel-head { grid-column: 1 / -1; }
.vs-panel.is-dock .vs-panel-head { padding-top: 8px; padding-bottom: 8px; }
.vs-panel.is-dock .vs-panel-head > .vs-ico { --s: 46px; margin: -12px 0 -12px -4px; }
.vs-panel.is-dock .vs-panel-title h2 { font-size: 22px; }
.vs-panel.is-dock > .vs-shop-nav { display: flex; flex-direction: column; min-height: 0; border-right: 3px solid rgba(154, 90, 44, .22); }
.vs-panel.is-dock .vs-shop-nav > .vs-tabs {
  flex: 1; min-height: 0; flex-direction: column; gap: 7px; margin: 0; padding: 12px 10px 14px 12px;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
}
.vs-panel.is-dock .vs-tab { min-height: 38px; padding: 4px 14px; border-radius: 14px; font-size: 15px; line-height: 1.1; white-space: normal; text-align: left; justify-content: flex-start; }
.vs-panel.is-dock .vs-tab[aria-selected="true"] { transform: translateX(3px); }
.vs-panel.is-dock .vs-panel-body { padding: 12px 14px 14px; }
.vs-panel.is-dock .vs-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 4px 2px 8px; gap: 12px; }
/* a card not built yet (LazyGrid): holds a card's height so the scroll bar and the position stay right */
.vs-card-slot { min-height: 200px; border-radius: 18px; background: rgba(255, 255, 255, .35); }
.vs-panel.is-dock .vs-panel-body { overflow-y: auto; } /* a short screen scrolls the cards instead of cutting their buttons */
.vs-panel.is-dock .vs-card { gap: 5px; padding: 7px 7px 8px; border-radius: 18px; }
/* a card's full-width button (Comprar + price, Pincel + price per tile) keeps its text inside on a narrow card */
.vs-card .vs-btn.block { padding-left: 6px; padding-right: 6px; gap: 4px; }
.vs-panel.is-dock .vs-card-art { height: 66px; border-radius: 13px; }
.vs-panel.is-dock .vs-card-art::after { bottom: 5px; height: 8px; }
.vs-panel.is-dock .vs-card-art > .vs-ico, .vs-panel.is-dock .vs-card-art > img { --s: 60px; }
.vs-panel.is-dock .vs-card h3 { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-panel.is-dock .vs-stats { display: flex; gap: 3px; overflow: hidden; }
.vs-panel.is-dock .vs-stats li { font-size: 11.5px; padding: 1px 5px 1px 2px; }
.vs-panel.is-dock .vs-stats li:nth-child(n+3) { display: none; }
.vs-panel.is-dock .vs-owned { font-size: 11.5px; margin: -3px 2px -2px; }
.vs-panel.is-dock .vs-panel-note { margin-bottom: 6px; padding: 3px 10px 3px 4px; font-size: 13px; }
.vs-panel.is-dock .vs-subtabs { margin-bottom: 4px; }
/* while a piece is being placed or the brush is on, the shop hides whole and comes back when it ends (shop.js collapse) */
.vs-panel.is-dock.is-collapsed { display: none; }
/* tutorial: the arrow that bobs over Loja in the build bar (phone layout keeps the banner and the shop above it) */
body:has(#buildbar .is-hint) { --vs-hint-h: 30px; }
.vs-panel .vs-panel-head .vs-panel-title { flex: 1; }

/* modal */
.vs-modal-back { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(40, 18, 6, .45); animation: vs-fade .2s ease both; }
.vs-panel.is-modal { position: relative; left: auto; top: auto; transform: none; width: min(440px, 100%); max-height: calc(100vh - 32px); animation: vs-bump .32s var(--vs-ease-pop) both; }
.vs-panel.is-modal .vs-panel-title h2 { font-size: 22px; white-space: normal; }
.vs-panel.is-modal .vs-panel-head > .vs-ico { --s: 50px; }
.vs-modal-emoji { font-size: 34px; line-height: 1; margin: -8px 0; }
.vs-modal-text { margin: 0 0 10px; font-size: 16px; font-weight: 500; line-height: 1.35; color: var(--vs-ink-2); }
.vs-modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 0 18px 18px; }
.vs-panel-body p { line-height: 1.35; }

/* ---- forms ---------------------------------------------------------------------------------------------------- */
.vs-form { display: grid; gap: 12px; }
.vs-field { display: grid; gap: 4px; font-size: 14px; font-weight: 600; color: var(--vs-ink-2); }
.vs-field em { font-style: normal; font-weight: 500; opacity: .8; }
.vs-field input, .vs-field select, .vs-field textarea, .vs-input {
  width: 100%; min-height: 44px; padding: 8px 14px; border-radius: 14px; border: 2.5px solid var(--vs-ink);
  background: #fff; box-shadow: inset 0 3px 0 rgba(224, 154, 79, .2); font: 600 16px/1.2 var(--vs-font); color: var(--vs-ink); outline: none;
}
.vs-field textarea { min-height: 70px; resize: vertical; }
.vs-field input:focus, .vs-input:focus, .vs-field select:focus, .vs-field textarea:focus { box-shadow: 0 0 0 3px #FFC531, inset 0 3px 0 rgba(224, 154, 79, .2); }
.vs-field input[aria-invalid="true"] { border-color: #B8261F; background: #FFF2EF; }
.pw { position: relative; display: block; }
.pw input { padding-right: 48px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; cursor: pointer; color: var(--vs-ink-2); display: grid; place-items: center; }
.field-hint { font-size: 12.5px; font-weight: 500; opacity: .8; }
.vs-rank-note { margin: 14px 4px 4px; text-align: center; }
.field-err, .form-error { font-size: 13.5px; font-weight: 600; color: #B8261F; margin: 0; }
.form-ok { margin: 0; padding: 8px 12px; border-radius: 12px; background: #E3F7DA; color: #1F6B1C; font-size: 14px; font-weight: 600; }
.link-btn { padding: 0; border: 0; background: none; color: var(--vs-blue); font: 700 14px var(--vs-font); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.vs-btn.vs-big { min-height: 50px; font-size: 19px; }
.vs-btn.busy { pointer-events: none; opacity: .75; }
.vs-row { display: flex; align-items: center; gap: 10px; }
.vs-row > .vs-grow { flex: 1; min-width: 0; }

/* ---- login / register / forgot / reset ------------------------------------------------------------------------- */
.vs-auth {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; overflow-y: auto;
  background:
    radial-gradient(rgba(255, 255, 255, .18) 2px, transparent 2.6px) 0 0 / 26px 26px,
    radial-gradient(circle at 50% 30%, #FFD98A, #FF9F43 45%, #C9562A 100%);
}
.vs-auth-card {
  width: min(430px, 100%); display: grid; gap: 14px; padding: 22px 22px 18px; border-radius: 30px; border: 4px solid var(--vs-ink);
  background: radial-gradient(rgba(224, 154, 79, .14) 2px, transparent 2.6px) 0 0 / 22px 22px, linear-gradient(180deg, #FFF9EC, #FFEFD2);
  box-shadow: 0 6px 0 var(--vs-ink), 0 30px 60px -10px rgba(40, 16, 4, .6); animation: vs-bump .4s var(--vs-ease-pop) both;
}
.vs-auth-brand { display: flex; align-items: center; gap: 12px; }
.vs-auth-brand img { filter: drop-shadow(0 4px 0 rgba(58, 36, 24, .45)); }
.vs-auth-brand h1 { margin: 0; font-size: 38px; font-weight: 700; line-height: 1; }
.vs-auth-tag { margin: 4px 0 0; font-size: 15px; font-weight: 600; color: var(--vs-ink-2); }
.vs-auth-tabs { display: flex; gap: 8px; }
.vs-auth-tabs .vs-tab { flex: 1; }
.vs-auth-note { margin: 0; padding: 8px 12px; border-radius: 12px; background: #FFF4CF; border: 2px dashed #E09A4F; font-size: 14px; font-weight: 600; }
.vs-auth-foot { margin: 0; text-align: center; font-size: 14px; font-weight: 500; color: var(--vs-ink-2); }
.vs-auth-text { margin: 0; font-size: 15px; font-weight: 500; color: var(--vs-ink-2); line-height: 1.35; }

/* ---- lists (drawer, quests, staff, settings) ------------------------------------------------------------------ */
.vs-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.vs-item {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 18px;
  border: 2.5px solid var(--vs-ink); background: linear-gradient(180deg, #FFFFFF, #FFF5E2); box-shadow: 0 3px 0 var(--vs-ink);
}
.vs-item > .vs-avatar-face, .vs-item > .vs-ico { --s: 44px; border-radius: 50%; }
.vs-item > .vs-avatar-face { box-shadow: 0 0 0 2.5px var(--vs-ink); }
.vs-item-text { flex: 1; min-width: 0; display: grid; gap: 1px; line-height: 1.15; }
.vs-item-text b { font-size: 16px; font-weight: 700; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.vs-item-text small { font-size: 13px; font-weight: 500; color: var(--vs-ink-2); overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.vs-item-nick { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.vs-item-acts { display: flex; gap: 6px; flex: none; }
.vs-item .vs-on { position: absolute; left: 40px; top: 38px; width: 13px; height: 13px; border-radius: 50%; background: #52B848; border: 2.5px solid var(--vs-ink); }
.vs-item.is-me { background: linear-gradient(180deg, #FFFBE6, #FFE9B0); }
.vs-pos { flex: none; width: 34px; text-align: center; font-size: 18px; font-weight: 700; }
.vs-pos.top1 { color: #E58E0E; } .vs-pos.top2 { color: #7F8DA6; } .vs-pos.top3 { color: #B86E35; }
.vs-score { flex: none; font-size: 15px; font-weight: 700; }
.vs-item-text small .vs-score { font-size: inherit; }
.vs-empty { padding: 18px 10px; text-align: center; font-size: 15px; font-weight: 600; color: var(--vs-ink-2); }
.vs-empty .vs-ico { --s: 54px; display: block; margin: 0 auto 6px; }
.vs-empty > .vs-btn { display: flex; margin: 10px auto 0; }
.vs-sec { margin: 6px 2px 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--vs-wood); }
.vs-sec:not(:first-child) { margin-top: 16px; }
.vs-sec-row { justify-content: space-between; margin: 8px 0 12px; }
.vs-sec-row > .vs-sec { margin: 0 2px; }

/* ---- drawer (Vizinhos) ---------------------------------------------------------------------------------------- */
.vs-drawer {
  position: fixed; z-index: 25; left: var(--vs-gutter); top: calc(var(--vs-top) + 76px); bottom: calc(var(--vs-bottom) + var(--vs-dock-h) + 12px);
  width: min(370px, calc(100vw - 2 * var(--vs-gutter))); display: flex; flex-direction: column;
  border-radius: 26px; border: 4px solid var(--vs-ink); font-family: var(--vs-font); color: var(--vs-ink);
  background: radial-gradient(rgba(224, 154, 79, .14) 2px, transparent 2.6px) 0 0 / 22px 22px, linear-gradient(180deg, #FFF9EC, #FFEFD2);
  box-shadow: 0 6px 0 var(--vs-ink), 0 24px 50px -12px rgba(40, 16, 4, .6); animation: vs-drawer-in .32s var(--vs-ease-pop) both;
}
@keyframes vs-drawer-in { from { opacity: 0; transform: translateX(-30px); } }
/* the dock lives in the bottom-right corner: where both fit side by side (370px drawer + 336px dock + gaps ≈ 750px),
   the drawer runs down to the dock's baseline; narrower, it stops above the dock's top */
@media (min-width: 760px) { .vs-drawer { bottom: calc(var(--vs-bottom) + 2px); } }
.vs-drawer .vs-panel-head { border-radius: 22px 22px 0 0; padding: 8px 58px 8px 12px; }
.vs-drawer .vs-panel-head > .vs-ico { --s: 46px; margin: -12px 0 -12px -2px; }
.vs-drawer .vs-panel-title h2 { font-size: 22px; }
.vs-drawer .vs-close { --vs-cam: 42px; top: -12px; right: -12px; }
.vs-drawer .vs-tabs { padding: 10px 10px 12px; gap: 6px; }
.vs-drawer .vs-tab { min-height: 34px; padding: 0 11px; font-size: 14px; }
.vs-drawer .vs-tab .vs-badge { top: -9px; right: -7px; min-width: 20px; height: 20px; font-size: 11px; }
.vs-drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px 14px; overscroll-behavior: contain; }
.vs-search { display: flex; gap: 6px; margin-bottom: 10px; }
.vs-search .vs-input { min-height: 38px; font-size: 15px; }
.vs-invite { display: grid; gap: 6px; margin-top: 12px; padding: 10px; border-radius: 16px; border: 2.5px dashed rgba(154, 90, 44, .55); background: rgba(255, 255, 255, .6); font-size: 14px; font-weight: 600; }
.vs-subtabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.vs-subtabs .vs-btn { flex: 1; }

/* ---- quests --------------------------------------------------------------------------------------------------- */
.vs-q { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px 10px 8px; border-radius: 18px; border: 2.5px solid var(--vs-ink); background: linear-gradient(180deg, #FFFFFF, #FFF5E2); box-shadow: 0 3px 0 var(--vs-ink); }
.vs-q > .vs-ico { --s: 44px; }
.vs-q-text { display: grid; gap: 4px; min-width: 0; }
.vs-q-text b { font-size: 16px; font-weight: 700; line-height: 1.1; }
.vs-q-text small { font-size: 13px; font-weight: 500; color: var(--vs-ink-2); line-height: 1.25; }
.vs-q-bar { position: relative; height: 14px; border-radius: 999px; border: 2px solid var(--vs-ink); background: #F3DDB8; overflow: hidden; }
.vs-q-bar > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #BE97FF, #8E5BD6 60%, #6338AE); }
.vs-q-bar > span { position: relative; display: block; text-align: center; font-size: 10.5px; font-weight: 700; line-height: 10px; color: #fff; text-shadow: var(--vs-ts-sm); }
.vs-q-rew { display: flex; gap: 6px; font-size: 13px; font-weight: 700; color: var(--vs-ink-2); }
.vs-q-rew span { display: inline-flex; align-items: center; gap: 2px; }
.vs-q-rew .vs-ico { --s: 18px; }
.vs-q.is-ready { background: linear-gradient(180deg, #FFFBE6, #FFE9B0); box-shadow: 0 0 0 3px #FFC531, 0 3px 0 4px var(--vs-ink); }
.vs-q.is-claimed { opacity: .6; }
.vs-q.is-tut { border-width: 3px; }
.vs-celebrate { position: fixed; z-index: 75; left: 50%; top: 42%; pointer-events: none; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; animation: vs-celebrate 1.6s var(--vs-ease) forwards; }
.vs-celebrate > .vs-ico { --s: 120px; filter: drop-shadow(0 6px 0 rgba(58, 36, 24, .45)); }
.vs-celebrate b { font-size: 30px; font-weight: 700; }
.vs-celebrate small { font-size: 20px; font-weight: 700; color: #FFE27A; text-shadow: var(--vs-ts); }
.vs-celebrate i.burst { position: absolute; left: 50%; top: 40%; width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--vs-ink); animation: vs-confetti 1.2s var(--vs-ease) forwards; }
@keyframes vs-celebrate { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } 30% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -62%) scale(1); } }
@keyframes vs-confetti { 0% { transform: translate(-50%, -50%) rotate(0); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--r)); opacity: 0; } }

/* ---- shop / café panel / swatches ------------------------------------------------------------------------------ */
.vs-card-art > img { image-rendering: auto; }
.vs-card-emoji { position: relative; z-index: 1; font-size: 58px; line-height: 1; filter: drop-shadow(0 3px 0 rgba(58, 36, 24, .35)); }
/* locked recipe with emoji art (no v4 sticker for its shape): greyed like the sticker cards */
.vs-card.is-locked .vs-card-art > .vs-card-emoji { filter: grayscale(1) brightness(1.08) contrast(.7) drop-shadow(0 3px 0 rgba(58, 36, 24, .2)); opacity: .55; }
a.vs-btn { text-decoration: none; }
.vs-tab.is-hint { box-shadow: 0 0 0 3px #FFC531, 0 0 14px 4px rgba(255, 197, 49, .75); }
.vs-card .vs-card-sub { margin: -4px 2px 0; font-size: 12.5px; font-weight: 600; color: var(--vs-ink-2); }
.vs-card.is-current { box-shadow: 0 0 0 3px #52B848, 0 4px 0 3px var(--vs-ink); }
.vs-swatch { position: relative; z-index: 1; width: 78%; height: 70%; border-radius: 12px; border: 2.5px solid var(--vs-ink); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .15); }
.vs-paintbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--vs-ink-2); }
.vs-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 0 0 14px; }
.vs-kv div { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 6px; border-radius: 14px; background: #FFF0D2; box-shadow: inset 0 0 0 1.5px rgba(154, 90, 44, .35); font-size: 14px; font-weight: 600; min-width: 0; }
.vs-kv .vs-ico { --s: 26px; }
.vs-kv b { font-size: 16px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* five stars and a number share one cell: small stars so a narrow sheet (the visited café's menu) still fits "Nv 12" */
.vs-kv .vs-stars { flex: none; }
.vs-kv .vs-stars .vs-ico { --s: 18px; margin-right: -1px; }

/* ---- popularity parts (café panel; docs/design/POPULARIDADE.md) ---------------------------------------------- */
.vs-popm { display: grid; gap: 6px; margin: 0 0 10px; }
.vs-popm-row { display: grid; grid-template-columns: auto 92px 1fr auto; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 14px; background: #FFF0D2; box-shadow: inset 0 0 0 1.5px rgba(154, 90, 44, .35); font-size: 14px; font-weight: 600; }
.vs-popm-row .vs-ico { --s: 24px; }
.vs-popm-row b { font-size: 14px; white-space: nowrap; min-width: 58px; text-align: right; }
.vs-popm-row.is-total { background: #fff; box-shadow: inset 0 0 0 2px var(--vs-ink); }
.vs-popm-cap { margin: -2px 6px 0; font-size: 12.5px; font-weight: 600; color: var(--vs-ink-2); }
.vs-popm-bar { position: relative; height: 12px; border-radius: 999px; background: rgba(58, 36, 24, .12); box-shadow: inset 0 0 0 2px var(--vs-ink); overflow: hidden; }
.vs-popm-bar > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(var(--c-hi, #fff), var(--c, #ccc)); box-shadow: inset 0 0 0 2px var(--vs-ink); transition: width .4s var(--vs-ease); }
.vs-panel-note.is-warn { background: #FFE1DC; box-shadow: inset 0 0 0 1.5px var(--vs-tomato); }

/* ---- the café panel's numbers open their explanation (cafehelp.js) ------------------------------------------- */
.vs-kv .is-tap, .vs-popm-row.is-tap { cursor: pointer; transition: transform .12s var(--vs-ease), box-shadow .12s; }
.vs-kv .is-tap:hover, .vs-popm-row.is-tap:hover { box-shadow: inset 0 0 0 2px var(--vs-wood); }
.vs-kv .is-tap:active, .vs-popm-row.is-tap:active { transform: scale(.98); }
.vs-kv .is-tap:focus-visible, .vs-popm-row.is-tap:focus-visible { outline: 3px solid var(--vs-blue, #2F6F8F); outline-offset: 2px; }
.vs-help-hint { display: flex; align-items: center; gap: 6px; margin: -4px 2px 8px; font-size: 13px; font-weight: 600; color: var(--vs-ink-2); }
.vs-help-hint .ico { width: 16px; height: 16px; flex: none; }
.vs-help { display: grid; gap: 12px; max-width: 480px; }
.vs-help-now { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px 8px 8px; border-radius: 14px; background: #FFF0D2; box-shadow: inset 0 0 0 1.5px rgba(154, 90, 44, .35); font-size: 15px; font-weight: 700; line-height: 1.3; }
.vs-help-now .vs-ico { --s: 28px; flex: none; }
.vs-help section { display: grid; gap: 4px; }
.vs-help section.is-alt { padding: 8px 12px; border-radius: 14px; background: #E6F2F7; box-shadow: inset 0 0 0 1.5px rgba(47, 111, 143, .35); }
.vs-help h3 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--vs-wood); }
.vs-help p, .vs-help li { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--vs-ink-2); }
.vs-help ul { display: grid; gap: 4px; margin: 0; padding-left: 20px; }
.vs-help b { font-weight: 700; color: var(--vs-ink); }
.vs-stars.is-falling::after { content: ''; display: inline-block; align-self: center; width: 0; height: 0; margin-left: 8px; border: 6px solid transparent; border-top: 9px solid var(--vs-tomato); border-bottom: 0; filter: drop-shadow(0 1px 0 var(--vs-ink)); }

/* ---- expansion / staff requirements --------------------------------------------------------------------------- */
.vs-reqs { display: grid; gap: 8px; margin: 10px 0 14px; padding: 0; list-style: none; }
.vs-reqs li { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 16px; border: 2.5px solid var(--vs-ink); background: #fff; font-size: 15px; font-weight: 600; }
.vs-reqs li .vs-ico { --s: 30px; }
.vs-reqs li .vs-grow { flex: 1; }
.vs-reqs li.ok { background: #EAF9E2; }
.vs-reqs li.bad { background: #FFF0EC; }
.vs-reqs .vs-mark { --s: 26px; }
.vs-req-note { margin: -6px 0 12px; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--vs-ink-2); }
.vs-big-size { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 4px 0 6px; font-size: 26px; font-weight: 700; }
.vs-big-size .vs-ico { --s: 48px; }
.vs-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.vs-box { padding: 12px; border-radius: 20px; border: 3px solid var(--vs-ink); background: linear-gradient(180deg, #FFFFFF, #FFF5E2); box-shadow: 0 4px 0 var(--vs-ink); }
.vs-box h3 { margin: 0 0 4px; font-size: 19px; }
.vs-box p { margin: 0 0 6px; font-size: 14px; font-weight: 500; color: var(--vs-ink-2); }

/* ---- settings ------------------------------------------------------------------------------------------------- */
.vs-set { display: grid; gap: 10px; }
.vs-set-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 2px rgba(154, 90, 44, .3); font-size: 15px; font-weight: 600; }
.vs-set-row > .vs-ico { --s: 34px; }
.vs-set-row > span { flex: 1; min-width: 0; }
.vs-set-row small { display: block; font-size: 12.5px; font-weight: 500; color: var(--vs-ink-2); }
.vs-set-row input[type="range"] { width: 130px; accent-color: #FF8A2A; }
.vs-seg { display: inline-flex; gap: 4px; }
.vs-seg .vs-btn { min-height: 32px; padding: 0 10px; font-size: 13.5px; }

/* ---- phone ---------------------------------------------------------------------------------------------------- */
@media (max-width: 640px) {
  /* decorate banner: under the café plaque (not over its stars), as wide as the screen allows (left: 50% alone would
     shrink it to half the width and wrap it into three lines) */
  .vs-mode { top: calc(var(--vs-top) + 142px); width: max-content; font-size: 13.5px; padding-left: 12px; }
  .vs-tr { flex-direction: column; }
  .vs-like { min-height: 34px; padding: 0 12px; font-size: 14px; }
  .vs-hud.is-visiting .vs-tr { display: flex; }
  .vs-buildbar { grid-template-columns: repeat(5, 1fr) !important; }
  .vs-buildbar .vs-tool { width: auto; }
  .vs-buildbar .vs-dock-sep { display: none; }
  /* decorate mode, bottom up: the build bar, the decorate banner (its height is --vs-mode-h, set by hud.js), then the
     shop and the zoom rail; --vs-hint-h makes room for the tutorial arrow over Loja */
  .vs-hud.is-build .vs-mode { top: auto; bottom: calc(var(--vs-bottom) + var(--vs-build-h) + var(--vs-hint-h, 0px) + 8px); }
  .vs-hud.is-build .vs-cam { bottom: calc(var(--vs-bottom) + var(--vs-build-h) + var(--vs-hint-h, 0px) + var(--vs-mode-h, 0px) + 24px); }
  .vs-panel.is-dock {
    --dock-gap: calc(var(--vs-hint-h, 0px) + var(--vs-mode-h, 0px) + 28px);
    left: 6px; right: 6px; width: auto; transform: none; bottom: calc(var(--vs-bottom) + var(--vs-build-h) + var(--dock-gap));
    max-height: min(60vh, calc(100vh - var(--vs-top) - 58px - var(--vs-bottom) - var(--vs-build-h) - var(--dock-gap)));
    max-height: min(60dvh, calc(100dvh - var(--vs-top) - 58px - var(--vs-bottom) - var(--vs-build-h) - var(--dock-gap)));
    grid-template-columns: 92px minmax(0, 1fr);
    border-radius: 22px; border-bottom: 4px solid var(--vs-ink); animation: vs-fade .25s ease both;
  }
  /* the side menu: a narrow column of centred names (two lines at most) */
  .vs-panel.is-dock .vs-shop-nav > .vs-tabs { gap: 6px; padding: 10px 5px 12px 7px; }
  .vs-panel.is-dock .vs-tab { min-height: 40px; padding: 4px 4px; font-size: 13px; text-align: center; justify-content: center; }
  .vs-panel.is-dock .vs-tab[aria-selected="true"] { transform: translateX(2px); }
  .vs-panel.is-dock .vs-panel-body { padding: 10px 8px 12px; }
  .vs-panel.is-modal { left: auto; right: auto; bottom: auto; border-radius: 24px; border-bottom: 4px solid var(--vs-ink); animation: vs-bump .3s var(--vs-ease-pop) both; }
  .vs-panel.is-dock .vs-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  /* a narrow card: a button's price drops under its label and the stats wrap to a second line, instead of being cut */
  .vs-card .vs-btn.block { font-size: 14px; flex-wrap: wrap; row-gap: 2px; padding-top: 3px; padding-bottom: 3px; }
  .vs-card .vs-btn.block .vs-cost { gap: 2px; margin-left: 0; padding-right: 6px; }
  .vs-panel.is-dock .vs-stats { flex-wrap: wrap; }
  /* side sheets (Missões, Cardápio, Menu…): centred with the same 6 px margins as the docked shop, standing on top of
     the dock (which stays visible under the scrim) and under the wallet row */
  .vs-panel.is-narrow, .vs-panel.is-wide {
    left: 6px; right: 6px; width: auto; transform: none;
    top: auto; bottom: calc(var(--vs-bottom) + var(--vs-dock-h) + 6px);
    max-height: calc(100vh - var(--vs-top) - 52px - var(--vs-bottom) - var(--vs-dock-h) - 6px);
    max-height: calc(100dvh - var(--vs-top) - 52px - var(--vs-bottom) - var(--vs-dock-h) - 6px);
    border-radius: 24px; border-bottom: 4px solid var(--vs-ink);
  }
  /* +12px: the drawer's 6px ink shadow keeps a 6px gap above the dock (as at 641-759px) */
  .vs-drawer { left: 6px; right: 6px; width: auto; top: calc(var(--vs-top) + 100px); bottom: calc(var(--vs-bottom) + var(--vs-dock-h) + 12px); }
  .vs-split { grid-template-columns: 1fr; }
  .vs-set-row { flex-wrap: wrap; gap: 8px 10px; }
  .vs-set-row > span { flex: 1 1 55%; }
  .vs-set-row input[type="range"] { flex: 1 1 100%; width: 100%; }
  .vs-set-row .vs-seg { flex: 1 1 100%; justify-content: flex-end; }
  .vs-auth-brand h1 { font-size: 32px; }
  .vs-pop { max-width: 240px; }
}
@media (max-height: 560px) {
  .vs-panel.is-dock { max-height: 52vh; bottom: calc(var(--vs-bottom) + var(--vs-dock-h) + 8px); }
  body:has(#buildbar .is-hint) .vs-panel.is-dock { bottom: calc(var(--vs-bottom) + var(--vs-dock-h) + 38px); }
  .vs-drawer { top: calc(var(--vs-top) + 60px); }
}
@media (prefers-reduced-motion: reduce) {
  .float-inner { animation: float-fade 1.1s linear forwards !important; }
  @keyframes float-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
  .is-hint, .vs-tool.is-hint .vs-tool-disc, .vs-tool.is-hint::before { animation: none; }
}
