/* ══════════════════════════════════════════════════════════════════════════════
   COUPLE CONNECT — structure : barre de navigation, menu mobile, formulaires
   (complète style.css, le thème « Rose Passion »)
══════════════════════════════════════════════════════════════════════════════ */
body.nav-locked { overflow: hidden; }

/* ── Navigation ── */
.nav-user { font-size: .88rem; padding: 6px 12px; }

.nav-logout { margin: 0; display: inline-flex; }
.nav-link-btn {
    background: none; border: none; cursor: pointer;
    color: rgba(180, 130, 150, .5);
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: .8rem;
    padding: 6px 10px; border-radius: 10px;
    transition: background .2s, color .2s;
}
.nav-link-btn:hover { color: #d94f6a; background: rgba(220, 80, 106, .08); }

.nav-burger {
    display: none;
    flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; padding: 6px;
    background: none; border: none; border-radius: 10px;
    cursor: pointer; flex-shrink: 0;
}
.nav-burger span {
    display: block; height: 2px; border-radius: 2px;
    background: var(--text, #f5e8ee);
    transition: transform .22s ease, opacity .22s ease;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay { display: none; }

/* ── Menu par rubriques : sous-menu déroulant sur ordinateur, sections dans le menu mobile ── */
.nav-group { position: relative; }
.nav-group > summary {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 10px; border-radius: 10px;
    color: rgba(220, 150, 160, .75);
    font-family: 'Crimson Pro', Georgia, serif; font-size: .88rem;
    list-style: none; cursor: pointer; white-space: nowrap;
    transition: background .2s, color .2s;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: '▾'; font-size: .7rem; opacity: .7; transition: transform .2s ease; }
.nav-group[open] > summary::after { transform: rotate(180deg); }
.nav-group > summary:hover, .nav-group[open] > summary { color: #d94f6a; background: rgba(220, 80, 106, .08); }
.nav-group.is-active > summary, .nav a.nav-link.is-active { color: #e8a0b0; font-weight: 700; }
.nav-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 950;
    display: grid; gap: 2px; min-width: 210px; padding: 6px;
    border: 1px solid rgba(180, 130, 150, .2); border-radius: 14px;
    background: #1a0810; box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}
.nav .nav-menu a, .nav .nav-menu a[href="/couple.php"] {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    color: var(--text); font-size: .92rem; font-weight: 400;
}
.nav .nav-menu a:hover { color: #d94f6a; background: rgba(220, 80, 106, .1); }
.nav .nav-menu a.is-active { color: #e8a0b0; font-weight: 700; background: rgba(220, 80, 106, .12); }
.nav-menu a span { width: 1.4em; text-align: center; }
@media (max-width: 768px) {
    .nav-group { width: 100%; }
    .nav-group > summary {
        display: flex; justify-content: space-between; min-height: 44px; padding: 12px 16px;
        color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    }
    .nav-group[open] > summary, .nav-group.is-active > summary { background: none; color: var(--muted); }
    .nav-menu { position: static; min-width: 0; padding: 0 0 6px; border: 0; border-radius: 0; background: none; box-shadow: none; }
    .nav .nav-menu a { min-height: 44px; padding: 12px 16px; font-size: .95rem; border-radius: 10px; }
}

/* ── Formulaires d'authentification ── */
.auth-card { width: 100%; max-width: 520px; margin: 0 auto; }
.auth-card h1 { margin: 0 0 6px; }
.auth-intro { margin: 0 0 22px; }
.auth-card .alert { margin-bottom: 18px; }

.alert ul { margin: 0; padding-left: 18px; }

.field-hint { font-weight: 400; font-size: .88rem; color: var(--muted); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }

.btn-block { width: 100%; }

.link { color: #e8a0b0; font-weight: 600; }
.link:hover { color: #d94f6a; text-decoration: underline; }

.form-links {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 6px;
    margin-top: 20px; font-size: .98rem;
}

/* ── Profil ── */
.profile-page { display: grid; gap: 20px; min-width: 0; }
/* Au-dessus des cartes suivantes : sinon elles recouvrent le menu de l'avatar
   (.card crée un contexte d'empilement via « contain ») */
.profile-header { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; position: relative; z-index: 10; }
.profile-header h1 { margin: 0 0 4px; overflow-wrap: anywhere; }
.profile-header p { margin: 0; overflow-wrap: anywhere; }
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; }
.profile-avatar {
    width: 72px; height: 72px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #c0394f, #d94f6a);
    box-shadow: 0 4px 16px rgba(200, 50, 80, .3);
    color: #fff;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem; font-weight: 700;
}
/* Avatar cliquable : ajoute, modifie ou supprime la photo */
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar-form { margin: 0; }
.avatar-edit {
    position: relative; padding: 0; border: none;
    cursor: pointer; appearance: none;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.avatar-edit:hover { transform: scale(1.04); }
.avatar-edit:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(220, 80, 106, .35), 0 4px 16px rgba(200, 50, 80, .3); }
.avatar-edit.is-uploading { opacity: .6; cursor: progress; transform: none; }
.avatar-media {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    border-radius: 50%; overflow: hidden;
}
.avatar-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-edit::after {
    content: '';
    position: absolute; inset: 0; z-index: 0;
    border-radius: 50%;
    background: rgba(20, 8, 14, .4);
    opacity: 0; transition: opacity .2s ease;
    pointer-events: none;
}
.avatar-edit:hover::after, .avatar-edit:focus-visible::after, .avatar-edit[aria-expanded="true"]::after { opacity: 1; }
.avatar-edit-badge {
    position: absolute; right: -4px; bottom: -4px; z-index: 1;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: #1a0810; border: 2px solid #d94f6a;
    font-size: .85rem; line-height: 1;
}

.avatar-menu {
    position: absolute; top: calc(100% + 10px); left: 0; z-index: 50;
    min-width: 210px;
    display: flex; flex-direction: column;
    padding: 6px;
    background: #1a0810;
    border: 1px solid rgba(180, 130, 150, .18);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
}
.avatar-menu button {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px 12px;
    border: none; border-radius: 8px; background: none;
    color: var(--text);
    font-family: 'Crimson Pro', Georgia, serif; font-size: .98rem;
    text-align: left; cursor: pointer;
}
.avatar-menu button:hover, .avatar-menu button:focus-visible { outline: none; background: rgba(220, 80, 106, .1); }
.avatar-menu .danger { color: var(--danger); }

.profile-photo-hint { margin: 12px 0 0; }

.nav-user { gap: 8px; }
.nav-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(220, 80, 106, .35); }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.profile-grid { align-items: start; }
.profile-grid h2 { margin: 0 0 6px; font-size: 1.35rem; }
.profile-grid .card > .muted { margin: 0 0 18px; }
.profile-grid .alert { margin-bottom: 16px; }

/* ── Mes données (export) ── */
.data-card h2 { margin: 0 0 8px; font-size: 1.35rem; }
.data-card > .muted { margin: 0 0 14px; }
.data-card > .small { margin: 14px 0 0; }
.data-card .alert { margin-bottom: 16px; }

/* ── Zone de suppression du compte ── */
.danger-zone { border-color: rgba(248, 113, 113, .28); }
.danger-zone:hover { border-color: rgba(248, 113, 113, .4); }
.danger-zone h2 { margin: 0 0 8px; font-size: 1.35rem; color: var(--danger); }
.danger-zone > .muted { margin: 0 0 10px; }
.danger-zone .alert { margin-bottom: 16px; }
.danger-list { margin: 0 0 12px; padding-left: 20px; color: var(--muted); line-height: 1.6; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; cursor: pointer; }
.checkbox-row input {
    width: 18px; height: 18px; flex-shrink: 0;
    margin: 3px 0 0; padding: 0;
    accent-color: #d94f6a; box-shadow: none;
}

.btn-danger {
    background: rgba(248, 113, 113, .12);
    color: #fecaca;
    border-color: rgba(248, 113, 113, .4);
}
.btn-danger:hover { background: rgba(248, 113, 113, .22); }

/* ── Cloche de notifications ── */
.nav .nav-bell {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; padding: 0;
    border-radius: 50%;
    color: rgba(220, 150, 160, .75);
}
.nav .nav-bell:hover { color: #d94f6a; background: rgba(220, 80, 106, .08); }
.nav-bell-icon { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }
.nav-bell-label { display: none; }
.nav-bell-badge {
    position: absolute; top: 1px; right: -1px;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px;
    background: #d94f6a; color: #fff;
    font: 700 .68rem/18px system-ui, sans-serif; text-align: center;
    box-shadow: 0 0 0 2px #1a0810;
}
.nav-burger.has-unread::after {
    content: '';
    position: absolute; top: 6px; right: 6px;
    width: 9px; height: 9px; border-radius: 50%;
    background: #d94f6a; box-shadow: 0 0 0 2px #1a0810;
}

/* ── Notifications ── */
.notif-page { display: grid; gap: 20px; min-width: 0; }
.notif-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.notif-head h1 { margin: 0 0 4px; }
.notif-head p { margin: 0; }
.push-settings { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; max-width: 440px; }
.notif-mark-read { margin: 6px 0 0; }
.profile-pending-email { margin: -8px 0 0; }
.notif-empty { margin: 0; text-align: center; }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notif-item {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 14px 16px; border-radius: 18px;
    background: rgba(40, 15, 25, .54); border: 1px solid var(--border);
}
.notif-item.is-unread { border-color: rgba(220, 80, 106, .4); background: rgba(220, 50, 80, .09); }
.notif-icon { flex-shrink: 0; margin-top: 2px; font-size: 1.4rem; line-height: 1; }
.notif-body { flex: 1; min-width: 0; }
.notif-body p { margin: 0; overflow-wrap: anywhere; }
.notif-body .notif-meta { margin-top: 4px; }
.notif-body .link { display: inline-block; margin-top: 8px; }
.notif-new { color: #e8a0b0; font-weight: 700; }
.notif-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.notif-actions form { margin: 0; }

/* ── Love notes ── */
.notes-page { display: grid; gap: 20px; min-width: 0; }
.notes-compose h1 { margin: 0 0 6px; }
.notes-compose > .muted { margin: 0 0 16px; }
.notes-compose .alert { margin-bottom: 16px; }
.notes-compose textarea { min-height: 110px; }
.note-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.note-actions label.btn { cursor: pointer; }
.note-actions label.btn:focus-within { box-shadow: 0 0 0 4px rgba(220, 80, 106, .25); }
.note-actions .note-send { margin-left: auto; }
.note-photo-preview { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.note-photo-preview img {
    display: block; max-width: 160px; max-height: 160px;
    border-radius: 14px; border: 1px solid var(--border); object-fit: cover;
}
.notes-feed { display: grid; gap: 14px; min-width: 0; }
.notes-mark-read { margin: 0; justify-self: end; }
.notes-none { margin: 0; text-align: center; }
.card.note { display: grid; gap: 12px; width: 100%; max-width: 680px; padding: 18px 20px; }
.note-mine { justify-self: end; border-color: rgba(220, 80, 106, .28); }
.note-theirs { justify-self: start; }
.card.note.is-unread { border-color: rgba(220, 80, 106, .6); box-shadow: 0 0 0 1px rgba(220, 80, 106, .25); }
.note-head { display: flex; align-items: center; gap: 10px; }
.note-head > div { display: grid; min-width: 0; }
.profile-avatar.note-avatar { width: 38px; height: 38px; font-size: 1rem; box-shadow: none; }
.note-body { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.note-photo img { display: block; max-width: 100%; max-height: 480px; border-radius: 16px; object-fit: contain; }
.note-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.note-foot form { margin: 0; }
.note-reactions { display: flex; flex-wrap: wrap; gap: 6px; }
.note-reaction {
    padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
    background: rgba(220, 80, 106, .06); font-size: 1.05rem; line-height: 1.4;
    cursor: pointer; transition: background .15s ease, transform .15s ease;
}
.note-reaction:hover { transform: scale(1.08); background: rgba(220, 80, 106, .14); }
.note-reaction.is-active { background: rgba(220, 80, 106, .28); border-color: rgba(220, 80, 106, .6); }
.notes-more { justify-self: center; }

/* ── Souvenirs ── */
.memories-page, .memory-page { display: grid; gap: 20px; min-width: 0; }
.memories-intro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.memories-intro h1 { margin: 0 0 4px; }
.memories-intro p { margin: 0; }
.memories-none { margin: 0; text-align: center; }
.memories-timeline { display: grid; gap: 12px; min-width: 0; }
.memories-year { margin: 14px 4px 0; font-size: 1.15rem; }
.memories-year:first-child { margin-top: 0; }
.card.memory-item {
    display: flex; align-items: center; gap: 16px; padding: 12px;
    color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease;
}
.card.memory-item:hover { transform: translateY(-2px); border-color: rgba(220, 80, 106, .45); }
.memory-cover {
    flex: 0 0 auto; display: grid; place-items: center; width: 96px; height: 96px;
    border-radius: 14px; overflow: hidden; background: rgba(220, 80, 106, .1); font-size: 2rem;
}
.memory-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.memory-info { display: grid; gap: 3px; min-width: 0; }
.memory-title { font-size: 1.05rem; overflow-wrap: anywhere; }
.memory-date { color: rgb(220, 80, 106); font-weight: 600; }
.memories-pages { display: flex; flex-wrap: wrap; gap: 10px; }
.memories-next { margin-left: auto; }
.memory-back { justify-self: start; }
.memory-detail { display: grid; gap: 12px; }
.memory-detail h1 { margin: 0; overflow-wrap: anywhere; }
.memory-detail .memory-date, .memory-place { margin: 0; }
.memory-body { margin: 0; line-height: 1.7; overflow-wrap: anywhere; }
.memory-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.memory-gallery a { display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; }
.memory-gallery img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.memory-gallery a:hover img { transform: scale(1.04); }
.memory-author { display: flex; align-items: center; gap: 10px; }
.memory-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.memory-actions form { margin: 0; }
.memory-form-card h1 { margin: 0 0 16px; }
.memory-form-card .alert { margin-bottom: 16px; }
.memory-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.memory-photos-existing { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.memory-photos-existing legend { margin-bottom: 8px; padding: 0; font-weight: 600; }
.memory-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.memory-photo-choice { display: grid; justify-items: center; gap: 6px; font-size: .9rem; }
.memory-photo-choice img {
    display: block; width: 100%; aspect-ratio: 1; object-fit: cover;
    border-radius: 12px; border: 1px solid var(--border); transition: opacity .15s ease;
}
.memory-photo-choice:has(input:checked) img { opacity: .3; }
.memory-photo-choice span { display: flex; align-items: center; gap: 6px; }
@media (max-width: 480px) {
    .memory-cover { width: 72px; height: 72px; }
}

/* ── Calendrier ── */
.calendar-page, .event-page, .sync-page { display: grid; gap: 20px; min-width: 0; }
.calendar-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.calendar-head h1 { margin: 0 0 4px; }
.calendar-head p { margin: 0; }
.calendar-head-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.calendar-month { display: grid; gap: 10px; min-width: 0; }
.calendar-month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.calendar-month-nav h2 { margin: 0; font-size: 1.2rem; text-align: center; }
.calendar-today-link { justify-self: center; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar-weekdays span { color: var(--muted); font-size: .78rem; text-align: center; text-transform: capitalize; }
.calendar-day {
    display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 92px; padding: 6px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--card-soft);
}
.calendar-day.is-other { opacity: .45; }
.calendar-day.is-today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.calendar-day-number { align-self: flex-start; color: inherit; font-size: .8rem; font-weight: 600; text-decoration: none; }
.calendar-day-number:hover { color: var(--primary); }
.calendar-day.is-today .calendar-day-number { color: var(--primary); }
.calendar-chip {
    display: flex; align-items: center; gap: 4px; min-width: 0; padding: 2px 5px; border-radius: 6px;
    background: rgba(220, 80, 106, .16); color: inherit; font-size: .74rem; line-height: 1.3; text-decoration: none;
}
.calendar-chip:hover { background: rgba(220, 80, 106, .3); }
.calendar-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-more { padding-left: 4px; color: var(--muted); font-size: .72rem; }
.calendar-upcoming h2 { margin: 0 0 12px; }
.calendar-upcoming > p { margin: 0; }
.calendar-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.calendar-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border);
    border-radius: 12px; color: inherit; text-decoration: none; transition: border-color .15s ease;
}
.calendar-item:hover { border-color: rgba(220, 80, 106, .45); }
.calendar-item-icon { flex: 0 0 auto; font-size: 1.5rem; }
.calendar-item-info { display: grid; flex: 1; gap: 2px; min-width: 0; }
.calendar-item-info strong { overflow-wrap: anywhere; }
.calendar-item-when { flex: 0 0 auto; white-space: nowrap; }
.dash-upcoming { display: grid; gap: 12px; }
.dash-upcoming .dash-card-head h2 { margin: 0; }
.dash-upcoming > p { margin: 0; }
.dash-upcoming > .btn { justify-self: start; }
@media (max-width: 640px) {
    .calendar-day { min-height: 56px; padding: 4px; }
    .calendar-chip { justify-content: center; padding: 2px; }
    .calendar-chip-text { display: none; }
}
@media (max-width: 420px) {
    .calendar-item-when { display: none; }
}
.event-form-card h1 { margin: 0 0 6px; }
.event-form-card .alert { margin: 12px 0 16px; }
.event-author { margin: 0 0 16px; }
.event-categories { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.event-categories legend { width: 100%; margin-bottom: 6px; padding: 0; font-weight: 600; }
.form .event-category { position: relative; display: inline-flex; align-items: center; margin: 0; cursor: pointer; }
.form .event-category input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.event-category span {
    padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
    transition: background .15s ease, border-color .15s ease;
}
.event-category input:checked + span { border-color: var(--primary); background: rgba(220, 80, 106, .22); }
.event-category input:focus-visible + span { box-shadow: 0 0 0 3px rgba(220, 80, 106, .35); }
.form .checkbox-line { display: flex; flex-direction: row; align-items: center; gap: 10px; cursor: pointer; }
.form .checkbox-line input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.event-delete { margin: 16px 0 0; }
.sync-card { display: grid; gap: 16px; }
.sync-card h1, .sync-card .lead, .sync-card > p, .sync-card > form { margin: 0; }
.sync-block { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; }
.sync-block h2 { margin: 0; font-size: 1.05rem; }
.sync-block p { margin: 0; }
.sync-block .btn { justify-self: start; }
.sync-steps { display: grid; gap: 4px; margin: 0; padding-left: 20px; }
.sync-link { display: flex; gap: 8px; min-width: 0; }
.sync-link input {
    flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--card-soft); color: var(--text); font-size: .85rem;
}
.sync-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.sync-actions form { margin: 0; }

/* ── Listes partagées ── */
.lists-page, .list-page { display: grid; gap: 20px; min-width: 0; }
.lists-intro h1 { margin: 0 0 4px; }
.lists-intro p, .lists-none { margin: 0; }
.lists-none { text-align: center; }
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card.list-card {
    display: flex; align-items: center; gap: 14px; padding: 16px;
    color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease;
}
.card.list-card:hover { transform: translateY(-2px); border-color: rgba(220, 80, 106, .45); }
.list-card-icon, .list-head-icon { flex: 0 0 auto; font-size: 2rem; line-height: 1; }
.list-card-info { display: grid; gap: 3px; min-width: 0; }
.list-card-info strong { overflow-wrap: anywhere; }
.lists-create { display: grid; gap: 14px; }
.lists-create h2, .lists-create .form { margin: 0; }
.list-templates { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.list-templates p { width: 100%; margin: 0; }
.list-templates form { margin: 0; }
.list-detail { display: grid; gap: 16px; }
.list-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.list-head h1 { margin: 0; overflow-wrap: anywhere; }
.list-add { display: flex; gap: 8px; margin: 0; }
.list-add input { flex: 1; min-width: 0; }
.list-items { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; }
.list-item form { margin: 0; }
.list-check {
    display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
    border: 2px solid var(--primary); border-radius: 50%; background: transparent;
    color: #fff; font-size: .9rem; cursor: pointer; transition: background .15s ease;
}
.list-check:hover { background: rgba(220, 80, 106, .2); }
.list-item.is-done .list-check { background: var(--primary); }
.list-item-text { display: grid; flex: 1; gap: 1px; min-width: 0; }
.list-item-text > span:first-child { overflow-wrap: anywhere; }
.list-item.is-done .list-item-text > span:first-child { color: var(--muted); text-decoration: line-through; }
.list-item-plan { flex: 0 0 auto; }
.list-remove {
    width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.list-remove:hover { background: rgba(248, 113, 113, .15); color: var(--danger); }
.list-empty { padding: 8px 2px; }
.list-done summary, .list-settings summary { font-weight: 600; cursor: pointer; }
.list-done > ul { margin-top: 10px; }
.list-done > form { margin: 10px 0 0; }
.list-settings .alert { margin-top: 14px; }
.list-settings .form { margin: 14px 0; }
.list-settings > form:last-child { margin: 0; }
@media (max-width: 420px) {
    .list-item-plan { display: none; }
}

/* ── Compteurs ── */
.trackers-page { display: grid; gap: 20px; min-width: 0; }
.trackers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tracker-card { display: grid; align-content: start; gap: 8px; }
.card.tracker-card.is-milestone, .card.dash-tracker.is-milestone { border-color: var(--primary); }
.tracker-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tracker-icon { flex: 0 0 auto; font-size: 1.6rem; line-height: 1; }
.tracker-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.tracker-edit { flex: 0 0 auto; }
.tracker-value { margin: 4px 0 0; }
.tracker-value strong { color: var(--primary); font-size: 2.2rem; line-height: 1.1; }
.tracker-value span { color: var(--muted); }
.tracker-detail, .tracker-card .dash-highlight { margin: 0; }
.tracker-steps { display: flex; gap: 8px; margin-top: 4px; }
.tracker-steps form { margin: 0; }
.tracker-steps .btn { min-width: 52px; }
.dash-trackers { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.card.dash-tracker {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    color: inherit; text-decoration: none; transition: transform .15s ease;
}
.card.dash-tracker:hover { transform: translateY(-2px); }
.dash-tracker-icon { flex: 0 0 auto; font-size: 1.6rem; line-height: 1; }
.dash-tracker-text { display: grid; gap: 2px; min-width: 0; }
.dash-tracker-text strong { color: var(--primary); font-size: 1.15rem; }
.dash-tracker-text .small { overflow-wrap: anywhere; }

/* ── Du calendrier aux souvenirs ── */
.calendar-past { flex-wrap: wrap; }
.calendar-past .btn { flex: 0 0 auto; margin-left: auto; }
.event-memory { display: grid; justify-items: start; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.event-memory p { margin: 0; }
.dash-memory-nudge { margin: 0; padding-top: 10px; border-top: 1px solid var(--border); }
.memory-from-event { margin: -8px 0 16px; }

/* ── Accueil : rubriques ── */
.dash-sections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dash-section { display: grid; align-content: start; gap: 12px; }
.dash-section h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.1rem; }
.dash-section-links { display: grid; gap: 6px; }
.dash-section-link {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 12px;
    color: inherit; text-decoration: none; transition: border-color .15s ease, background .15s ease;
}
.dash-section-link:hover { border-color: rgba(220, 80, 106, .45); background: rgba(220, 80, 106, .08); }
.dash-section-link span { width: 1.5em; font-size: 1.3rem; line-height: 1; text-align: center; }
@media (max-width: 900px) {
    .dash-sections { grid-template-columns: minmax(0, 1fr); }
    .dash-section-links { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ── Je pense à toi ── */
.dash-couple-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.dash-couple-actions form { margin: 0; }

/* ── Lettres pour le futur ── */
.letters-page, .letter-page, .gifts-page { display: grid; gap: 20px; min-width: 0; }
.letter-item > .link { flex: 0 0 auto; }
.letter-paper { display: grid; gap: 10px; width: 100%; max-width: 760px; justify-self: center; }
.letter-paper h1 { margin: 0; overflow-wrap: anywhere; }
.letter-meta { margin: 0; }
.letter-body { margin: 12px 0; font-size: 1.05rem; line-height: 1.8; overflow-wrap: anywhere; }
.letter-status { margin: 0; padding-top: 12px; border-top: 1px solid var(--border); }
.letter-page > .list-settings, .letter-delete { width: 100%; max-width: 760px; justify-self: center; }
.letter-delete { margin: 0; }

/* ── Idées cadeaux ── */
.lists-intro .gifts-private { margin: 8px 0 0; color: var(--primary); font-weight: 600; }
.gifts-title { margin: 0; }
.gift-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.gift-add input { flex: 1 1 200px; min-width: 0; }
.gift-link { flex: 0 1 auto; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Couple ── */
.couple-page { display: grid; gap: 20px; min-width: 0; }
.couple-intro h1 { margin: 0 0 6px; }
.couple-intro .lead { margin: 0; }
.couple-card { text-align: center; }
.couple-card h1 { margin: 14px 0 6px; overflow-wrap: anywhere; }
.couple-card form { display: flex; justify-content: center; margin-top: 22px; }
.couple-duo { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.couple-heart { color: #d94f6a; font-size: 1.6rem; }

/* Date de mise en couple */
.couple-date { max-width: 460px; margin: 18px auto 0; }
.couple-date p { margin: 0; }
.couple-since { font-size: 1.05rem; }
.couple-date .couple-duration {
    margin-top: 4px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    color: #e8a0b0;
}
.couple-date .couple-next { margin-top: 6px; }
.couple-card .couple-date-form { flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.couple-date-form input[type="date"] { width: auto; min-width: 180px; padding: 10px 14px; color-scheme: dark; }
.couple-date-edit { margin-top: 12px; }
.couple-date-edit summary {
    display: inline-block; list-style: none; cursor: pointer;
    color: #e8a0b0; font-weight: 600;
}
.couple-date-edit summary::-webkit-details-marker { display: none; }
.couple-date-edit[open] summary { color: var(--muted); }
.couple-card .couple-date-clear { margin-top: 8px; }
.link-button {
    padding: 0; border: none; background: none; cursor: pointer;
    color: var(--muted); font: inherit; font-size: .9rem; text-decoration: underline;
}
.link-button:hover { color: #d94f6a; }
.couple-card .couple-joined { margin: 18px 0 0; }
.couple-section h2 { margin: 0 0 6px; font-size: 1.35rem; }
.couple-section > .muted { margin: 0 0 16px; }
.couple-section .alert { margin-bottom: 16px; }
.couple-privacy { margin: 14px 0 0; }

.invite-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.invite-item {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
    padding: 14px 16px; border-radius: 18px;
    background: rgba(40, 15, 25, .54); border: 1px solid var(--border);
}
.invite-item strong { overflow-wrap: anywhere; }
.invite-item form { margin: 0; }
.invite-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-compact { padding: 9px 14px; font-size: .92rem; border-radius: 12px; }

/* ── Tableau de bord ── */
.dashboard { display: grid; gap: 20px; min-width: 0; }
.dash-hero .h1 { margin: 14px 0 8px; overflow-wrap: anywhere; }
.dash-hero .lead { margin: 0; }
/* Mon couple · À venir · Notifications (plus étroite) sur une rangée ; notifications en dessous sur tablette */
.dash-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, .8fr);
    gap: 20px; align-items: stretch;
}
.dash-grid.no-upcoming { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.dash-notifications { gap: 10px; }
.dash-notifications h2 { font-size: 1.1rem; }
.dash-notifications .dash-notifs { gap: 8px; }
.dash-notifications .dash-notifs p:first-child { font-size: .88rem; line-height: 1.35; }
.dash-notifications .notif-icon { font-size: 1rem; }
@media (max-width: 1000px) {
    .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .dash-grid:not(.no-upcoming) .dash-notifications { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .dash-grid, .dash-grid.no-upcoming { grid-template-columns: minmax(0, 1fr); }
}
.dash-card { display: flex; flex-direction: column; gap: 14px; }
.dash-card h2 { margin: 0; font-size: 1.35rem; }
.dash-card p { margin: 0; }
.dash-card > .btn, .dash-card > .link { align-self: flex-start; margin-top: auto; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.dash-couple { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.dash-couple-avatars { display: flex; align-items: center; gap: 10px; }
.dash-couple .couple-avatar { width: 52px; height: 52px; font-size: 1.4rem; }
.dash-couple .couple-heart { font-size: 1.2rem; }
.dash-couple-text { display: grid; gap: 4px; min-width: 0; }
.dash-couple-text strong { overflow-wrap: anywhere; }
.dash-highlight { color: #e8a0b0; font-weight: 600; }
.dash-notifs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.dash-notifs li { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.dash-notifs li > div { min-width: 0; }
.dash-notifs .notif-icon { font-size: 1.15rem; }
.dash-notifs p { overflow-wrap: anywhere; }
.dash-notifs .is-unread p:first-child { font-weight: 700; }

/* ── Accueil ── */
.home-hero { text-align: center; }
.home-hero .lead { max-width: 560px; margin-left: auto; margin-right: auto; }
.home-hero .actions { justify-content: center; }

/* ── Pages légales ── */
.legal-page { width: 100%; max-width: 860px; margin: 0 auto; }
.legal-page h1 { margin: 0 0 6px; }
.legal-page h2 { margin: 30px 0 10px; font-size: 1.3rem; }
.legal-page p, .legal-page li { line-height: 1.7; }
.legal-page ul { padding-left: 20px; }
.legal-page code { font-size: .9em; }
.legal-page .legal-updated { margin: 0 0 12px; }
.legal-table-wrap { overflow-x: auto; margin: 12px 0; }
.legal-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .95rem; }
.legal-table th, .legal-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.legal-table th { font-family: 'Playfair Display', Georgia, serif; }
.register-legal { margin: 0; }

/* ── Pied de page ── */
.site-footer { text-align: center; padding: 18px 0 10px; opacity: .5; font-size: .8rem; }
.site-footer a { text-decoration: underline; }
.site-footer a:hover { color: #d94f6a; }

/* ── Mobile ── */
@media (max-width: 768px) {
    .app-shell { padding: 12px; }

    .topbar {
        position: sticky; top: 0; z-index: 900;
        padding: 10px 14px; gap: 8px;
        flex-wrap: nowrap; align-items: center;
    }
    .tagline { display: none; }
    .brand { font-size: 1.1rem; }

    .nav-burger { display: flex; position: relative; z-index: 1001; }

    .nav {
        position: fixed; top: 0; right: 0; bottom: 0;
        width: min(280px, 85vw);
        flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 2px;
        padding: 72px 12px 32px;
        background: #1a0810;
        border-left: 1px solid rgba(180, 130, 150, .18);
        box-shadow: -12px 0 40px rgba(0, 0, 0, .6);
        overflow-y: auto;
        z-index: 1000;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .28s;
    }
    .nav.open {
        transform: translateX(0);
        visibility: visible;
        transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility 0s linear 0s;
    }
    .nav > a, .nav-user, .nav-link-btn {
        display: flex; align-items: center;
        min-height: 44px; padding: 12px 16px;
        font-size: .95rem; border-radius: 10px;
    }
    .nav-user { border-radius: 10px; }
    .nav-logout, .nav-link-btn { width: 100%; }
    .nav .nav-bell {
        width: auto; height: auto; min-height: 44px;
        padding: 12px 16px; gap: 10px;
        justify-content: flex-start; border-radius: 10px;
    }
    .nav-bell-label { display: inline; }
    .nav-bell-badge { position: static; box-shadow: none; }

    .nav-overlay.open {
        display: block;
        position: fixed; inset: 0;
        background: rgba(0, 0, 0, .45);
        z-index: 799;
    }

    .card, .hero { border-radius: 14px; padding: 20px 16px; }
    .btn { min-height: 44px; }
    input, textarea, select { font-size: 16px; } /* évite le zoom automatique sur iOS */
}

/* ── Jeux (salle /jeux.php et partie /partie.php) ── */
.games-page, .game-page { display: grid; gap: 20px; min-width: 0; }
.game-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.game-type { display: flex; flex-direction: column; gap: 10px; }
.game-type h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.25rem; }
.game-type p { margin: 0; }
.game-type form { margin-top: auto; }
.game-type-icon { font-size: 1.8rem; line-height: 1; }
.game-type-soon { opacity: .75; }
.game-new > summary { list-style: none; display: inline-flex; cursor: pointer; }
.game-new > summary::-webkit-details-marker { display: none; }
.game-new[open] > summary { opacity: .75; }
.game-new-menu { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card-soft); }
.game-levels-label { margin: 0 0 6px; }
.game-levels { display: flex; flex-wrap: wrap; gap: 6px; }
.game-score { color: var(--primary); font-weight: 600; }
.game-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.game-list a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 12px; color: inherit; text-decoration: none;
}
.game-list a:hover { border-color: rgba(220, 80, 106, .45); }
.game-list a.is-my-turn { border-color: var(--primary); background: rgba(220, 80, 106, .12); }
.game-list-icon { flex: 0 0 auto; font-size: 1.5rem; line-height: 1; }
.game-list-info { display: grid; flex: 1; gap: 2px; min-width: 0; }
.game-card { display: grid; gap: 14px; }
.game-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.game-head h1 { margin: 0; font-size: 1.6rem; }
.game-status { margin: 0; font-weight: 600; }
.game-page.is-my-turn .game-status { color: var(--primary); }
.game-players { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 0; }
.game-message { min-height: 1.2em; margin: 0; color: var(--danger); text-align: center; }
.game-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.game-actions form { margin: 0; }
.game-board-morpion { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: min(100%, 330px); margin: 0 auto; }
.morpion-cell {
    aspect-ratio: 1; padding: 0;
    font-size: clamp(2rem, 11vw, 2.8rem); line-height: 1; color: var(--text);
    background: var(--card-soft); border: 1px solid var(--border); border-radius: 14px;
    cursor: pointer; transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.morpion-cell:disabled { opacity: 1; cursor: default; }
.morpion-cell:not(:disabled):hover { border-color: var(--primary); transform: scale(1.03); }
.morpion-cell.is-last { border-color: rgba(220, 80, 106, .6); }
.game-board-morpion.is-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; width: min(100%, 420px); }
.game-board-morpion.is-6 .morpion-cell { font-size: clamp(1.1rem, 6vw, 1.6rem); border-radius: 9px; }
.morpion-cell.is-winning { background: rgba(220, 80, 106, .28); border-color: var(--primary); }
.game-board-puissance4 {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px;
    width: min(100%, 460px); margin: 0 auto; padding: 8px; overflow: hidden;
    background: linear-gradient(160deg, #3a1422, #220e17); border: 1px solid var(--border); border-radius: 16px;
}
.p4-column { display: grid; gap: 4px; padding: 3px; background: none; border: 0; border-radius: 10px; cursor: pointer; transition: background .12s ease; }
.p4-column:disabled { opacity: 1; cursor: default; }
.p4-column:not(:disabled):hover { background: rgba(220, 80, 106, .16); }
.p4-cell { display: block; aspect-ratio: 1; border-radius: 50%; background: rgba(8, 2, 5, .7); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .7); }
.p4-cell.is-p1 { background: radial-gradient(circle at 35% 30%, #ff8595, #d62f45 58%, #9a1b2e); box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .35); }
.p4-cell.is-p2 { background: radial-gradient(circle at 35% 30%, #ffe699, #f2b705 58%, #b08000); box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .3); }
.p4-cell.is-last { outline: 2px solid rgba(255, 255, 255, .5); outline-offset: -2px; }
.p4-cell.is-winning { outline: 3px solid #fff; outline-offset: -3px; box-shadow: 0 0 14px rgba(255, 255, 255, .55); }
.p4-cell.is-dropping { animation: p4-drop .5s cubic-bezier(.3, 1.35, .6, 1); }
@keyframes p4-drop { from { transform: translateY(-420%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .p4-cell.is-dropping { animation: none; } }
.game-board-bataille { display: grid; gap: 14px; }
.bn-info { min-height: 1.3em; margin: 0; font-weight: 600; text-align: center; }
.bn-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.bn-layout.is-single { grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 420px; margin: 0 auto; }
@media (max-width: 760px) { .bn-layout { grid-template-columns: minmax(0, 1fr); } }
.bn-board { display: grid; gap: 8px; min-width: 0; }
.bn-board h3 { margin: 0; font-size: 1rem; text-align: center; }
/* Grille : plateau illustré (cadre, mer et lignes dessinés), puis les navires par-dessus, puis les fiches des tirs.
   La marge de 8,45 % correspond à l'épaisseur du cadre dans plateau.webp : les cases tombent sur la grille dessinée.
   (Marge en % de la largeur du parent : la grille occupe toute sa largeur.) */
.bn-grid {
    display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); grid-template-rows: repeat(10, minmax(0, 1fr));
    aspect-ratio: 1; gap: 0; padding: 8.45%;
    background: url('../games/bataille/plateau.webp') center / 100% 100% no-repeat;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45));
}
.bn-cell { z-index: 1; padding: 0; background: transparent; border: 0; }
button.bn-cell { cursor: pointer; transition: background .1s ease; }
button.bn-cell:disabled { opacity: 1; cursor: default; }
button.bn-cell:not(:disabled):hover { background: rgba(255, 209, 102, .35); }
.bn-grid.is-aiming button.bn-cell:not(:disabled):hover { background: rgba(220, 80, 106, .55); }

/* Navires : illustrations (assets/games/bataille/<navire>[-coule]-h|v.webp), proue à droite ou en bas */
.bn-ship {
    position: relative; z-index: 2; min-width: 0; min-height: 0; margin: 1px; padding: 0; border: 0; pointer-events: none;
    background: transparent center / contain no-repeat; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5));
}
button.bn-ship { pointer-events: auto; cursor: pointer; touch-action: none; } /* le doigt déplace le navire au lieu de faire défiler la page */
button.bn-ship:disabled { opacity: 1; cursor: progress; }
button.bn-ship:not(:disabled):hover { filter: drop-shadow(0 0 3px rgba(255, 209, 102, .85)); }
button.bn-ship:focus-visible { outline: none; }
button.bn-ship:focus-visible, .bn-ship.is-dragging { filter: drop-shadow(0 0 2px #ffd166) drop-shadow(0 0 6px #ffd166); }
.bn-ship.is-dragging { z-index: 4; cursor: grabbing; }
.bn-ship.is-invalid { filter: drop-shadow(0 0 2px #ff4d5e) drop-shadow(0 0 6px #ff4d5e); opacity: .8; }
.bn-ship-porte-avions.is-horizontal { background-image: url('../games/bataille/porte-avions-h.webp'); }
.bn-ship-porte-avions.is-horizontal.is-sunk { background-image: url('../games/bataille/porte-avions-coule-h.webp'); }
.bn-ship-porte-avions.is-vertical { background-image: url('../games/bataille/porte-avions-v.webp'); }
.bn-ship-porte-avions.is-vertical.is-sunk { background-image: url('../games/bataille/porte-avions-coule-v.webp'); }
.bn-ship-croiseur.is-horizontal { background-image: url('../games/bataille/croiseur-h.webp'); }
.bn-ship-croiseur.is-horizontal.is-sunk { background-image: url('../games/bataille/croiseur-coule-h.webp'); }
.bn-ship-croiseur.is-vertical { background-image: url('../games/bataille/croiseur-v.webp'); }
.bn-ship-croiseur.is-vertical.is-sunk { background-image: url('../games/bataille/croiseur-coule-v.webp'); }
.bn-ship-contre-torpilleur.is-horizontal { background-image: url('../games/bataille/contre-torpilleur-h.webp'); }
.bn-ship-contre-torpilleur.is-horizontal.is-sunk { background-image: url('../games/bataille/contre-torpilleur-coule-h.webp'); }
.bn-ship-contre-torpilleur.is-vertical { background-image: url('../games/bataille/contre-torpilleur-v.webp'); }
.bn-ship-contre-torpilleur.is-vertical.is-sunk { background-image: url('../games/bataille/contre-torpilleur-coule-v.webp'); }
.bn-ship-sous-marin.is-horizontal { background-image: url('../games/bataille/sous-marin-h.webp'); }
.bn-ship-sous-marin.is-horizontal.is-sunk { background-image: url('../games/bataille/sous-marin-coule-h.webp'); }
.bn-ship-sous-marin.is-vertical { background-image: url('../games/bataille/sous-marin-v.webp'); }
.bn-ship-sous-marin.is-vertical.is-sunk { background-image: url('../games/bataille/sous-marin-coule-v.webp'); }
.bn-ship-torpilleur.is-horizontal { background-image: url('../games/bataille/torpilleur-h.webp'); }
.bn-ship-torpilleur.is-horizontal.is-sunk { background-image: url('../games/bataille/torpilleur-coule-h.webp'); }
.bn-ship-torpilleur.is-vertical { background-image: url('../games/bataille/torpilleur-v.webp'); }
.bn-ship-torpilleur.is-vertical.is-sunk { background-image: url('../games/bataille/torpilleur-coule-v.webp'); }
.bn-ship-torpilleur-2.is-horizontal { background-image: url('../games/bataille/torpilleur-2-h.webp'); }
.bn-ship-torpilleur-2.is-horizontal.is-sunk { background-image: url('../games/bataille/torpilleur-2-coule-h.webp'); }
.bn-ship-torpilleur-2.is-vertical { background-image: url('../games/bataille/torpilleur-2-v.webp'); }
.bn-ship-torpilleur-2.is-vertical.is-sunk { background-image: url('../games/bataille/torpilleur-2-coule-v.webp'); }

/* Fiches : rouge touché, blanche à l'eau */
.bn-peg {
    z-index: 3; align-self: center; justify-self: center; width: 46%; aspect-ratio: 1;
    border-radius: 50%; pointer-events: none;
}
.bn-peg.is-hit { /* croix rouge, un peu transparente pour laisser voir le navire */
    width: 64%; border-radius: 0; opacity: .8;
    background: linear-gradient(135deg, #ff7a88, #e0283f 55%, #9a1b2e);
    clip-path: polygon(18% 0, 50% 32%, 82% 0, 100% 18%, 68% 50%, 100% 82%, 82% 100%, 50% 68%, 18% 100%, 0 82%, 32% 50%, 0 18%);
}
.bn-peg.is-miss { width: 34%; background: radial-gradient(circle at 35% 30%, #fff, #d9e4ec 60%, #9fb2c0); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.bn-peg.is-pending { background: #ffd166; animation: bn-pulse .7s ease-in-out infinite alternate; }
.bn-peg.is-last { outline: 2px solid #fff; outline-offset: 2px; }
@keyframes bn-pulse { from { opacity: .25; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .bn-peg.is-pending { animation: none; } }
.bn-ships { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.bn-ships li { padding: 2px 8px; font-size: .78rem; border: 1px solid var(--border); border-radius: 999px; }
.bn-ships li.is-sunk { opacity: .55; text-decoration: line-through; }
.bn-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
/* Billard : table 3D (canvas), jauge de force et informations */
.game-board-billard { display: grid; gap: 10px; }
.bl-stage { width: 100%; max-width: 1100px; margin: 0 auto; touch-action: none; }
.bl-stage canvas { display: block; width: 100%; height: auto; border-radius: 14px; cursor: crosshair; }
.bl-power { width: 100%; max-width: 420px; height: 10px; margin: 0 auto; overflow: hidden; background: rgba(255, 255, 255, .1); border-radius: 999px; }
.bl-power span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #ffd166, #e0283f); transition: width .05s linear; }
.bl-info { display: grid; gap: 4px; text-align: center; }
.bl-info p, .bl-loading { margin: 0; }
.bl-info p:last-child { color: var(--muted); font-size: .9rem; }
.bl-loading { padding: 40px 0; text-align: center; color: var(--muted); }

/* ── Mini-golf (page d'une partie) ── */
.game-board-golf { display: grid; gap: 10px; }
.gf-stage { width: 100%; max-width: 560px; margin: 0 auto; touch-action: none; }
.gf-stage[hidden], .gf-tools[hidden], .gf-power[hidden], .gf-legend[hidden] { display: none; }
.gf-tools { display: flex; justify-content: center; gap: 8px; }
.gf-legend { margin: 0; text-align: center; color: var(--muted); font-size: .85rem; }
.gf-stage canvas { display: block; width: 100%; height: auto; border-radius: 14px; cursor: crosshair; }
.gf-power { width: 100%; max-width: 420px; height: 10px; margin: 0 auto; overflow: hidden; background: rgba(255, 255, 255, .1); border-radius: 999px; }
.gf-power span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #ffd166, #e0283f); transition: width .05s linear; }
.gf-info { display: grid; gap: 4px; text-align: center; }
.gf-info p, .gf-loading { margin: 0; }
.gf-info p:last-child { color: var(--muted); font-size: .9rem; }
.gf-loading { padding: 40px 0; text-align: center; color: var(--muted); }

/* ── Lettre à lettre (page d'une partie) ── */
.game-board-lettres { display: grid; gap: 14px; justify-items: center; text-align: center; }
.lt-score { margin: 0; font-weight: 600; }
.lt-word { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 58px; }
.lt-tile { display: inline-grid; place-items: center; width: 44px; height: 52px; font-size: 1.7rem; font-weight: 800; color: var(--text); background: var(--card-soft); border: 1px solid var(--border); border-radius: 10px; }
.lt-tile.is-mine { border-color: #ffd166; box-shadow: 0 0 0 2px rgba(255, 209, 102, .35); }
.lt-tile.is-theirs { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(220, 80, 106, .35); }
.lt-roll { width: 64px; height: 72px; font-size: 2.4rem; }
.lt-stop { font-size: 1.3rem; padding: 12px 34px; }
.lt-hint, .lt-recap { margin: 0; }
.lt-recap { padding: 10px 14px; border-radius: 12px; background: var(--card-soft); }
.lt-keyboard { display: grid; gap: 6px; width: min(100%, 520px); }
.lt-row { display: flex; justify-content: center; gap: 5px; }
.lt-key { flex: 1 1 0; max-width: 46px; min-width: 0; height: 46px; padding: 0; font-size: 1.1rem; font-weight: 700; color: var(--text); background: var(--card-soft); border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.lt-key:not(:disabled):hover { border-color: var(--primary); }
.lt-key:disabled { opacity: .5; cursor: default; }
.lt-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lt-history { margin: 0; padding-left: 1.4em; text-align: left; color: var(--muted); font-size: .92rem; }
.lt-rules { max-width: 560px; text-align: left; }
.lt-rules summary { cursor: pointer; color: var(--muted); }

/* ── Le mot le plus long ── */
.game-board-motlong { display: grid; gap: 14px; justify-items: center; text-align: center; }
.ml-tile { cursor: pointer; font-family: inherit; }
.ml-tile:disabled { opacity: .35; cursor: default; }
.ml-tile:not(:disabled):hover { border-color: var(--primary); }
.ml-typed { min-height: 52px; align-items: center; }
.ml-placeholder { color: var(--muted); }
.ml-recap p { margin: 2px 0; }

/* ── La pipopipette : plateau sur une feuille de cahier Seyès, traits à l'encre ── */
.game-board-pipo { display: grid; gap: 14px; justify-items: center; text-align: center; --pp-me: var(--primary); --pp-partner: #5aa9e6; }
.pp-tag.is-me { color: var(--pp-me); font-weight: 700; }
.pp-tag.is-partner { color: var(--pp-partner); font-weight: 700; }
.pp-grid { --pp-dot: 12px; --pp-ink: #2f3150; --pp-partner-ink: #2f7fc4; display: grid; width: min(100%, 440px); aspect-ratio: 1; padding: 8px; background: #f7f4ea url('../games/papier/cahier.webp') repeat; background-size: 360px 360px; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); touch-action: manipulation; }
.pp-dot { z-index: 2; background: var(--pp-ink); border-radius: 50%; }
.pp-box { display: grid; place-items: center; font-size: 1.1rem; color: #fff; border-radius: 4px; }
.pp-box.is-me { background: var(--pp-me); opacity: .8; }
.pp-box.is-partner { background: var(--pp-partner-ink); opacity: .8; }
/* Les traits débordent sur les cases voisines : une zone de toucher confortable sur mobile */
.pp-line { position: relative; z-index: 1; padding: 0; background: none; border: 0; cursor: pointer; }
.pp-h { margin: -10px 0; }
.pp-v { margin: 0 -10px; }
.pp-line::before { content: ''; position: absolute; border-radius: 3px; background: var(--pp-ink); opacity: .12; }
.pp-h::before { left: 0; right: 0; top: calc(50% - 3px); height: 6px; }
.pp-v::before { top: 0; bottom: 0; left: calc(50% - 3px); width: 6px; }
.pp-line:not(:disabled):hover::before { background: var(--pp-me); opacity: .5; }
.pp-line:disabled { cursor: default; }
.pp-line.is-me::before { background: var(--pp-me); opacity: 1; }
.pp-line.is-partner::before { background: var(--pp-partner-ink); opacity: 1; }
.pp-line.is-last::before { box-shadow: 0 0 0 2px rgba(47, 49, 80, .45); }
@media (max-width: 480px) { .pp-grid { --pp-dot: 10px; } }

/* Memory : cartes retournées en 3D, paires gagnées entourées de rose (moi) ou de bleu (l'autre) */
.game-board-memory { display: grid; gap: 14px; justify-items: center; text-align: center; --pp-me: var(--primary); --pp-partner: #5aa9e6; }
.mm-grid { display: grid; gap: 8px; width: min(100%, 460px); }
.mm-grid.is-4 { grid-template-columns: repeat(4, 1fr); }
.mm-grid.is-6 { grid-template-columns: repeat(6, 1fr); width: min(100%, 560px); gap: 6px; }
.mm-card { aspect-ratio: 1; padding: 0; background: none; border: 0; border-radius: 12px; cursor: pointer; perspective: 600px; touch-action: manipulation; }
.mm-card:disabled { cursor: default; }
.mm-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform .45s ease; transform-style: preserve-3d; }
.mm-card.is-up .mm-inner { transform: rotateY(180deg); }
.mm-back, .mm-front { position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); }
.mm-back { background: #8a1f45 url('../games/memory/dos.webp') center / cover no-repeat; }
.mm-front { transform: rotateY(180deg); background: #ffd6de; }
.mm-front img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mm-card:not(:disabled):not(.is-up):hover .mm-back { box-shadow: 0 0 0 3px var(--primary), 0 4px 10px rgba(0, 0, 0, .35); }
.mm-card.is-pending .mm-back { animation: mm-wait .8s ease-in-out infinite alternate; }
.mm-card.is-me .mm-front { box-shadow: 0 0 0 3px var(--pp-me); opacity: .75; }
.mm-card.is-partner .mm-front { box-shadow: 0 0 0 3px var(--pp-partner); opacity: .75; }
.mm-card.is-miss .mm-front { box-shadow: 0 0 0 3px var(--danger); }
.mm-card.is-open .mm-front { box-shadow: 0 0 0 3px #f5c542; }
@keyframes mm-wait { to { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .mm-inner { transition: none; } .mm-card.is-pending .mm-back { animation: none; } }

/* Yams : piste 3D, rangée de dés à garder, grille de scores */
.game-board-yams { display: grid; gap: 12px; justify-items: center; text-align: center; }
.ym-stage { width: min(100%, 680px); border-radius: 16px; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, rgba(90, 30, 50, .55), rgba(20, 8, 16, .2)); }
.ym-stage canvas { display: block; cursor: pointer; touch-action: manipulation; }
.ym-dice { display: flex; gap: 8px; justify-content: center; }
.ym-die { width: 48px; height: 48px; padding: 0; font-size: 2.3rem; line-height: 1; color: var(--text); background: var(--card-soft); border: 2px solid var(--border); border-radius: 10px; cursor: pointer; }
.ym-die:disabled { cursor: default; }
.ym-die.is-held { border-color: #f5c542; color: #f5c542; box-shadow: 0 0 0 2px rgba(245, 197, 66, .3); }
.ym-actions { display: flex; gap: 8px; justify-content: center; }
.ym-info { margin: 0; min-height: 1.4em; }
.ym-sheet { width: min(100%, 420px); }
.ym-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ym-table th, .ym-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); }
.ym-table tbody th { text-align: left; font-weight: 500; }
.ym-table td { width: 28%; text-align: center; }
.ym-table thead .is-me { color: var(--primary); }
.ym-table thead .is-partner { color: #5aa9e6; }
.ym-table .is-zero { color: var(--muted); }
.ym-table .is-last { background: rgba(245, 197, 66, .14); }
.ym-bonus th, .ym-bonus td { font-size: .9em; color: var(--muted); }
.ym-total-row th, .ym-total-row td { font-weight: 700; border-bottom: 0; }
.ym-pick { min-width: 44px; padding: 2px 8px; font: inherit; font-weight: 700; color: #fff; background: var(--primary); border: 0; border-radius: 8px; cursor: pointer; }
.ym-pick.is-zero { color: var(--text); background: var(--card-soft); font-weight: 400; }
.ym-pick:disabled { opacity: .5; cursor: default; }
@media (max-width: 480px) { .ym-die { width: 42px; height: 42px; font-size: 2rem; } }

/* Dessine, je devine : feuille de dessin, palette, indice et galerie de fin */
.game-board-dessin { display: grid; gap: 12px; justify-items: center; text-align: center; }
.ds-canvas { display: block; width: min(100%, 600px); aspect-ratio: 4 / 3; background: #fffdf7 url('../games/papier/cahier.webp') repeat; background-size: 360px 360px; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.ds-canvas.is-editing { cursor: crosshair; touch-action: none; }
.ds-canvas.is-small { width: min(100%, 300px); margin: 8px auto 0; }
.ds-words, .ds-buttons, .ds-colors, .ds-widths { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.ds-tools { display: grid; gap: 10px; justify-items: center; }
.ds-color { width: 32px; height: 32px; padding: 0; border: 2px solid rgba(255, 255, 255, .25); border-radius: 50%; cursor: pointer; }
.ds-color.is-active { border-color: #fff; box-shadow: 0 0 0 3px var(--primary); }
.ds-width { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; background: var(--card-soft); border: 2px solid var(--border); border-radius: 10px; cursor: pointer; }
.ds-width.is-active { border-color: var(--primary); }
.ds-dot { display: block; background: var(--text); border-radius: 50%; }
.ds-dot.is-0 { width: 5px; height: 5px; }
.ds-dot.is-1 { width: 11px; height: 11px; }
.ds-dot.is-2 { width: 20px; height: 20px; }
.ds-hint { margin: 0; font-family: ui-monospace, monospace; font-size: 1.3rem; letter-spacing: .08em; white-space: pre; }
.ds-guess { display: flex; gap: 8px; width: min(100%, 420px); }
.ds-input { flex: 1; min-width: 0; }
.ds-recap { width: min(100%, 600px); }
.ds-gallery { display: grid; gap: 12px; width: min(100%, 640px); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ds-gallery .ds-recap { width: auto; }

/* ── Le petit bac ── */
.game-board-petitbac { display: grid; gap: 14px; justify-items: center; text-align: center; }
.pb-letter { display: inline-grid; place-items: center; width: 72px; height: 72px; margin: 0; font-size: 2.6rem; font-weight: 800; color: #fff; background: var(--primary); border-radius: 16px; }
.pb-form { display: grid; gap: 10px; width: min(100%, 460px); text-align: left; }
.pb-field { display: grid; gap: 4px; font-weight: 600; }
.pb-check { display: grid; gap: 6px; width: min(100%, 560px); text-align: left; }
.pb-row { display: grid; grid-template-columns: minmax(90px, 1fr) 1fr 1fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.pb-head { font-weight: 700; color: var(--muted); border-bottom: none; }
.pb-cat { font-size: .9rem; color: var(--muted); }
.pb-out { text-decoration: line-through; opacity: .6; }
.pb-toggle { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.pb-history { width: min(100%, 560px); text-align: left; }
.pb-history summary { cursor: pointer; font-weight: 600; }

/* ── Tu me connais vraiment ? ── */
.game-board-connais { display: grid; gap: 14px; justify-items: center; text-align: center; }
.cn-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.cn-choices .btn { white-space: normal; }

/* ── Qui de nous deux ? ── */
.game-board-quinous { display: grid; gap: 14px; justify-items: center; text-align: center; }
.qn-meter { display: grid; gap: 2px; }
.qn-meter strong { font-size: 2rem; color: var(--primary); }
.qn-card { display: grid; gap: 12px; width: min(100%, 460px); padding: 18px; background: var(--card-soft); border: 1px solid var(--border); border-radius: 14px; }
.qn-question { margin: 0; font-size: 1.25rem; font-weight: 700; }
.qn-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.qn-buttons .btn { flex: 1 1 140px; }
.qn-list { display: grid; gap: 8px; width: min(100%, 520px); margin: 0; padding: 0; list-style: none; text-align: left; }
.qn-item { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.qn-item.is-agree { border-color: var(--primary); }
.qn-item.is-pending { opacity: .75; border-style: dashed; }
.qn-q { font-weight: 600; }

/* ── Wordle en duel ── */
.game-board-wordle { display: grid; gap: 14px; justify-items: center; text-align: center; }
.wd-grid { display: grid; gap: 5px; }
.wd-row { display: flex; gap: 5px; justify-content: center; }
.wd-cell { display: inline-grid; place-items: center; width: 48px; height: 48px; font-size: 1.5rem; font-weight: 800; color: var(--text); background: var(--card-soft); border: 1px solid var(--border); border-radius: 8px; }
.wd-cell.is-typed { border-color: var(--primary); }
.wd-cell.is-g, .lt-key.is-g { background: #3f9b4f; border-color: #3f9b4f; color: #fff; }
.wd-cell.is-y, .lt-key.is-y { background: #c99a1e; border-color: #c99a1e; color: #fff; }
.wd-cell.is-n, .lt-key.is-n { background: #4a4a55; border-color: #4a4a55; color: #ddd; }
.lt-key.is-wide { flex: 1.6 1 0; max-width: 70px; font-size: .95rem; }
.wd-theirs .wd-cell { width: 28px; height: 28px; font-size: .9rem; }
.wd-theirs p { margin: 0 0 6px; }
.wd-secret { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.wd-input { width: 9em; text-align: center; font-size: 1.3rem; letter-spacing: .2em; text-transform: uppercase; }

/* ── Surnom du partenaire (page Mon couple) ── */
.couple-card .couple-pseudo { margin: 0; }
.couple-nickname { max-width: 460px; margin: 14px auto 0; }
.couple-nickname > p { margin: 10px 0 0; }
.couple-card .couple-nickname form { margin-top: 12px; }

/* ── Humeur du jour (widget de l'accueil et page /humeur.php) ── */
.mood-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mood-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mood-emoji { flex: 0 0 auto; font-size: 2.4rem; line-height: 1; }
.mood-person-text { display: grid; gap: 2px; min-width: 0; }
.mood-person-text strong, .mood-note { overflow-wrap: anywhere; }
.mood-label { color: var(--primary); font-weight: 600; }
.mood-picker { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding-top: 12px; border-top: 1px solid var(--border); }
.mood-choice {
    width: 44px; height: 44px; padding: 0;
    font-size: 1.45rem; line-height: 1;
    background: transparent; border: 1px solid var(--border); border-radius: 12px;
    cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.mood-choice:hover { transform: translateY(-2px); border-color: rgba(220, 80, 106, .45); }
.mood-choice.is-selected { border-color: var(--primary); background: rgba(220, 80, 106, .22); }
.mood-page { display: grid; gap: 20px; min-width: 0; }
.mood-grid { align-items: start; }
.mood-clear { margin: 12px 0 0; }
.mood-partner .mood-emoji { font-size: 3rem; }
.mood-history { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mood-history li {
    display: grid; grid-template-columns: minmax(110px, .7fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center;
    padding: 8px 0; border-bottom: 1px solid var(--border);
}
.mood-history li:last-child { border-bottom: 0; }
.mood-history-day { font-weight: 600; }
.mood-history-entry { overflow-wrap: anywhere; }
@media (max-width: 560px) {
    .mood-people { grid-template-columns: minmax(0, 1fr); }
    .mood-history li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
