/* Brand fonts, bundled so they work offline (SIL Open Font License, see fonts/OFL-*.txt). */
@font-face { font-family: "Great Vibes"; src: url("fonts/great-vibes.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond-italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }

:root {
  --script: "Great Vibes", "Snell Roundhand", cursive;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --bg: #14110f;
  --panel: #1f1a17;
  --panel2: #2a231f;
  --text: #f6efe8;
  --muted: #a8998c;
  --amber: #f5a524;
  --amber2: #ffcf6b;
  --amber-bg: #3b2a12;
  --line: #3a302a;
  --danger: #ff6b6b;
  --ok: #4ade80;
  --gold: #ffd54a;
  --champagne: #d4af6a;
  --nav-idle: #8f8270;
  --radius: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { display: flex; flex-direction: column; }
/* Android 15 draws apps edge-to-edge, under the status bar; keep content below the clock/battery. */
body.native { padding-top: max(env(safe-area-inset-top), 36px); }
[hidden] { display: none !important; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel2); border-radius: 12px; padding: 10px 14px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--amber); color: #1a1205; border-color: transparent; font-weight: 700; }
button.big { width: 100%; padding: 14px; font-size: 1.05rem; }
button.small { padding: 6px 10px; font-size: .9rem; }
button.link { background: none; border: 0; color: var(--amber2); text-decoration: underline; }
input { width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; outline: none; }
input:focus { border-color: var(--amber); }
label { display: block; font-size: .85rem; color: var(--muted); margin: 12px 0; }
label input { margin-top: 6px; }

#demo-banner { background: var(--amber); color: #1a1205; text-align: center; font-size: .8rem; font-weight: 600; padding: 4px; }

/* Auth: "velvet rooftop". Warm blurred city lights on burgundy, wordmark up top, frosted sign-in card below. */
#auth { position: relative; flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; padding: 64px 18px 22px; overflow: hidden; background: radial-gradient(120% 80% at 50% 0%, #4a1c22 0%, #2a1216 45%, #150a0b 100%); }
.bokeh { position: absolute; inset: 0; pointer-events: none; }
.bokeh i { position: absolute; border-radius: 50%; filter: blur(12px); opacity: .55; animation: drift 16s ease-in-out infinite alternate; }
.bokeh i:nth-child(1) { width: 160px; height: 160px; left: -50px; top: 6%; background: #8a3a2a; }
.bokeh i:nth-child(2) { width: 90px; height: 90px; right: 8%; top: 9%; background: #c8862e; animation-delay: -4s; }
.bokeh i:nth-child(3) { width: 46px; height: 46px; left: 38%; top: 22%; background: #e0a84a; opacity: .45; animation-delay: -8s; }
.bokeh i:nth-child(4) { width: 130px; height: 130px; right: -40px; top: 30%; background: #6d2a3a; animation-delay: -2s; }
.bokeh i:nth-child(5) { width: 70px; height: 70px; left: 12%; top: 40%; background: #b5652a; opacity: .4; animation-delay: -10s; }
.bokeh i:nth-child(6) { width: 22px; height: 22px; left: 62%; top: 15%; background: #f3d9a4; opacity: .6; filter: blur(5px); animation-delay: -6s; }
.bokeh i:nth-child(7) { width: 16px; height: 16px; left: 22%; top: 28%; background: #f3d9a4; opacity: .5; filter: blur(4px); animation-delay: -12s; }
.bokeh i:nth-child(8) { width: 110px; height: 110px; left: 45%; top: 48%; background: #5c2a22; opacity: .45; animation-delay: -7s; }
@keyframes drift { to { transform: translate(14px, -12px) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .bokeh i { animation: none; } }
#auth .brand { position: relative; text-align: center; margin-top: 6vh; }
#auth h1 { margin: 0; font-family: var(--script); font-weight: 400; font-size: 4.6rem; line-height: 1.15; color: #f3d9a4; text-shadow: 0 2px 24px rgba(0, 0, 0, .45); }
.tagline { margin: 2px 0 0; font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: #e8cfa8; }
.glass-card { position: relative; width: 100%; max-width: 420px; margin: 0 auto; padding: 20px 20px 14px; border-radius: 22px; background: rgba(29, 18, 16, .78); border: 1px solid rgba(212, 175, 106, .4); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
.members { margin: 0; text-align: center; font-family: var(--serif); font-weight: 500; font-size: 1.6rem; color: #f3d9a4; }
#auth label { color: #a8957a; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; margin: 14px 0; }
#auth input { background: transparent; border: 0; border-bottom: 1px solid #6b5236; border-radius: 0; padding: 8px 2px; margin-top: 2px; font-size: 1rem; }
#auth input:focus { border-bottom-color: var(--champagne); }
#auth .primary { background: var(--champagne); color: #2a1a08; border-radius: 999px; font-family: var(--serif); font-weight: 600; font-size: 1.2rem; letter-spacing: .08em; margin-top: 4px; }
.link-soft { display: block; margin: 10px auto 0; background: none; border: 0; color: #e8cfa8; font-size: .95rem; }
.link-soft.small-soft { margin-top: 2px; font-size: .85rem; opacity: .8; }
.error { color: #ff8a8a; min-height: 1.2em; font-size: .9rem; margin: 4px 0; }


/* Shell */
#app { flex: 1; display: flex; flex-direction: column; min-height: 0; max-width: 640px; width: 100%; margin: 0 auto; }
.view { flex: 1; overflow-y: auto; padding: 0 16px 16px; position: relative; min-height: 0; }
.view header { display: flex; align-items: center; gap: 10px; padding: 14px 0; }
.view header h1 { margin: 0; font-size: 1.5rem; }
/* Bottom nav: "gold line" style. Thin champagne-gold icons, serif labels, a gold dot under the active tab. */
nav { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid rgba(212, 175, 106, .45); background: #110e0c; padding-bottom: env(safe-area-inset-bottom); }
nav button { background: none; border: 0; border-radius: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 6px; position: relative; color: var(--nav-idle); font-family: var(--serif); font-weight: 600; font-size: .9rem; letter-spacing: .03em; transition: color .2s; }
nav button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
nav button::after { content: ''; width: 4px; height: 4px; border-radius: 50%; margin-top: 1px; background: transparent; transition: background .2s; }
nav button.active { color: var(--champagne); }
nav button.active::after { background: var(--champagne); }
.nav-face { width: 26px; height: 26px; border-radius: 50%; border: 1px solid currentColor; overflow: hidden; display: grid; place-items: center; font-size: 15px; font-family: system-ui, sans-serif; }
.nav-face img { width: 100%; height: 100%; object-fit: cover; }
nav i { position: absolute; top: 6px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }

/* Map */
.view[data-view=map] { padding: 0; overflow: hidden; }
#map { position: absolute; inset: 0; background: #222; z-index: 0; }
.leaflet-container { font: inherit; }
.dark-tiles { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
.map-top { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 500; display: flex; justify-content: center; pointer-events: none; }
.chip { pointer-events: auto; background: rgba(31, 26, 23, .92); border-radius: 999px; padding: 8px 14px; font-size: .85rem; backdrop-filter: blur(6px); }
.fab { position: absolute; right: 14px; bottom: 18px; z-index: 500; width: 48px; height: 48px; border-radius: 50%; font-size: 1.4rem; background: var(--panel); padding: 0; }
.pin { display: flex; flex-direction: column; align-items: center; width: 64px; }
.pin span { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: var(--panel); border: 3px solid var(--amber); box-shadow: 0 4px 12px rgba(0, 0, 0, .5); }
.pin b { margin-top: 2px; font-size: 11px; background: rgba(20, 17, 15, .85); color: #fff; padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.pin.me span { border-color: #60a5fa; }
.pin.nearby span { border-style: dashed; border-color: var(--muted); }
.pin span { overflow: hidden; position: relative; }
.pin span img, .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pin.vip span { border-color: var(--gold); border-style: solid; box-shadow: 0 0 0 2px rgba(255, 213, 74, .35), 0 0 16px rgba(255, 213, 74, .55); }
.pin { position: relative; }
.pin-status { position: absolute; top: -6px; right: 4px; font-style: normal; font-size: 16px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }

/* Going out + alerts */
.map-top { gap: 8px; }
.chip.bell { position: relative; padding: 8px 12px; }
.chip.bell i { position: absolute; top: 4px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.go-out { position: absolute; left: 14px; bottom: 18px; z-index: 500; border-radius: 999px; padding: 12px 18px; font-weight: 700; background: var(--amber); color: #1a1205; border: 0; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); max-width: calc(100% - 90px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go-out.active { background: var(--panel); color: var(--amber2); border: 1px solid var(--amber); }
#map.picking { cursor: crosshair; outline: 3px solid var(--amber); outline-offset: -3px; }
.small { font-size: .8rem; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list li > div:nth-child(2) { flex: 1; min-width: 0; }
.list p { margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: var(--panel2); }
.avatar.sm { width: 34px; height: 34px; font-size: 18px; }
.avatar.xl { width: 112px; height: 112px; font-size: 56px; margin: 0 auto; }
.tap-photo { cursor: zoom-in; display: inline-block; }

/* Photo crop editor */
.crop { position: relative; margin: 16px auto 10px; border-radius: 50%; overflow: hidden; background: #000; touch-action: none; cursor: grab; box-shadow: 0 0 0 2px var(--champagne), 0 0 0 9999px rgba(0, 0, 0, 0); }
.crop:active { cursor: grabbing; }
.crop img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; pointer-events: none; transform-origin: 0 0; }
.zoom-row { display: flex; align-items: center; gap: 10px; max-width: 300px; margin: 6px auto 14px; font-size: 1.1rem; }
.zoom-row input { accent-color: var(--champagne); padding: 0; border: 0; background: none; }
.photo-view { text-align: center; }
.photo-view img { width: min(100%, 480px); aspect-ratio: 1; object-fit: cover; border-radius: 18px; display: block; margin: 8px auto 12px; }
.muted { color: var(--muted); font-size: .85rem; }
h3.section { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 0 4px; }
.empty { color: var(--muted); text-align: center; padding: 32px 8px; }
time { color: var(--muted); font-size: .75rem; }

/* Chat thread */
.thread { display: flex; flex-direction: column; padding: 0; }
.view .thread-head { padding: 10px 12px; border-bottom: 1px solid var(--line); }
#thread-who { flex: 1; display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.back { background: none; border: 0; font-size: 1.8rem; padding: 0 8px; line-height: 1; }
.msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 78%; padding: 9px 13px; border-radius: 18px; background: var(--panel2); align-self: flex-start; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: var(--amber); color: #1a1205; }
.msg.treat, .msg.treat.mine { background: linear-gradient(135deg, #3b2a12, #5a3b0f); color: var(--text); border: 1px solid var(--amber); text-align: center; padding: 14px 18px; }
.msg.treat .big-emoji { font-size: 36px; }
.msg.treat p { margin: 6px 0 0; font-style: italic; color: var(--amber2); }
.composer { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }

/* Bottom sheet */
#sheet { position: fixed; inset: 0; z-index: 1000; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; max-height: 90vh; overflow-y: auto; background: var(--panel); border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-close { position: absolute; top: 12px; right: 12px; background: none; border: 0; font-size: 1.1rem; color: var(--muted); }
.sheet-panel h2 { margin: 0 0 4px; }
.profile { text-align: center; margin-bottom: 16px; }
.profile h2 { margin: 10px 0 2px; }
.profile p { margin: 4px 0; }
.row { display: flex; gap: 8px; margin-top: 10px; }
.row > * { flex: 1; }

/* Treat */
.menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.menu-item { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 1.6rem; padding: 12px; }
.menu-item span { font-size: .9rem; }
.menu-item b { font-size: .85rem; color: var(--amber2); }
.menu-item.on { border-color: var(--amber); background: var(--amber-bg); }
.breakdown { background: var(--panel2); border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: .9rem; }
.breakdown div { display: flex; justify-content: space-between; padding: 3px 0; }
.breakdown .total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 700; }
.warn { background: #3a2a10; border: 1px solid #7a5a1a; border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
#t-payment { margin: 12px 0; }

/* Profile settings */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 8px; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.emoji-pick button { font-size: 1.4rem; padding: 6px 8px; }
.emoji-pick button.on { border-color: var(--amber); background: var(--amber-bg); }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; color: var(--text); font-size: .95rem; cursor: pointer; }
.radio input { width: auto; margin: 3px 0 0; }
.radio small { display: block; color: var(--muted); margin-top: 2px; }
.status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .85rem; background: var(--panel2); }
.status.ok { color: var(--ok); }
#me-logout { display: block; margin: 16px auto; }
#me-delete { display: block; margin: 0 auto 16px; font-size: .85rem; }
button.link.danger-link { color: var(--danger); }
#del-cancel { display: block; margin: 12px auto 0; }
.avatar { overflow: hidden; }
.avatar.vip { box-shadow: 0 0 0 2px var(--gold); }
.crown { font-size: .85em; }
.photo-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
label.btn { display: inline-block; margin: 0; cursor: pointer; border: 1px solid var(--line); background: var(--panel2); border-radius: 12px; padding: 10px 14px; color: var(--text); font-size: 1rem; }

/* Beta, safety, feedback */
textarea { width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; outline: none; font: inherit; color: inherit; resize: vertical; margin-top: 6px; }
textarea:focus { border-color: var(--amber); }
.beta-pill { display: inline-block; vertical-align: middle; padding: 2px 9px; border-radius: 999px; border: 1px solid rgba(212, 175, 106, .6); color: var(--champagne); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; font-family: system-ui, sans-serif; font-weight: 600; }
#auth .beta-pill { margin-top: 12px; background: rgba(20, 10, 10, .35); }
.beta-tag { position: absolute; z-index: 500; left: 12px; top: 74px; padding: 5px 11px; border-radius: 999px; font-size: .72rem; letter-spacing: .06em; color: var(--champagne); background: rgba(17, 14, 12, .88); border: 1px solid rgba(212, 175, 106, .5); }
.safety-row { display: flex; justify-content: center; gap: 22px; margin-top: 14px; }
.link-quiet { background: none; border: 0; padding: 6px; color: var(--muted); font-size: .88rem; }
.link-quiet:hover { color: var(--text); }
button.danger { background: #3a1414; border-color: #7a2a2a; color: #ffb3b3; }
.card.admin { border-color: rgba(212, 175, 106, .5); }
.report-item { border-top: 1px solid var(--line); padding: 10px 0; }
.report-item p { margin: 4px 0; }

/* Venue ("order at their spot") */
.venue-card { background: var(--amber-bg); border: 1px solid var(--amber); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.venue-head { display: flex; gap: 12px; align-items: center; }
.venue-head b { display: block; font-size: 1.1rem; }
.venue-head small { display: block; color: var(--muted); text-transform: capitalize; }
.venue-head small:first-child { text-transform: none; }
.venue-icon { font-size: 2rem; }
.venue-picks { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.venue-picks button { font-size: .85rem; padding: 6px 10px; border-radius: 999px; }
.venue-picks button.on { border-color: var(--amber); background: var(--amber-bg); }
.msg.treat small { display: block; color: var(--muted); margin-top: 2px; }
.cover { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px 2px; margin: 4px 0 8px; }
.cover-title { margin: 0 0 6px; font-size: .85rem; color: var(--champagne); }
.cover-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; flex-wrap: wrap; }
.cover-row small { display: block; color: var(--muted); font-size: .75rem; }
.cover-row .rate { display: flex; align-items: center; gap: 4px; }
.cover-row .rate input { width: 78px; padding: 8px; text-align: right; }
.cover-row .venue-picks { margin: 0; }
.breakdown .sub { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 6px; font-weight: 600; }

/* VIP */
.vip-hero { text-align: center; padding: 24px 16px; border-radius: var(--radius); background: radial-gradient(circle at 50% 0%, #4a3410, var(--panel) 70%); border: 1px solid #6b5016; margin-bottom: 14px; }
.vip-hero h2 { margin: 6px 0; font-size: 1.7rem; color: var(--gold); }
.vip-hero p { margin: 0; }
.vip-crown { font-size: 56px; }
.vip-teaser { text-align: center; border-color: var(--gold); }
.perks { list-style: none; padding: 0; margin: 0 0 16px; }
.perks li { display: flex; gap: 14px; align-items: flex-start; padding: 10px 2px; }
.perks li > span { font-size: 1.6rem; }
.perks p { margin: 2px 0 0; }
.center { text-align: center; }

#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; z-index: 2000; font-weight: 600; max-width: 90vw; text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
