:root {
  --ink: #2b211b; --ink-soft: #6b5d51; --paper: #fbf8f3; --paper-2: #f2ece3;
  --brass: #a9824b; --brass-ink: #7a5a2b; --line: rgba(43, 33, 27, .14);
  --promo: #b3261e; --promo-ink: #fff; --ok: #2f6b3a;
  --glass: rgba(251, 248, 243, .9); --on-dark: #f6efe4; --dark-glass: rgba(20, 15, 12, .55);
  --display: "Marcellus", "Trajan Pro", Georgia, serif;
  --body: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3ece2; --ink-soft: #bfb2a3; --paper: #221b16; --paper-2: #2d251f;
    --brass: #c9a36a; --brass-ink: #d9b57e; --line: rgba(243, 236, 226, .16);
    --promo: #e2574c; --ok: #7fc28a; --glass: rgba(34, 27, 22, .9); color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
html, body { height: 100%; margin: 0; }
body { background: #120d0a; color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: rgba(18, 13, 10, .85); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

#stage { position: relative; height: 100%; overflow: hidden; }
#scene { position: absolute; inset: 0; touch-action: none; }
#scene canvas { display: block; width: 100%; height: 100%; }

/* ---------- header ---------- */
.bar { position: absolute; left: 0; right: 0; top: 0; z-index: 6; padding: 10px 12px 0; color: var(--on-dark);
  background: linear-gradient(rgba(18, 13, 10, .72), rgba(18, 13, 10, 0)); pointer-events: none; }
.bar > * { pointer-events: auto; }
.bar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { color: inherit; text-decoration: none; display: flex; flex-direction: column; line-height: 1; text-shadow: 0 1px 10px rgba(0, 0, 0, .5); }
.brand b { font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: .06em; }
.brand span { font-size: 12px; opacity: .85; margin-top: 3px; }
.actions { display: flex; gap: 8px; align-items: center; }
.icon-btn, .chip-btn { min-height: 44px; min-width: 44px; border-radius: 999px; border: 1px solid rgba(246, 239, 228, .35);
  background: var(--dark-glass); color: var(--on-dark); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.chip-btn { padding: 0 16px; font-size: 15px; }
.chip-btn[aria-pressed="true"] { background: var(--promo); border-color: var(--promo); color: var(--promo-ink); }
.rooms { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 8px; scrollbar-width: none; }
.rooms::-webkit-scrollbar { display: none; }
.room { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(246, 239, 228, .25); background: rgba(20, 15, 12, .4); color: var(--on-dark); font-size: 14px; white-space: nowrap; }
.room.is-active { background: var(--on-dark); color: #2b211b; border-color: var(--on-dark); }
.room:disabled { opacity: .6; cursor: default; }
.room em { font-style: normal; font-size: 11px; opacity: .8; margin-left: 4px; }

/* ---------- pop-ups (search, menu) ---------- */
.pop { position: absolute; z-index: 8; top: calc(64px + env(safe-area-inset-top, 0px)); right: 12px; width: min(420px, calc(100vw - 24px));
  background: var(--paper); color: var(--ink); border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .4); padding: 12px; }
.pop input { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font: inherit; background: var(--paper-2); color: var(--ink); }
#results { list-style: none; margin: 8px 0 0; padding: 0; max-height: 52vh; overflow-y: auto; }
#results li button { display: flex; gap: 12px; align-items: center; width: 100%; border: 0; background: none; text-align: left; padding: 8px; border-radius: 12px; min-height: 56px; }
#results li button:hover, #results li button:focus-visible { background: var(--paper-2); }
#results img { width: 56px; height: 42px; object-fit: cover; border-radius: 8px; flex: none; background: var(--paper-2); }
#results .t { display: block; font-size: 14px; line-height: 1.3; }
#results .p { font-size: 13px; color: var(--brass-ink); }
#results .empty { padding: 12px 8px; color: var(--ink-soft); font-size: 14px; }
.pop-title { margin: 2px 4px 10px; font-family: var(--display); font-size: 18px; }
.pop-note { margin: 10px 4px 6px; font-size: 13px; color: var(--ink-soft); }
.seg { display: flex; background: var(--paper-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: transparent; font-size: 15px; }
.seg button[aria-checked="true"] { background: var(--paper); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); font-weight: 500; }
.link-btn { border: 0; background: none; color: var(--brass-ink); text-decoration: underline; padding: 8px 4px; font-size: 14px; min-height: 44px; text-align: left; }

/* ---------- product tags in the room ---------- */
#tags { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.tag { position: absolute; left: 0; top: 0; display: flex; align-items: stretch; pointer-events: auto; opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s; background: var(--glass); color: var(--ink); border-radius: 14px; box-shadow: 0 6px 22px rgba(0, 0, 0, .28);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tag.on { opacity: 1; visibility: visible; }
.tag.active { outline: 2px solid var(--brass); }
.tag button { border: 0; background: none; }
.tag .arrow { width: 40px; min-height: 48px; font-size: 22px; line-height: 1; color: var(--ink-soft); border-radius: 14px; }
.tag .arrow:hover { color: var(--ink); background: rgba(0, 0, 0, .05); }
.tag .main { padding: 6px 4px 7px; text-align: center; min-width: 120px; max-width: 190px; }
.tag strong { display: block; font-family: var(--display); font-weight: 400; font-size: 14px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag .pr { font-size: 13px; color: var(--brass-ink); }
.tag .ct { display: block; font-size: 11px; color: var(--ink-soft); }
.tag .badge { margin-left: 6px; background: var(--promo); color: var(--promo-ink); border-radius: 6px; padding: 0 5px; font-size: 11px; }
.tag .out { margin-left: 6px; color: var(--ink-soft); font-size: 11px; }
.tag.single .arrow { display: none; }
.fiche-open .tag:not(.active) { opacity: 0; visibility: hidden; }

/* ---------- joystick & hints ---------- */
#joy { position: absolute; left: 22px; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); width: 124px; height: 124px; border-radius: 50%;
  border: 1px solid rgba(246, 239, 228, .35); background: rgba(20, 15, 12, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: none; touch-action: none; z-index: 4; }
#joy i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(246, 239, 228, .85); box-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.coarse.started #joy { display: block; }
.fiche-open #joy { display: none !important; }
.hint, .toast { position: absolute; left: 50%; transform: translate(-50%, 8px); width: max-content; max-width: min(88vw, 560px); text-align: center;
  color: var(--on-dark); background: rgba(20, 15, 12, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 14px; padding: 10px 18px; font-size: 14px; opacity: 0; transition: opacity .4s, transform .4s; pointer-events: none; z-index: 5; }
.hint { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.coarse .hint { bottom: calc(170px + env(safe-area-inset-bottom, 0px)); }
.toast { top: calc(120px + env(safe-area-inset-top, 0px)); }
.hint.show, .toast.show { opacity: 1; transform: translate(-50%, 0); }
.hint kbd { font-family: var(--body); border: 1px solid rgba(246, 239, 228, .4); border-radius: 5px; padding: 0 5px; margin: 0 1px; }

/* ---------- product sheet ---------- */
.panel { position: absolute; z-index: 7; background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
  display: flex; flex-direction: column; transition: transform .4s cubic-bezier(.2, .8, .2, 1), visibility .4s; visibility: hidden; }
.panel.open { visibility: visible; transform: none !important; }
#sheet { right: 14px; top: calc(112px + env(safe-area-inset-top, 0px)); bottom: 14px; width: min(400px, calc(100vw - 28px)); border-radius: 20px; transform: translateX(calc(100% + 40px)); }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 8px 18px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-soft); }
.close { border: 0; background: transparent; border-radius: 999px; padding: 0 14px; min-height: 44px; font-size: 14px; color: var(--ink-soft); }
.close:hover { background: var(--paper-2); color: var(--ink); }
.scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper-2); }
.thumbs { display: flex; gap: 6px; padding: 8px 14px 0; }
.thumbs button { border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden; width: 56px; height: 44px; background: var(--paper-2); }
.thumbs button[aria-current="true"] { border-color: var(--brass); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.body { padding: 14px 20px 20px; }
#sheetTitle { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.15; margin: 0 0 8px; }
#sheetTitle:focus { outline: none; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 0 0 6px; }
.price strong { font-family: var(--display); font-weight: 400; font-size: 28px; }
#sheetCompare { color: var(--ink-soft); font-size: 15px; }
#sheetBadge { font-style: normal; background: var(--promo); color: var(--promo-ink); border-radius: 6px; padding: 1px 7px; font-size: 13px; }
#sheetBadge:empty { display: none; }
.stock { margin: 0 0 6px; font-size: 14px; color: var(--ok); }
.stock.out { color: var(--promo); }
.dims { margin: 0 0 12px; font-size: 14px; color: var(--ink-soft); }
.dims:empty { display: none; }
.opts { display: grid; gap: 8px; margin: 0 0 14px; }
.opt { font-size: 14px; color: var(--ink-soft); }
.opt ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.opt li { border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; color: var(--ink); font-size: 13px; }
.desc { font-size: 15px; line-height: 1.65; margin: 0 0 18px; }
.cta { display: flex; justify-content: center; align-items: center; min-height: 50px; text-decoration: none; background: var(--ink); color: var(--paper); border-radius: 999px; font-weight: 500; font-size: 16px; }
.cta:hover { background: var(--brass-ink); color: #fff; }
.note { font-size: 13px; color: var(--ink-soft); text-align: center; margin: 12px 0 0; }
.note:empty { display: none; }
.nav { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.nav button { flex: 1; min-height: 46px; border: 1px solid var(--line); background: transparent; border-radius: 999px; font-size: 15px; }
.nav button:disabled { opacity: .4; cursor: default; }
.nav button:not(:disabled):hover { background: var(--paper-2); }
#sheetCount { min-width: 56px; text-align: center; font-size: 14px; color: var(--ink-soft); }
@media (max-width: 720px) {
  #sheet { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 62%; border-radius: 20px 20px 0 0; transform: translateY(105%); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .photo { aspect-ratio: 16 / 9; }
  #sheetTitle { font-size: 21px; }
  .fiche-open #tags { display: none; }
  .bar { padding-left: 10px; padding-right: 10px; }
}

/* ---------- list view (no 3D) ---------- */
#catalogue { position: absolute; inset: 0; z-index: 9; overflow-y: auto; background: var(--paper); color: var(--ink); padding: calc(118px + env(safe-area-inset-top, 0px)) 16px 40px; }
.list-mode .bar { background: #120d0a; }
.cat-inner { max-width: 1100px; margin: 0 auto; }
#catalogue h1 { font-family: var(--display); font-weight: 400; font-size: 32px; margin: 0 0 4px; }
.cat-intro { color: var(--ink-soft); margin: 0 0 8px; }
#catalogue h2 { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 28px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.card { text-decoration: none; color: inherit; background: var(--paper-2); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--line); }
.card span { padding: 8px 10px 0; font-size: 14px; line-height: 1.3; }
.card b { padding: 4px 10px 10px; font-weight: 500; color: var(--brass-ink); font-size: 14px; }
.card .badge { align-self: flex-start; margin: 0 10px 8px; background: var(--promo); color: var(--promo-ink); border-radius: 6px; padding: 0 6px; font-size: 12px; }

/* ---------- intro & notices ---------- */
#intro { position: absolute; inset: 0; z-index: 12; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--on-dark);
  background: radial-gradient(ellipse at 50% 55%, rgba(18, 13, 10, .45), rgba(18, 13, 10, .92)); transition: opacity .8s, visibility .8s; }
#intro.gone { opacity: 0; visibility: hidden; }
#intro .in { max-width: 520px; }
#intro h1 { font-family: var(--display); font-weight: 400; font-size: clamp(38px, 8vw, 68px); line-height: 1.02; margin: 0 0 16px; }
#intro p { font-size: 17px; line-height: 1.6; margin: 0 auto 24px; max-width: 40ch; opacity: .92; }
#intro a { color: #d9b57e; }
.load { width: min(260px, 70vw); height: 2px; margin: 0 auto 22px; background: rgba(246, 239, 228, .18); border-radius: 2px; overflow: hidden; }
.load i { display: block; height: 100%; width: 0; background: #c9a36a; transition: width .3s; }
.loaded .load { visibility: hidden; }
#enter { min-height: 50px; border: 1px solid rgba(201, 163, 106, .8); background: rgba(201, 163, 106, .18); color: var(--on-dark); border-radius: 999px; padding: 0 34px; font-size: 17px; }
#enter:not([disabled]):hover { background: rgba(201, 163, 106, .35); }
#enter[disabled] { opacity: .55; cursor: wait; }
#intro small { display: block; margin-top: 18px; font-size: 13px; opacity: .7; }
#notice { position: absolute; inset: 0; z-index: 13; display: grid; place-items: center; background: rgba(18, 13, 10, .85); color: var(--on-dark); font-size: 17px; }
.noscript { padding: 40px; color: #f6efe4; }
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; } }

/* ---------- room switch loading screen ---------- */
#roomLoad { position: absolute; inset: 0; z-index: 11; display: grid; place-items: center; background: rgba(243, 239, 233, .92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #2b211b; text-align: center; }
#roomLoad p { margin: 0 0 4px; font-size: 14px; color: #6e6156; }
#roomLoad b { display: block; font-family: var(--display); font-weight: 400; font-size: 30px; margin-bottom: 16px; }
.rl-bar { width: min(240px, 60vw); height: 3px; background: rgba(43, 33, 27, .12); border-radius: 2px; overflow: hidden; margin: 0 auto; }
.rl-bar i { display: block; height: 100%; width: 0; background: #a9824b; transition: width .25s; }
.room:not(:disabled):not(.is-active) { cursor: pointer; }
.room:not(:disabled):not(.is-active):hover { background: rgba(20, 15, 12, .6); }
.privacy { font-size: 12px; line-height: 1.45; border-top: 1px solid var(--line); padding-top: 10px; }
.cta.ghost { background: transparent; color: var(--ink, #2b211b); border: 1px solid currentColor; margin-bottom: 8px; width: 100%; cursor: pointer; font: inherit; }
