:root {
  --bg: #0e0b16;
  --bg-2: #161020;
  --panel: #1c1530;
  --ink: #ece8f5;
  --muted: #a99fc4;
  --line: #2e2444;
  --accent: #c9a227;   /* tarnished gold */
  --accent-2: #8b5cf6; /* witch violet */
  --warn: #e0a45e;
  --radius: 18px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1100px 540px at 50% -10%, #241a3a 0%, var(--bg) 55%) fixed;
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: var(--accent); }
button { font: inherit; cursor: pointer; }
/* `hidden` must win over class rules that set display (.sheet, .header-controls, .view) */
[hidden] { display: none !important; }

/* ---------- header ---------- */
.site-head { padding: .9rem 1rem .4rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.wordmark { background: none; border: 0; color: var(--ink); font-size: clamp(1.25rem, 5.5vw, 1.8rem); font-weight: 800; letter-spacing: -0.02em; padding: 0; }
.wordmark span { color: var(--accent); }
.header-controls { display: flex; gap: .5rem; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
#city { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: .45rem .85rem; font-size: .95rem; max-width: 56vw; }
.refine { position: relative; }
.refine summary { list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: .45rem .85rem; color: var(--muted); user-select: none; }
.refine summary::-webkit-details-marker { display: none; }
.refine[open] summary { color: var(--ink); border-color: var(--accent-2); }
.refine-pop { position: absolute; right: 0; margin-top: .5rem; width: min(86vw, 320px); z-index: 10; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: .8rem; box-shadow: 0 24px 60px -24px rgba(0,0,0,.85); display: grid; gap: .7rem; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: .55rem; margin: 0; }
legend { color: var(--muted); font-size: .72rem; padding: 0 .35rem; text-transform: uppercase; letter-spacing: .06em; }
fieldset button { background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .7rem; margin: .15rem .15rem 0 0; font-size: .88rem; transition: all .12s; }
fieldset button.active { background: var(--accent-2); border-color: var(--accent-2); color: #fff; font-weight: 600; }

main { width: 100%; max-width: 560px; margin: 0 auto; padding: .5rem 1rem 3rem; }

/* ---------- landing ---------- */
.hero { text-align: center; padding: 1.5rem 0 1rem; }
.hero h1 { font-size: clamp(1.8rem, 8vw, 2.8rem); line-height: 1.05; margin: 0; }
.hero h1 em { color: var(--accent); font-style: italic; }
.hero-sub { color: var(--muted); margin: .8rem auto 0; max-width: 34ch; }
.how { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: .9rem; }
.how li { display: flex; gap: .8rem; align-items: flex-start; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: .9rem; }
.step-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-2); color: #fff; font-weight: 800; }
.how h3 { margin: 0 0 .15rem; font-size: 1.05rem; }
.how p { margin: 0; color: var(--muted); font-size: .92rem; }
.pick { text-align: center; margin-top: 1.5rem; }
.pick h2 { margin: 0 0 .8rem; }
.city-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.city-btn { position: relative; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 1rem .8rem; font-size: 1.05rem; font-weight: 600; transition: all .12s; }
.city-btn:not(.soon):hover { border-color: var(--accent); transform: translateY(-2px); }
.city-btn.soon { opacity: .55; }
.soon-tag { position: absolute; top: .4rem; right: .5rem; font-size: .62rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.pick-note { color: var(--warn); min-height: 1.2em; margin: .8rem 0 0; }
.ethos { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 2rem; }

/* ---------- deck + card ---------- */
.card-slot { position: relative; touch-action: pan-y; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; height: min(66dvh, 560px); will-change: transform; }
.enter-next { animation: enterNext .18s ease; }
.enter-prev { animation: enterPrev .18s ease; }
@keyframes enterNext { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes enterPrev { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
.card-art { position: relative; flex: none; height: clamp(140px, 26vh, 220px); display: flex; align-items: flex-end; padding: .7rem .9rem; overflow: hidden;
  background: radial-gradient(130% 110% at 18% 8%, hsl(var(--a, 266) 62% 34%) 0%, transparent 58%), linear-gradient(155deg, hsl(var(--a, 266) 55% 24%), hsl(var(--b, 244) 60% 12%)); }
.art-motif { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: clamp(60px, 19vw, 120px); opacity: .92; pointer-events: none; filter: drop-shadow(0 6px 18px rgba(0,0,0,.5)); }
.card-art.has-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-scrim { position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.55)); }
.art-area { position: relative; z-index: 1; color: rgba(255,255,255,.95); font-size: .82rem; font-weight: 700; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.badge { position: absolute; top: .55rem; right: .6rem; z-index: 1; font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; background: rgba(14,11,22,.72); color: var(--accent); padding: .18rem .55rem; border-radius: 999px; border: 1px solid var(--line); }
.ai-tag { position: absolute; bottom: .55rem; right: .6rem; z-index: 1; font-size: .62rem; letter-spacing: .02em; background: rgba(14,11,22,.66); color: rgba(236,232,245,.82); padding: .15rem .5rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(2px); }
.card-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .55rem; overflow-y: auto; }
.card-name { margin: 0; font-size: 1.25rem; line-height: 1.2; }
.blurb { margin: 0; color: var(--muted); font-size: .95rem; }
.do { margin: 0; font-size: .98rem; }
.do-label { color: var(--accent); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { font-size: .76rem; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: .15rem .55rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { font-size: .74rem; color: var(--accent-2); }
.detail summary { cursor: pointer; color: var(--muted); font-size: .86rem; }
.detail-body { font-size: .85rem; color: var(--muted); margin-top: .45rem; display: flex; flex-direction: column; gap: .3rem; }
.detail-body p { margin: 0; }
.warn { color: var(--warn) !important; }
.sources a { font-size: .8rem; }
.maps-link a { font-size: .82rem; color: var(--accent-2); text-decoration: none; }
.maps-link a:hover { text-decoration: underline; }
.btn-plan { margin-top: auto; align-self: flex-start; background: linear-gradient(180deg, #e6c34a, var(--accent)); color: #1a1326; border: none; border-radius: 999px; padding: .55rem 1.1rem; font-weight: 700; }

/* ---------- deck controls ---------- */
.deck-controls { display: flex; align-items: center; justify-content: center; gap: 1.1rem; margin-top: 1rem; }
.nav { width: 56px; height: 56px; border-radius: 50%; font-size: 1.7rem; line-height: 1; background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.nav:active { transform: scale(.94); }
.position { min-width: 70px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.deck-sub { display: flex; align-items: center; justify-content: center; gap: .7rem; margin-top: .9rem; }
.btn-surprise { background: linear-gradient(180deg, #e6c34a, var(--accent)); color: #1a1326; font-weight: 700; border: none; border-radius: 999px; padding: .6rem 1.1rem; box-shadow: 0 10px 26px -14px var(--accent); }
.swipe-hint { color: var(--muted); font-size: .82rem; }

/* ---------- coming soon / plan ---------- */
.coming-soon { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.cs-emoji { font-size: 2.4rem; margin: 0; }
.coming-soon h2 { color: var(--ink); margin: .4rem 0; }
.plan-invite-line { text-align: center; color: var(--muted); font-size: 1.05rem; margin: .5rem 0 1rem; }
.plan-when-line { text-align: center; color: var(--accent); font-weight: 600; margin: 1rem 0; }
#plan .btn-surprise, #plan-explore { display: block; margin: 1rem auto 0; }

/* ---------- composer sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(8,6,14,.66); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { width: 100%; max-width: 560px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 1.2rem 1.1rem calc(1.2rem + env(safe-area-inset-bottom)); position: relative; box-shadow: 0 -20px 60px -20px rgba(0,0,0,.9); animation: sheetUp .2s ease; }
@keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-close { position: absolute; top: .8rem; right: .9rem; background: none; border: 0; color: var(--muted); font-size: 1.3rem; }
.sheet-title { margin: 0 0 .2rem; }
.plan-place { margin: 0 0 1rem; color: var(--accent); font-weight: 700; font-size: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); margin-bottom: .8rem; }
.field input { background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; font-size: 1rem; }
.invite-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
.btn-invite { background: var(--panel); color: var(--ink); border: 1px solid var(--accent-2); border-radius: 999px; padding: .6rem 1.1rem; font-weight: 600; }
.invite-status { color: var(--accent); font-size: .85rem; min-height: 1.1em; margin: .6rem 0 0; word-break: break-all; }
.invite-fine { color: var(--muted); font-size: .78rem; margin: .5rem 0 0; }

/* ---------- rating prompt + footer ---------- */
.rating-prompt { background: var(--panel); border: 1px solid var(--accent-2); border-radius: 14px; padding: .75rem .9rem; margin-bottom: .8rem; display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.rating-actions { display: flex; gap: .4rem; align-items: center; }
.rating-actions button { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .35rem .55rem; font-size: 1.1rem; }
.rating-actions .link { font-size: .82rem; color: var(--muted); border: none; background: none; text-decoration: underline; }
.site-foot { max-width: 560px; margin: 0 auto; padding: 1.2rem 1rem 2.5rem; color: var(--muted); font-size: .8rem; text-align: center; }
.foot-dot { margin: 0 .4rem; opacity: .5; }

@media (min-width: 640px) {
  .card { height: min(62dvh, 600px); }
  .swipe-hint::after { content: " (or arrow keys)"; }
  .sheet { align-items: center; }
  .sheet-card { border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) { .enter-next, .enter-prev, .sheet-card { animation: none; } }
