/* ---------- Thème familial : crème, corail, soleil, sauge ---------- */
:root {
  --bg: #FFF6EC; --card: #FFFFFF; --ink: #4A3728; --muted: #A8927F; --line: #F3E6D8;
  --coral: #FF7E67; --coral-soft: #FFE6DF; --sun: #FFC94D; --sun-soft: #FFF3D1;
  --sage: #7CC6A0; --sage-soft: #E2F4EA; --sky: #7DB9E8; --lilac: #B69CF0;
  --radius: 24px; --shadow: 0 8px 24px rgba(140, 84, 40, .10);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --tab-h: calc(68px + env(safe-area-inset-bottom));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font: 500 16px/1.4 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  overscroll-behavior-y: none; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(circle at 10% 0%, #FFE9D2 0, transparent 40%), radial-gradient(circle at 100% 10%, #FFF0C9 0, transparent 35%);
  background-attachment: fixed; min-height: 100dvh;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; font-weight: 900; letter-spacing: -.3px; }
h2 { font-size: 21px; font-weight: 900; }
h3 { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
small { font-size: 12.5px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .cap::first-letter { text-transform: uppercase; }
.row { display: flex; gap: 8px; } .row > * { flex: 1; }

.splash { display: grid; place-items: center; height: 100dvh; font-size: 72px; animation: bob 1.2s ease-in-out infinite; }

/* ---------- Vues & animations d'entrée ---------- */
.view { max-width: 560px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px calc(var(--tab-h) + 90px); display: flex; flex-direction: column; gap: 14px; }
.view.enter > *:not(.fab) { animation: rise .5s var(--spring) both; }
.view.enter > *:nth-child(2) { animation-delay: .05s; } .view.enter > *:nth-child(3) { animation-delay: .1s; }
.view.enter > *:nth-child(4) { animation-delay: .15s; } .view.enter > *:nth-child(5) { animation-delay: .2s; }
.view.enter > *:nth-child(n+6) { animation-delay: .25s; }
@keyframes rise { from { opacity: 0; transform: translateY(22px) scale(.97); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-4deg); } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(18deg); } 20%, 40% { transform: rotate(-10deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.shake { animation: shake .4s; }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.2s 0.4s; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.hello { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px; }
.section-title { font-size: 17px; margin: 8px 4px -4px; }

/* ---------- Avatars ---------- */
.avatar { flex: none; border-radius: 50%; background: var(--c, var(--coral)); color: #fff; font-weight: 900; display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c, var(--coral)); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.add { background: var(--sun-soft); color: var(--coral); font-size: 40px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sun); }
.stack { display: flex; } .stack .avatar { box-shadow: 0 0 0 2px #fff; margin-left: -6px; } .stack .avatar:first-child { margin-left: 0; }

/* ---------- Boutons ---------- */
.btn { border-radius: 18px; padding: 14px 18px; font-weight: 800; width: 100%; transition: transform .2s var(--spring), opacity .2s; }
.btn:active, .fab:active, .round:active, .login-user:active, .cell:active, .week-day:active, .status-picker button:active, .react:active { transform: scale(.93); }
.btn.primary { background: linear-gradient(135deg, var(--coral), #FF9F6B); color: #fff; box-shadow: 0 8px 18px rgba(255, 126, 103, .35); }
.btn.soft { background: var(--sun-soft); color: #9A6A00; }
.btn.ghost { color: var(--muted); } .danger { color: #E0524A !important; }
.btn:disabled { opacity: .5; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; background: var(--sun-soft); color: #9A6A00; }
.chip.task { background: var(--sage-soft); color: #2F7D55; }
.round { width: 42px; height: 42px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-size: 24px; font-weight: 800; transition: transform .2s var(--spring); }
.more { margin-left: auto; opacity: .55; font-size: 15px; padding: 6px; }

.fab { position: fixed; right: max(18px, calc(50vw - 262px)); bottom: calc(var(--tab-h) + 16px); z-index: 20; display: flex; align-items: center; gap: 8px; padding: 14px 20px 14px 16px; border-radius: 99px; font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--coral), #FF9F6B); box-shadow: 0 10px 24px rgba(255, 126, 103, .45); transition: transform .2s var(--spring); animation: pop .5s var(--spring) .2s both; }
.fab span { font-size: 22px; line-height: 1; }

/* ---------- Barre d'onglets ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; height: var(--tab-h); padding: 8px 8px env(safe-area-inset-bottom); background: rgba(255, 255, 255, .88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 26px 26px 0 0; box-shadow: 0 -6px 24px rgba(140, 84, 40, .08); }
.tabbar a { flex: 1; max-width: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 18px; color: var(--muted); font-weight: 800; font-size: 11px; transition: background .25s, color .25s; }
.tab-icon { font-size: 24px; line-height: 1; height: 30px; display: grid; place-items: center; filter: grayscale(.7) opacity(.7); transition: transform .35s var(--spring), filter .25s; }
.tabbar a.on { color: var(--coral); background: var(--coral-soft); }
.tabbar a.on .tab-icon { filter: none; transform: translateY(-3px) scale(1.18); }
.tabbar .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--c); }

/* ---------- Présences ---------- */
.tonight { background: linear-gradient(160deg, #fff 50%, var(--sun-soft)); }
.tonight-people { display: flex; justify-content: space-around; margin: 6px 0 18px; }
.tonight-person { display: flex; flex-direction: column; align-items: center; gap: 4px; transition: opacity .3s; }
.tonight-person small { color: var(--muted); }
.tonight-person.away .avatar { filter: grayscale(.8); opacity: .55; }
.tonight-person.unknown .avatar { opacity: .75; }
.badge-wrap { position: relative; margin-bottom: 4px; }
.badge { position: absolute; right: -8px; bottom: -6px; width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 16px; box-shadow: 0 3px 8px rgba(0, 0, 0, .12); animation: pop .4s var(--spring); }
.status-picker { display: flex; gap: 8px; }
.status-picker button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 18px; background: var(--bg); font-weight: 800; font-size: 12.5px; border: 2px solid transparent; transition: transform .2s var(--spring), background .2s, border-color .2s; }
.status-picker button span { font-size: 24px; transition: transform .3s var(--spring); }
.status-picker button.on { background: var(--sage-soft); border-color: var(--sage); color: #2F7D55; }
.status-picker button.on span { transform: scale(1.25) rotate(-6deg); }
.status-picker.big button { padding: 18px 4px; font-size: 14px; } .status-picker.big span { font-size: 36px; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 16px; background: var(--bg); border: 2px solid transparent; transition: transform .2s var(--spring), background .2s; }
.week-day small { color: var(--muted); font-weight: 800; text-transform: capitalize; }
.week-day:first-child { border-color: var(--sun); }
.week-emoji { font-size: 20px; height: 26px; }
.week-day.home { background: var(--sage-soft); } .week-day.evening { background: #ECE6FB; } .week-day.away { background: var(--coral-soft); }

.dots { display: flex; justify-content: center; height: 16px; max-width: 100%; }
.mini { position: relative; width: 15px; height: 15px; border-radius: 50%; background: var(--c); color: #fff; font: 900 9px/15px inherit; font-style: normal; text-align: center; box-shadow: 0 0 0 1.5px #fff; margin-left: -4px; flex: none; }
.mini:first-child { margin-left: 0; }
.mini img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.mini.evening::after { content: '🌙'; position: absolute; right: -4px; top: -5px; font-size: 8px; line-height: 1; }
.mini.away { filter: grayscale(1); opacity: .45; }
.mini.away::after { content: ''; position: absolute; left: -1px; right: -1px; top: 6.5px; height: 2px; border-radius: 2px; background: #4A3728; transform: rotate(-45deg); }

/* ---------- Agenda ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 4px; }
.cal-card { padding: 14px 10px; overflow: hidden; }
.weekdays, .month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.weekdays span { text-align: center; font-weight: 800; font-size: 12px; color: var(--muted); padding-bottom: 8px; }
.cell { min-width: 0; min-height: 64px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 5px 0 6px; font-size: 13px; background: var(--bg); transition: transform .2s var(--spring); }
.cell.home { background: var(--sage-soft); } .cell.evening { background: #ECE6FB; } .cell.away { background: var(--coral-soft); }
.cell.void { background: none; } .cell.past { opacity: .5; }
.cell.today { box-shadow: 0 0 0 2.5px var(--coral), 0 6px 14px rgba(255, 126, 103, .3); } .cell.today b { background: var(--coral); color: #fff; border-radius: 99px; padding: 0 6px; }
.cell-emojis { font-size: 12px; height: 16px; line-height: 16px; }
.month.slide-left { animation: slideL .3s ease-out; } .month.slide-right { animation: slideR .3s ease-out; }
@keyframes slideL { from { opacity: 0; transform: translateX(40px); } } @keyframes slideR { from { opacity: 0; transform: translateX(-40px); } }
/* Vue semaine : une ligne par jour, une colonne par personne */
.wk { display: flex; flex-direction: column; gap: 6px; }
.wk-row { display: grid; grid-template-columns: 46px repeat(var(--cols), minmax(0, 1fr)); gap: 6px; align-items: stretch; }
.wk-row.past { opacity: .5; }
.wk-head { align-items: end; padding-bottom: 4px; }
.wk-person { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; } .wk-person small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-day { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 14px; line-height: 1.15; transition: transform .2s var(--spring); }
.wk-day small { color: var(--muted); font-weight: 800; text-transform: capitalize; } .wk-day b { font-size: 18px; }
.wk-row.today .wk-day { background: var(--coral); color: #fff; box-shadow: 0 6px 14px rgba(255, 126, 103, .35); } .wk-row.today .wk-day small { color: #fff; }
.wk-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 54px; border-radius: 14px; background: var(--bg); border: 2px solid transparent; transition: transform .2s var(--spring), background .25s; }
.wk-cell span { font-size: 22px; line-height: 1.1; } .wk-cell small { font-size: 10.5px; font-weight: 800; white-space: nowrap; }
.wk-cell.home { background: var(--sage-soft); color: #2F7D55; } .wk-cell.evening { background: #ECE6FB; color: #6A4FC0; } .wk-cell.away { background: var(--coral-soft); color: #C2503E; }
.wk-cell.none { color: var(--muted); } .wk-cell.none span { opacity: .45; font-weight: 900; }
.wk-cell.mine { border-color: rgba(74, 55, 40, .12); border-style: dashed; } .wk-cell.mine:active { transform: scale(.9); }
.wk-extras { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px; text-align: left; margin-bottom: 4px; }
.wk-extras .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; } .wk-extras .chip i { font-style: normal; opacity: .7; margin-left: 5px; }
.wk.slide-left { animation: slideL .3s ease-out; } .wk.slide-right { animation: slideR .3s ease-out; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 12.5px; font-weight: 700; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.event-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 0; border-top: 1px solid var(--line); }
h3 + .event-row, .day-people + .event-row { border-top: 0; }
.event-row > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.event-emoji { width: 44px; height: 44px; border-radius: 14px; background: var(--sun-soft); display: grid; place-items: center; font-size: 22px; flex: none; }
.day-sheet { display: flex; flex-direction: column; gap: 14px; }
.day-people { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.day-person { display: flex; align-items: center; gap: 12px; } .day-person span { margin-left: auto; font-size: 14px; }

/* ---------- Envies / tâches ---------- */
.segmented { display: flex; background: rgba(255, 255, 255, .7); border-radius: 16px; padding: 4px; gap: 4px; }
.segmented button { flex: 1; padding: 9px 4px; border-radius: 13px; font-weight: 800; font-size: 14px; color: var(--muted); transition: all .25s var(--spring); }
.segmented button.on { background: #fff; color: var(--ink); box-shadow: 0 3px 10px rgba(140, 84, 40, .12); transform: scale(1.02); }
.post { display: flex; flex-direction: column; gap: 12px; transition: opacity .3s; }
.post.done { opacity: .55; } .post.done p { text-decoration: line-through; }
.post-head { display: flex; align-items: center; gap: 10px; } .post-head > div:nth-child(2) { display: flex; flex-direction: column; line-height: 1.2; }
.post-head .chip { margin-left: auto; } .post-head .more { margin-left: 0; }
.post-body { display: flex; gap: 12px; align-items: flex-start; } .post-body p { flex: 1; font-size: 17px; font-weight: 700; white-space: pre-wrap; overflow-wrap: anywhere; }
.check { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--sage); color: #fff; font-weight: 900; transition: all .3s var(--spring); }
.check.on { background: var(--sage); transform: scale(1.1) rotate(-8deg); }
.post-photo { width: 100%; max-height: 320px; object-fit: cover; border-radius: 18px; transition: max-height .35s ease; }
.post-photo.zoom { max-height: 1000px; object-fit: contain; }
.post-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.assignees { display: flex; align-items: center; gap: 8px; }

.reactions { display: flex; gap: 8px; }
.react { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: var(--bg); border: 2px solid transparent; transition: transform .2s var(--spring), background .2s; min-height: 40px; }
.react-emoji { font-size: 19px; transition: transform .3s var(--spring); }
.react.on.up { background: var(--sun-soft); border-color: var(--sun); } .react.on.down { background: var(--coral-soft); border-color: var(--peach, #FFB199); }
.react.on .react-emoji { transform: scale(1.3) rotate(-10deg); animation: pop .4s var(--spring); }

/* ---------- Miam ---------- */
.meal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.meal { padding: 0; overflow: hidden; position: relative; }
.meal.unanimous { box-shadow: 0 0 0 3px var(--sun), var(--shadow); }
.meal-photo { width: 100%; height: 170px; object-fit: cover; display: block; }
.meal-photo.none { height: 96px; display: grid; place-items: center; font-size: 56px; background: linear-gradient(135deg, var(--sun-soft), var(--coral-soft)); }
.meal .when { position: absolute; top: 12px; left: 12px; background: #fff; color: var(--coral); box-shadow: 0 3px 10px rgba(0, 0, 0, .12); text-transform: capitalize; }
.meal-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.meal-title { display: flex; align-items: center; } .meal-title h3 { margin: 0; font-size: 18px; }
.mini-meal { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.mini-meal img, .mini-meal-emoji { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--sun-soft); font-size: 26px; }
.mini-meal > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); font-weight: 700; }
.empty-emoji { font-size: 64px; animation: bob 2.4s ease-in-out infinite; margin-bottom: 8px; }

/* ---------- Feuilles & formulaires ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(74, 55, 40, .4); display: flex; align-items: flex-end; justify-content: center; animation: fade .25s both; }
.backdrop.out { animation: fade .25s reverse both; } .backdrop.out .sheet { animation: sheetUp .25s ease-in reverse both; }
.sheet { width: 100%; max-width: 560px; max-height: 90dvh; overflow-y: auto; background: var(--bg); border-radius: 30px 30px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); animation: sheetUp .4s var(--spring) both; }
.sheet { position: relative; overscroll-behavior: contain; transition: transform .25s ease; }
.grab-zone { position: sticky; top: -10px; z-index: 2; margin: -10px -20px 6px; padding: 12px 0 14px; background: linear-gradient(var(--bg) 70%, transparent); cursor: grab; touch-action: none; }
.grabber { width: 48px; height: 5px; border-radius: 9px; background: #E5D3C0; margin: 0 auto; }
.sheet-close { position: sticky; top: 2px; z-index: 3; display: block; width: 38px; height: 38px; margin: -30px -8px -8px auto; border-radius: 50%; background: #fff; box-shadow: 0 3px 10px rgba(140, 84, 40, .18); font-size: 16px; font-weight: 900; color: var(--muted); transition: transform .2s var(--spring); }
.sheet-close:active { transform: scale(.85); }
.sheet h2 { padding-right: 40px; }
@keyframes fade { from { opacity: 0; } } @keyframes sheetUp { from { transform: translateY(100%); } }
.form { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; } .field > span { font-weight: 800; font-size: 13.5px; color: var(--muted); padding-left: 4px; }
input, textarea { width: 100%; border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 13px 14px; outline: none; transition: border-color .2s, box-shadow .2s; resize: none; font-size: 16px; min-height: 50px; -webkit-appearance: none; appearance: none; }
input:focus, textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 4px var(--coral-soft); }
.emoji-row { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; }
.emoji-row button { flex: none; width: 46px; height: 46px; border-radius: 14px; background: #fff; font-size: 24px; border: 2px solid transparent; transition: transform .25s var(--spring); }
.emoji-row button.on { border-color: var(--coral); background: var(--coral-soft); transform: scale(1.12); }
.people-row { display: flex; gap: 14px; padding: 4px; }
.person { display: flex; flex-direction: column; align-items: center; gap: 6px; opacity: .4; filter: grayscale(.6); transition: all .25s var(--spring); font-weight: 800; }
.person.on { opacity: 1; filter: none; transform: scale(1.06); }
.photo-add { width: 100%; padding: 18px; border-radius: 18px; border: 2px dashed var(--peach, #FFB199); background: #fff; font-weight: 800; color: var(--coral); display: flex; align-items: center; justify-content: center; gap: 8px; }
.photo-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .photo-choice .photo-add { flex-direction: column; gap: 4px; padding: 14px 6px; font-size: 13.5px; }
.photo-add span { font-size: 22px; } .photo-add.loading { opacity: .5; pointer-events: none; } .photo-add.loading span { animation: bob .8s infinite; }
.photo-preview { position: relative; } .photo-preview img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 18px; display: block; animation: rise .4s var(--spring); }
.photo-preview .chip { position: absolute; top: 10px; right: 10px; background: #fff; color: var(--ink); }
.color-row { display: flex; gap: 12px; justify-content: center; padding: 4px; }
.color-row button { width: 38px; height: 38px; border-radius: 50%; background: var(--c); transition: transform .25s var(--spring), box-shadow .2s; }
.color-row button.on { transform: scale(1.2); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--c); }

.ask { text-align: center; display: flex; flex-direction: column; gap: 16px; } .ask-emoji { font-size: 60px; animation: bob 2s ease-in-out infinite; }

/* ---------- Connexion ---------- */
.login { min-height: 100dvh; max-width: 420px; margin: 0 auto; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.login.enter > * { animation: rise .5s var(--spring) both; } .login.enter > *:nth-child(2) { animation-delay: .06s; } .login.enter > *:nth-child(3) { animation-delay: .12s; } .login.enter > *:nth-child(4) { animation-delay: .18s; }
.login-logo { font-size: 84px; line-height: 1; animation: bob 2.6s ease-in-out infinite !important; }
.login-users { display: flex; flex-wrap: wrap; justify-content: center; gap: 26px; margin-top: 14px; }
.login-user { display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 16px; transition: transform .25s var(--spring); }

/* ---------- Profil ---------- */
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 14px 0 4px; }
.avatar-edit { position: relative; } .avatar-edit .badge { right: 0; bottom: 0; width: 38px; height: 38px; font-size: 18px; }
.toggle-row, .list-row { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 13px 2px; font-weight: 800; text-align: left; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.switch { width: 52px; height: 30px; border-radius: 99px; background: var(--line); position: relative; transition: background .25s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .3s var(--spring); }
.toggle-row.on .switch { background: var(--sage); } .toggle-row.on .switch::after { transform: translateX(22px); }

/* ---------- Toast & confettis ---------- */
.toast { position: fixed; top: calc(16px + env(safe-area-inset-top)); left: 50%; z-index: 100; translate: -50% 0; display: flex; gap: 8px; align-items: center; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 99px; font-weight: 800; font-size: 14px; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); animation: toastIn .4s var(--spring) both; max-width: 90vw; }
.toast.out { animation: toastIn .3s reverse both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-30px) scale(.8); } }
.confetti { position: fixed; z-index: 200; pointer-events: none; font-size: 22px; translate: -50% -50%; animation: burst .9s cubic-bezier(.15, .8, .3, 1) both; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.4); opacity: 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Jeu : points, niveaux, trophées ---------- */
.roles { display: flex; gap: 8px; }
.role { flex: 1; padding: 10px 6px; border-radius: 14px; background: var(--bg); font-weight: 800; font-size: 13.5px; border: 2px solid transparent; transition: transform .2s var(--spring), background .2s; }
.role:active { transform: scale(.93); } .role.on { background: var(--sun-soft); border-color: var(--sun); color: #9A6A00; }
.btn.ready { animation: pop .4s var(--spring); }
.meal .ribbon { position: absolute; top: 12px; right: 12px; background: var(--sage); color: #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .15); }
.meal.cooked .meal-photo.none { background: linear-gradient(135deg, var(--sage-soft), var(--sun-soft)); }
.meal-body .post-foot:empty { display: none; }

.game { background: linear-gradient(150deg, #fff 45%, var(--sun-soft)); display: flex; flex-direction: column; gap: 10px; }
.game-top { display: flex; align-items: center; gap: 14px; }
.level-badge { flex: none; width: 62px; height: 62px; border-radius: 20px; background: linear-gradient(135deg, var(--sun), var(--coral)); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 8px 18px rgba(255, 160, 80, .4); transform: rotate(-4deg); }
.level-badge small { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; opacity: .9; } .level-badge b { font-size: 28px; font-weight: 900; }
.game-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; } .game-info > b { font-size: 17px; }
.bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; width: var(--p); border-radius: 99px; background: linear-gradient(90deg, var(--sun), var(--coral)); animation: grow 1s var(--spring) both; }
@keyframes grow { from { width: 0; } }
.flame { flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1; filter: grayscale(1); opacity: .4; }
.flame span { font-size: 30px; } .flame b { font-size: 15px; margin-top: 2px; }
.flame.on { filter: none; opacity: 1; } .flame.on span { animation: flicker 1.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.14) rotate(4deg); } }

.trophies { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 6px; }
.trophy { display: flex; flex-direction: column; align-items: center; gap: 4px; filter: grayscale(1); opacity: .32; transition: transform .2s var(--spring); }
.trophy span { width: 52px; height: 52px; border-radius: 18px; background: var(--bg); display: grid; place-items: center; font-size: 27px; }
.trophy small { font-size: 10.5px; font-weight: 800; text-align: center; line-height: 1.15; }
.trophy.on { filter: none; opacity: 1; } .trophy.on span { background: var(--sun-soft); box-shadow: 0 0 0 2px var(--sun), 0 6px 14px rgba(255, 201, 77, .35); }
.trophy:active { transform: scale(.9); }

.board-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; } .board-head h3 { margin: 0; }
.mini-seg { background: var(--bg); padding: 3px; } .mini-seg button { padding: 5px 12px; font-size: 12.5px; }
.rank { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 16px; }
.rank.me { background: var(--sun-soft); }
.rank > div:nth-of-type(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.medal { width: 26px; text-align: center; font-size: 22px; font-weight: 900; color: var(--muted); }
.mini-flame { font-size: 12.5px; font-weight: 800; color: #E8590C; } .score { white-space: nowrap; }

.fly-points { position: fixed; z-index: 210; translate: -50% -50%; pointer-events: none; font-weight: 900; font-size: 24px; color: #E59400; text-shadow: 0 2px 0 #fff, 0 0 14px #fff; animation: fly 1.3s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes fly { 0% { opacity: 0; transform: translateY(10px) scale(.5); } 20% { opacity: 1; transform: translateY(-20px) scale(1.25); } 100% { opacity: 0; transform: translateY(-130px) scale(1); } }

.party { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 24px; background: rgba(74, 55, 40, .55); animation: fade .3s both; }
.party.out { animation: fade .3s reverse both; }
.party-card { position: relative; overflow: hidden; width: 100%; max-width: 340px; text-align: center; background: linear-gradient(160deg, #fff 40%, var(--sun-soft)); border-radius: 32px; padding: 34px 24px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); animation: pop .6s var(--spring) both; }
.party-card > * { position: relative; }
.party-rays { position: absolute !important; left: 50%; top: 84px; width: 520px; height: 520px; translate: -50% -50%; background: repeating-conic-gradient(rgba(255, 201, 77, .35) 0 12deg, transparent 12deg 24deg); border-radius: 50%; animation: spin 14s linear infinite; mask-image: radial-gradient(circle, #000 20%, transparent 62%); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 62%); }
@keyframes spin { to { rotate: 360deg; } }
.party-emoji { font-size: 84px; line-height: 1.1; animation: bob 1.6s ease-in-out infinite; }
.party-card small { font-weight: 900; text-transform: uppercase; letter-spacing: 1.5px; color: var(--coral); font-size: 12px; }
.party-card h2 { font-size: 28px; } .party-card p { color: var(--muted); margin-bottom: 10px; }

/* ---------- Fiche d'un membre, WhatsApp ---------- */
.wa { flex: none; display: flex; align-items: center; gap: 7px; padding: 10px 14px 10px 11px; border-radius: 99px; background: #25D366; color: #fff; font-weight: 900; font-size: 13.5px; box-shadow: 0 8px 18px rgba(37, 211, 102, .35); transition: transform .2s var(--spring); }
.wa:active { transform: scale(.9); } .wa svg { width: 22px; height: 22px; fill: #fff; } .wa.empty { background: #fff; color: #128C4A; box-shadow: var(--shadow); } .wa.empty svg { fill: #25D366; }
.family-row { display: flex; gap: 18px; padding: 2px 4px 12px; overflow-x: auto; }
.member { display: flex; flex-direction: column; gap: 14px; }
.member-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.member-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.member-stats div { background: #fff; border-radius: 16px; padding: 10px 4px; text-align: center; display: flex; flex-direction: column; line-height: 1.2; box-shadow: var(--shadow); }
.member-stats b { font-size: 19px; } .member-stats small { font-size: 10.5px; color: var(--muted); font-weight: 800; }
.member .card { box-shadow: none; } .tonight-person, .rank { width: 100%; text-align: left; } .tonight-person { width: auto; text-align: center; }
.list-row small { margin-left: auto; }
