:root { color-scheme: dark; --bg: #0f0f10; --fg: #f6f3ee; --muted: #b9b2a8; --gold: #d9b26a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Heebo", Arial, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
[hidden] { display: none !important; }
#t-cam { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
#t-view { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }

.top { position: fixed; z-index: 5; top: calc(env(safe-area-inset-top) + 10px); inset-inline: 10px; display: flex; gap: 8px; justify-content: flex-start; }
.top button { background: rgba(15, 15, 16, .62); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 8px 14px; font-size: 14px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.top button.on { border-color: var(--gold); color: var(--gold); }
body:not(.live) .top { display: none; }

.hint { position: fixed; z-index: 4; top: calc(env(safe-area-inset-top) + 62px); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px);
  background: rgba(15, 15, 16, .72); border: 1px solid rgba(255, 255, 255, .16); border-radius: 14px; padding: 10px 16px; font-size: 16px; line-height: 1.35; text-align: center;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hint.soft { font-size: 14px; opacity: .85; }

.dbg { position: fixed; z-index: 4; top: calc(env(safe-area-inset-top) + 120px); right: 10px; margin: 0; padding: 8px 10px; max-width: calc(100% - 20px);
  background: rgba(0, 0, 0, .6); border-radius: 10px; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; direction: rtl; }

.sheet { position: fixed; z-index: 6; top: calc(env(safe-area-inset-top) + 58px); inset-inline: 10px; max-width: 420px; padding: 14px 16px;
  background: rgba(20, 20, 22, .94); border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; display: grid; gap: 12px; font-size: 15px; }
.sheet label { display: grid; gap: 6px; }
.sheet select, .sheet input { width: 100%; font: inherit; }
.sheet select { padding: 8px; border-radius: 10px; background: #2a2a2d; color: var(--fg); border: 1px solid #444; }
.sheet p { margin: 0; color: var(--muted); font-size: 13px; }

.chip { position: fixed; z-index: 4; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 112px); width: max-content; max-width: calc(100% - 28px);
  background: rgba(15, 15, 16, .62); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.chip.ok { color: #9fe3bd; }

.products { position: fixed; z-index: 5; inset-inline: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 10px 10px calc(env(safe-area-inset-bottom) + 10px); background: linear-gradient(to top, rgba(10, 10, 11, .88), rgba(10, 10, 11, .45) 75%, transparent); }
body:not(.live) .products { display: none; }
.product { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.product img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.product .pl { font-size: 14px; font-weight: 600; }
.product .pn { font-size: 11px; color: var(--muted); }
.product.on { border-color: var(--gold); background: rgba(217, 178, 106, .16); }

.intro { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 30%, #2a2622, #0f0f10 70%); overflow: auto; }
.card { max-width: 440px; text-align: center; }
.card h1 { font-size: 26px; margin: 0 0 10px; color: var(--gold); font-weight: 600; }
.card p { line-height: 1.5; margin: 0 0 12px; }
.card ul { text-align: start; color: var(--muted); line-height: 1.55; margin: 0 0 18px; padding-inline-start: 20px; font-size: 15px; }
#t-startBtn { background: var(--gold); color: #1a1408; border: 0; border-radius: 999px; padding: 14px 34px; font-size: 18px; font-weight: 700; margin: 4px 0 12px; }
.small { font-size: 13px !important; color: var(--muted); }

.error { position: fixed; z-index: 20; inset-inline: 16px; top: 30%; padding: 18px; border-radius: 16px; background: #2b1717; border: 1px solid #7a3a3a; line-height: 1.5; text-align: center; }
