:root {
    --bg: #050507;
    --card: rgba(18, 16, 24, .78);
    --line: rgba(255, 255, 255, .08);
    --text: #f6f1e8;
    --muted: #a39b92;
    --gold: #e7c48a;
    --gold-2: #f4e4c1;
    --danger: #ff8b8b;
    --ok: #9be7b7;
    --grad: linear-gradient(135deg, #8b5cf6 0%, #ec4899 42%, #f59e0b 100%);
    --shadow: 0 24px 80px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Outfit, system-ui, sans-serif;
}

body {
    min-height: 100dvh;
    overflow-x: hidden;
}

.noise {
    pointer-events: none;
    position: fixed;
    inset: 0;
    opacity: .09;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.55'/></svg>");
    z-index: 0;
}

.orb {
    pointer-events: none;
    position: fixed;
    width: 22rem;
    height: 22rem;
    border-radius: 50%;
    filter: blur(70px);
    z-index: 0;
}
.orb-a { top: -6rem; right: -4rem; background: rgba(139, 92, 246, .28); }
.orb-b { bottom: -8rem; left: -6rem; background: rgba(245, 158, 11, .16); }

.app {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    max-width: 430px;
    margin: 0 auto;
    padding: 20px 20px calc(28px + env(safe-area-inset-bottom));
}

.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.logo {
    font-family: Fraunces, serif;
    font-weight: 700;
    letter-spacing: .18em;
    font-size: 15px;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.chip {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gold);
    border: 1px solid rgba(231, 196, 138, .28);
    padding: 6px 10px;
    border-radius: 999px;
}

.hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: calc(100dvh - 120px);
}
.mark {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: var(--grad);
    display: grid;
    place-items: center;
    box-shadow: var(--shadow);
    margin-bottom: 28px;
}
.mark svg { width: 34px; height: 34px; }
h1 {
    font-family: Fraunces, serif;
    font-size: 40px;
    line-height: .95;
    font-weight: 500;
    letter-spacing: -.03em;
    max-width: 14ch;
}
h1 em { font-style: italic; color: var(--gold-2); }
.lead {
    margin-top: 16px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
    max-width: 34ch;
}

.btn {
    appearance: none;
    border: 0;
    width: 100%;
    border-radius: 999px;
    padding: 18px 20px;
    font-family: Outfit, sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: #140c08;
    background: var(--grad);
    box-shadow: 0 12px 40px rgba(236, 72, 153, .28);
}
.btn:disabled { opacity: .55; }
.btn-ghost {
    background: transparent;
    color: var(--text);
    box-shadow: none;
    border: 1px solid var(--line);
}
.btn-danger {
    background: transparent;
    color: var(--danger);
    box-shadow: none;
    border: 1px solid rgba(255, 139, 139, .25);
}
.field {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.04);
    color: var(--text);
    border-radius: 16px;
    padding: 16px 18px;
    font-family: Outfit, sans-serif;
    font-size: 16px;
    outline: none;
}
.field::placeholder { color: var(--muted); }
.field:focus { border-color: rgba(231, 196, 138, .45); }
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card img {
    display: block;
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: #111;
}
.card-body { padding: 18px 18px 20px; }
.kicker {
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold);
}
.card h2 {
    font-family: Fraunces, serif;
    font-size: 28px;
    margin-top: 4px;
}
.subline { margin-top: 10px; color: var(--muted); font-size: 13px; }

.uploader {
    border: 1px dashed rgba(255,255,255,.18);
    border-radius: 28px;
    padding: 22px;
    text-align: center;
    background: rgba(255,255,255,.03);
}
.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 18px;
    margin-bottom: 12px;
}
.panel h2 {
    font-family: Fraunces, serif;
    font-size: 28px;
    margin-top: 6px;
}
.quiet-link {
    display: block;
    width: 100%;
    margin-top: 16px;
    background: none;
    border: 0;
    padding: 0;
    color: var(--muted);
    font-family: Outfit, sans-serif;
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    text-align: center;
    opacity: .5;
}
.thumbs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}
.thumbs .item, .thumbs label.add, .thumbs .empty-photo {
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #16141c;
}
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .x {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.72);
    color: #fff;
    font-size: 16px;
    z-index: 3;
    cursor: pointer;
}
.replace-hit {
    position: absolute;
    inset: 0;
    display: grid;
    align-items: end;
    justify-items: center;
    padding-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 4px #000;
    background: linear-gradient(transparent 55%, rgba(0,0,0,.45));
    cursor: pointer;
}
.replace-hit input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.act {
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    padding: 10px 6px;
    font-size: 12px;
    font-weight: 700;
    font-family: Outfit, sans-serif;
    background: rgba(255,255,255,.08);
    color: var(--text);
    cursor: pointer;
}
.act.danger { color: var(--danger); background: rgba(255,139,139,.12); }
.act input[type=file] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    font-size: 40px;
}
label.add {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 28px;
    cursor: pointer;
    border: 1px dashed rgba(255,255,255,.16);
}
.pickers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
}
.picker {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 16px;
    padding: 14px 10px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.04);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.picker input[type=file] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    font-size: 40px;
    cursor: pointer;
}
.picker.cam {
    border-color: rgba(231, 196, 138, .35);
    color: var(--gold);
    background: transparent;
    font-family: Outfit, sans-serif;
}
input#cameraNative { position: absolute; width: 1px; height: 1px; opacity: 0.01; overflow: hidden; }

.cam-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: #050507;
    display: flex;
    flex-direction: column;
}
.cam-overlay.hidden { display: none; }
.cam-overlay video {
    flex: 1;
    width: 100%;
    object-fit: cover;
    background: #000;
    transform: scaleX(-1);
}
.cam-bar {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 10px;
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
    background: #050507;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0 22px;
}
.stat {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 14px;
}
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 12px; }

.check { color: var(--muted); font-size: 14px; line-height: 1.7; }
.check b { color: var(--text); font-weight: 500; }

.price {
    font-family: Fraunces, serif;
    font-size: 42px;
    margin: 8px 0 18px;
}
.price small { font-size: 18px; color: var(--muted); }

.center { text-align: center; padding-top: 48px; }
.spark { font-size: 42px; margin-bottom: 12px; }
.status { min-height: 20px; color: var(--muted); font-size: 13px; text-align: center; margin-top: 10px; }
.error { color: var(--danger); }

.nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 18px;
}
.nav button {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 16px;
    padding: 12px;
    font-family: Outfit, sans-serif;
    font-weight: 600;
}

.empty-photo {
    aspect-ratio: 3/4;
    display: grid;
    place-items: center;
    color: var(--muted);
    background:
        radial-gradient(circle at 30% 20%, rgba(139,92,246,.25), transparent 40%),
        #0d0c12;
}

.hidden { display: none !important; }
