:root { --ink: #1d1b19; --paper: #f5f3ee; --muted: #6b655e; --accent: #a3271d; --line: rgba(29,27,25,.14); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink);
  font-family: "Inter", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#stage:active { cursor: grabbing; }

.hud-top { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 16px; padding: 14px 18px;
  padding-top: max(14px, env(safe-area-inset-top)); pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.brand img { height: 30px; width: auto; display: block; }
.scenes { display: flex; gap: 6px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.scenes a, .list-link { font-size: .78rem; letter-spacing: .04em; text-decoration: none; color: var(--ink);
  background: rgba(245,243,238,.82); backdrop-filter: blur(6px); padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); }
.scenes a[aria-current="page"] { background: var(--ink); color: var(--paper); }

.loading { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; background: var(--paper);
  transition: opacity .8s ease; z-index: 5; }
.loading p { font-family: "EB Garamond", Georgia, serif; font-size: 2rem; margin: 0 0 8px; }
.loading span { color: var(--muted); font-size: .85rem; }
.loading.done { opacity: 0; pointer-events: none; }

.hint { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); margin: 0; font-size: .8rem; color: var(--ink);
  background: rgba(245,243,238,.85); backdrop-filter: blur(6px); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  transition: opacity .6s; white-space: nowrap; }
.hint.gone { opacity: 0; pointer-events: none; }
.hint .touch { display: none; }
@media (hover: none) { .hint .desk { display: none; } .hint .touch { display: inline; } }

.pad { position: fixed; left: 18px; right: 18px; bottom: max(70px, calc(env(safe-area-inset-bottom) + 60px)); display: none; justify-content: space-between; pointer-events: none; }
.pad > div { display: flex; flex-direction: column; gap: 10px; pointer-events: auto; }
.pad-lift button { font-size: .8rem; }
.pad button { width: 58px; height: 58px; border-radius: 50%; border: 1px solid var(--line); background: rgba(245,243,238,.85);
  backdrop-filter: blur(6px); font-size: 1.2rem; color: var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; }
@media (hover: none) { .pad { display: flex; } }

.card { position: fixed; right: 18px; top: 70px; width: min(340px, calc(100% - 36px)); max-height: calc(100% - 90px); overflow: auto;
  background: rgba(250,249,246,.96); backdrop-filter: blur(8px); border: 1px solid var(--line); padding: 18px 18px 14px; z-index: 4;
  box-shadow: 0 18px 50px rgba(0,0,0,.12); }
.card[hidden] { display: none; }
.card img { width: 100%; height: auto; display: block; background: #e9e6df; margin-bottom: 12px; }
.card h2 { font-family: "EB Garamond", Georgia, serif; font-weight: 400; font-size: 1.6rem; margin: 0 0 8px; }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 10px; font-size: .85rem; }
.card dt { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; padding-top: 2px; }
.card dd { margin: 0; }
.card .badge { display: inline-block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--accent); padding: 3px 8px; margin: 0 0 12px; }
.card .badge[hidden] { display: none; }
.card .close { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
.compare { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; font-size: .75rem; }
.compare span { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .68rem; margin-right: 2px; }
.compare button { font: inherit; font-size: .75rem; padding: 6px 10px; border: 1px solid var(--line); background: none; cursor: pointer; border-radius: 999px; }
.compare button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { font: inherit; font-size: .8rem; padding: 9px 14px; border: 1px solid var(--ink); background: transparent; color: var(--ink);
  text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--ink); color: var(--paper); }
.steps { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: .8rem; color: var(--muted); }
.steps button { border: 1px solid var(--line); background: none; width: 38px; height: 32px; cursor: pointer; font-size: 1rem; }

@media (max-width: 640px) {
  .hud-top { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .scenes { order: 3; width: 100%; }
  .list-link { margin-left: auto; }
  .card { left: 12px; right: 12px; width: auto; top: auto; bottom: 12px; max-height: 58%; }
  .card img { max-height: 180px; object-fit: contain; }
}
.fallback { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; padding: 20px; background: var(--paper); }
