:root {
  --ink: #0c1014;
  --ink-soft: #141a22;
  --panel: rgba(18, 24, 32, 0.78);
  --parchment: #e8dfd0;
  --parchment-dim: #c4b8a4;
  --gold: #b8955a;
  --gold-bright: #d4b078;
  --text: #ece6db;
  --muted: #9a9286;
  --ok: #7aab8a;
  --bad: #c9786e;
  --border: rgba(184, 149, 90, 0.28);
  --accent: var(--gold);
  --accent-dim: #8a6f42;
  --bg: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(165deg, rgba(8, 10, 14, 0.72) 0%, rgba(12, 16, 20, 0.88) 45%, rgba(10, 12, 16, 0.94) 100%),
    url("assets/hero-palm.jpg") center / cover no-repeat fixed;
  background-color: var(--ink);
}

.site-header {
  padding: 1rem 1.25rem 0.35rem;
  max-width: 720px;
  margin: 0 auto;
}

.brand-mark {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  line-height: 1.1;
}

.banner {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.banner.ok { color: var(--ok); }
.banner.warn { color: var(--gold-bright); }
.banner.bad { color: var(--bad); }

.mode-banner {
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gold-bright);
}

.mode-title {
  margin: 0 0 0.35rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--parchment);
}

.back-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.phase-label {
  margin: 0.5rem 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-bright);
}

.scan-status-banner {
  margin: 0 0 0.5rem;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid rgba(232, 223, 208, 0.28);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.scan-status-banner.hidden { display: none; }

.panel:not(.active) video,
.panel:not(.active) .camera-overlays {
  display: none !important;
}

.header-home {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.home-btn {
  width: 100%;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--gold);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.verify-enroll-new {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(18, 24, 32, 0.55);
  display: grid;
  gap: 0.65rem;
}

.verify-enroll-new.hidden {
  display: none;
}

.verify-enroll-new label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.verify-enroll-new input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--ink-soft);
  color: var(--text);
  font: inherit;
}

.verify-enroll-new button {
  width: 100%;
}
  cursor: pointer;
}

main {
  padding: 0 1rem 2.5rem;
  max-width: 720px;
  margin: 0 auto;
}

.panel {
  display: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1rem 1.25rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(10px);
  animation: panelIn 0.45s ease both;
}

.panel.active { display: block; }

@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

#panel-home.active {
  background: transparent;
  border: none;
  padding: 0;
  backdrop-filter: none;
  min-height: calc(100vh - 7rem);
  display: flex;
  flex-direction: column;      /* hero, then the result charts beneath it (a row put them side by side) */
  align-items: stretch;
  justify-content: flex-end;
}
#panel-home.active .home-hero { flex: 0 0 auto; }

.home-hero {
  width: 100%;
  padding: 2.5rem 0.5rem 1.5rem;
}

.home-brand {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(3.4rem, 14vw, 5.2rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--parchment);
  line-height: 0.95;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.55);
  animation: brandRise 0.9s ease both;
}

.home-tagline {
  margin: 0.85rem 0 0;
  max-width: 22rem;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--parchment-dim);
  animation: brandRise 0.9s ease 0.12s both;
}

.home-cta {
  margin-top: 1.5rem;
  animation: brandRise 0.9s ease 0.22s both;
}

.home-signed {
  margin-top: 1.25rem;
  font-size: 0.85rem;
}

@keyframes brandRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.cta-primary {
  background: var(--gold);
  color: var(--ink);
  border: none;
  padding: 0.8rem 1.35rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
}

label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

input, select {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--ink-soft);
  color: var(--text);
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.muted { color: var(--muted); font-weight: 400; }

.camera-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 3 / 4;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  isolation: isolate;
  contain: layout paint;
  margin: 0.75rem 0;
}

.camera-stack { position: absolute; inset: 0; overflow: hidden; }

.camera-overlays {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.camera-wrap.mirror-preview .camera-stack video {
  transform: scaleX(-1);
  -webkit-transform: scaleX(-1);
}

.camera-stack video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  z-index: 0;
  cursor: pointer;
}

.camera-stack video.camera-hidden {
  visibility: hidden;
  opacity: 0;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.guide-box {
  position: absolute;
  z-index: 2;
  border: 2px dashed rgba(212, 176, 120, 0.4);
  border-radius: 8px;
  pointer-events: none;
  box-sizing: border-box;
}

.face-oval {
  display: none;
  position: absolute;
  left: 50%;
  top: 46%;
  width: 58%;
  height: 72%;
  transform: translate(-50%, -50%);
  z-index: 3;
  border: 2px solid rgba(212, 176, 120, 0.9);
  border-radius: 50%;
  pointer-events: none;
  box-sizing: border-box;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.38);
}

.camera-wrap.face-mode .guide-box {
  display: none;
}

.camera-wrap.face-mode .face-oval {
  display: block;
}

.size-hud {
  position: absolute;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: auto;
  z-index: 16;
  width: 7.6rem;
  min-width: 7.6rem;
  max-width: 7.6rem;
  min-height: 3.4rem;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
  white-space: pre-line;
  line-height: 1.25;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.size-hud.idle { color: rgba(255, 255, 255, 0.75); }

/* Tilt-guided registration: pose coverage (flat + four directions) and the current tilt readout. */
.tilt-hud {
  position: absolute;
  left: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 19;
  max-width: calc(100% - 8.6rem);
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  pointer-events: none;
  white-space: pre-line;
  line-height: 1.3;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.tilt-hud.ok {
  color: #7dff9a;
  border-color: rgba(125, 255, 154, 0.45);
}
.tilt-hud.wait { color: #ffd27d; }
.size-hud.ok {
  color: #7dff9a;
  border: 1px solid rgba(125, 255, 154, 0.45);
}
.size-hud.closer,
.size-hud.further {
  color: #ffb347;
  border: 1px solid rgba(255, 179, 71, 0.45);
}

.hold-still {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: clamp(2.1rem, 11vw, 3.6rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  color: #7dff9a;
  text-shadow: 0 0 2px #000, 0 3px 14px rgba(0, 0, 0, 0.95);
  animation: hold-still-pulse 1.1s ease-in-out infinite;
}

.hold-still span {
  padding: 0.38em 0.58em;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.72);
  border: 3px solid #7dff9a;
}

.hold-still.other-hand { color: #ffb347; z-index: 15; }
.hold-still.other-hand span { border-color: #ffb347; display: flex; flex-direction: column; align-items: center; gap: 0.25em; }
.hold-still.other-hand small { font-size: 0.34em; font-weight: 600; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.9); }

/* Registration flat phase (18 Sep): point at palm / un-tilt palm / hold still, centred like HOLD STILL.
   Orange while it is an instruction, green once the palm is level and flat frames are being taken. */
.hold-still.flat-guide { color: #ffb347; font-size: clamp(1.5rem, 7.5vw, 2.6rem); letter-spacing: 0.08em; text-align: center; }
.hold-still.flat-guide span { border-color: #ffb347; display: flex; flex-direction: column; align-items: center; gap: 0.3em; max-width: 86%; }
.hold-still.flat-guide b { font-weight: 800; }
.hold-still.flat-guide small { font-size: 0.62em; font-weight: 700; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.95); }
.hold-still.flat-guide small:empty { display: none; }
.hold-still.flat-guide.level { color: #7dff9a; }
.hold-still.flat-guide.level span { border-color: #7dff9a; }

@keyframes hold-still-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.88; transform: scale(1.045); }
}

.camera-scan-prompt {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 10px;
  right: auto;
  z-index: 19;
  max-width: calc(100% - 6.75rem);
  white-space: pre-line;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  pointer-events: none;
}

/* Tilt-guided registration prompt: hand quiet, instruction loud, coverage dim. */
.camera-scan-prompt .prompt-hand { color: rgba(255, 255, 255, 0.85); font-weight: 600; }
.camera-scan-prompt .prompt-action {
  color: #ffb347;
  font-size: 1.25em;
  font-weight: 800;
  text-shadow: 0 0 2px #000;
}
.camera-scan-prompt.pose-ok .prompt-action { color: #7dff9a; }
.camera-scan-prompt .prompt-coverage {
  display: inline-block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82em;
  font-weight: 500;
}

.camera-complete-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: #000;
  color: #fff;
  text-align: center;
  pointer-events: none;
}

.camera-complete-overlay p {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.45;
  max-width: 16rem;
}

.hidden { display: none !important; }

.progress { margin: 0.5rem 0; }

progress {
  width: 100%;
  height: 8px;
  margin-top: 0.35rem;
  accent-color: var(--gold);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

button {
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.file-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.file-btn input { display: none; }

.message {
  min-height: 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.message.ok { color: var(--ok); }
.message.bad { color: var(--bad); }

.consent-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  margin: 1rem 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--parchment-dim);
}

.consent-box a { color: var(--gold-bright); }

.consent-check {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 1rem 0;
}

.legal-footer {
  margin: 1.25rem 0 0;
  font-size: 0.85rem;
  text-align: center;
  color: var(--muted);
}

.legal-footer a { color: var(--gold-bright); }

.legal-page {
  padding: 0 1.25rem 2rem;
  max-width: 42rem;
}

.legal-page a { color: var(--gold-bright); }

/* Loading */
.loading-stage {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.25rem;
  padding: 2rem 1rem;
}

.loading-brand {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.4rem;
  color: var(--parchment);
  letter-spacing: 0.04em;
}

.loading-pulse {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 2px solid rgba(184, 149, 90, 0.25);
  border-top-color: var(--gold-bright);
  animation: spin 1.1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-copy {
  margin: 0;
  color: var(--parchment-dim);
  font-size: 1.05rem;
  max-width: 18rem;
  line-height: 1.4;
}

/* Fortune reveal */
.fortune-hands {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0.5rem 0 1.25rem;
}

.fortune-hand {
  margin: 0;
}

.fortune-hand figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fortune-hand img {
  width: 100%;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #000;
  animation: revealFade 0.7s ease both;
}

@keyframes revealFade {
  from { opacity: 0; filter: brightness(0.7); }
  to { opacity: 1; filter: brightness(1); }
}

.fortune-intro {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--parchment);
  margin: 0 0 1rem;
}

.fortune-section-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.2rem;
  color: var(--gold-bright);
  margin: 1.25rem 0 0.5rem;
}

.fortune-para {
  margin: 0 0 0.85rem;
  line-height: 1.55;
  color: var(--parchment-dim);
  font-size: 1.02rem;
}

.claim-link {
  color: var(--parchment);
  text-decoration: underline;
  text-decoration-color: rgba(184, 149, 90, 0.55);
  text-underline-offset: 3px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  display: inline;
}

.claim-link:hover,
.claim-link:focus-visible {
  text-decoration-color: var(--gold-bright);
  color: var(--gold-bright);
}

.fortune-disclaimer {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Line attribution modal */
.line-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.line-modal.hidden { display: none !important; }

.line-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 8, 0.78);
  animation: panelIn 0.25s ease both;
}

.line-modal-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--ink-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1rem 1rem;
  animation: panelIn 0.3s ease both;
}

.line-modal-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--parchment);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.line-modal-title {
  margin: 0 1.5rem 0.35rem 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  color: var(--gold-bright);
  text-transform: capitalize;
}

.line-modal-claim {
  margin: 0 0 0.85rem;
  color: var(--parchment-dim);
  line-height: 1.45;
  font-size: 0.98rem;
}

.line-modal-card img {
  width: 100%;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--border);
}

@media (max-width: 480px) {
  .fortune-hands { grid-template-columns: 1fr 1fr; }
}

/* Camera fills the visible phone screen. svh avoids iPhone URL-bar overflow;
   Android Chrome treats svh/dvh similarly. */
body:has(#panel-verify.active),
body:has(#panel-register.active) {
  overflow: hidden;
}

#panel-verify.active,
#panel-register.active {
  position: relative;
  padding: 0;
  margin: 0;
  background: #000;
  border: none;
  border-radius: 0;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  height: 100svh;
  max-height: 100svh;
}

body:has(#panel-verify.active) .site-header,
body:has(#panel-register.active) .site-header {
  display: none;
}

body:has(#panel-verify.active) main,
body:has(#panel-register.active) main {
  padding: 0;
  max-width: none;
  overflow: hidden;
}

#panel-verify .phase-label,
#panel-verify .scan-status-banner,
#panel-verify #verify-hint,
#panel-verify #verify-align,
#panel-verify #verify-user-status,
#panel-verify .progress,
#panel-verify .actions,
#panel-register .phase-label,
#panel-register .scan-status-banner,
#panel-register .hint,
#panel-register .progress,
#panel-register .actions,
#panel-register .home-btn {
  display: none !important;
}

#panel-verify .camera-wrap,
#panel-register .camera-wrap {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 10px;
}

#panel-verify .back-link,
#panel-register .back-link {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 10px;
  left: auto;
  z-index: 22;
  margin: 0;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-weight: 600;
}

#panel-verify #verify-message,
#panel-register #register-message {
  position: absolute;
  left: 10px;
  right: auto;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 16;
  max-width: calc(100% - 8.6rem);
  margin: 0;
  min-height: 0;
  padding: 8px 10px;
  border-radius: 6px;
  text-align: left;
  text-shadow: none;
  pointer-events: none;
}

/* Register: the bottom-left corner belongs to the tilt readout, so messages sit in a band just above
   the two HUDs, centred. */
#panel-register #register-message {
  left: 10px;
  right: 10px;
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 4.4rem);
  max-width: none;
  text-align: center;
  z-index: 20;
}

#panel-verify #verify-message:not(:empty),
#panel-register #register-message:not(:empty) {
  background: rgba(0, 0, 0, 0.78);
}

/* Rolling registration level (capture.js updateRollGuide): ring = tilt cap, orange marker = next empty bin,
   white dot = live palm normal (green while a frame is being banked). */
.roll-guide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.roll-guide.hidden { display: none; }
.roll-ring {
  position: relative;
  width: 58%;
  max-width: 280px;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), inset 0 0 0 2px rgba(0, 0, 0, 0.35);
}
.roll-guide.far .roll-ring { border-color: #ff6b6b; }
.roll-cross {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28)) center/1px 100% no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28)) center/100% 1px no-repeat;
  border-radius: 50%;
}
.roll-target, .roll-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -14px 0 0 -14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.roll-target {
  border: 3px solid #ffb347;
  background: rgba(255, 179, 71, 0.18);
  box-shadow: 0 0 10px rgba(255, 179, 71, 0.7);
  transition: transform 450ms ease-out;
}
.roll-target.hidden { display: none; }
.roll-dot {
  margin: -10px 0 0 -10px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
  transition: transform 80ms linear;
}
.roll-dot.lost { opacity: 0.35; }
.roll-board {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  overflow: visible;
}
.roll-sector {
  fill: rgba(255, 255, 255, 0.07);
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 1.2;
  transition: fill 200ms linear;
}
.roll-sector.filled { fill: rgba(125, 255, 154, 0.55); stroke: rgba(125, 255, 154, 0.9); }
.roll-guide.paint .roll-cross { display: none; }
.roll-guide.flat-phase .roll-sector { opacity: 0.35; }
.roll-guide.flat-phase .roll-target { display: none; }
/* The live dot (the palm normal): hidden in the flat phase; moved by a spring every animation frame in
   capture.js (rollDotFrame), so no CSS easing on top. */
.roll-guide.dot-off .roll-dot { display: none; }
.roll-guide .roll-dot { transition: none; }
/* ?tiltdebug=1 readout */
.tilt-debug {
  position: absolute;
  right: 6px;
  top: 52px;
  z-index: 25;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #7dff9a;
  font: 11px/1.3 ui-monospace, Menlo, Consolas, monospace;
  white-space: pre;
  pointer-events: none;
}
/* Palm registration: distance goes in the centre box (MOVE CLOSER / MOVE BACK), so no size box bottom right. */
.camera-wrap.hud-off .size-hud { display: none !important; }

/* Registration explainer (18 Sep): Jorik's 3D hand with the ring and dot, over the live camera. */
.explainer {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: auto;   /* .camera-overlays passes taps through; the button needs them */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.explainer-stage { position: relative; flex: none; }
.explainer-hand { position: absolute; inset: 0; }
.roll-ring.explainer-ring { position: absolute; max-width: none; aspect-ratio: auto; }
.explainer-text {
  margin: 0;
  max-width: 22rem;
  text-align: center;
  color: #f2e9d0;
  font-size: 1.05rem;
  line-height: 1.35;
  text-shadow: 0 1px 3px #000;
}
.roll-guide.ok .roll-dot { background: #7dff9a; }
.roll-guide.ok .roll-target { border-color: #7dff9a; }

/* Homepage result charts (20 RGB-Cross-Match/tools/mue_homepage_charts.py) */
.results-charts {
  /* full-bleed: break out of the 720-px panel to the viewport width, under the buttons. The transform form
     is the one iOS Safari honours with overflow-x hidden on html. */
  position: relative;
  width: 100vw;
  max-width: 100vw;
  left: 50%;
  transform: translateX(-50%);
  margin: 1.4rem 0 0.6rem;
  padding: 0 clamp(8px, 2vw, 24px);
  box-sizing: border-box;
}
.results-charts h3 { margin: 0 0 0.5rem; font-size: 1.05rem; color: #d4af37; font-weight: 600; letter-spacing: 0.02em; }
.results-charts img { display: block; width: 100%; height: auto; border-radius: 10px; margin: 0 0 0.9rem; border: 1px solid rgba(212, 175, 55, 0.25); }
.results-charts .results-note { margin: 0.2rem 0 0; font-size: 0.82rem; color: rgba(255, 255, 255, 0.65); line-height: 1.35; }

/* Roll registration: the instruction sits top-centre over the palm, not tucked in the corner. */
.camera-scan-prompt.roll-centre {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  max-width: min(92%, 30rem);
  text-align: center;
}
.camera-scan-prompt.roll-centre .prompt-action { display: block; font-size: 1.15em; margin-top: 2px; }

/* ------------------------------------------------------------------------------------------------
   Boop theme (1 Oct 2026): colours, type and shapes from boop.it. Layered over the original rules
   above so the capture screens keep their layout; the camera HUD colours are left as they were.
   ------------------------------------------------------------------------------------------------ */
:root {
  --ink: #000000;
  --ink-soft: #0c0c0f;
  --panel: #0c0c0f;
  --parchment: #ececec;
  --parchment-dim: #969696;
  --gold: #3c6ec8;          /* Boop primary button */
  --gold-bright: #5fa5ff;   /* Boop blue: links and highlights */
  --text: #ececec;
  --muted: #969696;
  --ok: #6fd39a;
  --bad: #ff7a70;
  --border: #3a3a40;
  --accent: var(--gold-bright);
  --accent-dim: #2c2c30;
  --bg: #000000;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body { background: #000; }

.site-header { padding: 1.1rem 1rem 0.6rem; }
.brand-mark { display: flex; align-items: center; gap: 0.7rem; font-family: inherit; }
.brand-logo { height: 26px; width: auto; display: block; filter: brightness(0) invert(1); opacity: 0.93; }
.brand-sub {
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 400; padding-top: 3px;
}

.mode-title, .home-brand, .loading-brand, .fortune-section-title, .line-modal-title {
  font-family: inherit;
}
.mode-title { font-size: 1.7rem; font-weight: 300; letter-spacing: -0.01em; color: var(--text); }

.panel {
  background: var(--panel);
  border: 1px solid #2c2c30;
  border-radius: 20px;
  padding: 1.25rem 1.1rem 1.4rem;
  backdrop-filter: none;
}

.home-brand {
  font-size: clamp(40px, 12vw, 52px);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: var(--text);
  text-shadow: none;
}
.home-tagline { color: var(--muted); font-size: 1.05rem; }

button, .file-btn {
  min-height: 48px;
  padding: 0 1.4rem;
  border-radius: 24px;
  font-size: 1rem;
  font-weight: 400;
  color: #fff;
  background: var(--gold);
  border: 1px solid var(--gold);
  transition: background 0.15s, border-color 0.15s;
}
button:hover:not(:disabled) { background: #4a7dd6; border-color: #4a7dd6; }
button.secondary, .file-btn {
  background: transparent;
  border: 1px solid #8c8c92;
  color: #fff;
}
button.secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); border-color: #fff; }
.cta-primary { background: var(--gold); color: #fff; border: 1px solid var(--gold); border-radius: 24px; font-weight: 400; }
.back-link, .header-home { color: var(--gold-bright); }

input, select {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #000;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
}
input:focus, select:focus { outline: none; border-color: var(--gold-bright); }

a, .consent-box a, .legal-footer a, .legal-page a { color: var(--gold-bright); }
.consent-box { background: #000; border-color: #2c2c30; border-radius: 14px; color: #c8c8c8; }

progress { accent-color: var(--gold-bright); }

.results-charts h3 { color: var(--text); font-weight: 400; }
.results-charts img { border-color: #2c2c30; border-radius: 14px; }

.loading-brand .brand-logo { height: 40px; margin: 0 auto; }
/* The result charts were drawn in Mue gold; turn the gold bars Boop blue without redrawing them. */
.results-charts img { filter: hue-rotate(180deg) saturate(1.3) brightness(1.15); }
/* 16 px side gutter on phones, as on boop.it */
main { padding-left: 16px; padding-right: 16px; }
.site-header { padding-left: 16px; padding-right: 16px; }
/* Wave registration (1 Oct): the ring is the reach of the palm centre, 22 % of the view's width from the
   middle (the scanner's wave radius), so a palm at the edge cell is still in view. */
.roll-guide.wave .roll-ring { width: 44%; max-width: none; }
