/* filters: one viewport camera app, mobile first, dark DAEMONS palette. Only dialogs scroll. */
:root {
  color-scheme: dark;
  --bg: #0b0c0a; --bg2: #121411; --card: #171a15; --card2: #1f231c; --line: #2a3025; --line2: #3c4535;
  --ink: #f2f6ec; --mute: #a3ad98; --lime: #c6ff4d; --lime-ink: #10160a; --lime-soft: #c6ff4d1a;
  --lav: #b9a7ff; --coral: #ff8a70; --r: 14px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; color: var(--ink); font: 16px/1.45 var(--font); background: var(--bg); }
.defs { position: absolute; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { width: 20px; height: 20px; flex: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--lav); outline-offset: 2px; }
a { color: var(--lime); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(1.4rem, 6vw, 2.1rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.mute { color: var(--mute); }
.small { font-size: .9rem; }
.err { color: var(--coral); }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }

.app { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; min-height: 44px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand span { display: flex; flex-direction: column; line-height: 1.05; }
.brand b { font-size: 1.1rem; }
.brand small { color: var(--mute); font-size: .76rem; }
.top-actions { display: flex; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--lime); background: var(--lime-soft); color: var(--lime); font-weight: 700; white-space: nowrap; }
.pill.on { background: var(--lime); color: var(--lime-ink); }
.pill.ghosty { border-color: var(--line2); background: var(--card); color: var(--ink); }
.pill.ghosty svg { color: var(--lav); }
@media (max-width: 380px) { .pill.ghosty span { display: none; } .pill.ghosty { padding: 0 12px; } }

.stage { position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden; background: repeating-conic-gradient(#14160f 0 25%, #10120d 0 50%) 0 0 / 28px 28px; }
#out { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; }
.stage.live #out { box-shadow: 0 0 0 1px var(--line); }
.intro { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: 8px; padding: 16px 20px; overflow: auto; background: radial-gradient(90% 60% at 50% 20%, #1c2a10, var(--bg) 70%); }
.intro p { margin: 0; max-width: 34ch; }
#intro-art { width: min(40vw, 22dvh, 180px); height: auto; aspect-ratio: 1; }
.primary { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--lime); color: var(--lime-ink); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.primary.big { min-height: 54px; padding: 0 26px; font-size: 1.08rem; margin: 6px 0; }
.ghost { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card2); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.rec { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: #0b0c0acc; padding: 6px 12px; border-radius: 999px; font-weight: 800; }
.rec i { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.hint { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); margin: 0; background: #0b0c0acc; padding: 5px 12px; border-radius: 999px; font-size: .85rem; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.hint:empty { display: none; }

.controls { display: grid; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg2); }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--card); border-radius: 999px; padding: 4px; border: 1px solid var(--line); }
.modes button { min-height: 40px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; color: var(--mute); }
.modes button[aria-checked="true"] { background: var(--lime); color: var(--lime-ink); }
.masks { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.masks::-webkit-scrollbar { display: none; }
.mask { flex: none; width: 56px; height: 56px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); padding: 3px; position: relative; display: grid; place-items: center; }
.mask canvas { width: 100%; height: 100%; }
.mask[aria-selected="true"] { border-color: var(--lime); }
.mask .lk { position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; border-radius: 999px; background: #0b0c0acc; color: var(--coral); display: grid; place-items: center; }
.mask .lk svg { width: 11px; height: 11px; }
.mask.add { color: var(--lav); border-style: dashed; }
.mask .own { position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; }
.shoot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; }
.round { width: 52px; height: 52px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card2); display: grid; place-items: center; }
.shutter { width: 70px; height: 70px; border-radius: 999px; border: 4px solid var(--ink); background: transparent; padding: 4px; }
.shutter span { display: block; width: 100%; height: 100%; border-radius: 999px; background: var(--lime); }
.recbtn span { width: 20px; height: 20px; border-radius: 999px; background: var(--coral); }
.recbtn.on span { border-radius: 4px; }
.controls button:disabled { opacity: .45; cursor: default; }

dialog { color: var(--ink); background: var(--bg2); border: 1px solid var(--line2); border-radius: 20px; padding: 20px; width: min(94vw, 460px); max-height: min(92dvh, 760px); overflow: auto; overscroll-behavior: contain; }
dialog::backdrop { background: #000b; }
.x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--card2); display: grid; place-items: center; }
.result { margin: 6px 0 14px; display: grid; place-items: center; }
.result img, .result video { max-width: 100%; max-height: 52dvh; border-radius: 14px; border: 1px solid var(--line); }
.actions { display: flex; gap: 8px; }
.actions > * { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 10px 0; display: grid; gap: 6px; }
.card p { margin: 0; }
.buy { display: flex; flex-wrap: wrap; gap: 8px; }
.buy .owned { color: var(--lime); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.idrow { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line2); border-radius: 999px; padding: 4px 4px 4px 14px; margin: 10px 0; }
.idrow .hash { color: var(--mute); font-weight: 700; }
.idrow input { flex: 1; width: 0; min-width: 0; border: 0; background: transparent; font-size: 1.1rem; padding: 8px 0; outline: none; }
.wallets { display: grid; gap: 8px; margin: 12px 0; }
.wbtn { display: flex; align-items: center; gap: 12px; min-height: 56px; border-radius: 14px; border: 1px solid var(--line2); background: var(--card); padding: 8px 12px; text-align: left; }
.wbtn .wico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--card2); }
.wbtn .wname { flex: 1; font-weight: 700; }
.wbtn .wsub { color: var(--mute); font-size: .8rem; }
.toast { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); background: var(--lime); color: var(--lime-ink); font-weight: 700; padding: 10px 16px; border-radius: 999px; z-index: 50; max-width: 90vw; text-align: center; }
body.lost main { height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; }
body.lost img { image-rendering: pixelated; }

/* Landscape phones and wide screens: controls move to a side column. */
@media (orientation: landscape) and (min-width: 560px) {
  .app { grid-template-columns: minmax(0, 1fr) clamp(250px, 30vw, 340px); grid-template-rows: auto minmax(0, 1fr); padding-bottom: env(safe-area-inset-bottom); }
  .top { grid-column: 1 / -1; }
  .controls { border-top: 0; border-left: 1px solid var(--line); align-content: center; grid-template-rows: auto auto auto; }
  .masks { flex-wrap: wrap; overflow: auto; max-height: 40dvh; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .top { padding: 4px 12px; }
  .pill { min-height: 40px; }
  .mask { width: 48px; height: 48px; }
  .shutter { width: 60px; height: 60px; }
  .round { width: 46px; height: 46px; }
  .modes button { min-height: 36px; }
  .intro { gap: 4px; }
  #intro-art { width: 90px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
