:root {
  --green: #00843d;
  --green-deep: #005c2b;
  --gold: #c9a24b;
  --gold-hi: #f0d58a;
  --ink: #1b1d1c;
  --paper: #fbfaf7;
  --font: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1410; font-family: var(--font); color: var(--ink); }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#scene.dragging { cursor: grabbing; }
#scene.pointing { cursor: pointer; }
button { font-family: var(--font); cursor: pointer; }
.hidden { display: none !important; }

/* intro */
#intro { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 30%, #0f6b3c 0%, #04331b 60%, #021a0e 100%); transition: opacity .8s; }
#intro.gone { opacity: 0; pointer-events: none; }
.intro-card { text-align: center; color: #fff; max-width: 560px; width: 100%; }
.intro-board { display: inline-block; padding: 22px 44px; background: #fff; border-radius: 10px;
  border: 6px solid var(--gold); box-shadow: 0 0 0 2px #fff6 inset, 0 0 0 1px #8a6a22, 0 18px 50px #0007; }
.intro-board span { font-weight: 300; font-size: clamp(26px, 6vw, 44px); color: var(--green); letter-spacing: .5px; }
.intro-sub { letter-spacing: 4px; text-transform: uppercase; font-size: 12px; color: var(--gold-hi); margin: 22px 0 18px; }
#loadbar { height: 3px; background: #ffffff22; border-radius: 3px; overflow: hidden; margin: 0 auto 8px; max-width: 320px; }
#loadbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); transition: width .2s; }
#loadtext { font-size: 12px; color: #ffffffaa; margin: 0 0 18px; }
#enter { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #2b2210; border: 0; padding: 12px 30px;
  border-radius: 30px; font-size: 15px; font-weight: 600; letter-spacing: .5px; box-shadow: 0 6px 20px #0006; }
#enter:disabled { opacity: .4; cursor: default; }
.intro-hint { font-size: 12px; color: #ffffff99; margin-top: 18px; line-height: 1.6; }

/* HUD */
#brand { position: fixed; top: 12px; left: 12px; z-index: 10; color: #fff; pointer-events: none; background: #0e2a1cc8; border: 1px solid #c9a24b88; border-radius: 10px; padding: 7px 12px; }
#brand b { display: block; font-weight: 400; font-size: 18px; letter-spacing: .4px; }
#brand span { font-size: 12px; color: var(--gold-hi); letter-spacing: 1px; text-transform: uppercase; }
.pill { position: fixed; top: 14px; right: 16px; z-index: 10; background: #ffffffe8; border: 1px solid var(--gold);
  border-radius: 22px; padding: 8px 14px; font-size: 13px; color: var(--green-deep); box-shadow: 0 4px 14px #0003; }
.pill em { font-style: normal; background: var(--green); color: #fff; border-radius: 10px; padding: 1px 7px; margin-left: 6px; font-size: 12px; }

#tour { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 10; display: flex; flex-direction: column;
  align-items: center; gap: 8px; max-width: calc(100vw - 32px); }
#tourMain, #tourItems { display: flex; gap: 6px; overflow-x: auto; max-width: 100%; scrollbar-width: none; padding: 2px; }
#tourMain::-webkit-scrollbar, #tourItems::-webkit-scrollbar { display: none; }
#tour button { flex: 0 0 auto; background: #ffffffe6; border: 1px solid #ffffff; color: var(--green-deep); padding: 8px 14px;
  border-radius: 20px; font-size: 13px; box-shadow: 0 3px 12px #0003; backdrop-filter: blur(6px); }
#tour button:hover, #tour button.on { background: var(--green); color: #fff; border-color: var(--gold); }
#tour button.alt { color: #6b5212; border-color: var(--gold); }
#tourItems button { font-size: 12px; padding: 6px 12px; background: #0e2a1ccc; color: #fff; border-color: var(--gold); }
#tourItems button i { font-style: normal; color: var(--gold-hi); margin-left: 6px; }

#mapWrap { position: fixed; right: 16px; top: 62px; z-index: 9; background: #ffffffd9; border: 1px solid var(--gold);
  border-radius: 12px; padding: 6px; box-shadow: 0 6px 18px #0004; cursor: crosshair; }
#map { display: block; width: 176px; height: 160px; }
#hint { position: fixed; left: 16px; bottom: 20px; z-index: 9; color: #fff; font-size: 12px; text-shadow: 0 1px 4px #000; opacity: .85; pointer-events: none; }
#move { position: fixed; left: 16px; bottom: 90px; z-index: 9; display: none; flex-direction: column; gap: 8px; }
#move button { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--gold); background: #ffffffd0; color: var(--green-deep); font-size: 20px; }

/* hover card (same details as the product banner) */
.card { position: fixed; z-index: 20; pointer-events: none; width: 250px; background: #fffffff5; border-radius: 10px;
  border: 1px solid var(--gold); box-shadow: 0 10px 30px #0005; overflow: hidden; }
.card .ch { background: var(--green); color: #fff; padding: 8px 12px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  border-bottom: 2px solid var(--gold); }
.card .cb { padding: 10px 12px 12px; }
.card h4 { margin: 0 0 2px; font-weight: 600; font-size: 16px; color: var(--ink); }
.card .code { font-size: 11px; color: #777; margin: 0 0 6px; }
.card .price { font-size: 18px; color: #8a6a1c; margin: 6px 0 4px; font-weight: 600; }
.card .desc { font-size: 12px; color: #444; margin: 0; line-height: 1.45; }
.card .tap { font-size: 11px; color: var(--green); margin-top: 8px; }

/* modal */
#modal { position: fixed; inset: 0; z-index: 40; background: #000a; display: grid; place-items: center; padding: 16px; }
.modal-card { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: min(900px, 100%); max-height: 92vh;
  background: var(--paper); border-radius: 14px; overflow: hidden; border: 1px solid var(--gold); box-shadow: 0 20px 60px #000a; }
.modal-img { background: radial-gradient(circle at 50% 40%, #fff, #e9e6dd); display: grid; place-items: center; padding: 24px; min-height: 320px; }
.modal-img img { max-width: 100%; max-height: 70vh; object-fit: contain; filter: drop-shadow(0 12px 20px #0004); }
.modal-body { padding: 30px 28px; overflow: auto; }
.m-gallery { margin: 0; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--green); }
.modal-body h2 { margin: 6px 0 2px; font-weight: 300; font-size: 30px; }
.m-code { margin: 0 0 16px; font-size: 12px; color: #888; }
.m-desc { font-size: 14px; line-height: 1.6; color: #333; }
.m-price { font-size: 26px; color: #8a6a1c; margin: 18px 0 4px; }
.m-status { font-size: 12px; letter-spacing: 2px; color: var(--green); margin: 0 0 20px; }
.m-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.m-actions button, .cart-foot button { border: 1px solid var(--green); background: #fff; color: var(--green-deep); padding: 10px 18px; border-radius: 24px; font-size: 14px; }
button.gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border-color: #a8832e; color: #2b2210; font-weight: 600; }
.x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 26px; color: #666; z-index: 2; }

/* cart */
#cart { position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; width: min(360px, 100%); background: var(--paper);
  border-left: 2px solid var(--gold); box-shadow: -10px 0 40px #0006; display: flex; flex-direction: column; }
.cart-head { position: relative; padding: 18px 20px; background: var(--green); color: #fff; }
.cart-head h3 { margin: 0; font-weight: 400; }
.cart-head .x { color: #fff; top: 12px; }
#cartList { list-style: none; margin: 0; padding: 10px 16px; flex: 1; overflow: auto; }
#cartList li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eee; font-size: 14px; }
#cartList img { width: 46px; height: 56px; object-fit: contain; }
#cartList li div { flex: 1; }
#cartList small { display: block; color: #8a6a1c; }
#cartList button { border: 0; background: none; color: #999; font-size: 18px; }
.cart-foot { padding: 16px 20px; border-top: 1px solid #e5e0d0; }
.cart-foot p { display: flex; justify-content: space-between; margin: 0 0 12px; }
.cart-foot .note { font-size: 12px; color: #555; display: block; margin-top: 10px; }

#toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 30; background: #0e2a1ce8; color: #fff;
  border: 1px solid var(--gold); padding: 10px 18px; border-radius: 24px; font-size: 14px; }

@media (max-width: 720px) {
  .modal-card { grid-template-columns: 1fr; overflow: auto; }
  .modal-img { min-height: 220px; }
  .modal-img img { max-height: 36vh; }
  #mapWrap { bottom: auto; top: 58px; right: 10px; padding: 4px; }
  #map { width: 110px; height: 100px; }
  #hint { display: none; }
  #move { display: flex; }
  #tour { bottom: 10px; }
  #brand b { font-size: 15px; }
}
@media (hover: none) { #move { display: flex; } }

/* BAGAI panel */
#bagai { position: fixed; left: 16px; bottom: 120px; z-index: 35; width: min(360px, calc(100vw - 32px)); max-height: 60vh; display: flex; flex-direction: column;
  background: #0b2416f0; color: #fff; border: 1px solid var(--gold); border-radius: 14px; box-shadow: 0 0 30px #38ff9c40, 0 10px 30px #0008; overflow: hidden; }
.bg-head { display: flex; align-items: center; padding: 10px 12px; background: linear-gradient(90deg, #00843d, #0b2416); border-bottom: 1px solid var(--gold); }
.bg-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.bg-title img { width: 30px; height: 30px; }
.bg-title span { font-weight: 600; letter-spacing: 2px; color: var(--gold-hi); }
.bg-title small { color: #fff; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bg-close { border: 0; background: none; color: #fff; font-size: 22px; }
.bg-log { padding: 10px 12px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.45; }
.bg-line { padding: 7px 10px; border-radius: 10px; max-width: 88%; }
.bg-line.bagai { background: #ffffff14; border: 1px solid #c9a24b66; align-self: flex-start; }
.bg-line.you { background: #00843d; align-self: flex-end; }
.bg-status { font-size: 11px; color: var(--gold-hi); padding: 0 12px 6px; min-height: 16px; }
.bg-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.bg-chip { background: #ffffff10; color: #fff; border: 1px solid #c9a24b88; border-radius: 16px; padding: 5px 10px; font-size: 12px; }
.bg-chip:hover { background: #c9a24b33; }
.bg-mic { margin: 0 12px 12px; border: 0; border-radius: 22px; padding: 9px; font-size: 14px; font-weight: 600; color: #2b2210; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); }
#bagai.listening .bg-mic { background: #38ff9c; animation: bgpulse 1s infinite; }
@keyframes bgpulse { 50% { box-shadow: 0 0 0 8px #38ff9c33; } }
.m-actions button.ask { display: inline-flex; align-items: center; gap: 6px; border-color: var(--gold); color: #0b4d2a; }
.m-actions button.ask img { width: 20px; height: 20px; }

/* mock checkout: gold frame with gold maple studs */
#co { position: fixed; inset: 0; z-index: 60; background: #000b; display: grid; place-items: center; padding: 16px; }
.co-frame { position: relative; width: min(720px, 100%); max-height: 94vh; display: flex; padding: 16px; border-radius: 22px;
  background: linear-gradient(135deg, #f6dc8f, #c9a24b 30%, #fbe7a6 55%, #b48a35 80%, #e9c977); box-shadow: 0 0 0 1px #8a6a22, 0 25px 70px #000c; }
.co-inner { position: relative; flex: 1; overflow: auto; background: #fffdf7; border-radius: 12px; box-shadow: inset 0 0 0 1px #8a6a2255; }
.stud { position: absolute; width: 34px; height: 34px; z-index: 2; filter: drop-shadow(0 2px 3px #0006); }
.stud.tl { top: -6px; left: -6px; } .stud.tr { top: -6px; right: -6px; } .stud.bl { bottom: -6px; left: -6px; } .stud.br { bottom: -6px; right: -6px; }
.co-inner .x { top: 8px; right: 14px; }
.co-page { padding: 34px 48px 40px; }
.co-kicker { margin: 0; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--green); }
.co-page h2 { font-weight: 300; font-size: 30px; margin: 6px 0 8px; color: var(--ink); }
.co-demo { font-size: 12px; color: #7a5a14; background: #fbf3dc; border: 1px dashed #c9a24b; border-radius: 8px; padding: 8px 10px; }
.co-items { margin: 12px 0; }
.co-items div, #cdItems div { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #eee5cf; font-size: 14px; }
.co-items img, #cdItems img { width: 44px; height: 54px; object-fit: contain; }
.co-items b, #cdItems b { margin-left: auto; color: #8a6a1c; font-weight: 600; }
.co-items small, #cdItems small { display: block; color: var(--green); font-size: 11px; }
fieldset { border: 1px solid #e6d8b3; border-radius: 10px; margin: 14px 0; padding: 10px 14px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
legend { padding: 0 6px; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #8a6a1c; }
fieldset label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #555; }
fieldset label.wide { grid-column: 1 / -1; }
fieldset input { font: inherit; font-size: 14px; padding: 9px 10px; border: 1px solid #d9cba5; border-radius: 8px; background: #fff; }
fieldset input:focus { outline: 2px solid #c9a24b66; border-color: #c9a24b; }
.co-err { color: #b3261e; font-size: 13px; min-height: 18px; margin: 4px 0; }
.co-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; margin: 8px 0 16px; }
.co-total b { font-size: 24px; color: #8a6a1c; }
.co-place { width: 100%; padding: 13px; font-size: 16px; }
.co-meta { color: #666; font-size: 13px; margin: 0 0 14px; }
.co-page h3 { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #8a6a1c; margin: 14px 0 6px; font-weight: 600; }
.co-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.co-two p { margin: 0 0 6px; font-size: 14px; line-height: 1.5; }
.co-sum { margin: 16px 0 20px; border-top: 1px solid #e6d8b3; padding-top: 10px; }
.co-sum p { display: flex; justify-content: space-between; margin: 6px 0; font-size: 14px; }
.co-sum p.t { font-size: 17px; border-top: 1px solid #e6d8b3; padding-top: 8px; }
.co-sum p.t b { color: #8a6a1c; font-size: 22px; }
@media (max-width: 600px) { .co-page { padding: 30px 22px; } fieldset, .co-two { grid-template-columns: 1fr; } #bagai { bottom: 110px; } }
#coDone > button.gold { width: 100%; padding: 13px; font-size: 16px; border-radius: 24px; border: 1px solid #a8832e; }
/* subtle remove links */
#cartList .rm { display: inline; padding: 0; margin-top: 2px; border: 0; background: none; color: #9a9a9a; font-size: 11px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
#cartList .rm:hover { color: #b3261e; }
.m-actions button.subtle { border: 0; background: none; color: #8a8a8a; font-size: 12px; text-decoration: underline; padding: 10px 4px; }
.m-actions button.subtle:hover { color: #b3261e; }
.m-actions button.ask { padding: 6px 10px; }
.m-actions button.ask img { width: 28px; height: 28px; }
.card .ch.ch-icon { display: flex; align-items: center; gap: 8px; letter-spacing: 0; text-transform: none; font-size: 13px; }
.card .ch.ch-icon img { width: 22px; height: 22px; }
/* a humble sponsor line at the foot of the welcome page */
.intro-sponsor { position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; letter-spacing: 1px; color: #ffffff99; }
.intro-sponsor img { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 1px #c9a24b88; }
.intro-sponsor span { color: #f0d58acc; }
/* the BAGAI icon always sits at the left of the gallery name and location */
#brand { display: flex; align-items: center; gap: 10px; }
#brand .brand-icon { width: 42px; height: 42px; flex: 0 0 auto; filter: drop-shadow(0 1px 3px #0008); }
#brand span { display: block; }
@media (max-width: 720px) { #brand .brand-icon { width: 34px; height: 34px; } }
.bg-line.bagai { position: relative; padding-left: 34px; }
.bg-line.bagai .bg-av { position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; }
