/* ==========================================================================
   Dina Chateau - boutique UI
   A dark, glassy boutique shell that sits on top of the A-Frame canvas.
   ========================================================================== */

:root {
  --ink:        #0d0809;
  --ink-2:      #171012;
  --panel:      rgba(22, 14, 18, 0.90);
  --panel-soft: rgba(30, 20, 24, 0.72);
  --line:       rgba(201, 162, 39, 0.30);
  --line-soft:  rgba(246, 236, 220, 0.12);
  --gold:       #c9a227;
  --gold-soft:  #e6cf95;
  --cream:      #f7efe2;
  --muted:      #b3a49a;
  --rose:       #d4697f;
  --shadow:     0 24px 60px rgba(0, 0, 0, 0.55);
  --serif:      "Didot", "Bodoni MT", "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:       "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; line-height: 1.5; }

kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0.12em 0.42em;
  margin-right: 2px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(201, 162, 39, 0.10);
  color: var(--gold-soft);
  font: 600 0.72rem/1.3 var(--sans);
  text-align: center;
}

/* ------------------------------------------------------------- boot screen */
#boot {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #241419 0%, #0d0809 70%);
  transition: opacity 0.6s ease;
}
#boot.gone { opacity: 0; pointer-events: none; }
.boot-inner { text-align: center; }
.mark {
  width: 74px; height: 74px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font: 600 1.5rem/1 var(--serif);
  letter-spacing: 0.08em;
  color: var(--gold-soft);
  background: radial-gradient(circle at 30% 30%, rgba(201,162,39,0.25), transparent 70%);
}
.mark.small { width: 54px; height: 54px; font-size: 1.1rem; margin-bottom: 12px; }
.boot-text { margin: 0 0 14px; color: var(--muted); letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.7rem; }
.boot-bar { width: 190px; height: 2px; margin: 0 auto; background: rgba(246,236,220,0.14); overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: sweep 1.3s infinite linear; }
@keyframes sweep { from { transform: translateX(-120%); } to { transform: translateX(320%); } }

/* ------------------------------------------------------------ intro veil */
.veil {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 30%, rgba(74, 30, 42, 0.55), transparent 62%),
    linear-gradient(180deg, rgba(10, 6, 8, 0.92), rgba(10, 6, 8, 0.97));
  backdrop-filter: blur(6px);
  animation: fade 0.5s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.veil.closing { animation: fade-out 0.4s ease forwards; }
@keyframes fade-out { to { opacity: 0; visibility: hidden; } }

.intro-card {
  width: min(560px, 100%);
  padding: 40px 40px 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(26, 17, 21, 0.92), rgba(15, 10, 12, 0.94));
  box-shadow: var(--shadow);
  text-align: center;
}
.eyebrow { margin: 0 0 10px; color: var(--gold); font-size: 0.68rem; letter-spacing: 0.3em; text-transform: uppercase; }
.intro-card h1 {
  margin: 0;
  font: 500 clamp(2.2rem, 7vw, 3.3rem)/1.05 var(--serif);
  letter-spacing: 0.02em;
}
.intro-sub { margin: 6px 0 22px; color: var(--gold-soft); font: 400 0.95rem/1 var(--serif); letter-spacing: 0.42em; text-transform: uppercase; }
.intro-copy { margin: 0 auto 24px; max-width: 42ch; color: var(--muted); font-size: 0.95rem; line-height: 1.65; }
.intro-controls { list-style: none; margin: 0 0 28px; padding: 20px 0 0; border-top: 1px solid var(--line-soft); text-align: left; }
.intro-controls li { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 0.85rem; color: var(--muted); }
.intro-controls span { color: var(--muted); }
.intro-foot { margin: 16px 0 0; color: rgba(179, 164, 154, 0.6); font-size: 0.72rem; letter-spacing: 0.08em; }

/* --------------------------------------------------------------- buttons */
.btn {
  appearance: none;
  cursor: pointer;
  border-radius: 2px;
  font: 600 0.76rem/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.85em 1.5em;
  transition: transform 0.14s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, #e0bf58, #b78d1c);
  color: #241a05;
}
.btn-primary:hover { background: linear-gradient(180deg, #f0d275, #c9a227); }
.btn-ghost {
  border: 1px solid var(--line);
  background: rgba(201, 162, 39, 0.06);
  color: var(--gold-soft);
}
.btn-ghost:hover { background: rgba(201, 162, 39, 0.16); color: var(--cream); }
.btn-wide { display: block; width: 100%; margin-top: 10px; }

/* ------------------------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
#hud > * { pointer-events: auto; }

#topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(10, 6, 8, 0.82), rgba(10, 6, 8, 0));
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold-soft);
  font: 600 0.85rem/1 var(--serif);
  letter-spacing: 0.06em;
  background: rgba(201, 162, 39, 0.08);
}
.brand-name { display: flex; flex-direction: column; font: 500 1rem/1.15 var(--serif); letter-spacing: 0.06em; }
.brand-name em { font: 400 0.6rem/1.4 var(--sans); font-style: normal; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }
.tools { display: flex; gap: 8px; }
.tools .btn { padding: 0.7em 1em; }
.pill {
  display: inline-block;
  min-width: 20px;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(36, 26, 5, 0.35);
  font-size: 0.7rem;
}

#crosshair {
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border: 1px solid rgba(246, 236, 220, 0.5);
  border-radius: 50%;
  transition: width 0.15s ease, height 0.15s ease, margin 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
#crosshair.hot { width: 14px; height: 14px; margin: -7px 0 0 -7px; border-color: var(--gold); background: rgba(201, 162, 39, 0.22); }

#tip {
  position: absolute;
  z-index: 5;
  transform: translate(14px, 14px);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  font-size: 0.8rem;
  white-space: nowrap;
  pointer-events: none;
}
#tip strong { display: block; font: 500 0.95rem/1.2 var(--serif); letter-spacing: 0.02em; }
#tip span { color: var(--gold-soft); font-size: 0.75rem; letter-spacing: 0.1em; }

#toast-wrap {
  position: absolute;
  left: 50%; bottom: 92px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: 0.83rem;
  animation: toast-in 0.28s ease;
}
.toast.gone { animation: toast-out 0.35s ease forwards; }
.toast em { color: var(--gold-soft); font-style: normal; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* -------------------------------------------------------- product card */
.card {
  position: absolute;
  left: 50%; bottom: 30px;
  width: min(430px, calc(100vw - 40px));
  transform: translateX(-50%);
  padding: 24px 26px 22px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(28, 18, 22, 0.95), rgba(15, 10, 12, 0.96));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: card-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes card-in { from { opacity: 0; transform: translate(-50%, 16px); } }
.card-close {
  position: absolute;
  top: 10px; right: 12px;
  width: 30px; height: 30px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.card-close:hover { color: var(--cream); border-color: var(--line); }
.card h2 { margin: 0 0 4px; font: 500 1.5rem/1.15 var(--serif); }
.p-line { margin: 0 0 14px; color: var(--gold-soft); font: italic 400 0.9rem/1 var(--serif); letter-spacing: 0.06em; }
.p-meta { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.price { font: 500 1.25rem/1 var(--serif); color: var(--cream); }
.rating { color: var(--gold-soft); font-size: 0.85rem; }
.rating em { color: var(--muted); font-style: normal; font-size: 0.78rem; }
.p-notes { margin: 0 0 18px; color: var(--muted); font-size: 0.9rem; line-height: 1.65; }
.p-actions { display: flex; gap: 10px; }
.p-actions .btn { flex: 1; }

/* ------------------------------------------------------------- drawers */
.drawer {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(400px, 92vw);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 13, 16, 0.97), rgba(12, 8, 10, 0.98));
  box-shadow: -30px 0 70px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  animation: drawer-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes drawer-in { from { transform: translateX(30px); opacity: 0; } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.drawer-head h2 { margin: 0; font: 500 1.35rem/1 var(--serif); letter-spacing: 0.02em; }
.drawer-head .card-close { position: static; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 24px; }
.drawer-foot { padding: 18px 24px 24px; border-top: 1px solid var(--line-soft); background: rgba(10, 6, 8, 0.6); }

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.cart-line h3 { margin: 0; font: 500 1rem/1.2 var(--serif); }
.cart-line .cl-line { grid-column: 1; color: var(--muted); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; }
.cart-line .cl-price { grid-row: 1; text-align: right; font: 500 0.95rem/1.2 var(--serif); }
.qty { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.qty button {
  width: 26px; height: 26px;
  border: 1px solid var(--line);
  background: rgba(201, 162, 39, 0.08);
  color: var(--gold-soft);
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}
.qty button:hover { background: rgba(201, 162, 39, 0.2); }
.qty span { min-width: 22px; text-align: center; font-size: 0.9rem; }
.qty .rm { margin-left: auto; width: auto; padding: 0 10px; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; }
.empty-bag { padding: 40px 0; text-align: center; color: var(--muted); font-size: 0.9rem; line-height: 1.7; }
.empty-bag em { display: block; margin-bottom: 6px; font: italic 400 1.1rem/1.4 var(--serif); color: var(--gold-soft); }

#totals { margin: 0 0 16px; font-size: 0.86rem; }
#totals > div { display: flex; justify-content: space-between; padding: 5px 0; color: var(--muted); }
#totals dd { margin: 0; color: var(--cream); }
#totals .grand { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--cream); }
#totals .grand dt { font: 500 1rem/1 var(--serif); letter-spacing: 0.04em; }
#totals .grand dd { font: 500 1.2rem/1 var(--serif); color: var(--gold-soft); }

.dept-list { list-style: none; margin: 16px 0 0; padding: 0; }
.dept-list li { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.dept-list h3 { margin: 0 0 6px; font: 500 1.05rem/1.2 var(--serif); }
.dept-list h3 span { color: var(--gold); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; margin-left: 8px; }
.dept-list p { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.6; }
.dept-list .where { color: var(--gold-soft); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; }

.help-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.88rem; line-height: 1.85; }
.help-list li { margin-bottom: 10px; }
.help-list kbd { margin: 0 1px; }

/* -------------------------------------------------------------- receipt */
.receipt-card {
  width: min(420px, 100%);
  padding: 36px 32px 30px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(28, 18, 22, 0.96), rgba(14, 9, 11, 0.97));
  box-shadow: var(--shadow);
  text-align: center;
}
.receipt-card h2 { margin: 0 0 12px; font: 500 1.7rem/1.1 var(--serif); }
.receipt-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.7; }
.receipt-no { color: var(--gold-soft) !important; font: 500 0.85rem/1 var(--sans); letter-spacing: 0.2em; margin: 18px 0 24px; }

/* ------------------------------------------------------------- joystick */
#joystick {
  position: absolute;
  left: 26px; bottom: 26px;
  width: 124px; height: 124px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.13), rgba(20, 13, 16, 0.55));
  touch-action: none;
}
#stick {
  position: absolute;
  left: 50%; top: 50%;
  width: 50px; height: 50px;
  margin: -25px 0 0 -25px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: rgba(201, 162, 39, 0.28);
  transition: transform 0.08s linear;
}
#touch-look {
  position: absolute;
  right: 22px; bottom: 34px;
  color: rgba(246, 236, 220, 0.35);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 720px) {
  #topbar { padding: 10px 12px; }
  .brand-name { font-size: 0.88rem; }
  .tools .btn { padding: 0.65em 0.7em; font-size: 0.68rem; }
  .intro-card { padding: 30px 22px 24px; }
  .card { bottom: 16px; padding: 20px 20px 18px; }
  .p-actions { flex-direction: column; }
  .drawer { width: 100vw; }
  #toast-wrap { bottom: 168px; }
}
@media (max-height: 560px) {
  .intro-controls { display: none; }
}
