:root {
  --plum: #2A1A2E; --plum-mid: #5B3A63; --mist: #B9A9BD; --coral: #E8604C; --coral-dark: #C94A37; --amber: #F2A541;
  --cream: #FBEFEA; --paper: #FFFFFF; --ink: #2A1A2E; --muted: #6B5A6E; --line: #EADFE3; --ok: #2A9D6F; --danger: #B23A28;
  --radius: 18px; --font: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --serif: "Lora", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--font); font-size: 16px; -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; background: var(--paper); }
.screen { flex: 1; display: flex; flex-direction: column; padding: 20px 20px 24px; }
.screen.dark { background: var(--plum); color: #fff; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .04em; color: var(--coral); }
.brand::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--coral); }
.dark .brand { color: var(--amber); }
h1 { font-family: var(--serif); font-size: 40px; line-height: 1.08; margin: 36px 0 12px; font-weight: 600; }
h2 { font-family: var(--serif); font-size: 26px; line-height: 1.15; margin: 8px 0 6px; font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 16px; line-height: 1.45; }
.dark .sub { color: var(--mist); }
.spacer { flex: 1; min-height: 16px; }
.cta { display: block; width: 100%; min-height: 52px; border: 0; border-radius: 999px; background: var(--coral); color: #fff; font-weight: 700; font-size: 17px; cursor: pointer; margin: 8px 0; }
.cta:active { background: var(--coral-dark); }
.cta.line { background: transparent; border: 1.5px solid currentColor; color: inherit; }
.cta[disabled] { opacity: .5; }
.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 10px 0; display: block; margin: 0 auto; min-height: 44px; }
.back { background: none; border: 0; color: var(--muted); padding: 8px 0; cursor: pointer; text-align: left; min-height: 44px; }
label { display: block; font-weight: 700; font-size: 14px; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], select, textarea {
  width: 100%; min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fff; font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--coral); outline-offset: 1px; border-color: transparent; }
.pw { position: relative; }
.pw input { padding-right: 52px; }
.pw button { position: absolute; right: 4px; top: 4px; width: 44px; height: 40px; border: 0; background: none; cursor: pointer; color: var(--muted); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { flex: 1; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; }
.seg button[aria-pressed=true] { border-color: var(--coral); background: #FDE7E2; color: var(--coral-dark); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 4px; font-size: 14px; line-height: 1.4; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--coral); }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; line-height: 1.4; }
.error { color: var(--danger); font-weight: 700; min-height: 1.4em; margin: 10px 0 0; font-size: 14px; }
.test { border: 1.5px dashed var(--amber); background: #FFF6E6; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 12px 0; color: #7A4B00; }
.dark .test { background: rgba(242,165,65,.12); color: var(--amber); }
.card { background: var(--cream); border-radius: var(--radius); padding: 14px 16px; margin: 8px 0; }
.card b { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.place { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fff; }
.place .dot { width: 44px; height: 44px; border-radius: 50%; background: var(--cream); display: grid; place-items: center; flex: none; font-size: 20px; }
.place small { display: block; color: var(--muted); }
.place .count { margin-left: auto; text-align: right; font-size: 13px; color: var(--muted); }
.place .count b { display: block; font-size: 20px; color: var(--ink); }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--plum); color: #fff; border-radius: var(--radius); padding: 12px 14px; margin: 6px 0 10px; font-size: 14px; }
.mini { min-height: 40px; border-radius: 999px; border: 0; padding: 0 14px; background: var(--coral); color: #fff; font-weight: 700; cursor: pointer; flex: none; }
.mini.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.person { border-radius: var(--radius); overflow: hidden; background: var(--cream); position: relative; display: flex; flex-direction: column; }
.person img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #ddd; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; pointer-events: none; }
.person .info { padding: 10px 12px 12px; }
.person .info strong { font-size: 16px; }
.person .info p { margin: 4px 0 8px; font-size: 13px; color: var(--muted); font-style: italic; line-height: 1.35; }
.heart { width: 100%; min-height: 44px; border-radius: 999px; border: 1.5px solid var(--coral); background: #fff; color: var(--coral-dark); font-weight: 700; cursor: pointer; font-size: 14px; }
.heart[aria-pressed=true] { background: var(--coral); color: #fff; }
.more { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(42,26,46,.65); color: #fff; font-size: 20px; cursor: pointer; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.filters select { min-height: 40px; width: auto; flex: 1; font-size: 14px; padding: 6px 10px; }
.big-photo { width: 100%; max-width: 280px; aspect-ratio: 3/4; object-fit: cover; border-radius: 22px; display: block; margin: 12px auto; border: 4px solid var(--amber); pointer-events: none; user-select: none; }
.spots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.spots button { min-height: 46px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,.35); background: transparent; color: #fff; cursor: pointer; font-size: 14px; }
.spots button[aria-pressed=true] { background: var(--amber); border-color: var(--amber); color: var(--plum); font-weight: 700; }
.tabs { position: sticky; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; min-height: 56px; border: 0; background: none; cursor: pointer; font-weight: 700; color: var(--muted); font-size: 14px; }
.tabs button[aria-current=page] { color: var(--coral); }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--plum); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; transition: .25s; pointer-events: none; max-width: 90vw; z-index: 30; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.sheet-wrap { position: fixed; inset: 0; background: rgba(42,26,46,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet { background: #fff; width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
.sheet h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 22px; }
.selfie-box { width: 200px; aspect-ratio: 3/4; border-radius: 22px; border: 2px dashed var(--mist); margin: 16px auto; display: grid; place-items: center; overflow: hidden; color: var(--muted); text-align: center; padding: 10px; font-size: 14px; }
.selfie-box img { width: 100%; height: 100%; object-fit: cover; }
.legal h3 { font-size: 16px; margin: 18px 0 4px; }
.legal p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 36px 10px; line-height: 1.5; }
.netbar { background: var(--amber); color: var(--plum); text-align: center; padding: 8px; font-size: 14px; font-weight: 700; }
@media (min-width: 520px) { #app { margin-top: 20px; margin-bottom: 20px; min-height: calc(100dvh - 40px); border-radius: 28px; overflow: hidden; box-shadow: 0 20px 60px rgba(42,26,46,.15); } }

.person .two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.vlike { min-height: 44px; border-radius: 999px; border: 1.5px solid #2A9D8F; background: #fff; color: #1F7A6F; font-weight: 900; font-size: 18px; cursor: pointer; }
.vlike[aria-pressed=true] { background: #2A9D8F; color: #fff; }
.person .heart { font-size: 18px; }
.heart[disabled] { opacity: .35; }
.person.got-super { box-shadow: 0 0 0 2.5px var(--coral); }
.got { position: absolute; left: 8px; top: 8px; background: #fff; color: var(--coral-dark); font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 4px 9px; }
.plans { display: grid; gap: 8px; margin-top: 10px; }
.plans button { text-align: left; border-radius: 12px; border: 1.5px solid rgba(255,255,255,.35); background: transparent; color: #fff; padding: 10px 12px; cursor: pointer; }
.plans button b { display: block; color: #fff; font-size: 15px; margin: 0; }
.plans button small { display: block; color: var(--mist); font-size: 12.5px; margin-top: 2px; }
.plans button[aria-pressed=true] { background: var(--amber); border-color: var(--amber); }
.plans button[aria-pressed=true] b, .plans button[aria-pressed=true] small { color: var(--plum); }
.reflink { display: block; font-family: ui-monospace, Menlo, monospace; background: #fff; border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 13px; word-break: break-all; }

.plans.light button { border-color: var(--line); color: var(--ink); background: #fff; }
.plans.light button b { color: var(--ink); }
.plans.light button small { color: var(--muted); }
.plans.light button[aria-pressed=true] { background: var(--plum); border-color: var(--plum); }
.plans.light button[aria-pressed=true] b, .plans.light button[aria-pressed=true] small { color: #fff; }

/* version 5 : établissements inscrits, REV Partner, points */
button.place { cursor: pointer; font: inherit; color: inherit; }
.pbadge { font-style: normal; font-size: 11px; font-weight: 800; background: var(--plum); color: #fff; border-radius: 999px; padding: 2px 7px; margin-left: 4px; vertical-align: middle; }
.place small.ad { color: var(--coral-dark); font-weight: 700; }
.qrmini svg { width: 140px; height: auto; display: block; margin: 8px 0; }
.vphotos { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 8px 0; }
.vphotos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 100px; margin: 8px 0 14px; }
.bars span { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 11px; color: var(--muted); }
.bars i { display: block; width: 70%; background: var(--coral); border-radius: 6px 6px 0 0; margin-bottom: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 40px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; padding: 0 14px; cursor: pointer; font-weight: 700; }
.chips button[aria-pressed=true] { background: var(--plum); border-color: var(--plum); color: #fff; }

/* version 6 : wallet, invitations, carte, règle du consentement, thèmes */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 6px; }
.wal { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--cream); color: var(--ink); cursor: pointer; white-space: nowrap; }
.logout { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); font-weight: 700; cursor: pointer; }
.dark .wal { background: rgba(255,255,255,.12); color: #fff; } .dark .logout { color: #fff; border-color: rgba(255,255,255,.35); }
.seg.two { margin: 0 0 10px; }
.place .pinfo { flex: 1; min-width: 0; }
.place small.live { color: #1F7A6F; font-weight: 700; }
.here { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--coral); color: #fff; font-weight: 800; cursor: pointer; white-space: nowrap; flex: none; }
.here.back2 { background: var(--ok); }
.rmap { position: relative; height: 300px; border-radius: var(--radius); overflow: hidden; margin: 4px 0 6px; background-color: var(--cream);
  background-image: linear-gradient(90deg, transparent 47%, rgba(255,255,255,.7) 47%, rgba(255,255,255,.7) 53%, transparent 53%), linear-gradient(0deg, transparent 47%, rgba(255,255,255,.7) 47%, rgba(255,255,255,.7) 53%, transparent 53%); background-size: 70px 70px; }
.rmap .ring { position: absolute; left: 50%; top: 50%; width: 80px; height: 80px; margin: -40px 0 0 -40px; border-radius: 50%; border: 1.5px dashed var(--ok); }
.rmap .medot { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #2F7BEA; box-shadow: 0 0 0 5px rgba(47,123,234,.25); }
.mpin { position: absolute; width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 0; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--coral); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.mpin span { transform: rotate(45deg); font-size: 17px; }
.mpin[aria-pressed=true] { outline: 3px solid var(--plum); }
.mlabel { position: absolute; transform: translate(-50%, 18px); font-size: 11px; font-weight: 700; background: var(--paper); border-radius: 8px; padding: 1px 6px; white-space: nowrap; pointer-events: none; }
.charter { border: 1.5px solid var(--coral); border-radius: var(--radius); padding: 12px 14px; margin: 6px 0 8px; line-height: 1.45; }
.charter b { display: block; font-family: var(--serif); font-size: 18px; margin-bottom: 4px; }
.charter p { margin: 0; }
.tgl { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.tgl button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); font-weight: 700; cursor: pointer; flex: none; }
.tgl button[aria-pressed=true] { background: var(--ok); border-color: var(--ok); color: #fff; }
.tgl.small { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.rule { font-size: 13px; background: var(--cream); border-left: 3px solid var(--coral); border-radius: 8px; padding: 8px 10px; margin: 0 0 8px; }
.price { background: var(--plum); color: #fff; border-radius: var(--radius); padding: 14px 16px; margin: 6px 0 10px; }
.price b { display: block; font-family: var(--serif); font-size: 26px; }
.price span { color: var(--mist); font-size: 14px; }
.small-label { font-size: 13px; font-weight: 700; color: var(--muted); margin: 12px 0 0; }
.rules2 { font-size: 13px; line-height: 1.5; color: var(--muted); padding-left: 18px; margin: 12px 0 0; }
.invite { width: 100%; min-height: 44px; border-radius: 999px; border: 0; background: var(--coral); color: #fff; font-weight: 800; cursor: pointer; font-size: 14px; }
.invite[aria-pressed=true] { background: var(--ok); }
.invite[disabled] { opacity: .55; }
.blurph { width: 100%; aspect-ratio: 3/4; background: radial-gradient(circle at 50% 38%, #b9a9bd 0 18%, transparent 19%), radial-gradient(ellipse at 50% 92%, #b9a9bd 0 34%, transparent 35%), #8f7d93; filter: blur(6px); }
.pend { border: 1.5px dashed var(--ok); border-radius: 14px; padding: 10px 12px; margin: 0 0 8px; font-size: 13px; }
.pend > b { display: block; margin-bottom: 4px; }
.prow { padding: 4px 0; }
.bubble { background: rgba(255,255,255,.1); border-radius: 18px 18px 18px 4px; padding: 12px 14px; font-size: 17px; line-height: 1.4; margin: 6px 0 8px; }
.wbal { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.moves { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.moves li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px solid var(--line); }

/* thèmes : clair (par défaut), sombre, nuit */
html[data-theme=sombre] { --paper: #17121A; --ink: #F1E8F2; --cream: #2A2130; --line: #3D3142; --muted: #B5A6B8; --mist: #8A7A8E; color-scheme: dark; }
html[data-theme=sombre] body { background: #0E0A10; }
html[data-theme=sombre] input[type=text], html[data-theme=sombre] input[type=email], html[data-theme=sombre] input[type=password], html[data-theme=sombre] input[type=number], html[data-theme=sombre] input[type=tel], html[data-theme=sombre] select, html[data-theme=sombre] textarea,
html[data-theme=sombre] .place, html[data-theme=sombre] .seg button, html[data-theme=sombre] .heart, html[data-theme=sombre] .tabs, html[data-theme=sombre] .sheet, html[data-theme=sombre] .chips button, html[data-theme=sombre] .reflink, html[data-theme=sombre] .plans.light button { background: #221A26; color: var(--ink); }
html[data-theme=sombre] .plans.light button b { color: var(--ink); }
html[data-theme=sombre] .plans.light button[aria-pressed=true] { background: var(--coral); border-color: var(--coral); }
html[data-theme=sombre] .seg button[aria-pressed=true] { background: #4A2A2A; color: #FFB4A6; }
html[data-theme=sombre] .chips button[aria-pressed=true] { background: var(--coral); border-color: var(--coral); color: #fff; }
html[data-theme=sombre] .screen.dark { background: #0E0A10; }
html[data-theme=sombre] .toast { background: #F1E8F2; color: #17121A; }
html[data-theme=sombre] .rmap { background-image: linear-gradient(90deg, transparent 47%, rgba(255,255,255,.08) 47%, rgba(255,255,255,.08) 53%, transparent 53%), linear-gradient(0deg, transparent 47%, rgba(255,255,255,.08) 47%, rgba(255,255,255,.08) 53%, transparent 53%); }
html[data-theme=sombre] .place small.live { color: #5FD0B4; }
html[data-theme=nuit] { --plum: #141B33; --plum-mid: #27335E; --coral: #C8A24B; --coral-dark: #8A6A1E; --amber: #E3C77A; --cream: #EEF1F7; --ink: #141B33; --muted: #5B6379; --mist: #AEB4C8; --line: #DCE1EC; }
html[data-theme=nuit] .seg button[aria-pressed=true] { background: #F5ECD6; color: #6B5214; }

.hereok { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding: 14px 16px; margin: 4px 0 12px; border-radius: 20px; background: linear-gradient(135deg, rgba(42,157,111,.16), rgba(42,157,111,.04)); box-shadow: inset 0 0 0 1px rgba(42,157,111,.25); }
.hereok .radar { position: relative; width: 64px; height: 64px; display: grid; place-items: center; }
.hereok .radar i { position: absolute; inset: 8px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; animation: ring 2.4s ease-out infinite; }
.hereok .radar i + i { animation-delay: 1.2s; }
.hereok .core { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--ok); color: #fff; font-weight: 900; font-size: 20px; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(42,157,111,.35); }
.hereok .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hereok small { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ok); }
.hereok b { font-family: var(--serif); font-size: 20px; line-height: 1.15; }
.hereok em { font-style: normal; font-size: 13px; color: var(--muted); }
@keyframes ring { 0% { transform: scale(.55); opacity: .7; } 100% { transform: scale(1.25); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hereok .radar i { animation: none; opacity: .35; transform: scale(1); } }
.nodisc { display: block; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 999px; padding: 8px 6px; }

.timer { --p: 1; --c: var(--ok); position: relative; flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 360deg), rgba(127,127,127,.18) 0); vertical-align: middle; }
.timer::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--paper); }
.timer > span { position: relative; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer.late { --c: var(--coral); }
.timer.big { width: 64px; height: 64px; }
.timer.big > span { font-size: 15px; }
.prow.t { display: flex; align-items: center; gap: 10px; }
.dark .timer::before { background: var(--plum); }
.waiting { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.waiting b { font-size: 13px; color: var(--ok); }

/* version 7 : mode explorateur, filtre, choix du mode */
.explore { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ok); background: rgba(42,157,111,.12); border-radius: 10px; padding: 3px 8px; margin: 4px 0 2px; }
.pbadge.near { background: rgba(42,157,111,.15); color: var(--ok); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 10px; }
.mode { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--paper); color: var(--muted); font-size: 13px; line-height: 1.35; cursor: pointer; min-height: 160px; }
.mode b { font-family: var(--serif); font-size: 19px; color: var(--ink); }
.mode em { font-style: normal; font-weight: 800; color: var(--coral); margin-top: auto; }
.mode .mico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--cream); font-size: 16px; }
.mode[aria-checked=true] { border-color: var(--ok); background: rgba(42,157,111,.08); }
.mode[aria-checked=true] .mico { background: var(--ok); color: #fff; }
