/* Olive Virtual — shared HUD styles (store + lounge).
   Black-and-gold, same palette family as experience.php (#0e0f0e / #bb9b49). */
:root {
  --ink: #0d0e0d;
  --ink-2: #161715;
  --panel: rgba(17, 18, 16, .82);
  --panel-solid: #151614;
  --line: rgba(201, 167, 90, .28);
  --line-soft: rgba(255, 255, 255, .09);
  --gold: #d2b26a;
  --gold-2: #bb9b49;
  --gold-ink: #1a1609;
  --text: #f4f0e6;
  --muted: #b8b1a1;
  --ok: #8fd19e;
  --warn: #e8bd62;
  --danger: #f08a7a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .8);
  --display: "Cormorant Garamond", "Times New Roman", serif;
  --ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--text); font-family: var(--ui); -webkit-font-smoothing: antialiased; }
body.app { overflow: hidden; overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }

/* ── buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; letter-spacing: .01em; text-decoration: none;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.gold { background: linear-gradient(180deg, #e2c47e, #bb9b49); color: var(--gold-ink); box-shadow: 0 10px 30px -12px rgba(210, 178, 106, .7); }
.btn.gold:hover:not([disabled]) { background: linear-gradient(180deg, #ecd08d, #c6a654); }
.btn.ghost { background: rgba(255, 255, 255, .04); border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--gold); }
.btn.wa { background: #1faa59; color: #fff; }
.btn.wa:hover { background: #22b960; }
.btn.block { width: 100%; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line-soft); font-weight: 700; font-size: 15px;
}
.icon-btn:hover { border-color: var(--line); }
.pill-btn {
  min-height: 44px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-weight: 600; font-size: 14px;
}
.pill-btn.gold { background: linear-gradient(180deg, #e2c47e, #bb9b49); color: var(--gold-ink); border-color: transparent; }

/* ── loader / welcome ────────────────────────────── */
.screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
#loader {
  background:
    radial-gradient(900px 520px at 70% 10%, rgba(201, 167, 90, .18), transparent 60%),
    radial-gradient(700px 500px at 10% 100%, rgba(111, 123, 74, .18), transparent 60%),
    linear-gradient(180deg, rgba(10, 11, 10, .72), rgba(10, 11, 10, .94));
  transition: opacity .6s ease;
}
#loader.out { opacity: 0; pointer-events: none; }
.loader-card {
  width: min(460px, 100%); padding: 34px 28px 26px; border-radius: 24px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.brand-logo { width: 190px; height: auto; display: block; margin: 0 auto; }
.brand-sub { margin-top: 10px; font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--gold); }
.loader-card h1 { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 6vw, 40px); line-height: 1.05; margin: 22px 0 10px; }
.loader-lead { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 0 20px; }
.progress { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-2), #f0d590); transition: width .3s ease; }
.progress-label { font-size: 12px; color: var(--muted); margin: 8px 0 18px; }
.age-note { font-size: 13px; color: var(--muted); margin: 14px 0 0; line-height: 1.5; }
.age-note a { color: var(--muted); }
.tips { list-style: none; padding: 16px 0 0; margin: 18px 0 0; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.only-touch { display: none; }
.is-touch .only-touch { display: revert; }
.is-touch .only-desktop { display: none; }

/* ── top bar ─────────────────────────────────────── */
.hud { position: fixed; z-index: 20; }
#topbar {
  top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 8px 8px 16px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--line-soft); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.tb-brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: inherit; }
.tb-brand img { width: 120px; height: auto; flex: none; margin: -6px 0; }
.tb-brand span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid var(--line-soft); padding-left: 12px; }
.tb-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.cart-btn { position: relative; }
.cart-btn .count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--gold-ink); color: var(--gold); font-size: 12px; font-weight: 700;
}
.cart-btn.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.12); } }

/* dropdown menu (aisles / camera) */
.menu {
  position: fixed; z-index: 30; top: 76px; right: 12px; width: min(300px, calc(100vw - 24px));
  padding: 8px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-soft);
  box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.menu-title { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); padding: 8px 10px 6px; }
.menu button {
  width: 100%; display: flex; gap: 12px; align-items: center; text-align: left;
  min-height: 48px; padding: 8px 10px; border-radius: 10px; background: none; border: 0;
}
.menu button:hover, .menu button:focus-visible { background: rgba(255, 255, 255, .06); }
.menu button i { font-style: normal; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgba(201, 167, 90, .12); color: var(--gold); font-size: 13px; font-weight: 700; flex: none; }
.menu button b { display: block; font-size: 14px; font-weight: 600; }
.menu button small { display: block; font-size: 12px; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 6px 4px; }

/* ── hint + toast ────────────────────────────────── */
#hint {
  left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%);
  padding: 10px 18px; border-radius: 999px; font-size: 13.5px; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
  background: var(--panel); border: 1px solid var(--line-soft); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#toast {
  position: fixed; z-index: 60; left: 50%; top: 86px; transform: translate(-50%, -10px);
  padding: 12px 18px; border-radius: 12px; font-size: 14px; max-width: calc(100vw - 32px);
  background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── 3D-anchored labels / hotspots ───────────────── */
#labels { position: fixed; inset: 0; z-index: 10; pointer-events: none; overflow: hidden; }
.tag3d {
  position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform;
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 9px; border-radius: 999px;
  background: rgba(14, 15, 13, .78); border: 1px solid var(--line-soft); font-size: 12.5px; white-space: nowrap;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: opacity .2s;
  min-height: 34px;
}
.tag3d .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(143, 209, 158, .18); }
.tag3d.mine .dot { background: var(--gold); box-shadow: 0 0 0 3px rgba(210, 178, 106, .25); }
.tag3d b { font-weight: 700; }
.plus3d {
  position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  background: transparent; border: 0;
}
.plus3d::before {
  content: "+"; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(210, 178, 106, .95); color: var(--gold-ink); font-weight: 800; font-size: 19px; line-height: 1;
  box-shadow: 0 0 0 6px rgba(210, 178, 106, .22), 0 6px 18px rgba(0, 0, 0, .5);
}
.plus3d:hover::before { transform: scale(1.1); }
@media (prefers-reduced-motion: no-preference) {
  .plus3d::before { animation: pulse 2.4s ease-in-out infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(210, 178, 106, .08), 0 6px 18px rgba(0, 0, 0, .5); } }
}

/* ── bottom product card (store) ─────────────────── */
#productCard {
  left: 50%; bottom: calc(16px + var(--safe-b)); transform: translateX(-50%);
  width: min(520px, calc(100vw - 24px)); display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center;
  padding: 12px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
#productCard img { width: 76px; height: 106px; object-fit: cover; border-radius: 10px; background: #000; }
.pc-meta { min-width: 0; }
.pc-cat { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.pc-name { font-family: var(--display); font-size: 22px; line-height: 1.1; margin: 2px 0 4px; font-weight: 600; }
.pc-price { font-size: 15px; font-weight: 700; }
.pc-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pc-actions .btn { min-height: 44px; padding: 0 16px; font-size: 14px; }
.pc-close { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; background: none; color: var(--muted); font-size: 22px; }

/* ── sheets (dialogs) ────────────────────────────── */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: end center;
  background: rgba(5, 6, 5, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
@media (min-width: 760px) { .sheet-wrap { place-items: center; } }
.sheet {
  position: relative; width: min(560px, 100%); max-height: min(92vh, 860px); overflow-y: auto; overscroll-behavior: contain;
  padding: 26px 22px calc(22px + var(--safe-b)); border-radius: 24px 24px 0 0;
  background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow);
  user-select: text; -webkit-user-select: text; touch-action: pan-y;
}
@media (min-width: 760px) { .sheet { border-radius: 24px; padding: 30px 30px 26px; } }
.sheet.small { width: min(440px, 100%); }
.sheet .close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .06); font-size: 22px; }
.eyebrow { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.sheet h2 { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.1; margin: 6px 0 4px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.55; }
.field { margin-top: 18px; }
.field > label, .field .lbl { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.field .req { color: var(--gold); }
.field.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field.row > label { margin: 0; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .field.two { grid-template-columns: 1fr; } }
input[type="text"], input[type="tel"], input[type="email"], textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; font-size: 16px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line-soft); outline: none;
}
input:focus, textarea:focus { border-color: var(--gold); }
input[aria-invalid="true"] { border-color: var(--danger); }
textarea { resize: vertical; min-height: 64px; }
.err { color: var(--danger); font-size: 12.5px; margin-top: 6px; min-height: 0; }
.chips { display: flex; gap: 8px; }
.chips.scroll { overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.chips.wrap { flex-wrap: wrap; }
.chip {
  flex: none; min-height: 44px; min-width: 64px; padding: 6px 14px; border-radius: 12px; font-size: 14px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line-soft); text-align: center; line-height: 1.2;
}
.chip small { display: block; font-size: 11px; color: var(--muted); }
.chip[aria-pressed="true"] { background: rgba(210, 178, 106, .16); border-color: var(--gold); color: #fff; }
.chip[disabled] { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.slot-cap { display: block; font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-soft); border-radius: 999px; padding: 2px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .05); font-size: 20px; }
.stepper output { min-width: 34px; text-align: center; font-weight: 700; font-size: 16px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--muted); margin-top: 16px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--gold-2); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 22px; }
.sheet-actions .btn { flex: 1 1 auto; }
.done-seal { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: rgba(210, 178, 106, .16); color: var(--gold); border: 1px solid var(--line); margin-bottom: 14px; }
dl.summary { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 18px 0; font-size: 14.5px; }
dl.summary dt { color: var(--muted); }
dl.summary dd { margin: 0; font-weight: 600; }
.legal { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 14px; }

/* cart list */
.cart-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.cart-list li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line-soft); }
.cart-list img { width: 52px; height: 72px; object-fit: cover; border-radius: 8px; }
.cart-list .nm { font-weight: 600; font-size: 14px; line-height: 1.3; }
.cart-list .pr { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cart-list .stepper button { width: 36px; height: 36px; font-size: 17px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 15px; }
.cart-total b { font-size: 20px; }
.empty { text-align: center; color: var(--muted); padding: 26px 0 8px; }

/* help */
.help-grid { display: grid; gap: 10px; margin: 16px 0; font-size: 14px; }
kbd { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px; margin-right: 3px; border-radius: 7px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); font-family: var(--ui); font-size: 12px; font-weight: 700; }

/* ── minimap ─────────────────────────────────────── */
#minimap {
  right: 12px; top: 84px; padding: 8px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--line-soft); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#minimap canvas { display: block; width: 180px; height: 150px; border-radius: 10px; cursor: pointer; }
.mm-legend { display: flex; gap: 12px; justify-content: center; font-size: 11px; color: var(--muted); padding-top: 6px; }
.mm-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
@media (max-width: 640px) { #minimap { top: auto; bottom: calc(150px + var(--safe-b)); } #minimap canvas { width: 132px; height: 110px; } .mm-legend { display: none; } }

/* ── mobile joystick ─────────────────────────────── */
#joy {
  position: fixed; z-index: 15; left: 22px; bottom: calc(26px + var(--safe-b)); width: 118px; height: 118px; border-radius: 50%;
  background: rgba(14, 15, 13, .45); border: 1px solid var(--line-soft); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  touch-action: none;
}
#joyKnob { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; background: rgba(210, 178, 106, .85); box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
.is-touch #hint { bottom: calc(160px + var(--safe-b)); }

/* ── cinematic overlay ───────────────────────────── */
#cine { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
#cine .bar { position: absolute; left: 0; right: 0; height: 0; background: #000; transition: height .7s ease; }
#cine .bar.top { top: 0; } #cine .bar.bottom { bottom: 0; }
#cine.on .bar { height: 9vh; }
#caption { position: absolute; left: 0; right: 0; bottom: calc(9vh + 22px); text-align: center; opacity: 0; transition: opacity .6s; }
#caption.show { opacity: 1; }
#caption b { display: block; font-family: var(--display); font-weight: 500; font-size: clamp(26px, 4vw, 44px); letter-spacing: .08em; }
#caption span { font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
#stopBtn { position: fixed; z-index: 13; right: 16px; bottom: calc(9vh + 16px); display: none; }
#cine.on ~ #stopBtn { display: inline-flex; }

/* fallback (no WebGL) */
.fallback { max-width: 640px; margin: 0 auto; padding: 40px 20px; text-align: center; }
.fallback img { width: 100%; height: auto; border-radius: 16px; margin: 18px 0; }

@media (max-width: 560px) {
  .tb-brand img { width: 96px; }
  .tb-brand span { display: none; }
  .pill-btn .lbl { display: none; }
  .pill-btn { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
