:root {
  --bg: #14122b; --bg2: #1d1a3d; --card: #fff8e7; --ink: #2a2140; --muted: #7d7596;
  --gold: #f5c542; --gold2: #d9a31a; --pink: #ff4f8b; --ok: #3ccf91; --line: rgba(255,255,255,.12);
  --radius: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: #f3f0ff; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
body { min-height: 100vh; background: radial-gradient(1200px 500px at 50% -200px, #3a2a7a 0%, var(--bg) 70%) no-repeat, var(--bg); }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; margin: 0; letter-spacing: .01em; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--gold); }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 96px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 4px; max-width: 720px; margin: 0 auto; }
.brand { font-family: Georgia, serif; font-size: 1.25rem; color: var(--gold); }
.brand small { display: block; font: 600 .7rem system-ui; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.me { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.pts { white-space: nowrap; background: var(--gold); color: #3a2a00; font-weight: 700; border-radius: 99px; padding: 2px 10px; font-size: .85rem; }
.btn { border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 700; cursor: pointer; background: var(--gold); color: #3a2a00; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: #f3f0ff; border: 1px solid var(--line); }
.btn.danger { background: var(--pink); color: #fff; }
.btn.small { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn[disabled] { opacity: .5; }
.link { background: none; border: 0; color: var(--gold); text-decoration: underline; cursor: pointer; padding: 0; }
input, textarea, select { width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
label { display: block; font-size: .85rem; color: var(--muted); margin: 12px 0 6px; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.err { color: #ff9db9; margin: 10px 0 0; min-height: 1.2em; font-size: .9rem; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }

/* connexion */
.auth { max-width: 420px; margin: 0 auto; padding: 48px 20px; text-align: center; }
.auth h1 { color: var(--gold); font-size: 2rem; }
.auth .sub { color: var(--muted); margin: 6px 0 24px; }
.auth form { text-align: left; }
.auth .btn { width: 100%; margin-top: 18px; }
.tabs2 { display: flex; gap: 6px; background: var(--bg2); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.tabs2 button { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 9px; color: var(--muted); font-weight: 700; cursor: pointer; }
.tabs2 button.on { background: var(--gold); color: #3a2a00; }

/* progression */
.progress { margin-top: 12px; }
.bar { height: 14px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold2), var(--gold)); border-radius: 99px; transition: width .6s; }
.progress .lbl { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.progress .lbl b { color: var(--gold); font-size: 1.05rem; }

/* grille de vignettes */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 16px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.sticker { position: relative; background: var(--card); color: var(--ink); border-radius: 14px; padding: 8px 8px 10px; text-decoration: none; display: block; box-shadow: 0 6px 16px rgba(0,0,0,.35); transition: transform .15s; }
.sticker:active { transform: scale(.97); }
.sticker .pic { aspect-ratio: 3 / 4; border-radius: 9px; background: #e9dfc7 center / cover; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.sticker.empty .pic { background: repeating-linear-gradient(45deg, #efe5cd, #efe5cd 10px, #e6dabd 10px, #e6dabd 20px); border: 2px dashed #b9a97d; }
.sticker .pic .q { font: 700 3.2rem Georgia, serif; color: #b9a97d; }
.sticker .nm { font: 700 .95rem Georgia, serif; margin: 8px 2px 4px; line-height: 1.2; word-break: break-word; }
.sticker .mini { height: 6px; background: #e3d8bd; border-radius: 9px; overflow: hidden; }
.sticker .mini i { display: block; height: 100%; background: var(--pink); }
.sticker .cnt { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.sticker.out .pic { filter: grayscale(1) brightness(.8); }
.ribbon { position: absolute; top: 14px; left: -4px; background: var(--pink); color: #fff; font: 700 .65rem system-ui; letter-spacing: .08em; padding: 3px 9px; border-radius: 0 6px 6px 0; z-index: 2; text-transform: uppercase; }
.ribbon.wait { background: #8a7bd1; }
.sticker.add { background: transparent; border: 2px dashed var(--gold2); color: var(--gold); box-shadow: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 180px; font-weight: 700; text-align: center; gap: 6px; }
.sticker.add .plus { font-size: 2.4rem; line-height: 1; }

/* fil d'activité */
.feed { list-style: none; margin: 8px 0 0; padding: 0; font-size: .9rem; }
.feed li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.feed li:last-child { border: 0; }
.feed b { color: var(--gold); }
.feed .p { color: var(--ok); font-weight: 700; white-space: nowrap; }

/* fiche */
.hero { display: flex; gap: 16px; align-items: flex-start; }
.hero .sticker { width: 42%; max-width: 200px; flex: none; }
.hero .info h2 { font-size: 1.6rem; color: var(--gold); line-height: 1.15; }
.slots { margin-top: 14px; display: grid; gap: 10px; }
.slot { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); color: var(--ink); border-radius: 12px; padding: 10px 14px; text-align: left; border: 0; width: 100%; cursor: pointer; }
.slot .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.slot .v { font-weight: 600; word-break: break-word; }
.slot .by { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.slot.todo { background: transparent; color: var(--gold); border: 2px dashed var(--gold2); }
.slot.todo .k { color: var(--gold2); }
.slot.todo .v { font-weight: 700; }
.slot .go { font-size: 1.3rem; }
.songs { list-style: none; padding: 0; margin: 10px 0 0; }
.songs li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.songs li:last-child { border: 0; }
.songs .t { font-weight: 600; }
.songs .s { font-size: .8rem; color: var(--muted); }
.x { background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tag { display: inline-block; font: 700 .7rem system-ui; letter-spacing: .08em; text-transform: uppercase; border-radius: 99px; padding: 3px 10px; background: var(--pink); color: #fff; }
.tag.wait { background: #8a7bd1; }

/* classement */
.rank { list-style: none; padding: 0; margin: 12px 0 0; counter-reset: r; }
.rank li { counter-increment: r; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; margin-bottom: 8px; background: var(--bg2); border: 1px solid var(--line); }
.rank li::before { content: counter(r); font: 700 1.2rem Georgia, serif; width: 28px; text-align: center; color: var(--gold); }
.rank li:nth-child(1)::before { content: "🥇"; } .rank li:nth-child(2)::before { content: "🥈"; } .rank li:nth-child(3)::before { content: "🥉"; }
.rank li.me { border-color: var(--gold); }
.rank .n { flex: 1; font-weight: 700; }
.rank .n small { display: block; font-weight: 400; color: var(--muted); }
.rank .t { font: 700 1.2rem Georgia, serif; color: var(--gold); }

/* navigation basse */
nav.bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px; background: rgba(20,18,43,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); z-index: 10; }
nav.bottom a { flex: 1; max-width: 160px; text-align: center; text-decoration: none; color: var(--muted); font-size: .75rem; font-weight: 700; padding: 6px 4px; border-radius: 10px; }
nav.bottom a span { display: block; font-size: 1.35rem; line-height: 1.2; }
nav.bottom a.on { color: var(--gold); background: rgba(245,197,66,.1); }

/* dialogue et toast */
dialog { border: 1px solid var(--line); border-radius: 18px; background: var(--bg2); color: #f3f0ff; width: min(92vw, 420px); padding: 20px; }
dialog::backdrop { background: rgba(5,4,15,.7); }
dialog h3 { color: var(--gold); margin-bottom: 4px; }
dialog .btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
#toast { position: fixed; left: 50%; top: 18px; transform: translate(-50%, -140%); background: var(--gold); color: #3a2a00; font-weight: 700; padding: 12px 20px; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 50; transition: transform .35s cubic-bezier(.2,1.4,.4,1); max-width: 90vw; text-align: center; }
#toast.show { transform: translate(-50%, 0); }
#toast.bad { background: var(--pink); color: #fff; }
.similar { background: rgba(245,197,66,.1); border: 1px solid var(--gold2); border-radius: 12px; padding: 10px 12px; margin-top: 12px; font-size: .9rem; }
.similar a { display: block; padding: 4px 0; }
.empty-state { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty-state .big { font-size: 3rem; }
.invite { font: 700 1.4rem ui-monospace, Menlo, monospace; letter-spacing: .12em; color: var(--gold); }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.admin-row:last-child { border: 0; }

/* confirmations façon wiki */
.slotwrap { display: grid; gap: 4px; }
.slotact { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 4px; align-items: center; }
.mini-btn { border: 1px solid var(--gold2); background: rgba(245,197,66,.12); color: var(--gold); border-radius: 99px; padding: 4px 12px; font-size: .8rem; font-weight: 700; cursor: pointer; }
.mini-btn.ghost { border-color: var(--line); background: transparent; color: var(--muted); }
.okmark { color: var(--ok); font-size: .82rem; font-weight: 700; }
.confbox { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }

/* immunité */
.ribbon.imm { background: #2f8fe8; }
.tag.imm { background: #2f8fe8; }
.immbox { background: rgba(47,143,232,.14); border-color: #2f8fe8; margin-top: 16px; }

/* pronostics */
.steps { display: flex; gap: 8px; margin-top: 12px; }
.step { flex: 1; text-align: center; padding: 8px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.step b { display: inline-block; width: 20px; height: 20px; line-height: 20px; border-radius: 50%; background: var(--line); color: #fff; margin-right: 4px; }
.step.on { color: var(--gold); border-color: var(--gold2); }
.step.on b { background: var(--gold); color: #3a2a00; }
.pickgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--bg); border: 2px solid var(--line); cursor: pointer; text-align: left; position: relative; min-height: 56px; }
.pick .av { width: 38px; height: 38px; border-radius: 50%; flex: none; background: #e9dfc7 center / cover; color: #8b7a45; display: flex; align-items: center; justify-content: center; font: 700 1rem Georgia, serif; }
.pick .pn { font-weight: 600; font-size: .9rem; line-height: 1.15; word-break: break-word; }
.pick .chk { display: none; position: absolute; top: -8px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: #3a2a00; font-size: .8rem; line-height: 22px; text-align: center; font-weight: 700; }
.pick.on { border-color: var(--gold); background: rgba(245,197,66,.12); }
.pick.on .chk { display: block; }
.pick[disabled] { opacity: .4; cursor: not-allowed; }
