:root {
  --body: #1d1915;
  --body-2: #2b2520;
  --cream: #f4ecdc;
  --gold: #d8bd8a;
  --orange: #ff8a1f;
  --serif: "Cormorant Garamond", serif;
  --sans: "Jost", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: #14110e; color: var(--cream); font-family: var(--sans); font-weight: 300; overflow: hidden;
  -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.screen { position: fixed; inset: 0; display: none; }
.screen.on { display: flex; }

/* ---------- intro / done ---------- */
.intro, .done {
  align-items: center; justify-content: center; padding: 24px; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 0%, #3a2f22 0%, #14110e 65%);
}
.box { width: min(420px, 100%); text-align: center; animation: up .9s var(--ease); }
@keyframes up { from { opacity: 0; transform: translateY(30px); } }
.brand { font-family: var(--sans); font-weight: 500; letter-spacing: .3em; text-transform: uppercase; font-size: .72rem; color: var(--gold); }
.brand span { font-family: "Pinyon Script", cursive; text-transform: none; letter-spacing: 0; font-size: 1.4rem; color: var(--cream); margin-right: 6px; vertical-align: -3px; }
.roll { margin: 30px auto 26px; width: 120px; height: 150px; position: relative; }
.can {
  position: absolute; inset: 0; border-radius: 16px;
  background: linear-gradient(90deg, #a87b2c 0%, #f3cf7a 30%, #c69138 55%, #8e6421 100%);
  box-shadow: 0 30px 60px rgba(0,0,0,.5), inset 0 0 0 2px rgba(255,255,255,.15);
  display: grid; place-content: center; color: #2a1d08; animation: wob 4s ease-in-out infinite;
}
.can::before, .can::after { content: ""; position: absolute; left: 10px; right: 10px; height: 12px; background: #1b1814; border-radius: 4px; }
.can::before { top: -8px; } .can::after { bottom: -8px; }
.can b { font-family: var(--serif); font-size: 3.4rem; line-height: 1; font-weight: 500; }
.can small { letter-spacing: .3em; font-weight: 500; font-size: .7rem; }
.can.empty { filter: grayscale(.6) brightness(.7); }
@keyframes wob { 50% { transform: rotate(-4deg) translateY(-6px); } }
.box h1 { font-family: var(--serif); font-weight: 400; font-size: 2.6rem; line-height: 1.1; }
.box h1 em { font-family: "Pinyon Script", cursive; font-style: normal; color: var(--gold); font-size: 1.15em; }
.box p { color: rgba(244,236,220,.75); margin: 14px 0 24px; line-height: 1.6; }
.box p b { color: var(--cream); font-weight: 500; }
.name { display: block; text-align: left; margin-bottom: 18px; }
.name span { font-size: .68rem; letter-spacing: .25em; text-transform: uppercase; color: var(--gold); }
.name input {
  width: 100%; margin-top: 8px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(244,236,220,.2);
  background: rgba(255,255,255,.05); color: var(--cream); font: inherit; font-size: 1.05rem; outline: none; user-select: text; -webkit-user-select: text;
}
.name input:focus { border-color: var(--gold); }
.cta {
  display: block; width: 100%; padding: 17px; border-radius: 999px; background: var(--cream); color: #1b1814;
  font-weight: 500; letter-spacing: .18em; text-transform: uppercase; font-size: .82rem; text-decoration: none; text-align: center;
  transition: transform .3s var(--ease);
}
.cta:active { transform: scale(.97); }
.cta.ghost { background: transparent; border: 1px solid rgba(244,236,220,.35); color: var(--cream); }
.btns { display: grid; gap: 12px; }
.tiny { font-size: .75rem; opacity: .6; margin: 16px 0 0 !important; }
.back { display: inline-block; margin-top: 22px; font-size: .85rem; opacity: .7; text-decoration: none; }

/* ---------- camera ---------- */
.cam {
  flex-direction: column; background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.015) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #2a241e, #17130f);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.06); text-decoration: none; font-size: 1rem; }
.ic svg { width: 22px; height: 22px; }
.brand.small span { font-size: 1.15rem; }

.finder {
  position: relative; flex: 1; margin: 0 16px; border-radius: 22px; overflow: hidden; background: #000;
  box-shadow: inset 0 0 0 3px #0c0a08, 0 0 0 1px rgba(255,255,255,.06), 0 20px 40px rgba(0,0,0,.5);
  min-height: 0;
}
.finder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.1) contrast(1.05) sepia(.1); }
.finder video.mirror { transform: scaleX(-1); }
.finder-vig { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55)); pointer-events: none; }
.frame-corners i { position: absolute; width: 26px; height: 26px; border: 2px solid rgba(255,255,255,.7); }
.frame-corners i:nth-child(1) { top: 16px; left: 16px; border-right: 0; border-bottom: 0; }
.frame-corners i:nth-child(2) { top: 16px; right: 16px; border-left: 0; border-bottom: 0; }
.frame-corners i:nth-child(3) { bottom: 16px; left: 16px; border-right: 0; border-top: 0; }
.frame-corners i:nth-child(4) { bottom: 16px; right: 16px; border-left: 0; border-top: 0; }
.flashfx { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flashfx.go { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
.finder.dark video { filter: brightness(0); transition: filter .05s; }
.wind-hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 9px 16px; border-radius: 99px;
  background: rgba(0,0,0,.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: .8rem; letter-spacing: .1em; white-space: nowrap;
  opacity: 0; transition: opacity .3s;
}
.wind-hint.on { opacity: 1; animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translate(-46%, 0); } }

.body { padding: 16px 22px 20px; }
.counter-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; }
.counter {
  width: 64px; height: 44px; border-radius: 10px; overflow: hidden; position: relative; background: #0c0a08;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.8), 0 0 0 2px #3a332b;
}
.counter::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.7), transparent 35%, transparent 65%, rgba(0,0,0,.7)); }
.strip { position: absolute; left: 0; right: 0; top: 0; transition: transform .6s var(--ease); }
.strip div { height: 44px; display: grid; place-items: center; font-family: "Share Tech Mono", monospace; font-size: 1.6rem; color: var(--orange); text-shadow: 0 0 8px rgba(255,138,31,.6); }
.counter-wrap .lbl { font-size: .7rem; letter-spacing: .25em; text-transform: uppercase; opacity: .6; }

.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.flash { justify-self: start; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; position: relative; background: linear-gradient(180deg, #3a332b, #221d18); box-shadow: 0 4px 0 #0e0c0a, inset 0 1px 0 rgba(255,255,255,.1); color: rgba(244,236,220,.4); transition: color .3s; }
.flash svg { width: 24px; height: 24px; }
.flash.on { color: #ffd479; }
.flash .led { position: absolute; top: 6px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #3a1a0a; }
.flash.on .led { background: #ff5a2a; box-shadow: 0 0 10px #ff5a2a; animation: blink 1s infinite; }
.flash.on.ready .led { animation: none; background: #8aff5a; box-shadow: 0 0 10px #8aff5a; }
@keyframes blink { 50% { opacity: .3; } }
.shutter { width: 86px; height: 86px; border-radius: 50%; padding: 7px; background: linear-gradient(180deg, #4a4037, #1c1814); box-shadow: 0 6px 0 #0b0907, 0 12px 30px rgba(0,0,0,.6); transition: transform .1s; }
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f6e3b8, #c99a4a 60%, #8b6326); box-shadow: inset 0 -4px 10px rgba(0,0,0,.35); }
.shutter:active, .shutter.press { transform: translateY(4px); box-shadow: 0 2px 0 #0b0907, 0 6px 16px rgba(0,0,0,.6); }
.shutter:disabled { filter: grayscale(1) brightness(.6); }
.wheel {
  justify-self: end; width: 58px; height: 92px; border-radius: 14px; overflow: hidden; position: relative; cursor: grab; touch-action: none;
  background: #0d0b09; box-shadow: inset 0 0 0 2px #3a332b;
}
.wheel.need { box-shadow: inset 0 0 0 2px var(--orange), 0 0 22px rgba(255,138,31,.35); }
.ridges { position: absolute; left: 6px; right: 6px; top: -40px; bottom: -40px; background: repeating-linear-gradient(180deg, #5a4e42 0 3px, #2a241e 3px 9px); border-radius: 10px; }
.wheel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.75), transparent 30%, transparent 70%, rgba(0,0,0,.75)); pointer-events: none; }
.status { text-align: center; margin-top: 14px; font-size: .78rem; letter-spacing: .12em; opacity: .65; min-height: 1.2em; }

.toast { position: fixed; left: 50%; top: 24px; transform: translate(-50%, -20px); z-index: 50; background: var(--cream); color: #1b1814; padding: 11px 20px; border-radius: 999px; font-size: .85rem; opacity: 0; transition: all .4s var(--ease); pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 700px) {
  .cam { align-items: center; }
  .cam > * { width: 460px; }
  .finder { margin: 0 auto; width: 430px; }
}
