/* Knips — Nocturne (dark) tokens with the prototype's gold accent. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --color-bg: #161826;
  --color-surface: #232532;
  --color-text: #e9e9ed;

  /* Gold accent (from the prototype) */
  --gold: #c9a44e;
  --gold-bright: #e2c479;

  --color-neutral-300: #cfd3e5;
  --color-neutral-400: #b2b6ca;
  --color-neutral-500: #9397ab;
  --color-neutral-600: #75798c;
  --color-neutral-700: #595d6c;
  --color-neutral-800: #3f424d;
  --color-neutral-900: #292b31;

  --font-heading: "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --radius: 12px;
}

* , *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-heading); font-weight: 400; margin: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: rgba(201,164,78,.3); }
a { color: var(--gold); text-underline-offset: 3px; }

/* — App frame: full-height mobile column, centered on wide screens — */
.app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  position: relative;
  overflow: hidden;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: max(34px, env(safe-area-inset-top)) 26px 26px;
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.grow { flex: 1; }
.center { align-items: center; text-align: center; }

/* — Typographic bits — */
.kick { font: 600 10px var(--font-heading); letter-spacing: .22em; color: var(--gold); text-transform: uppercase; }
.rule { width: 34px; height: 1px; background: var(--gold); margin: 24px 0 18px; }
.muted { color: var(--color-neutral-500); }
.uppermeta { font: 400 11px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--color-neutral-500); }
h1.title { font-size: 30px; margin-top: 24px; }
h2.title { font-size: 25px; }
.lead { font: 400 14px/1.55 var(--font-body); color: var(--color-neutral-400); max-width: 260px; }

/* — Buttons — */
.pri {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; height: 52px; border: 0; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #161826; font: 600 15px var(--font-heading); cursor: pointer;
  transition: filter .15s; text-decoration: none;
}
.pri:hover { filter: brightness(1.06); }
.pri:active { filter: brightness(.94); }
.pri:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.sec {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px; border: 1px solid var(--color-neutral-800);
  border-radius: var(--radius); background: transparent; color: var(--color-neutral-300);
  font: 500 14px var(--font-heading); cursor: pointer; transition: background .15s; text-decoration: none;
}
.sec:hover { background: rgba(255,255,255,.04); }
.mt { margin-top: 11px; }
.mt-lg { margin-top: 20px; }

/* — Forms — */
label.lbl { font: 500 12px var(--font-body); color: var(--color-neutral-400); margin-bottom: 10px; display: block; }
input.nm, .box {
  width: 100%; height: 54px; border: 1px solid var(--color-neutral-700);
  border-radius: var(--radius); background: var(--color-surface); padding: 0 16px;
  font: 400 16px var(--font-body); color: var(--color-text); outline: none;
}
input.nm:focus { border-color: var(--gold); }
.hint { font: 400 11px var(--font-body); color: var(--color-neutral-600); margin-top: 12px; }
.err { font: 500 12px var(--font-body); color: #e59b9b; margin-top: 12px; min-height: 14px; }

/* Guest-count stepper */
.stepper {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; border: 1px solid var(--color-neutral-800); border-radius: var(--radius);
  background: var(--color-surface); padding: 0 8px;
}
.stepper button { width: 40px; height: 40px; border-radius: 9px; border: 0; background: var(--color-neutral-900); color: var(--color-neutral-300); font-size: 20px; cursor: pointer; }
.stepper button.plus { color: var(--gold); }
.stepper .val { font: 500 22px var(--font-heading); }

.pricebox {
  margin-top: 22px; padding: 16px 18px; border: 1px solid rgba(201,164,78,.3);
  border-radius: var(--radius); background: rgba(201,164,78,.06);
  display: flex; align-items: center; justify-content: space-between;
}
.pricebox .amount { font: 600 20px var(--font-heading); color: var(--gold-bright); }

/* — Brand mark — */
.logo {
  width: 62px; height: 62px; border-radius: 18px;
  background: linear-gradient(160deg, var(--gold-bright), var(--gold));
  display: flex; align-items: center; justify-content: center; color: #161826;
  box-shadow: 0 12px 30px rgba(201,164,78,.3);
}
.logo i { font-size: 30px; }
.logo .brandmark { width: 34px; height: 34px; display: block; }

/* — Task card — */
.taskcat { font: 400 10px var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-top: 20px; }
.tasktext { font-size: 25px; line-height: 1.3; font-weight: 400; margin-top: 8px; text-wrap: pretty; }
.taskmeta { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--color-neutral-500); font: 400 12px var(--font-body); }
.taskmeta i { color: var(--gold); }

/* — Capture preview — */
.preview {
  margin-top: 16px; flex: 1; border-radius: 16px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #232636, #1a1c2a); border: 1px solid var(--color-neutral-800);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--color-neutral-600); min-height: 260px;
}
.preview img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.preview i { font-size: 38px; }

/* — Success — */
.checkring {
  width: 72px; height: 72px; border-radius: 50%; border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center; color: var(--gold-bright);
}
.checkring i { font-size: 34px; }

/* — Gallery — */
.gallery-head { display: flex; align-items: baseline; justify-content: space-between; }
.grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  overflow-y: auto; padding-bottom: 10px;
}
.tile {
  aspect-ratio: 3/4; border-radius: 12px; position: relative; overflow: hidden;
  display: flex; align-items: flex-end; padding: 10px; cursor: pointer;
  background: linear-gradient(135deg, #2a2d40, #191b28);
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .cap {
  position: relative; z-index: 1; font: 500 9px var(--font-body); color: var(--gold-bright);
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.tile .shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.55), transparent 55%); z-index: 0; }
.empty { color: var(--color-neutral-600); text-align: center; padding: 40px 10px; font-size: 13px; }

/* — Detail — */
.detail-img {
  margin-top: 16px; flex: 1; border-radius: 16px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #242739, #15171f); border: 1px solid var(--color-neutral-800);
  display: flex; align-items: center; justify-content: center; color: var(--color-neutral-700);
  min-height: 260px;
}
.detail-img img { width: 100%; height: 100%; object-fit: contain; }

/* — Bottom nav — */
.nav {
  height: 62px; flex: none; border-top: 1px solid var(--color-neutral-900);
  display: flex; align-items: center; justify-content: space-around; padding: 0 24px;
}
.navi {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font: 500 10px var(--font-body); background: none; border: 0; cursor: pointer;
  color: var(--color-neutral-600);
}
.navi i { font-size: 20px; }
.navi.active { color: var(--gold); }

/* — Host stat tiles — */
.stats { display: flex; gap: 10px; margin-top: 20px; }
.stat { flex: 1; border: 1px solid var(--color-neutral-800); border-radius: 12px; padding: 12px 14px; }
.stat .big { font: 500 24px var(--font-heading); color: var(--gold-bright); }
.stat .lbl2 { font: 400 11px var(--font-body); color: var(--color-neutral-500); }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; overflow-y: auto; }
.thumb { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg,#2a2d40,#191b28); display:flex; align-items:center; justify-content:center; color: var(--color-neutral-700); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* — QR block — */
.qrwrap {
  margin-top: 24px; width: 210px; height: 210px; border-radius: 20px; background: #f3f5fe;
  padding: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.5); align-self: center;
}
.qrwrap svg { width: 100%; height: 100%; display: block; }
.linkline { margin-top: 20px; display: flex; align-items: center; justify-content: center; gap: 8px; font: 500 14px var(--font-body); color: var(--color-neutral-300); }
.linkline i { color: var(--gold); }
.pwline { margin-top: 10px; font: 400 13px var(--font-body); color: var(--color-neutral-500); }
.pwline b { color: var(--gold-bright); font-weight: 600; letter-spacing: .04em; }
.codeline { margin-top: 12px; font: 400 14px var(--font-body); color: var(--color-neutral-400); }
.codeline b { font: 700 20px var(--font-heading); color: var(--gold-bright); letter-spacing: .16em; }

/* — Code entry (start screen) — */
.or { margin: 16px 0 10px; font: 500 11px var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--color-neutral-600); }
.codejoin { display: flex; gap: 10px; width: 100%; }
.codejoin .code-input { flex: 1; min-width: 0; }
.code-input { text-transform: uppercase; text-align: center; letter-spacing: .3em; font: 600 18px var(--font-heading); }
.code-input::placeholder { letter-spacing: .3em; color: var(--color-neutral-700); }
.join-btn {
  flex: 0 0 54px; width: 54px; height: 54px; border: 0; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: #161826;
  font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.join-btn:active { filter: brightness(.94); }

/* — In-app QR scanner overlay — */
.scanner { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; align-items: center; justify-content: center; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanframe {
  position: absolute; width: 64vw; max-width: 300px; aspect-ratio: 1;
  border: 2px solid var(--gold); border-radius: 22px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.5);
}
.scanhint { position: absolute; bottom: 15%; left: 0; right: 0; text-align: center; padding: 0 28px; font: 500 14px var(--font-body); color: #fff; }
.scanclose {
  position: absolute; top: max(20px, env(safe-area-inset-top)); right: 20px;
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55);
  color: #fff; font-size: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer;
}

/* — Back button (top-left, on screens without bottom nav) — */
.backbtn {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  margin: -6px 0 10px; padding: 6px 4px 6px 0; border: 0; background: transparent;
  color: var(--color-neutral-400); cursor: pointer; font: 500 13px var(--font-body);
}
.backbtn i { font-size: 20px; }
.backbtn:hover { color: var(--color-text); }

/* — Loading dots — */
.loading { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--color-neutral-500); flex: 1; }

/* Photos must not be trivially saved: block selection, drag and long-press menu. */
.noselect img, img.protected {
  -webkit-user-select: none; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none;
  pointer-events: none;
}

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: var(--color-surface); color: var(--color-text); padding: 12px 18px;
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 13px; z-index: 50;
  border: 1px solid var(--color-neutral-800); max-width: 90%;
}
.hidden { display: none !important; }

/* — Consent checkbox rows (join + create) — */
.consent { display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  font: 400 12px/1.5 var(--font-body); color: var(--color-neutral-400); }
.consent input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--gold); }
.consent a { color: var(--gold-bright); }

/* — Footer links (start screen) — */
.footlinks { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center;
  font: 400 12px var(--font-body); color: var(--color-neutral-600); }
.footlinks a { color: var(--color-neutral-500); }

/* — Gallery download-all button — */
.galbar { display: flex; justify-content: flex-end; margin-top: 12px; }
.dlall { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
  border: 1px solid var(--color-neutral-800); border-radius: 999px; background: var(--color-surface);
  color: var(--color-neutral-300); font: 500 12px var(--font-body); text-decoration: none; }
.dlall:hover { border-color: var(--gold); }
.dlall i { color: var(--gold); font-size: 15px; }

/* — Install FAB — */
.installfab {
  position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 55;
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0;
  border-radius: 999px; background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #161826; font: 600 13px var(--font-heading); cursor: pointer;
  box-shadow: 0 10px 26px rgba(201,164,78,.4);
}
.installfab i { font-size: 18px; }
/* On screens with the bottom nav (task/gallery/host), install is offered via
   the "?" help sheet instead — hide the floating FAB so it can't overlap. */
body:has(.nav) .installfab { display: none; }

/* — Help FAB on the task screen — */
.helpfab {
  position: fixed; left: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 55;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-surface); color: var(--gold-bright);
  border: 1px solid var(--color-border); box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.helpfab i { font-size: 22px; }

/* — iOS install guide overlay — */
.iosguide { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; justify-content: center; padding: 16px;
  animation: fade .2s ease; }
.ioscard { position: relative; width: 100%; max-width: 400px; background: var(--color-surface);
  border: 1px solid var(--color-neutral-800); border-radius: 18px; padding: 26px 22px 22px;
  margin-bottom: max(16px, env(safe-area-inset-bottom)); }
.iosclose { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: var(--color-neutral-900); color: var(--color-neutral-400); font-size: 16px; cursor: pointer; }
.iossteps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.iossteps li { counter-increment: s; position: relative; padding: 10px 0 10px 40px;
  font: 400 14px var(--font-body); color: var(--color-neutral-300); border-top: 1px solid var(--color-neutral-900); }
.iossteps li:first-child { border-top: 0; }
.iossteps li::before { content: counter(s); position: absolute; left: 0; top: 9px; width: 26px; height: 26px;
  display: grid; place-items: center; border-radius: 50%; background: rgba(201,164,78,.15);
  color: var(--gold-bright); font: 600 12px var(--font-heading); }
.iossteps b { color: var(--color-text); }
.iossteps i { color: var(--gold); }

/* — Cookie notice — */
.cookiebar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 58;
  width: calc(100% - 24px); max-width: 420px; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--color-surface); border: 1px solid var(--color-neutral-800);
  border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.5); font: 400 12px/1.45 var(--font-body);
  color: var(--color-neutral-400); }
.cookiebar a { color: var(--gold-bright); }
.cookiebar .cookieok { flex: 0 0 auto; padding: 8px 14px; border: 0; border-radius: 9px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: #161826;
  font: 600 12px var(--font-heading); cursor: pointer; }
