:root {
  --ink-0: #0b0907;
  --ink-1: #0e0c0a;
  --ink-2: #16130f;
  --ink-3: #1e1a15;
  --line: #2a251e;
  --line-strong: #3a3329;
  --ivory: #ede6d6;
  --text-2: #a39c8c;
  --text-3: #6e685c;
  --gold: #c9a86a;
  --gold-hi: #e2c891;
  --gold-lo: #8a7246;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --fs-14: 14px;
  --fs-16: 16px;
  --s2: 8px;
  --s5: 24px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(120% 90% at 50% 60%, #1c1916 0%, #121013 55%, #0b0a0e 100%);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: var(--fs-16);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.serif { font-family: var(--serif); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 48px; padding: 0 var(--s5);
  border-radius: 999px; border: 1px solid transparent;
  font-size: var(--fs-16); font-weight: 500; letter-spacing: 0.04em;
  cursor: pointer; transition: transform 160ms var(--ease-out), background 160ms, border-color 160ms, color 160ms;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--gold); color: #17120a; }
.btn-primary:hover { background: var(--gold-hi); }
.btn-ghost { border-color: var(--line-strong); color: var(--ivory); background: transparent; }
.btn-ghost:hover { border-color: var(--gold-lo); color: var(--gold-hi); }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#scene.grab { cursor: grab; }
#scene.grabbing { cursor: grabbing; }
#scene.point { cursor: pointer; }
.vignette {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(110% 85% at 50% 55%, transparent 60%, rgba(6, 5, 4, 0.28) 100%);
}

/* top bar */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) clamp(14px, 2.8vw, 36px) 0;
  pointer-events: none; white-space: nowrap;
  transition: opacity 520ms var(--ease-out);
}
.top > * { pointer-events: auto; }
body.is-hud-dim .top { opacity: 0.52; }
@media (max-width: 680px) {
  body.is-hud-dim .top { opacity: 0.68; }
}
.top:hover, .top:focus-within { opacity: 1 !important; }
.crumb {
  font-size: 12.5px; color: var(--text-3); letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 7px; white-space: nowrap; flex-shrink: 0;
}
.crumb a { color: var(--text-2); transition: color 180ms, text-shadow 180ms; white-space: nowrap; }
.crumb a:hover { color: var(--ivory); }
.crumb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 2px; border: none; background: transparent;
  color: rgba(238, 224, 196, 0.80) !important; font-size: 12.5px; letter-spacing: 0.05em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.94), 0 0 18px rgba(0, 0, 0, 0.78);
}
.crumb-btn:hover {
  color: #fff4dc !important;
  text-shadow: 0 0 14px rgba(226, 200, 145, 0.65), 0 1px 8px rgba(0, 0, 0, 0.95);
}
.crumb-sep {
  color: rgba(201, 168, 106, 0.42); font-size: 12px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9); user-select: none; pointer-events: none;
}
.mode-switch {
  position: relative; display: inline-flex; align-items: center;
  white-space: nowrap; flex-shrink: 0;
}
.mode-trigger {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 11px; border-radius: 999px;
  border: 1px solid rgba(201, 168, 106, 0.26);
  background: rgba(12, 10, 8, 0.38);
  color: #f4e2bc; font-size: 12px; font-weight: 500; letter-spacing: 0.05em;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  cursor: pointer; transition: color 160ms, border-color 160ms, background 160ms, box-shadow 160ms;
}
.mode-trigger:hover, .mode-switch.is-open .mode-trigger {
  color: #fff4dc; border-color: rgba(226, 200, 145, 0.56);
  background: rgba(20, 17, 13, 0.68);
}
.mode-spark { font-size: 9.5px; color: rgba(226, 200, 145, 0.88); }
.mode-caret { font-size: 10px; color: rgba(226, 200, 145, 0.72); transition: transform 180ms var(--ease-out); }
.mode-switch.is-open .mode-caret { transform: rotate(180deg); }
.mode-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 132px; padding: 5px; border-radius: 12px;
  background: rgba(12, 10, 8, 0.92);
  border: 1px solid rgba(201, 168, 106, 0.36);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.72);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(-4px); pointer-events: none;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), visibility 180ms;
}
.mode-menu::before {
  content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px;
}
.mode-switch.is-open .mode-menu {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
@media (hover: hover) {
  .mode-switch:hover .mode-menu {
    opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
  }
}
.mode-link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 10px; border-radius: 8px; font-size: 12px; color: #c8beaa !important;
  text-decoration: none; letter-spacing: 0.05em; transition: color 160ms, background 160ms; white-space: nowrap;
}
.mode-link:hover { color: #fff4dc !important; background: rgba(201, 168, 106, 0.12); }
.mode-link.is-active { color: #f6e6c4 !important; background: rgba(201, 168, 106, 0.20); font-weight: 500; font-family: var(--sans) !important; }
.mode-link.is-active::after { content: "✦"; font-size: 9.5px; color: var(--gold-hi); }

.gesture-wrap { position: relative; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; flex-shrink: 0; white-space: nowrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  height: 28px; padding: 0 11px; border-radius: 999px;
  border: 1px solid rgba(201, 168, 106, 0.22); background: rgba(12, 10, 8, 0.36);
  color: rgba(237, 230, 214, 0.82); font-size: 11.5px; letter-spacing: 0.05em; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: color 160ms, border-color 160ms, background 160ms, box-shadow 160ms;
}
.chip:hover { color: var(--gold-hi); border-color: rgba(201, 168, 106, 0.52); background: rgba(18, 15, 12, 0.64); }
.chip[aria-pressed="true"] {
  color: var(--gold-hi); border-color: rgba(226, 200, 145, 0.56);
  background: rgba(201, 168, 106, 0.14);
  box-shadow: 0 0 14px rgba(201, 168, 106, 0.18);
}
#soundToggle, .chip-help { width: 28px; padding: 0; justify-content: center; }
#soundToggle { font-size: 13px; }
#soundToggle[aria-pressed="false"] { opacity: 0.56; }

.hud-notice {
  position: fixed; top: max(62px, calc(env(safe-area-inset-top) + 52px)); left: 50%; transform: translateX(-50%);
  z-index: 24; margin: 0; padding: 8px 16px; border-radius: 999px; max-width: min(90vw, 420px);
  background: rgba(16, 14, 11, 0.90); border: 1px solid rgba(223, 193, 136, 0.48);
  color: #f4e2bc; font-size: 12.5px; letter-spacing: 0.04em; text-align: center;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 244, 218, 0.16);
  pointer-events: none;
}

.camera-panel {
  position: fixed; right: 18px; bottom: 116px; width: 182px; z-index: 16;
  background: rgba(16, 15, 12, 0.92); backdrop-filter: blur(10px);
  border: 1px solid #8a7048; border-radius: 14px; padding: 9px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}
.cam-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px; font-size: 11px; color: #d8c49a; letter-spacing: 0.06em; white-space: nowrap;
}
#cameraClose {
  width: 24px; height: 24px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(201, 168, 106, 0.4); background: rgba(16, 14, 12, 0.8);
  color: #e6d6b5; cursor: pointer; font-size: 14px; line-height: 1;
}
.camera-video {
  display: block; width: 100%; height: auto; max-height: 176px; object-fit: contain;
  border-radius: 8px; transform: scaleX(-1); background: #080806;
  border: 1px solid rgba(216, 196, 154, 0.2);
}
.cam-stage { position: relative; border-radius: 8px; overflow: hidden; }
.cam-low-guide {
  position: absolute; left: 4px; right: 4px; bottom: 4px; height: 44%;
  border: 1px dashed rgba(146, 226, 186, 0.48); border-radius: 6px;
  background: linear-gradient(180deg, rgba(82, 196, 148, 0.03) 0%, rgba(82, 196, 148, 0.13) 100%);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 3px;
  font-size: 9px; letter-spacing: 0.04em; color: rgba(206, 246, 224, 0.88);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.92); pointer-events: none; white-space: nowrap;
}
@media (max-width: 650px) { .cam-low-guide { font-size: 8px; padding-bottom: 2px; } }
.cam-status {
  margin: 7px 0 2px; font-size: 11px; line-height: 1.35; color: #ecd9b0; text-align: center;
  white-space: normal; word-break: keep-all;
}
.help-dialog {
  max-width: min(92vw, 520px); padding: 26px 28px; color: #ede6d6;
  background: linear-gradient(165deg, rgba(24, 20, 15, 0.94), rgba(11, 10, 9, 0.96));
  border: 1px solid rgba(223, 193, 136, 0.44); border-radius: 18px; line-height: 1.82;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 26px 68px rgba(0, 0, 0, 0.78), inset 0 1px 0 rgba(255, 244, 218, 0.16);
}
.help-dialog::backdrop { background: rgba(4, 5, 8, 0.72); backdrop-filter: blur(6px); }
.help-close {
  float: right; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(223, 193, 136, 0.42); background: rgba(16, 14, 12, 0.85); color: #e8d8b8; cursor: pointer;
  transition: border-color 160ms, color 160ms, transform 140ms;
}
.help-close:hover { border-color: #f3dfb2; color: #fff5df; }
.help-close:active { transform: scale(0.95); }
.help-dialog h2 { margin: 0 0 12px; font-size: 20px; font-weight: 500; color: var(--gold-hi); letter-spacing: 0.06em; }
.help-dialog p { margin: 10px 0; font-size: 14px; color: var(--ivory); }

.hand-cursor {
  --cursor-scale: 1;
  position: fixed; left: 0; top: 0; z-index: 18;
  width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 999px;
  border: 1.5px solid rgba(236, 208, 152, 0.74);
  background: radial-gradient(circle, rgba(242, 217, 166, 0.28) 0%, rgba(201, 168, 106, 0.06) 65%, transparent 100%);
  box-shadow: 0 0 8px rgba(226, 196, 138, 0.28);
  pointer-events: none; will-change: transform;
  transform: translate3d(-999px, -999px, 0) scale(var(--cursor-scale));
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.hand-cursor[data-dwelling="true"] {
  --cursor-scale: 1.18;
  border-color: rgba(248, 224, 170, 0.90);
  box-shadow: 0 0 12px rgba(240, 208, 146, 0.42);
}
.hand-cursor[data-snapped="true"] {
  --cursor-scale: 1.32;
  border-color: rgba(252, 228, 176, 0.94); background: rgba(245, 214, 148, 0.16);
  box-shadow: 0 0 16px rgba(245, 212, 142, 0.48), inset 0 0 6px rgba(245, 218, 156, 0.26);
}
.hand-cursor.is-pinch, .hand-cursor[data-gesture="fist"], .hand-cursor[data-pose="fist"] {
  --cursor-scale: 1.22;
  border-color: #fff0c8;
  background: radial-gradient(circle, rgba(250, 236, 200, 0.72) 0%, rgba(226, 200, 145, 0.28) 70%, transparent 100%);
  box-shadow: 0 0 16px rgba(245, 212, 142, 0.58);
}
.hand-cursor[data-state="open-required"] {
  --cursor-scale: 1.05;
  border-style: dashed;
  border-color: rgba(164, 214, 255, 0.82);
  background: radial-gradient(circle, rgba(164, 214, 255, 0.20) 0%, transparent 72%);
  box-shadow: 0 0 12px rgba(154, 204, 255, 0.36);
}
.hand-cursor[data-state="motion-blocked"] {
  border-color: rgba(244, 184, 128, 0.84);
  box-shadow: 0 0 12px rgba(244, 176, 112, 0.42);
}
.hand-cursor::after {
  content: "";
  position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(#fff2c8 var(--hold-deg, 0deg), rgba(232, 198, 136, 0.16) 0deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.6px), #000 calc(100% - 2.1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.6px), #000 calc(100% - 2.1px));
  opacity: 0; transition: opacity 0.12s; pointer-events: none;
}
.hand-cursor[data-holding="true"]::after {
  opacity: 1;
}
.status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.question {
  position: fixed; left: 50%; top: max(54px, calc(env(safe-area-inset-top) + 46px)); transform: translateX(-50%);
  margin: 0; padding: 4px 20px; z-index: 9; pointer-events: none; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  white-space: nowrap; transition: opacity 380ms var(--ease-out);
}
.question::before {
  content: ""; position: absolute; inset: -14px -32px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(6, 7, 11, 0.60), rgba(6, 7, 11, 0) 100%);
}
.question .q-main {
  margin: 0; font-size: 20px; font-weight: 400; letter-spacing: 0.32em; padding-left: 0.32em;
  color: rgba(245, 236, 218, 0.94); line-height: 1.4;
  text-shadow: 0 2px 18px rgba(8, 6, 5, 0.95), 0 0 24px rgba(0, 0, 0, 0.85);
}
.question .q-main::after {
  content: ""; display: block; width: 42px; height: 1px; margin: 7px auto 0;
  background: linear-gradient(90deg, transparent, rgba(226, 198, 138, 0.85), transparent);
}
.question .q-sub {
  margin: 0; font-size: 11.5px; letter-spacing: 0.16em; color: #b9ad96;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}
.spread-toggle {
  margin-top: 7px;
  display: inline-flex; align-items: center; gap: 2px; padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(214, 186, 130, 0.28);
  background: rgba(12, 13, 20, 0.62);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 244, 218, 0.10);
  pointer-events: auto;
}
.spread-tab {
  height: 24px; padding: 0 11px; border: none; border-radius: 999px;
  background: transparent; color: rgba(226, 214, 190, 0.72);
  font-size: 11.5px; font-weight: 400; letter-spacing: 0.08em; cursor: pointer;
  transition: color 180ms, background 180ms, box-shadow 180ms;
}
.spread-tab:hover { color: #fcf0d5; }
.spread-tab.is-active {
  color: #19130a; font-weight: 600;
  background: linear-gradient(135deg, #ebd099 0%, #c9a45f 100%);
  box-shadow: 0 0 12px rgba(226, 198, 138, 0.34);
}
body.is-catching .spread-toggle,
body.has-drawn-card .spread-toggle,
body.is-final .spread-toggle,
body.is-complete .spread-toggle,
body.is-reading .spread-toggle {
  pointer-events: none;
}

/* Upper-sky constellation star labels (no card boxes during drawing!) */
.sky-labels {
  position: fixed; inset: 0; z-index: 8; pointer-events: none;
  transition: opacity 280ms var(--ease-out);
}
body.is-final .sky-labels,
body.is-complete .sky-labels,
body.is-reading .sky-labels {
  opacity: 0; pointer-events: none; visibility: hidden;
}
.sky-star-label {
  position: absolute; left: -9999px; top: -9999px;
  transform: translate(-50%, 0);
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(214, 186, 130, 0.28);
  background: radial-gradient(circle at 50% 40%, rgba(16, 18, 26, 0.74), rgba(8, 9, 14, 0.66));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--serif); font-size: 11.5px; letter-spacing: 0.14em;
  color: rgba(238, 222, 188, 0.84);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.96);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  pointer-events: auto; cursor: default; white-space: nowrap;
  transition: color 240ms, opacity 240ms, text-shadow 240ms, border-color 240ms, box-shadow 240ms, transform 220ms var(--ease-out);
}
.sky-star-label.is-next {
  color: #fcf0d5;
  border-color: rgba(242, 212, 150, 0.68);
  background: radial-gradient(circle at 50% 40%, rgba(28, 24, 18, 0.86), rgba(10, 11, 16, 0.78));
  box-shadow: 0 0 16px rgba(226, 196, 138, 0.26), 0 4px 14px rgba(0, 0, 0, 0.55);
  text-shadow: 0 0 12px rgba(226, 196, 138, 0.55), 0 2px 10px rgba(0, 0, 0, 0.95);
  animation: riverStarNextPulse 2.8s ease-in-out infinite;
}
@keyframes riverStarNextPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(226, 196, 138, 0.22), 0 4px 14px rgba(0, 0, 0, 0.55); }
  50% { box-shadow: 0 0 22px rgba(242, 212, 146, 0.46), 0 4px 14px rgba(0, 0, 0, 0.55); }
}
.sky-star-label.is-filled {
  cursor: pointer;
  color: #fbf0d8; font-weight: 500; font-size: 12px;
  padding: 2px 11px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(24, 21, 16, 0.86), rgba(10, 12, 20, 0.84));
  border: 1px solid rgba(238, 208, 148, 0.54);
  backdrop-filter: blur(6px);
  box-shadow: 0 0 18px rgba(226, 196, 138, 0.26), 0 6px 16px rgba(0, 0, 0, 0.6);
  text-shadow: 0 0 12px rgba(232, 202, 142, 0.45), 0 2px 8px rgba(0, 0, 0, 0.98);
}
.sky-star-label.is-filled:hover {
  border-color: #f6e0ae;
  color: #fff7e2;
  transform: translate(-50%, -2px);
}

/* Card name caption positioned cleanly in the upper sky so dripping river water below the lifted card stays 100% unobstructed */
.center-caption {
  position: fixed; left: 50%; top: max(56px, calc(env(safe-area-inset-top) + 48px));
  transform: translateX(-50%);
  z-index: 11; pointer-events: none; opacity: 0; will-change: opacity;
}
.center-caption .cap-in {
  display: inline-flex; align-items: baseline; gap: 10px;
  padding: 6px 20px; border-radius: 999px;
  background: rgba(14, 12, 10, 0.84);
  border: 1px solid rgba(226, 200, 145, 0.50);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 244, 218, 0.14);
  white-space: nowrap;
}
.center-caption .cap-name { font-size: 19px; font-weight: 500; color: var(--ivory); letter-spacing: 0.16em; }
.center-caption .cap-sep { color: var(--gold); opacity: 0.7; }
.center-caption .cap-orient { font-size: 13px; color: var(--gold-hi); letter-spacing: 0.14em; }

/* bottom dock (gesture-first during browse; middle-lower enlarged showcase when complete) */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0 16px max(16px, calc(env(safe-area-inset-bottom) + 10px));
  pointer-events: none;
  transition: bottom 420ms var(--ease-out), transform 420ms var(--ease-out);
}
body.is-complete .dock {
  bottom: 15%;
  gap: 16px;
}
.dock > * { pointer-events: auto; }
body:not(.is-complete) .progress.slots {
  display: none !important;
}
.hint {
  margin: 0; padding: 3px 8px;
  border: none; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
  font-size: 12px; color: rgba(226, 200, 145, 0.72); letter-spacing: 0.08em; pointer-events: none;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100vw - 24px);
  text-shadow: 0 1px 10px rgba(8, 6, 5, 0.96), 0 0 18px rgba(0, 0, 0, 0.86);
  transition: opacity 480ms var(--ease-out);
}
body.is-hud-dim .hint { opacity: 0.42 !important; }
body.is-catching .question,
body.is-catching .hint,
body.has-drawn-card .question,
body.has-drawn-card .hint {
  opacity: 0 !important; pointer-events: none;
}
/* Pure gesture immersion: hide bulky button bar visually while keeping DOM/keyboard accessible */
.ctrl {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.ctrl.off { opacity: 0; pointer-events: none; }
.nav-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(201, 168, 106, 0.26); background: rgba(14, 12, 10, 0.55);
  color: var(--gold); font-size: 24px; line-height: 1; padding: 0 0 3px; cursor: pointer;
}
.catch-btn { min-width: 152px; letter-spacing: 0.24em; padding: 0 28px 0 32px; }
.progress {
  position: relative;
  display: inline-flex; gap: 22px; align-items: flex-start; justify-content: center;
  padding: 14px 24px 12px; border-radius: 20px;
  background: linear-gradient(168deg, rgba(20, 18, 16, 0.86), rgba(10, 10, 13, 0.92));
  border: 1px solid rgba(212, 178, 114, 0.44);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.68), 0 0 24px rgba(201, 168, 106, 0.16), inset 0 1px 0 rgba(255, 244, 218, 0.18);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.slot-pill {
  display: inline-flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 2px 4px; border-radius: 10px;
  background: transparent; border: none;
  color: var(--text-2); font-size: 13px; letter-spacing: 0.08em;
  cursor: pointer; transition: color 240ms, transform 200ms;
}
.slot-pill:hover { transform: translateY(-3px); }
.slot-pill.is-next { color: var(--gold-hi); }
.slot-pill.is-filled { color: var(--ivory); }
.slot-well {
  position: relative; overflow: hidden;
  width: 82px; height: 123px; border-radius: 8px;
  border: 1px solid rgba(242, 214, 156, 0.88);
  background: radial-gradient(circle at 50% 42%, rgba(201, 168, 106, 0.14), rgba(10, 8, 6, 0.92));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.72), 0 0 14px rgba(212, 175, 106, 0.28);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 240ms, box-shadow 240ms, transform 240ms;
}
.slot-empty-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 12px; color: rgba(216, 194, 152, 0.68); letter-spacing: 0.08em;
  pointer-events: none; z-index: 1; transition: opacity 220ms, color 220ms;
}
.slot-pill.is-filled .slot-empty-label { opacity: 0; visibility: hidden; }
.slot-card-img {
  position: relative; z-index: 2;
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 7px;
  filter: brightness(1.20) contrast(1.06) saturate(1.06);
}
.slot-card-img.is-reversed { transform: rotate(180deg); }
.slot-card-name {
  font-family: var(--serif); font-size: 13px; line-height: 1.2; min-height: 16px; letter-spacing: 0.06em;
  color: #f6e7c6; font-weight: 500; max-width: 96px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slot-card-name:empty { display: none; }
body.is-five-stage .progress { gap: 14px; padding: 12px 18px 10px; }
body.is-five-stage .slot-well { width: 72px; height: 108px; }
body.is-five-stage .slot-card-name { font-size: 12px; max-width: 78px; }
.restart, .reopen-btn { height: 44px; padding: 0 26px; font-size: 14.5px; }
.restart { background: rgba(14, 12, 10, 0.84); border-color: rgba(201, 168, 106, 0.48); backdrop-filter: blur(8px); }
.complete-actions { display: flex; gap: 16px; align-items: center; justify-content: center; }

/* Unified reading modal handles reading view */
.reading {
  display: none !important;
}

@media (max-width: 650px) {
  .top { padding: max(10px, env(safe-area-inset-top)) 10px 0; gap: 4px; }
  .crumb { gap: 4px; font-size: 11px; letter-spacing: 0.02em; }
  .crumb-btn { padding: 2px 1px; font-size: 11px; letter-spacing: 0.02em; }
  .crumb-sep { font-size: 10px; }
  .mode-trigger { height: 24px; padding: 0 8px; font-size: 10.5px; letter-spacing: 0.02em; gap: 3px; }
  .mode-spark, .mode-caret { font-size: 8.5px; }
  .mode-menu { min-width: 118px; padding: 4px; }
  .mode-link { padding: 5px 8px; font-size: 11px; letter-spacing: 0.03em; }
  .gesture-wrap { gap: 4px; }
  .chip { height: 24px; padding: 0 7px; font-size: 10.5px; letter-spacing: 0.02em; }
  #soundToggle, .chip-help { width: 24px; height: 24px; padding: 0; font-size: 11.5px; }
  .camera-panel {
    top: auto;
    bottom: max(56px, calc(env(safe-area-inset-bottom) + 48px));
    right: 8px; width: 114px; padding: 5px; border-radius: 10px;
  }
  .camera-video { max-height: 112px; }
  .cam-head { font-size: 9.5px; margin-bottom: 3px; }
  #cameraClose { width: 19px; height: 19px; font-size: 11.5px; }
  .cam-status { font-size: 9.5px; line-height: 1.28; margin: 4px 0 1px; white-space: normal; }
  .question { top: max(48px, calc(env(safe-area-inset-top) + 42px)); }
  .question .q-main { font-size: 17px; letter-spacing: 0.22em; padding-left: 0.22em; }
  .question .q-sub { font-size: 10.5px; letter-spacing: 0.1em; }
  .center-caption { top: max(48px, calc(env(safe-area-inset-top) + 42px)); }
  .center-caption .cap-in { padding: 5px 15px; gap: 8px; }
  .center-caption .cap-name { font-size: 16px; }
  .center-caption .cap-orient { font-size: 11.5px; }
  .dock { gap: 5px; padding: 0 10px max(10px, calc(env(safe-area-inset-bottom) + 6px)); }
  body.is-complete .dock { bottom: 14%; gap: 14px; }
  .progress { gap: 14px; padding: 12px 16px 10px; border-radius: 16px; }
  .slot-pill { padding: 2px 3px; gap: 5px; }
  .slot-well { width: 68px; height: 102px; border-radius: 7px; }
  .slot-empty-label { font-size: 11px; }
  .slot-card-name { font-size: 11.5px; max-width: 82px; }
  .sky-star-label { font-size: 10.5px; }
  .sky-star-label.is-filled { font-size: 11px; }
  .spread-toggle { margin-top: 5px; }
  .spread-tab { height: 22px; padding: 0 9px; font-size: 10.5px; letter-spacing: 0.05em; }
  body.is-five-stage .sky-star-label { padding: 2px 7px; font-size: 10px; letter-spacing: 0.08em; }
  body.is-five-stage .sky-star-label.is-filled { padding: 2px 8px; font-size: 10px; }
  body.is-five-stage .progress { gap: 7px; padding: 10px 10px 8px; border-radius: 14px; }
  body.is-five-stage .slot-pill { padding: 1px 1px; gap: 4px; }
  body.is-five-stage .slot-well { width: 56px; height: 84px; border-radius: 6px; }
  body.is-five-stage .slot-empty-label { font-size: 9.5px; }
  body.is-five-stage .slot-card-name { font-size: 10px; max-width: 58px; letter-spacing: 0.02em; }
  .hint { font-size: 10.5px; padding: 2px 6px; letter-spacing: 0.03em; max-width: calc(100vw - 16px); }
  .restart, .reopen-btn { height: 40px; padding: 0 22px; font-size: 13.5px; }
}

@media (max-width: 380px) {
  .crumb-home, .crumb-home + .crumb-sep { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sky-star-label.is-next { animation: none; }
  .top, .hint, .question, .sky-labels, .hand-cursor, .mode-menu { transition: none !important; }
}

[hidden] { display: none !important; }
