/* =========================================================
   Paris s'éveille — feuille de style
   ========================================================= */
:root {
  --paper: #F6F1E8;
  --card: #FFFDF9;
  --ink: #1C2333;
  --ink-2: #3A4256;
  --muted: #7A766E;
  --line: #E7DECF;
  --line-2: #D9CDB8;
  --dawn: #D8613A;
  --dawn-soft: #F7DCCD;
  --gold: #B38B45;
  --ok: #2E7D5B;
  --ok-soft: #DDEFE5;
  --bad: #B8473B;
  --bad-soft: #F6DEDA;
  --seine: #9BBBD0;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(28,35,51,.04), 0 8px 24px -12px rgba(28,35,51,.18);
  --serif: 'Fraunces', 'Gelasio', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 480px; margin: 0 auto; padding: 0 18px 48px; }

/* ---------- En-tête ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 6px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.sun { width: 30px; height: 30px; flex: none; }
.brand-name { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.brand-name em { font-style: italic; font-weight: 400; color: var(--dawn); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:active { background: var(--line); }
.top-actions { display: flex; gap: 2px; align-items: center; }
.pill-user { font-size: 13px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--card); max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hero { padding: 18px 0 22px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hero h1 { font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1.08; margin: 6px 0 0; letter-spacing: -.02em; }
.hero h1 em { color: var(--dawn); }
.stats { display: flex; gap: 10px; margin-top: 18px; }
.stat { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.stat b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }

/* ---------- Cartes de jeux ---------- */
.games { display: grid; gap: 12px; }
.game-card {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; text-align: left; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.game-card:active { transform: scale(.985); }
.game-num { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); }
.game-num svg { width: 26px; height: 26px; }
.game-card h3 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 19px; }
.game-card p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.game-status { font-size: 13px; font-weight: 600; color: var(--dawn); white-space: nowrap; }
.game-status.done { color: var(--ok); font-family: var(--serif); font-size: 18px; }
.game-status.done small { font-family: var(--sans); font-size: 11px; color: var(--muted); font-weight: 500; display: block; text-align: right; }

.summary { margin-top: 18px; background: var(--ink); color: #F6F1E8; border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; }
.summary::after { content: ''; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(216,97,58,.55), rgba(216,97,58,0) 70%); }
.summary .eyebrow { color: rgba(246,241,232,.6); }
.summary .big { font-family: var(--serif); font-size: 42px; font-weight: 500; line-height: 1; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.summary .big small { font-size: 18px; opacity: .6; }
.summary .next { font-size: 13px; opacity: .75; }
.summary .btn { margin-top: 14px; background: #F6F1E8; color: var(--ink); position: relative; z-index: 1; }

.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; margin-top: 28px; font-size: 13px; color: var(--muted); }
.footer-links button, .footer-links a { white-space: nowrap; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 18px; border-radius: 14px; font-weight: 600; font-size: 15.5px; background: var(--ink); color: #fff; transition: opacity .15s, transform .1s; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .35; cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn.dawn { background: var(--dawn); }
.btn.small { width: auto; padding: 9px 14px; font-size: 14px; border-radius: 11px; }
.link-btn { color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; padding: 8px; }

/* ---------- Écran de jeu ---------- */
.screen-head { display: flex; align-items: center; gap: 8px; padding: 14px 0 4px; }
.screen-head .title { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.screen-head .sub { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.progress { display: flex; gap: 6px; margin: 10px 0 18px; }
.progress i { flex: 1; height: 3px; border-radius: 3px; background: var(--line); }
.progress i.on { background: var(--dawn); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.section-title { font-family: var(--serif); font-size: 22px; font-weight: 500; margin: 4px 0 6px; letter-spacing: -.01em; }
.hint { font-size: 14px; color: var(--muted); margin: 0 0 14px; }

/* Lieux */
.places { position: relative; display: grid; gap: 10px; }
.place { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; }
.place .dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--ink); background: var(--card); margin: 5px 4px; }
.place.to .dot { background: var(--dawn); border-color: var(--dawn); }
.place h4 { margin: 0; font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.2; }
.place p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.places::before { content: ''; position: absolute; left: 10px; top: 22px; bottom: 30px; border-left: 2px dotted var(--line-2); }
.st-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 9px 4px 5px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); }
.st-chip .m { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 10px; display: grid; place-items: center; font-weight: 700; }

/* Pastilles de lignes */
.roundel { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 99px; font-weight: 700; font-size: 13.5px; letter-spacing: -.02em; flex: none; }
.roundel.rer { border-radius: 8px; }
.roundel.sm { min-width: 24px; height: 24px; font-size: 11.5px; }
.roundel.walk { background: var(--paper); border: 1px solid var(--line-2); color: var(--ink-2); }
.lines-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.lines-pick button { border-radius: 99px; padding: 2px; border: 2px solid transparent; }
.lines-pick button.sel { border-color: var(--ink); }
.walk-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 12px 6px 6px; border-radius: 99px; border: 1px dashed var(--line-2); color: var(--ink-2); }

/* Itinéraire construit */
.route { list-style: none; margin: 0 0 14px; padding: 0; }
.route li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.route li:last-child { border-bottom: 0; }
.route .leg-main { font-weight: 600; font-size: 15px; }
.route .leg-sub { font-size: 12.5px; color: var(--muted); }
.current { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--paper); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
.current b { font-family: var(--serif); font-size: 17px; }
.arrived { background: var(--ok-soft); color: var(--ok); }

/* Liste de stations */
.search { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; margin: 10px 0; }
.search:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.st-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.st-list button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 15px; }
.st-list button:last-child { border-bottom: 0; }
.st-list button:active { background: var(--paper); }
.st-list button.here { color: var(--muted); pointer-events: none; }
.st-list .tick { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--lc, var(--ink)); flex: none; background: #fff; }
.st-list .others { margin-left: auto; display: flex; gap: 3px; }
.st-list .branch { font-size: 11px; color: var(--muted); padding: 8px 14px 4px; text-transform: uppercase; letter-spacing: .1em; background: var(--paper); }

/* Estimations */
.estimate { padding: 6px 0 4px; }
.estimate + .estimate { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 18px; }
.est-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.est-head .lbl { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.est-head .lbl svg { width: 22px; height: 22px; }
.est-val { font-family: var(--serif); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.est-val small { font-size: 14px; color: var(--muted); font-family: var(--sans); font-weight: 500; margin-left: 2px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: var(--line); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); border: 4px solid var(--card); box-shadow: 0 1px 6px rgba(0,0,0,.25); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); border: 4px solid var(--card); }
.stepper { display: flex; gap: 8px; margin-top: 10px; }
.stepper button { flex: 1; padding: 8px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; }

/* Résultats */
.score-hero { text-align: center; padding: 8px 0 6px; }
.score-hero .big { font-family: var(--serif); font-size: 56px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.score-hero .big small { font-size: 20px; color: var(--muted); }
.score-hero .msg { font-family: var(--serif); font-style: italic; color: var(--dawn); font-size: 18px; margin-top: 6px; }
.rows { margin-top: 14px; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.row .r-title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.row .r-pts { font-family: var(--serif); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; }
.row .r-detail { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); }
.bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--dawn); border-radius: 4px; }
.best-route { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }

/* Quiz */
.q-count { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.q-text { font-family: var(--serif); font-size: 24px; line-height: 1.22; font-weight: 500; margin: 10px 0 20px; letter-spacing: -.01em; }
.choices { display: grid; gap: 10px; }
.choice { text-align: left; padding: 15px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: #fff; font-size: 16px; display: flex; align-items: center; gap: 12px; transition: background .15s, border-color .15s; }
.choice .k { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.choice.right { background: var(--ok-soft); border-color: var(--ok); }
.choice.right .k { background: var(--ok); color: #fff; border-color: var(--ok); }
.choice.wrong { background: var(--bad-soft); border-color: var(--bad); }
.choice.wrong .k { background: var(--bad); color: #fff; border-color: var(--bad); }
.choice:disabled { cursor: default; }
.explain { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--paper); font-size: 14.5px; color: var(--ink-2); border-left: 3px solid var(--gold); }
.explain b { font-family: var(--serif); }

/* Photo + carte */
.photo-frame { position: relative; border-radius: var(--radius); overflow: hidden; background: #ddd5c6; aspect-ratio: 4 / 3; box-shadow: var(--shadow); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-frame .credit { position: absolute; right: 8px; bottom: 8px; font-size: 10.5px; background: rgba(0,0,0,.45); color: #fff; padding: 3px 7px; border-radius: 6px; }
.photo-frame .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; text-align: center; padding: 20px; }
.map-wrap { margin-top: 14px; }
.map-svg { width: 100%; height: auto; display: block; touch-action: manipulation; }
.map-svg .arr { fill: #EFE7D8; stroke: #fff; stroke-width: .7; cursor: pointer; transition: fill .15s; }
.map-svg .arr:hover { fill: #E6DAC4; }
.map-svg .arr.sel { fill: var(--ink); }
.map-svg .arr.no { fill: var(--bad-soft); cursor: default; }
.map-svg .arr.yes { fill: var(--ok); }
.map-svg .seine { fill: none; stroke: var(--seine); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.map-svg .outline { fill: none; stroke: var(--ink-2); stroke-width: .9; pointer-events: none; }
.map-svg text { font-family: var(--sans); font-size: 5.4px; font-weight: 700; fill: var(--ink-2); text-anchor: middle; pointer-events: none; }
.map-svg text.on { fill: #fff; }
.tries { display: flex; justify-content: center; gap: 8px; margin: 12px 0; }
.tries i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.tries i.used { background: var(--bad); }
.tries i.win { background: var(--ok); }
.feedback { text-align: center; font-size: 15px; min-height: 24px; margin-bottom: 10px; }
.feedback b { font-family: var(--serif); font-size: 18px; }
.arrow { display: inline-block; transition: transform .3s; }

/* ---------- Modales ---------- */
.overlay { position: fixed; inset: 0; background: rgba(28,35,51,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; animation: fade .2s; }
.sheet { background: var(--card); width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; padding: 22px 20px 28px; max-height: 88vh; overflow-y: auto; animation: up .25s ease; }
@media (min-width: 560px) { .overlay { align-items: center; } .sheet { border-radius: 22px; } }
.sheet h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 0 0 6px; }
.sheet p { color: var(--ink-2); font-size: 14.5px; }
.field { display: block; margin: 12px 0; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; }
.err { color: var(--bad); font-size: 13.5px; min-height: 18px; }
.mode-cards { display: grid; gap: 10px; margin: 14px 0; }
.mode-card { text-align: left; border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; }
.mode-card b { font-family: var(--serif); font-size: 17px; }
.mode-card p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.lb { list-style: none; padding: 0; margin: 8px 0 0; }
.lb li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
.lb li.me { background: var(--dawn-soft); border-radius: 10px; border-bottom-color: transparent; padding-left: 8px; }
.lb .rk { font-family: var(--serif); font-weight: 600; color: var(--muted); }
.lb li:nth-child(-n+3) .rk { color: var(--gold); }
.lb .pts { font-family: var(--serif); font-weight: 600; font-variant-numeric: tabular-nums; }
.demo-note { font-size: 12px; color: var(--muted); background: var(--paper); border-radius: 10px; padding: 8px 10px; margin-top: 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 99px; font-size: 14px; z-index: 60; animation: up .2s; }
.loading { text-align: center; padding: 60px 0; color: var(--muted); font-family: var(--serif); font-style: italic; }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(16px); opacity: 0; } }
.fade-in { animation: up .3s ease; }

/* ---------- Aides & malus ---------- */
.help-row { margin-top: 14px; }
.help-btn { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; text-align: left; font-size: 14px; padding: 11px 14px; border-radius: 12px; border: 1px dashed var(--line-2); color: var(--ink-2); background: transparent; }
.help-btn span { font-weight: 700; color: var(--bad); white-space: nowrap; font-size: 13px; }
.help-btn:active { background: var(--paper); }
.reveal { font-size: 14px; padding: 11px 14px; border-radius: 12px; background: var(--dawn-soft); color: #6d3420; }
.malus { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--bad); text-align: right; }
.lines-pick.all { gap: 6px; }
.lines-pick button.dim { opacity: .22; }

/* ---------- Duo / Carré / Cash ---------- */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 8px 14px; border-radius: 16px; border: 1px solid var(--line-2); background: #fff; text-align: center; transition: transform .1s; }
.mode-btn:active { transform: scale(.97); }
.mode-btn b { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.mode-btn span { font-size: 11.5px; color: var(--muted); line-height: 1.25; min-height: 28px; }
.mode-btn em { font-style: normal; font-weight: 700; font-size: 13px; padding: 3px 9px; border-radius: 99px; margin-top: 4px; }
.mode-btn.duo em { background: #EDE7DB; color: var(--ink-2); }
.mode-btn.carre em { background: #E6ECF5; color: #2B4A7A; }
.mode-btn.cash { border-color: var(--dawn); background: linear-gradient(180deg, #fff, #FCEFE7); }
.mode-btn.cash em { background: var(--dawn); color: #fff; }
.mode-tag { display: inline-block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: #EDE7DB; color: var(--ink-2); }
.mode-tag.carre { background: #E6ECF5; color: #2B4A7A; }
.mode-tag.cash { background: var(--dawn); color: #fff; }
.cash-input { font-size: 17px; margin: 0 0 12px; }
.cash-ans { font-family: var(--serif); font-size: 20px; padding: 14px 16px; border-radius: 14px; border: 1px solid; }
.cash-ans.right { background: var(--ok-soft); border-color: var(--ok); }
.cash-ans.wrong { background: var(--bad-soft); border-color: var(--bad); }

/* Liste des stations avec bouton « Correspondances » */
.st-list .st-row { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.st-list .st-row:last-child { border-bottom: 0; }
.st-list .st-row > button[data-stop] { flex: 1; min-width: 0; border-bottom: 0; }
.st-list .st-row.here > button[data-stop] { color: var(--muted); pointer-events: none; }
.st-list .st-row .others { margin: 0 12px 0 0; display: flex; gap: 3px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 55%; }
.st-list .corr-btn { width: auto; flex: none; border: 1px solid var(--line-2) !important; border-radius: 99px; padding: 5px 10px !important; margin-right: 10px; font-size: 12px !important; color: var(--ink-2); background: var(--paper); gap: 4px; }
.st-list .corr-btn b { color: var(--bad); font-weight: 700; }
.st-list .corr-none { color: var(--line-2); font-size: 12px; margin-right: 14px; }
.via-walk { font-size: 12px; margin: 0 1px 0 4px; }

/* ---------- Célébration « meilleur itinéraire » ---------- */
.perfect { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 6px; border-radius: 14px;
  background: linear-gradient(120deg, #FCEBDD, #FFF6E5 60%, #E9F3EC); border: 1px solid #F0D3BD; }
.perfect b { display: block; font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); }
.perfect span { font-size: 13px; color: var(--ink-2); }
.perfect-icon { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--dawn); color: #fff !important; font-size: 18px !important; }
.perfect.pop { animation: pop .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.perfect.pop .perfect-icon { animation: spin 1.2s ease-out .15s both; }
.badge-perfect { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--dawn); color: #fff; margin-left: 6px; vertical-align: 2px; }
.confetti { position: fixed; left: 0; right: 0; top: 34%; height: 0; pointer-events: none; z-index: 70; }
.confetti i { position: absolute; top: 0; opacity: 0; animation-name: confetti; animation-timing-function: cubic-bezier(.15, .7, .4, 1); animation-fill-mode: forwards; }
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  55% { opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) * -1.4)) rotate(var(--r)); opacity: 0; }
}
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes spin { 0% { transform: rotate(-180deg) scale(.4); } 100% { transform: rotate(0) scale(1); } }

/* ---------- Photo floutée ---------- */
.photo-frame img { transition: filter .7s ease, transform .7s ease; }
.pts-badge { position: absolute; left: 10px; top: 10px; background: rgba(28,35,51,.82); color: #fff; font-weight: 700; font-size: 13px; padding: 5px 10px; border-radius: 99px; backdrop-filter: blur(4px); }
.blur-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.blur-meter { display: flex; gap: 4px; flex: 1; }
.blur-meter i { flex: 1; height: 6px; border-radius: 6px; background: var(--line); }
.blur-meter i.on { background: linear-gradient(90deg, var(--dawn), var(--gold)); }
.blur-bar .btn { flex: none; }
.muted-pts { font-weight: 500; color: var(--muted); font-size: 12.5px; }

/* ---------- Accueil & connexion ---------- */
.welcome { text-align: center; }
.welcome-sun .sun { width: 56px; height: 56px; }
.welcome h2 em { color: var(--dawn); }
.welcome p { font-size: 15.5px; line-height: 1.55; }
.welcome .btn { margin-top: 8px; }
.onboard h2 { font-size: 25px; line-height: 1.15; margin: 6px 0 14px; }
.perks { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.perks li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; background: var(--paper); border-radius: 12px; padding: 10px 12px; }
.perks li span { font-size: 20px; text-align: center; }
.perks b { display: block; font-size: 14.5px; }
.perks small { display: block; font-size: 12.5px; color: var(--muted); }
.guest-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--muted); font-size: 13px; }
.guest-or::before, .guest-or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.guest-note { font-size: 12.5px !important; color: var(--muted) !important; text-align: center; margin: 10px 0 0; }
.brand-name { white-space: nowrap; }
@media (max-width: 400px) {
  .brand-name { font-size: 18px; }
  .sun { width: 26px; height: 26px; }
  .top-actions .icon-btn { width: 34px; }
  .pill-user { max-width: 118px; padding: 7px 10px; font-size: 12.5px; }
}
.st-list .corr-btn { white-space: nowrap; }
@media (max-width: 400px) { .st-list .corr-btn { font-size: 11.5px !important; padding: 5px 8px !important; margin-right: 8px; } }

/* ---------- Archives ---------- */
.arch-banner { margin-top: 12px; font-size: 13.5px; background: var(--dawn-soft); color: #6d3420; padding: 10px 12px; border-radius: 12px; line-height: 1.45; }
.arch-banner a { color: inherit; font-weight: 600; white-space: nowrap; }
.arch-link { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); border: 1px dashed var(--line-2); background: transparent; }
.arch-link span:first-child { font-size: 22px; text-align: center; }
.arch-link b { display: block; font-family: var(--serif); font-size: 17px; font-weight: 600; }
.arch-link small { display: block; font-size: 12.5px; color: var(--muted); }
.arch-list { max-height: 60vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; }
.arch-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 15px; }
.arch-row:last-child { border-bottom: 0; }
.arch-row.cur { background: var(--paper); }
.arch-date { display: inline-block; }
.arch-date::first-letter { text-transform: uppercase; }
.arch-score { font-family: var(--serif); font-weight: 600; color: var(--ok); }
.arch-score small { font-family: var(--sans); font-size: 10.5px; color: var(--muted); font-weight: 500; }
.arch-play { font-size: 13.5px; font-weight: 600; color: var(--dawn); }

/* ---------- Ligues ---------- */
.league-entry { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--paper); margin: 4px 0 12px; }
.league-entry span:first-child { font-size: 20px; text-align: center; }
.league-entry b { display: block; font-size: 15px; }
.league-entry small { display: block; font-size: 12.5px; color: var(--muted); }
.lg-list { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.lg-row { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.lg-row:last-child { border-bottom: 0; }
.lg-row b { display: block; font-family: var(--serif); font-size: 17px; font-weight: 600; }
.lg-row small { display: block; font-size: 12.5px; color: var(--muted); }
.lg-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; background: var(--paper); border-radius: 14px; }
.lg-invite { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 14px; margin-top: 10px; }
.lg-invite small { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .65; }
.lg-invite b { font-family: 'Courier New', monospace; font-size: 24px; letter-spacing: 4px; }

/* ---------- Carte à épingle (Arrondi) ---------- */
.gmap { position: relative; border-radius: 14px; overflow: hidden; background: #E9E3D6; }
.gmap svg { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.gmap.zoomed svg { cursor: grab; }
.gbg { fill: #E9E3D6; }
.garr { fill: #F5EFE3; stroke: #F5EFE3; stroke-width: .5px; vector-effect: non-scaling-stroke; }
.garr.hl { fill: var(--ok-soft); stroke: var(--ok-soft); }
.gpark { fill: #C9DDB4; pointer-events: none; }
.gseine { fill: none; stroke: #A9C7DA; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.gline-arr { fill: none; stroke: #7C8496; stroke-width: 1.1px; vector-effect: non-scaling-stroke; pointer-events: none; }
.gmap text { font-family: var(--sans); text-anchor: middle; pointer-events: none; }
.garr-n { font-weight: 700; fill: var(--ink-2); opacity: .7; }
.gpark-n { font-style: italic; fill: #4F7A3A; font-weight: 600; opacity: .9; }
.gpin path { stroke: #fff; stroke-width: 1.5px; }
.gpin.me path { fill: var(--ink); }
.gpin.target path { fill: var(--dawn); }
.gpin circle { fill: #fff; }
.gline { stroke: var(--dawn); stroke-width: 2.4px; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; fill: none; }
.gzoom { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; }
.gzoom button { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,253,249,.96); border: 1px solid var(--line-2); font-size: 19px; font-weight: 700; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.gfull-bar { display: none; }
.gmap.full { position: fixed; inset: 0; z-index: 900; border-radius: 0; display: flex; flex-direction: column; background: #E9E3D6; }
.gmap.full svg { flex: 1; aspect-ratio: auto; height: 100%; min-height: 0; }
.gmap.full .gzoom { top: calc(10px + env(safe-area-inset-top)); }
.gmap.full .gfull-bar { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.gfull-hint { font-size: 12.5px; color: var(--muted); }
body.gmap-open { overflow: hidden; }
.map-wrap.geo { margin-left: -18px; margin-right: -18px; padding: 0 !important; border-radius: 0; border-left: 0; border-right: 0; overflow: hidden; }
.map-wrap.geo .gmap { border-radius: 0; }
@media (min-width: 520px) { .map-wrap.geo { margin-left: 0; margin-right: 0; border-radius: 14px; border: 1px solid var(--line); } }
.geo-res { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.geo-res div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.geo-res b { display: block; font-family: var(--serif); font-size: 20px; }
.geo-res span { font-size: 12px; color: var(--muted); }
.geo-res .ok b { color: var(--ok); }
.geo-res .ko b { color: var(--bad); }

/* Interrupteur (e-mail du matin) */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; }
.toggle-row b { display: block; font-size: 15px; }
.toggle-row small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { flex: none; width: 44px; height: 26px; border-radius: 13px; background: var(--line-2); position: relative; transition: background .2s; }
.toggle-row i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.toggle-row input:checked + i { background: var(--ok); }
.toggle-row input:checked + i::after { transform: translateX(18px); }

/* Code PIN */
.pin-input { font-size: 26px !important; letter-spacing: 12px; text-align: center; font-variant-numeric: tabular-nums; }
/* Bouton Classement (en-tête) */
.pill-rank { border: 1px solid var(--line-2); background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 11px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.top-actions .pill-user { max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 440px) {
  .top-actions [data-act="rules"] { display: none; }
  .top-actions { gap: 6px; }
  .pill-rank { padding: 7px 9px; font-size: 12.5px; }
  .top-actions .pill-user { max-width: 108px; padding: 7px 9px; }
  .brand-name { font-size: 16.5px !important; }
  .brand svg { width: 22px; }
}
@media (max-width: 370px) { .brand-name { display: none; } }
/* Propositions */
.prop-kinds { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.prop-kinds button { border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 8px 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.prop-kinds button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.sheet textarea { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); resize: vertical; }

/* Options discrètes */
.mail-opt { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.mail-opt input { width: 13px; height: 13px; margin: 0; accent-color: var(--muted); }
.guest-link { text-align: center; margin: 18px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.guest-link .link-btn { font-size: 12.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.guest-link span { display: inline-block; margin-top: 4px; font-size: 11px; opacity: .85; }
