/* =========================================================
   LYNK — THÈME GRAPHIQUE
   Chargé APRÈS style.css : il redessine l'apparence sans
   toucher à la structure ni au JavaScript.

   Direction : « autocollants ». Encre indigo, papier lilas
   pointillé, aplats vifs, contours épais et ombre pleine
   sous chaque bloc (comme un bouton de jeu qu'on enfonce).
   Les couleurs viennent des façades pastel de Rochefort.
   ========================================================= */

@font-face {
    font-family: "Unbounded";
    src: url("../fonts/unbounded.woff") format("woff");
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Figtree";
    src: url("../fonts/figtree.woff") format("woff");
    font-weight: 300 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #1B1340;
    --ink-soft: #4A4270;
    --muted: #756E94;
    --paper: #F4EFFF;
    --card: #FFFFFF;

    --violet: #7C3AED;
    --violet-deep: #5B21D6;
    --violet-soft: #EADFFF;

    --sun: #FFD23F;
    --sun-soft: #FFF1B8;
    --rose: #FF5C93;
    --rose-soft: #FFD6E4;
    --mint: #3DDBA4;
    --mint-soft: #C9F6E4;
    --sky: #6CB8FF;
    --sky-soft: #D3E9FF;

    --border: 2px solid var(--ink);
    --lift: 0 5px 0 var(--ink);
    --lift-sm: 0 3px 0 var(--ink);

    --font-display: "Unbounded", "Arial Rounded MT Bold", Arial, sans-serif;
    --font-body: "Figtree", "Segoe UI", Arial, sans-serif;
}

/* ---------- Base ---------- */

html {
    scrollbar-color: var(--violet) transparent;
    /* Le fond du document couvre tout l'écran : aucune bande blanche ne peut
       apparaître en bas (ou sur les côtés) quand la page est plus courte que
       la fenêtre. */
    background-color: var(--paper);
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--ink);
    background-color: var(--paper);
    background-image: radial-gradient(rgba(27, 19, 64, .10) 1.3px, transparent 1.5px);
    background-size: 24px 24px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--font-display);
    letter-spacing: -.03em;
    line-height: 1.12;
    font-weight: 800;
}

button, input, select, textarea {
    font-family: var(--font-body);
}

::selection {
    background: var(--sun);
    color: var(--ink);
}

:focus-visible {
    outline: 3px solid var(--rose);
    outline-offset: 3px;
}

.app,
.profile-page,
.login-page {
    background: transparent;
}

/* ---------- Barre latérale ---------- */

.sidebar {
    background: var(--ink);
    border-right: 0;
    color: #fff;
    position: sticky;
    isolation: isolate;
}

/* Deux formes qui dépassent du bas de la barre : le seul geste décoratif ici. */
.sidebar::before,
.sidebar::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: -1;
    border-radius: 50%;
}

.sidebar::before {
    width: 170px;
    height: 170px;
    left: -96px;
    bottom: -118px;
    background: var(--violet);
}

.sidebar::after {
    width: 96px;
    height: 96px;
    right: -44px;
    bottom: 150px;
    border: 14px solid var(--rose);
    opacity: .9;
}

.sidebar.collapsed::after {
    display: none;
}

.brand {
    color: #fff;
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -.05em;
    text-transform: lowercase;
}

.brand-icon,
.logo-icon {
    background: url("../assets/lynk-logo.png") center / contain no-repeat;
    color: transparent;
    font-size: 0;
    border-radius: 0;
    flex: 0 0 auto;
}

.brand-icon {
    width: 44px;
    height: 44px;
}

.nav-item {
    color: rgba(255, 255, 255, .74);
    border-radius: 16px;
    font-weight: 700;
    font-size: 15px;
    gap: 12px;
    padding: 0 10px;
}

.nav-item span:first-child {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, .09);
    font-size: 17px;
    transition: background-color .2s ease, transform .2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
    transform: none;
    box-shadow: none;
}

.nav-item:hover span:first-child {
    background: rgba(255, 255, 255, .16);
    transform: rotate(-6deg);
}

.nav-item.active {
    background: var(--sun);
    color: var(--ink);
    font-weight: 800;
    box-shadow: 0 3px 0 var(--rose);
}

.nav-item.active:hover {
    background: var(--sun);
    box-shadow: 0 3px 0 var(--rose);
}

.nav-item.active span:first-child {
    background: rgba(27, 19, 64, .12);
}

.logout-button {
    color: rgba(255, 255, 255, .6);
    border-radius: 16px;
    font-weight: 700;
    padding: 0 10px;
}

.logout-button span:first-child {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, .06);
}

.logout-button:hover {
    background: rgba(255, 92, 147, .18);
    color: #FFB3CC;
    transform: none;
    box-shadow: none;
}

/* Flèche de la barre latérale : fond jaune et double flèche. */
.sidebar-toggle {
    background: var(--sun);
    border: 2px solid var(--ink);
    color: var(--ink);
    box-shadow: 0 3px 0 var(--ink);
}

.sidebar-toggle:hover {
    background: var(--sun-soft);
    color: var(--ink);
    box-shadow: 0 3px 0 var(--ink);
}

.sidebar.collapsed .nav-item,
.sidebar.collapsed .logout-button {
    padding-left: 0;
    padding-right: 0;
}

/* ---------- En-tête de page ---------- */

.topbar {
    background: transparent;
    border-bottom: 0;
    height: auto;
    min-height: 104px;
    padding: 30px 44px 0;
    align-items: flex-start;
}

.topbar h1 {
    font-size: clamp(24px, 3vw, 32px);
    margin-bottom: 8px;
}

.topbar p {
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
}

.mail-button {
    width: 52px;
    height: 52px;
    border: var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--lift-sm);
    font-size: 20px;
}

.mail-button:hover {
    background: var(--sun-soft);
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--ink);
}

.mail-button:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 var(--ink);
}

.notification-dot {
    top: -5px;
    right: -5px;
    width: 15px;
    height: 15px;
    background: var(--rose);
    border: 2px solid var(--ink);
}

.content {
    max-width: 1100px;
    padding: 30px 44px 80px;
}

body.chat-page .topbar {
    padding-top: 22px;
}

/* ---------- Blocs : contour d'encre + ombre pleine ---------- */

.profile-card,
.empty-card,
.login-card,
.profile-setup-card,
.lynk-modal-card,
.lynk-notification-card,
.lynk-notification-sheet,
.lynk-logout-sheet,
.mission-card,
.badge-card,
.ranking-card,
.rewards-stat-card,
.special-badge-card,
.rewards-info-card,
.rewards-hero,
.badges-intro-card,
.equipped-preview {
    background: var(--card);
    border: var(--border);
    border-radius: 24px;
    box-shadow: var(--lift);
}

/* Les blocs d'information ne bougent pas au survol. */
.empty-card:hover,
.login-card:hover,
.profile-setup-card:hover,
.mission-card:hover,
.ranking-card:hover,
.rewards-stat-card:hover,
.special-badge-card:hover,
.rewards-info-card:hover,
.rewards-hero:hover,
.badges-intro-card:hover,
.welcome-card:hover {
    transform: none;
    box-shadow: var(--lift);
}

/* Les blocs cliquables se soulèvent, puis s'enfoncent au clic. */
.profile-card:hover,
.lynk-notification-card:hover,
.badge-card:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 0 var(--ink);
    border-color: var(--ink);
}

.profile-card:active,
.lynk-notification-card:active,
.badge-card:not(:disabled):active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--ink);
}

.empty-card {
    background: rgba(255, 255, 255, .72);
    border-style: dashed;
    box-shadow: none;
    padding: 40px 28px;
}

.empty-card:hover {
    box-shadow: none;
}

.empty-card h3 {
    font-size: 17px;
}

.empty-card p {
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.55;
}

.empty-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border: var(--border);
    border-radius: 22px;
    background: var(--violet-soft);
    box-shadow: var(--lift-sm);
    font-size: 30px;
    color: var(--violet-deep);
    transform: rotate(-4deg);
}

.discover-match-card {
    border-style: solid;
    background: #fff;
    box-shadow: var(--lift);
}

.discover-match-card:hover {
    box-shadow: var(--lift);
}

.discover-loading-card,
.mailbox-loading-card,
.mailbox-empty-state,
.mailbox-error-state {
    border-style: dashed;
}

/* ---------- Titres de section ---------- */

.section-header {
    margin: 0 0 18px;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: clamp(17px, 2vw, 21px);
}

.section-header h2::before {
    content: "";
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    border: var(--border);
    border-radius: 50%;
    background: var(--rose);
}

.content > .section-header:nth-of-type(4n+2) h2::before {
    background: var(--sun);
    border-radius: 5px;
    transform: rotate(18deg);
}

.content > .section-header:nth-of-type(4n+3) h2::before {
    background: var(--mint);
}

.content > .section-header:nth-of-type(4n+4) h2::before {
    background: var(--sky);
    border-radius: 5px;
    transform: rotate(18deg);
}

.rewards-special-section,
.rewards-section {
    margin-top: 44px;
}

.rewards-section-heading h2::before,
.rewards-section-heading p {
    display: none;
}

.rewards-section-heading h2 {
    display: block;
}

.text-button {
    color: var(--violet-deep);
    font-weight: 800;
    font-size: 15px;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.text-button:hover {
    transform: none;
    box-shadow: none;
    color: var(--rose);
}

/* ---------- Accueil : le grand bloc d'accroche ---------- */

.welcome-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: var(--violet);
    color: #fff;
    border: var(--border);
    border-radius: 32px;
    box-shadow: 0 8px 0 var(--ink);
    padding: clamp(28px, 4vw, 48px);
    padding-right: min(38%, 360px);
    min-height: 250px;
    margin-bottom: 52px;
}

.welcome-small {
    display: inline-block;
    margin-bottom: 20px;
    padding: 7px 14px;
    border: var(--border);
    border-radius: 999px;
    background: var(--sun);
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    opacity: 1;
    transform: rotate(-2.5deg);
    box-shadow: var(--lift-sm);
}

.welcome-card h2 {
    font-size: clamp(30px, 4.6vw, 52px);
    line-height: 1.04;
    letter-spacing: -.045em;
    margin-bottom: 18px;
    overflow-wrap: anywhere;
}

.welcome-card p {
    max-width: 44ch;
    font-size: 17px;
    line-height: 1.55;
    font-weight: 500;
    color: rgba(255, 255, 255, .92);
}

.welcome-art {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(38%, 360px);
    z-index: -1;
    pointer-events: none;
}

.welcome-art i {
    position: absolute;
    display: block;
    border: var(--border);
}

.welcome-art .a1 {
    width: 190px;
    height: 190px;
    right: -34px;
    top: -52px;
    border-radius: 50%;
    background: var(--rose);
}

.welcome-art .a2 {
    width: 120px;
    height: 120px;
    right: 118px;
    bottom: -44px;
    border-radius: 50%;
    background: var(--sun);
}

.welcome-art .a3 {
    width: 74px;
    height: 74px;
    right: 22px;
    bottom: 54px;
    border-radius: 22px;
    background: var(--mint);
    transform: rotate(14deg);
}

.welcome-art img {
    position: absolute;
    width: 132px;
    height: 132px;
    right: 96px;
    top: 56px;
    transform: rotate(-12deg);
    filter: drop-shadow(0 6px 0 var(--ink));
    animation: lynkMarkSettle .9s cubic-bezier(.2, 1.4, .4, 1) .15s both;
}

@keyframes lynkMarkSettle {
    from { transform: rotate(-60deg) scale(.4); opacity: 0; }
    to { transform: rotate(-12deg) scale(1); opacity: 1; }
}

@media (max-width: 760px) {
    .welcome-card {
        padding-right: clamp(28px, 4vw, 48px);
        padding-bottom: 150px;
    }

    .welcome-art {
        inset: auto 0 0 0;
        width: 100%;
        height: 140px;
    }

    .welcome-art .a1 { right: -50px; top: 40px; width: 150px; height: 150px; }
    .welcome-art .a2 { right: 70px; bottom: -48px; width: 100px; height: 100px; }
    .welcome-art .a3 { right: 18px; bottom: 60px; width: 60px; height: 60px; }
    .welcome-art img { right: 120px; top: 36px; width: 96px; height: 96px; }
}

/* ---------- Cartes de personnes ---------- */

.profile-card {
    padding: 20px 22px;
    gap: 18px;
    margin-bottom: 18px;
}

.content > .profile-card,
#ownProfileCard {
    margin-bottom: 48px;
}

.profile-avatar {
    width: 66px;
    height: 66px;
    border: var(--border);
    border-radius: 50%;
    background-color: var(--sun);
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 24px;
}

.profile-avatar .lynk-status-dot,
.profile-avatar-large .lynk-status-dot {
    right: -3px;
    bottom: 0;
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    outline: 2px solid var(--ink);
    box-shadow: none;
}

.lynk-status-dot[data-status="online"] { background: var(--mint); }
.lynk-status-dot[data-status="offline"] { background: #B4AECB; }
.lynk-status-dot[data-status="course"] { background: linear-gradient(135deg, var(--rose), #FF9A3D); }

/* Les initiales changent de couleur d'une personne à l'autre. */
.profile-card:nth-child(4n+2) .profile-avatar,
.ranking-row:nth-child(4n+2) .ranking-avatar { background-color: var(--rose-soft); }
.profile-card:nth-child(4n+3) .profile-avatar,
.ranking-row:nth-child(4n+3) .ranking-avatar { background-color: var(--mint-soft); }
.profile-card:nth-child(4n+4) .profile-avatar,
.ranking-row:nth-child(4n+4) .ranking-avatar { background-color: var(--sky-soft); }

.profile-info h3 {
    font-size: 17px;
    letter-spacing: -.02em;
}

.profile-info p {
    color: var(--ink-soft);
    font-size: 14px;
}

.birthday-line {
    color: var(--ink-soft);
    font-size: 14px;
}

#upcomingBirthdays {
    background: var(--paper);
    border: 0;
    box-shadow: none;
    padding: 0;
    gap: 14px;
}

#upcomingBirthdays > .profile-card {
    margin: 0 !important;
}

#upcomingBirthdays.empty-card {
    background: var(--paper);
    border: 2px dashed var(--ink);
    padding: 40px 28px;
}

/* ---------- Boutons ---------- */

.login-button,
.primary-button,
.secondary-button,
.danger-button,
.lynk-logout-actions button,
.discover-match-button {
    border: var(--border);
    border-radius: 16px;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0;
    box-shadow: var(--lift-sm);
    transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease;
}

.login-button,
.primary-button,
.discover-match-button,
.lynk-logout-confirm {
    background: var(--violet);
    color: #fff;
}

.login-button:hover,
.primary-button:hover,
.discover-match-button:hover,
.lynk-logout-confirm:hover {
    background: var(--violet-deep);
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--ink);
    filter: none;
}

.secondary-button,
.lynk-logout-cancel {
    background: #fff;
    color: var(--ink);
    padding: 11px 18px;
}

.secondary-button:hover,
.lynk-logout-cancel:hover {
    background: var(--sun-soft);
    color: var(--ink);
    border-color: var(--ink);
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--ink);
}

.danger-button {
    background: var(--rose-soft);
    color: #8F1239;
    border-color: var(--ink);
}

.danger-button:hover {
    background: var(--rose);
    color: #fff;
    border-color: var(--ink);
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--ink);
}

.login-button:active,
.primary-button:active,
.secondary-button:active,
.danger-button:active,
.discover-match-button:active,
.lynk-logout-actions button:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 var(--ink);
}

.login-button:disabled,
.discover-match-button:disabled,
.danger-button:disabled {
    opacity: .6;
    box-shadow: var(--lift-sm) !important;
}

.discover-match-button {
    min-height: 60px;
    font-size: 16px;
}

/* ---------- Champs de formulaire ---------- */

.input-group label {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 9px;
    color: var(--ink);
}

.input-group label span {
    color: var(--muted);
    font-weight: 500;
}

.input-group input,
.input-group select,
.input-group textarea,
.interest-custom,
.character-input {
    background: #fff;
    border: var(--border);
    border-radius: 16px;
    color: var(--ink);
    font-size: 16px;
    font-weight: 500;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: #9A93B8;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus,
.interest-custom:focus,
.character-input:focus {
    border-color: var(--ink);
    box-shadow: 0 4px 0 var(--violet);
    outline: none;
}

.character-input {
    border: var(--border) !important;
    border-radius: 16px !important;
    background: #fff !important;
}

.character-input:focus {
    border-color: var(--ink) !important;
    box-shadow: 0 4px 0 var(--violet) !important;
}

.character-input-icon {
    background: var(--sun);
    color: var(--ink);
    border: 2px solid var(--ink);
}

/* Centres d'intérêt : des pastilles qu'on enfonce */
.interest span {
    border: var(--border);
    border-radius: 16px;
    background: #fff;
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--lift-sm);
    transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease;
}

.interest:hover span {
    background: var(--sun-soft);
}

.interest input:checked + span {
    background: var(--violet);
    color: #fff;
    border-color: var(--ink);
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--ink);
}

.interest-dropdown {
    border: var(--border);
    border-radius: 18px;
    background: #fff;
}

.interest-dropdown summary {
    font-size: 15px;
    font-weight: 700;
    padding: 15px 16px;
}

.interest-dropdown[open] summary {
    background: var(--sun);
    color: var(--ink);
    border-bottom: var(--border);
}

.interest-options label {
    font-size: 13px;
    font-weight: 600;
}

.interest-options label:hover {
    background: var(--violet-soft);
}

.interest-options input,
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--violet);
}

/* Photo de profil */
.profile-photo-picker {
    border: 2px dashed var(--ink);
    border-radius: 22px;
    background: rgba(255, 255, 255, .7);
}

.profile-photo-preview,
.avatar-character-preview {
    border: var(--border);
    background-color: var(--sun);
    color: var(--ink);
    border-radius: 50%;
    font-family: var(--font-display);
    font-weight: 800;
}

.profile-photo-label {
    background: var(--sun);
    border: var(--border);
    color: var(--ink);
    border-radius: 16px;
    box-shadow: var(--lift-sm);
}

.profile-photo-label:hover {
    background: var(--sun-soft);
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--ink);
}

.profile-photo-remove {
    color: var(--violet-deep);
}

.profile-photo-remove:hover {
    background: var(--rose-soft);
}

.profile-photo-help {
    color: var(--ink-soft);
    font-size: 13px;
}

/* ---------- Page de connexion ---------- */

.login-page {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 540px) minmax(360px, 460px);
    grid-template-areas: "hero card";
    justify-content: start;
    align-items: center;
    column-gap: clamp(28px, 4vw, 56px);
    row-gap: 22px;
    padding: clamp(20px, 4vw, 56px) clamp(20px, 7vw, 120px);
    overflow: hidden;
}

.login-page > .login-card {
    grid-area: card;
    max-width: none;
    padding: clamp(26px, 3.4vw, 40px);
    border-radius: 30px;
    box-shadow: 0 8px 0 var(--ink);
    position: relative;
    z-index: 2;
}

.login-card .logo {
    display: none;
    justify-content: flex-start;
    margin-bottom: 24px;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.05em;
    color: var(--ink);
    text-transform: lowercase;
}

.logo-icon {
    width: 46px;
    height: 46px;
}

.login-card h1 {
    text-align: left;
    font-size: clamp(24px, 2.6vw, 30px);
    margin-bottom: 10px;
}

.subtitle {
    text-align: left;
    color: var(--ink-soft);
    font-size: 16px;
    margin-bottom: 26px;
    line-height: 1.5;
}

.login-info {
    text-align: left;
    color: var(--ink-soft);
    font-size: 14px;
}

.login-info a,
.login-card a[href="#"] {
    color: var(--violet-deep) !important;
    font-weight: 800 !important;
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 4px;
}

.login-hero {
    grid-area: hero;
    position: relative;
    z-index: 1;
    min-height: min(640px, 80vh);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-hero-mark {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: clamp(22px, 5vh, 56px);
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.05em;
    text-transform: lowercase;
}

.login-hero-mark img {
    width: 52px;
    height: 52px;
}

.login-hero h2 {
    max-width: 11ch;
    font-size: clamp(40px, 6.4vw, 92px);
    line-height: 1;
    letter-spacing: -.045em;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: clamp(22px, 4vh, 36px);
    animation: lynkRise .7s cubic-bezier(.2, .9, .3, 1) both;
}

.login-hero h2 em {
    font-style: normal;
}

.login-hero p {
    max-width: 38ch;
    font-size: clamp(16px, 1.5vw, 20px);
    line-height: 1.5;
    font-weight: 500;
    color: var(--ink-soft);
}

.login-stickers {
    position: relative;
    height: 92px;
    margin-top: clamp(28px, 6vh, 64px);
}

.login-stickers span {
    position: absolute;
    padding: 10px 18px;
    border: var(--border);
    border-radius: 999px;
    font-weight: 800;
    font-size: 16px;
    box-shadow: var(--lift-sm);
    white-space: nowrap;
}

.login-stickers span:nth-child(1) { left: 0; top: 18px; background: var(--sun); transform: rotate(-4deg); }
.login-stickers span:nth-child(2) { left: 128px; top: 0; background: var(--rose-soft); transform: rotate(3deg); }
.login-stickers span:nth-child(3) { left: 232px; top: 36px; background: var(--mint-soft); transform: rotate(-2deg); }
.login-stickers span:nth-child(4) { left: 62px; top: 56px; background: var(--sky-soft); transform: rotate(2deg); }
.login-stickers span:nth-child(5) { left: 330px; top: 8px; background: var(--violet-soft); transform: rotate(4deg); }

.login-shapes {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.login-shapes i {
    position: absolute;
    display: block;
    border: var(--border);
}

.login-shapes .s1 { width: 280px; height: 280px; right: -90px; top: -80px; border-radius: 50%; background: var(--rose); }
.login-shapes .s2 { width: 150px; height: 150px; left: -50px; bottom: -40px; border-radius: 40px; background: var(--sun); transform: rotate(16deg); }
.login-shapes .s3 { width: 120px; height: 120px; right: 34%; bottom: -60px; border-radius: 50%; background: var(--mint); }
.login-shapes .s4 { width: 54px; height: 54px; left: 46%; top: 40px; border-radius: 16px; background: var(--sky); transform: rotate(-12deg); }

@keyframes lynkRise {
    from { opacity: 0; transform: translateY(26px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 1040px) {
    .login-page {
        grid-template-columns: minmax(0, 480px);
        grid-template-areas: "hero" "card";
        justify-content: center;
        align-items: start;
        gap: 22px;
    }

    .login-hero {
        min-height: 0;
    }

    .login-hero-mark {
        margin-bottom: 18px;
    }

    .login-hero h2 {
        font-size: clamp(38px, 11vw, 60px);
        max-width: 12ch;
        margin-bottom: 14px;
    }

    .login-stickers {
        display: none;
    }

    .login-card .logo {
        display: none;
    }

    .login-shapes .s1 { width: 190px; height: 190px; right: -70px; top: -60px; }
    .login-shapes .s2,
    .login-shapes .s3 { display: none; }
}

/* Pages de configuration du profil */
.profile-setup-card {
    border-radius: 30px;
    box-shadow: 0 8px 0 var(--ink);
}

.profile-brand {
    color: var(--ink);
}

.setup-header p {
    color: var(--ink-soft);
    font-size: 15px;
}

/* ---------- Récompenses, badges, classements ---------- */

.rewards-kicker {
    display: inline-block;
    margin-bottom: 12px;
    padding: 5px 12px;
    border: var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    transform: rotate(-2deg);
}

.rewards-hero,
.badges-intro-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: var(--sun);
    border: var(--border);
    border-radius: 32px;
    box-shadow: 0 8px 0 var(--ink);
}

.badges-intro-card {
    background: var(--sky);
}

.rewards-hero::before {
    background: var(--rose);
    border: var(--border);
    opacity: 1;
    width: 230px;
    height: 230px;
    right: -60px;
    top: -90px;
    z-index: -1;
}

.rewards-hero::after {
    background: var(--mint);
    border: var(--border);
    width: 120px;
    height: 120px;
    right: 150px;
    bottom: -70px;
    z-index: -1;
}

.rewards-hero h2,
.badges-intro-card h2 {
    font-size: clamp(28px, 3.6vw, 44px);
    letter-spacing: -.045em;
    color: var(--ink);
}

.rewards-hero p,
.badges-intro-card p {
    color: var(--ink);
    font-weight: 500;
    font-size: 16px;
}

.rewards-badges-button {
    background: var(--ink) !important;
    color: #fff !important;
    border: var(--border) !important;
    border-radius: 18px !important;
    box-shadow: 0 4px 0 var(--violet-deep) !important;
}

.rewards-badges-button::before {
    display: none;
}

.rewards-badges-button:hover {
    background: var(--violet-deep) !important;
    box-shadow: 0 6px 0 var(--ink) !important;
}

.rewards-stat-card {
    border-radius: 22px;
}

.rewards-stat-icon,
.rewards-info-icon {
    border: var(--border);
    border-radius: 16px !important;
    background: var(--sun);
}

.rewards-stat-card:nth-child(2) .rewards-stat-icon { background: var(--rose-soft); }
.rewards-stat-card:nth-child(3) .rewards-stat-icon { background: var(--mint-soft); }
.rewards-stat-card:nth-child(4) .rewards-stat-icon { background: var(--sky-soft); }

.rewards-stat-card strong {
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: -.03em;
    color: var(--ink);
}

.rewards-stat-card div span,
.rewards-section-heading p,
.rewards-info-card p,
.mission-card p,
.mission-card small,
.special-badge-card span,
.badge-card > span {
    color: var(--ink-soft);
}

.rewards-stat-card div span {
    font-size: 13px;
}

.rewards-section-heading h2 {
    font-size: clamp(20px, 2.4vw, 26px);
}

.rewards-section-heading p {
    display: block;
    margin-top: 8px;
    font-size: 15px;
}

.mission-card {
    border-radius: 26px;
}

.mission-card.is-complete {
    border-color: var(--ink);
    background: var(--violet-soft);
    box-shadow: var(--lift);
}

.mission-badge-image,
.badge-card-image,
.special-badge-image {
    border: var(--border);
    background: var(--sun-soft);
}

.mission-card:nth-child(3n+2) .mission-badge-image,
.badge-card:nth-child(4n+2) .badge-card-image { background: var(--rose-soft); }
.mission-card:nth-child(3n+3) .mission-badge-image,
.badge-card:nth-child(4n+3) .badge-card-image { background: var(--mint-soft); }
.badge-card:nth-child(4n+4) .badge-card-image { background: var(--sky-soft); }

.mission-badge-image {
    border-radius: 22px !important;
}

.mission-complete-check,
.badge-equipped-check {
    background: var(--mint);
    color: var(--ink);
    border: 2px solid var(--ink);
    width: 26px;
    height: 26px;
    box-shadow: none;
}

.mission-status,
.mission-check-label {
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 800;
    color: var(--muted);
}

.mission-check-label {
    color: var(--violet-deep);
}

.mission-card h3 {
    font-size: 16px;
    color: var(--ink);
}

.mission-card p {
    font-size: 14px;
}

.mission-progress {
    height: 14px;
    border: var(--border);
    background: #fff;
}

.mission-progress span {
    background: repeating-linear-gradient(135deg, var(--violet) 0 8px, var(--violet-deep) 8px 16px);
    border-right: 2px solid var(--ink);
}

.mission-progress span[style*="width:0"],
.mission-progress span[style*="width: 0"] {
    border-right: 0;
}

.special-badge-card {
    border-radius: 20px;
    box-shadow: var(--lift-sm);
}

.special-badge-card strong,
.badge-card strong {
    color: var(--ink);
    font-size: 14px;
}

.special-badge-card span {
    font-size: 13px;
}

.rewards-info-card {
    background: var(--violet-soft);
    border-radius: 24px;
}

.rewards-info-card strong {
    color: var(--ink);
    font-size: 15px;
}

.reward-empty-card,
.reward-loading-card {
    border: 2px dashed var(--ink);
    background: rgba(255, 255, 255, .72);
    color: var(--ink-soft);
}

.badge-card {
    border-radius: 24px;
}

.badge-card.is-equipped {
    border: var(--border);
    background: var(--violet-soft);
    box-shadow: 0 5px 0 var(--violet-deep);
}

.badge-card.is-equipped:hover {
    box-shadow: 0 8px 0 var(--violet-deep);
}

.badge-lock {
    background: var(--ink);
    border: 2px solid #fff;
}

.equipped-preview {
    border-radius: 22px;
    box-shadow: var(--lift-sm);
    color: var(--ink-soft);
}

.equipped-preview div strong {
    color: var(--ink);
}

.ranking-card {
    border-radius: 28px;
}

.ranking-card-header h2 {
    font-size: clamp(19px, 2.2vw, 24px);
}

.ranking-row {
    border: var(--border);
    border-radius: 18px;
    background: #fff;
}

.ranking-position {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--ink);
}

.ranking-avatar {
    border: var(--border);
    background: var(--sun);
    color: var(--ink);
    font-family: var(--font-display);
}

.ranking-user span {
    color: var(--ink-soft);
}

.ranking-value {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--violet-deep);
}

.ranking-top-1 { background: var(--sun); }
.ranking-top-2 { background: var(--sky-soft); }
.ranking-top-3 { background: var(--rose-soft); }

.ranking-top-1 .ranking-value { color: var(--ink); }

.ranking-top-1 .ranking-avatar { background: #fff; }
.ranking-top-2 .ranking-avatar,
.ranking-top-3 .ranking-avatar { background: #fff; }

.discover-interest {
    border: 2px solid var(--ink);
    background: var(--violet-soft);
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    border-radius: 999px;
    padding: 5px 12px;
}

.discover-interest:nth-child(4n+2) { background: var(--sun-soft); }
.discover-interest:nth-child(4n+3) { background: var(--mint-soft); }
.discover-interest:nth-child(4n+4) { background: var(--rose-soft); }

.discover-loader {
    color: var(--ink);
}

.discover-loader-dot {
    background: var(--violet);
    border: 2px solid var(--ink);
    width: 13px;
    height: 13px;
}

/* ---------- Fenêtres, notifications, messages ---------- */

.lynk-modal {
    background: rgba(27, 19, 64, .58);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.lynk-modal-card {
    border-radius: 28px;
    box-shadow: 0 8px 0 var(--ink);
}

.lynk-notification-backdrop {
    background: rgba(27, 19, 64, .58);
}

.lynk-notification-sheet {
    border-radius: 30px;
    box-shadow: 0 8px 0 var(--ink);
}

.lynk-notification-kicker {
    color: var(--violet-deep);
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 800;
}

.lynk-notification-sheet h2 {
    color: var(--ink);
}

.lynk-notification-sheet p {
    color: var(--ink-soft);
}

.lynk-notification-close {
    background: #fff;
    border: var(--border);
    color: var(--ink);
    box-shadow: var(--lift-sm);
}

.lynk-notification-close:hover {
    background: var(--sun);
}

.lynk-notification-icon,
.leave-confirm-icon,
.lynk-notification-card-icon {
    border: var(--border);
    background: var(--violet-soft);
    color: var(--violet-deep);
    border-radius: 18px;
}

.lynk-notification-card {
    padding: 18px 20px;
    border-radius: 22px;
}

.lynk-notification-card.is-unread {
    background: var(--sun-soft);
    border-color: var(--ink);
}

.lynk-notification-card-dot {
    background: var(--rose);
    border: 2px solid var(--ink);
    width: 14px;
    height: 14px;
    flex-basis: 14px;
}

.lynk-notification-card-content strong {
    color: var(--ink);
    font-size: 16px;
}

.lynk-notification-card-content span {
    color: var(--ink-soft);
    font-size: 14px;
}

.lynk-notification-card-content small {
    color: var(--muted);
    font-size: 12px;
}

.leave-confirm-card p,
.lynk-logout-text {
    color: var(--ink-soft);
    font-size: 14px;
}

.lynk-logout-title {
    color: var(--ink);
}

.lynk-logout-sheet {
    border-radius: 26px;
}

.danger-icon {
    background: var(--rose-soft) !important;
    color: #8F1239 !important;
}

.lynk-toast {
    background: var(--ink);
    color: #fff;
    border: 2px solid var(--ink);
    border-radius: 18px;
    box-shadow: 0 5px 0 var(--violet);
    font-size: 14px;
}

.lynk-toast.is-success { box-shadow: 0 5px 0 var(--mint); background: var(--ink); }
.lynk-toast.is-error { box-shadow: 0 5px 0 var(--rose); background: var(--ink); }

.lynk-toast-icon {
    background: rgba(255, 255, 255, .16);
}

/* Discussion : la messagerie suit toujours la couleur choisie dans Personnalisation. */
.chat-page #messagesContainer .chat-message-row > div > div[style*="border-radius"] {
    /* La couleur des messages envoyés est appliquée par chat.js via --accent. */
}

.chat-page #messageForm .login-button {
    background: var(--accent, var(--violet));
}

.chat-page #messageForm .login-button:hover {
    background: var(--violet-deep);
}

/* Discussion : zone de saisie */
#messageForm {
    background: #fff !important;
    border: var(--border) !important;
    border-radius: 22px !important;
    box-shadow: var(--lift-sm);
    padding: 10px 10px 10px 14px !important;
}

#messageInput {
    font-size: 16px !important;
    font-weight: 500;
    background: #fff !important;
    color: var(--ink) !important;
    border-radius: 10px !important;
    padding: 5px 10px !important;
    caret-color: var(--ink) !important;
}

#messageInput::placeholder {
    color: #bdbdbd !important;
    opacity: 1;
}

#messageForm .login-button {
    border-radius: 16px;
}

#typingIndicator {
    color: var(--muted) !important;
    font-size: 13px !important;
    font-weight: 600;
}

/* ---------- Mobile ---------- */

@media (max-width: 750px) {
    .topbar {
        padding: 22px 18px 0;
        min-height: 86px;
    }

    .content {
        padding: 22px 16px 70px;
    }

    .welcome-card {
        margin-bottom: 40px;
    }

    .sidebar::before { width: 150px; height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
    .welcome-art img,
    .login-hero h2 {
        animation: none;
    }

    .nav-item:hover span:first-child {
        transform: none;
    }
}

/* =========================================================
   MESSAGES DANS LES FORMULAIRES
   Les erreurs et confirmations affichées sous un champ
   reprennent le style des notifications Lynk.
   ========================================================= */

#errorMessage:not(.empty-card),
#successMessage,
#requestError,
#requestSuccess,
#announcementError,
#composerError,
#membersError,
#messageReportError,
#groupError,
#reportError,
#photoMessage,
#characterMessage,
#friendMessage {
    position: relative;
    padding: 12px 14px 12px 54px !important;
    border: var(--border);
    border-radius: 16px;
    background: var(--rose-soft);
    color: var(--ink) !important;
    font-size: 14px !important;
    font-weight: 700;
    line-height: 1.45;
    box-shadow: var(--lift-sm);
    text-align: left;
}

#errorMessage:not(.empty-card):empty,
#successMessage:empty,
#requestError:empty,
#requestSuccess:empty,
#announcementError:empty,
#composerError:empty,
#membersError:empty,
#messageReportError:empty,
#groupError:empty,
#reportError:empty,
#photoMessage:empty,
#characterMessage:empty,
#friendMessage:empty {
    display: none !important;
}

#errorMessage:not(.empty-card)::before,
#successMessage::before,
#requestError::before,
#requestSuccess::before,
#announcementError::before,
#composerError::before,
#membersError::before,
#messageReportError::before,
#groupError::before,
#reportError::before,
#photoMessage::before,
#characterMessage::before,
#friendMessage::before {
    content: "!";
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--rose);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
}

/* Confirmations */
#successMessage,
#requestSuccess,
[data-state="success"] {
    background: var(--mint-soft) !important;
}

#successMessage::before,
#requestSuccess::before,
[data-state="success"]::before {
    content: "\2713";
    background: var(--mint);
}

/* Confirmations de demande d'ami : petite barre verte */
#friendMessage {
    background: var(--mint-soft);
}

#friendMessage::before {
    content: "\2713";
    background: var(--mint);
}

/* Les erreurs du message d'ami restent en rose. */
#friendMessage[data-state="error"] {
    background: var(--rose-soft) !important;
}

#friendMessage[data-state="error"]::before {
    content: "!";
    background: var(--rose);
}

[data-state="error"] {
    background: var(--rose-soft) !important;
}

[data-state="error"]::before {
    content: "!";
    background: var(--rose);
}

/* =========================================================
   NOTIFICATIONS ET FENÊTRES (js/lynk-ui.js)
   ========================================================= */

.lynk-ui-stack {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 30000;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.lynk-ui-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 12px 13px 14px;
    border: var(--border);
    border-radius: 20px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 5px 0 var(--ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(24px) scale(.96);
    transition: opacity .22s ease, transform .34s cubic-bezier(.2, 1.3, .4, 1);
}

.lynk-ui-toast.is-visible {
    opacity: 1;
    transform: none;
}

.lynk-ui-toast.is-leaving {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity .22s ease, transform .3s ease;
}

.lynk-ui-toast-icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: var(--border);
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
}

.lynk-ui-toast.is-success .lynk-ui-toast-icon { background: var(--mint); }
.lynk-ui-toast.is-error .lynk-ui-toast-icon { background: var(--rose); }
.lynk-ui-toast.is-info .lynk-ui-toast-icon { background: var(--sun); }

.lynk-ui-toast.is-error { background: var(--rose-soft); }
.lynk-ui-toast.is-success { background: var(--mint-soft); }
.lynk-ui-toast.is-info { background: var(--sun-soft); }

.lynk-ui-toast-text {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.lynk-ui-toast-close {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.lynk-ui-toast-close:hover {
    background: rgba(27, 19, 64, .12);
    transform: none;
    box-shadow: none;
}

.lynk-ui-backdrop {
    position: fixed;
    inset: 0;
    z-index: 29000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(27, 19, 64, .6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .22s ease;
}

.lynk-ui-backdrop.is-open { opacity: 1; }
.lynk-ui-backdrop.is-closing { opacity: 0; }

.lynk-ui-dialog {
    width: min(440px, 100%);
    padding: 30px 28px 26px;
    border: var(--border);
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 8px 0 var(--ink);
    text-align: center;
    transform: translateY(26px) scale(.95);
    transition: transform .34s cubic-bezier(.2, 1.3, .4, 1);
}

.lynk-ui-backdrop.is-open .lynk-ui-dialog { transform: none; }
.lynk-ui-backdrop.is-closing .lynk-ui-dialog { transform: translateY(14px) scale(.97); }

.lynk-ui-dialog-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border: var(--border);
    border-radius: 20px;
    background: var(--sun);
    box-shadow: var(--lift-sm);
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    transform: rotate(-5deg);
}

.lynk-ui-dialog-icon.is-danger { background: var(--rose); }

.lynk-ui-dialog-title {
    font-size: 21px;
    margin-bottom: 10px;
}

.lynk-ui-dialog-message {
    margin: 0 auto 22px;
    max-width: 34ch;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.55;
}

.lynk-ui-dialog-label {
    display: block;
    margin: 4px 0 8px;
    text-align: left;
    font-weight: 800;
    font-size: 15px;
}

.lynk-ui-dialog-input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: var(--border);
    border-radius: 16px;
    background: #fff;
    color: var(--ink);
    font-size: 16px;
    font-weight: 500;
}

.lynk-ui-dialog-input:focus {
    outline: none;
    box-shadow: 0 4px 0 var(--violet);
}

.lynk-ui-dialog-error {
    margin-top: 10px;
    padding: 9px 12px;
    border: var(--border);
    border-radius: 12px;
    background: var(--rose-soft);
    font-size: 14px;
    font-weight: 700;
    text-align: left;
}

.lynk-ui-dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 22px;
}

.lynk-ui-dialog-actions > button {
    flex: 1 1 0;
    min-height: 50px;
}

.lynk-ui-locked {
    overflow: hidden;
}

@media (max-width: 520px) {
    .lynk-ui-stack {
        right: 16px;
        left: 16px;
        bottom: 16px;
        width: auto;
    }

    .lynk-ui-dialog-actions {
        flex-direction: column-reverse;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lynk-ui-toast,
    .lynk-ui-dialog,
    .lynk-ui-backdrop {
        transition: none;
    }
}

/* ---------- Page Match : blocs plus compacts ---------- */

.match-page .welcome-card {
    min-height: 0;
    padding: 20px 24px;
    margin-bottom: 18px;
    border-radius: 22px;
    box-shadow: 0 5px 0 var(--ink);
}

.match-page .welcome-small {
    margin-bottom: 10px;
    padding: 4px 11px;
    font-size: 12px;
}

.match-page .welcome-card h2 {
    font-size: clamp(20px, 2.6vw, 28px);
    margin-bottom: 8px;
}

.match-page .welcome-card p {
    max-width: none;
    font-size: 14px;
    line-height: 1.5;
}

.match-page .discover-match-button {
    min-height: 44px;
    margin-top: 14px;
    font-size: 14px;
    border-radius: 14px;
}

.match-page .section-header {
    margin-bottom: 12px;
}

.match-page .empty-card {
    padding: 22px 20px;
}

.match-page .empty-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 10px;
    border-radius: 15px;
    font-size: 20px;
}

.match-page .empty-card h3 {
    font-size: 15px;
}

.match-page .empty-card p {
    font-size: 13px;
}

.match-page .profile-card {
    padding: 14px 16px;
    gap: 14px;
    margin-bottom: 12px;
    border-radius: 20px;
}

.match-page .profile-avatar {
    width: 52px;
    height: 52px;
    min-width: 52px;
    font-size: 20px;
}

.match-page .profile-card p {
    font-size: 13px;
}

.match-page .discover-interest {
    padding: 3px 10px;
    font-size: 12px;
}

@media (max-width: 760px) {
    .match-page .welcome-card {
        padding: 18px 18px;
    }
}

/* =========================================================
   LYNK — MODE SOMBRE
   Le mode clair reste le thème par défaut.
   ========================================================= */

html[data-theme="dark"] {
    color-scheme: dark;
    /* La couleur de police du thème sombre reprend EXACTEMENT celle du bouton
       « Voir tout son emploi du temps » (var(--violet-deep)). */
    --ink: var(--violet-deep);
    --ink-soft: #B8A0F0;
    --muted: #9C86CE;
    --paper: #150E27;
    --card: #261B4A;
    --violet: #4C1D95;
    --violet-deep: #3B1177;
    --violet-soft: #30234F;
    --sun: #FFD84D;
    --sun-soft: #4B3D0B;
    --rose: #FF6A9D;
    --rose-soft: #4B1F31;
    --mint: #43DDA8;
    --mint-soft: #173E32;
    --sky: #70BFFF;
    --sky-soft: #19344A;
    --border: 2px solid #473A62;
    --lift: 0 5px 0 #08050E;
    --lift-sm: 0 3px 0 #08050E;
}

html[data-theme="dark"] body {
    color: var(--ink);
    background-color: var(--paper);
    background-image: radial-gradient(rgba(255,255,255,.055) 1.3px, transparent 1.5px);
}

html[data-theme="dark"] .main-content,
html[data-theme="dark"] .content,
html[data-theme="dark"] .profile-page,
html[data-theme="dark"] .login-page,
html[data-theme="dark"] .app {
    color: var(--ink);
}

html[data-theme="dark"] .sidebar {
    background: #090611;
    color: #D6C0FF;
}

html[data-theme="dark"] .sidebar::before {
    background: #5B21D6;
}

html[data-theme="dark"] .sidebar::after {
    border-color: #FF5C93;
}

html[data-theme="dark"] .nav-item {
    color: rgba(214, 192, 255, .78);
}

html[data-theme="dark"] .nav-item:hover {
    background: rgba(214, 192, 255, .10);
    color: #D6C0FF;
}

html[data-theme="dark"] .nav-item.active {
    color: #3E1F91;
}

html[data-theme="dark"] .welcome-card,
html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .empty-card,
html[data-theme="dark"] .mission-card,
html[data-theme="dark"] .badge-card,
html[data-theme="dark"] .special-badge-card,
html[data-theme="dark"] .badges-intro-card,
html[data-theme="dark"] .reward-empty-card,
html[data-theme="dark"] .reward-loading-card,
html[data-theme="dark"] .discover-match-card,
html[data-theme="dark"] .search-card,
html[data-theme="dark"] .mailbox-loading-card,
html[data-theme="dark"] .lynk-notification-card,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .admin-card,
html[data-theme="dark"] .conversation-settings-card,
html[data-theme="dark"] .chat-card {
    background: var(--card);
    color: var(--ink);
    border-color: #473A62;
}

html[data-theme="dark"] .welcome-card h1,
html[data-theme="dark"] .welcome-card h2,
html[data-theme="dark"] .profile-card h2,
html[data-theme="dark"] .profile-card h3,
html[data-theme="dark"] .empty-card h3,
html[data-theme="dark"] .section-header h2,
html[data-theme="dark"] .mission-card h3,
html[data-theme="dark"] .badge-card strong,
html[data-theme="dark"] .special-badge-card strong,
html[data-theme="dark"] .lynk-notification-card strong {
    color: var(--ink);
}

html[data-theme="dark"] p,
html[data-theme="dark"] small,
html[data-theme="dark"] label,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .section-header p {
    color: var(--ink-soft);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background: #2A1E4A;
    color: #E7DDFF;
    border-color: #55476F;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #9C92B8;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
    border-color: #A78BFA;
    box-shadow: 0 0 0 3px rgba(139,92,246,.20);
}

html[data-theme="dark"] option {
    background: #2A1E4A;
    color: #E7DDFF;
}

html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .secondary-button:hover {
    background: #2E2154;
    color: #D6C0FF;
    border-color: #55476F;
}

html[data-theme="dark"] .lynk-notification-card.is-unread {
    background: #2E2154;
}

html[data-theme="dark"] .lynk-notification-card:hover,
html[data-theme="dark"] .profile-card:hover,
html[data-theme="dark"] .welcome-card:hover,
html[data-theme="dark"] .mission-card:hover,
html[data-theme="dark"] .badge-card:not(:disabled):hover {
    background: #2E2154;
}

html[data-theme="dark"] .modal,
html[data-theme="dark"] .lynk-modal,
html[data-theme="dark"] .modal-overlay {
    background: rgba(0,0,0,.72);
}

html[data-theme="dark"] .lynk-modal-card,
html[data-theme="dark"] .modal-content {
    background: #261B4A;
    color: var(--ink);
    border-color: #473A62;
}

html[data-theme="dark"] .chat-bubble,
html[data-theme="dark"] .message-bubble {
    color: #E7DDFF;
}

html[data-theme="dark"] .message-input,
html[data-theme="dark"] #messageInput {
    background: #2A1E4A !important;
    color: #E7DDFF !important;
    caret-color: #E7DDFF !important;
    border-color: #473A62 !important;
}

html[data-theme="dark"] .empty-icon,
html[data-theme="dark"] .profile-avatar,
html[data-theme="dark"] .avatar {
    border-color: #55476F;
}

html[data-theme="dark"] table,
html[data-theme="dark"] th,
html[data-theme="dark"] td {
    border-color: #473A62;
}

html[data-theme="dark"] .table-row:hover,
html[data-theme="dark"] tr:hover {
    background: rgba(139,92,246,.08);
}

html[data-theme="dark"] .theme-choice {
    background: #2A1E4A;
    color: #D6C0FF;
    border-color: #55476F;
}

html[data-theme="dark"] .theme-choice:hover {
    background: #34265A;
}

html[data-theme="dark"] .theme-choice.is-selected {
    background: #3A2860;
    border-color: #A78BFA;
    box-shadow: 0 0 0 3px rgba(139,92,246,.15);
}

/* Réduit les flashs lors d'un changement de thème. */
html[data-theme="dark"] .loading,
html[data-theme="dark"] .loader-container {
    color: var(--ink);
}


/* ---------- Série de connexion ---------- */

.login-streak-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    margin: -20px 0 48px;
    padding: 18px 20px;
    background: var(--card);
    color: var(--ink);
    border: var(--border);
    border-radius: 22px;
    box-shadow: var(--lift-sm);
    overflow: hidden;
    transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease;
}

.login-streak-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.12) 50%, transparent 65%);
    transform: translateX(-130%);
    transition: transform .55s ease;
}

.login-streak-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 0 rgba(0,0,0,.08), 0 18px 30px rgba(0,0,0,.08);
}

.login-streak-card:hover::after {
    transform: translateX(130%);
}

.login-streak-icon {
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--violet-soft);
    border: 2px solid var(--ink);
    box-shadow: 0 8px 18px rgba(0,0,0,.12);
    transition: transform .28s cubic-bezier(.34,1.56,.64,1), box-shadow .28s ease;
}

.login-streak-card:hover .login-streak-icon {
    transform: translateY(-2px) rotate(-3deg) scale(1.06);
    box-shadow: 0 10px 22px rgba(0,0,0,.14);
}

.login-streak-card:hover .lynk-streak-badge-image {
    animation: lynk-streak-card-flame .65s cubic-bezier(.34,1.56,.64,1);
}

.lynk-streak-badge-image {
    width: 42px;
    height: 46px;
    object-fit: contain;
    display: block;
    flex: 0 0 auto;
    opacity: 1;
    filter: none;
}

/* Gel de série : la flamme de la carte devient bleu clair. */
.lynk-streak-badge-image.is-frozen {
    filter: hue-rotate(165deg) saturate(1.35) brightness(1.18);
}

.login-streak-freezes {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    color: #2E7DD1;
    font-size: 12px;
    font-weight: 800;
}
html[data-theme="dark"] .login-streak-freezes { color: #9BD3FF; }
.login-streak-freezes[hidden] { display: none; }

.lynk-streak-toast-image {
    width: 26px;
    height: 30px;
    object-fit: contain;
    display: block;
}

.lynk-badge-streak {
    width: 24px;
    height: 28px;
    object-fit: contain;
    display: inline-block;
    flex: 0 0 auto;
}

.login-streak-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.login-streak-kicker {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.login-streak-copy strong {
    font-family: var(--font-display);
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.2;
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
}

.login-streak-card:hover [data-login-streak-value] {
    animation: lynk-streak-card-number .5s cubic-bezier(.34,1.56,.64,1);
}

@keyframes lynk-streak-card-flame {
    0% { transform: scale(1) rotate(0); }
    35% { transform: scale(1.14) rotate(5deg); }
    65% { transform: scale(.98) rotate(-3deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes lynk-streak-card-number {
    0% { transform: translateY(0); }
    45% { transform: translateY(-3px) scale(1.06); }
    100% { transform: translateY(0) scale(1); }
}

.login-streak-copy p {
    margin: 3px 0 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.login-streak-link {
    margin-left: auto;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 15px;
    border-radius: 14px;
    background: transparent;
    color: var(--ink);
    border: 2px solid var(--ink);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 4px 0 rgba(0,0,0,.12);
    transition: transform .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.login-streak-link:hover {
    transform: translateY(-2px);
    background: var(--ink);
    color: var(--card);
    box-shadow: 0 6px 0 rgba(0,0,0,.12);
}

.login-streak-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 0 rgba(0,0,0,.12);
}

.login-streak-link-arrow {
    font-size: 17px;
    line-height: 1;
}

 .lynk-badge-streak {
    margin: 0 2px;
    vertical-align: middle;
}

.lynk-streak-toast-icon {
    display: grid;
    place-items: center;
}

@media (prefers-reduced-motion: reduce) {
    .login-streak-card,
    .login-streak-icon {
        transition: none;
    }

    .login-streak-card::after,
    .login-streak-card:hover .lynk-streak-badge-image,
    .login-streak-card:hover [data-login-streak-value] {
        animation: none;
        transition: none;
    }
}

@media (max-width: 620px) {
    .login-streak-card {
        align-items: flex-start;
        flex-wrap: wrap;
        margin-top: -12px;
    }

    .login-streak-link {
        margin-left: 0;
        margin-top: 2px;
    }
}

html[data-theme="dark"] .login-streak-icon {
    background: #2A1E4A;
    border-color: #55476F;
}

/* Le badge fourni par l'utilisateur est noir en thème clair et blanc en thème sombre. */
html[data-theme="dark"] .lynk-streak-badge-image,
html[data-theme="dark"] .lynk-streak-toast-image,
html[data-theme="dark"] .lynk-badge-streak {
    filter: brightness(0) invert(1);
}

html[data-theme="dark"] .login-streak-link {
    border-color: #8F83AE;
    color: #D6C0FF;
}

html[data-theme="dark"] .login-streak-link:hover {
    background: #261B4A;
    color: #F4ECFF;
}

/* ---------- Sélecteur de thème ---------- */
.theme-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.theme-choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    min-height: 86px;
    padding: 12px 42px 12px 12px;
    border: 2px solid #D8D0E9;
    border-radius: 18px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.theme-choice:hover {
    transform: translateY(-3px);
    border-color: var(--violet);
    box-shadow: 0 7px 18px rgba(124,58,237,.14);
}

.theme-choice:active {
    transform: translateY(0);
}

.theme-choice.is-selected {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}

.theme-choice-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.theme-choice-text strong {
    font-size: 16px;
}

.theme-choice-text small {
    color: var(--muted);
    line-height: 1.3;
}

.theme-choice-check {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    background: var(--violet);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    opacity: 0;
    transform: scale(.7);
    transition: opacity .18s ease, transform .18s ease;
}

.theme-choice.is-selected .theme-choice-check {
    opacity: 1;
    transform: scale(1);
}

.theme-choice-preview {
    position: relative;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid rgba(27,19,64,.14);
}

.theme-choice-preview span {
    position: absolute;
    display: block;
    border-radius: 5px;
}

.theme-choice-preview span:nth-child(1) {
    left: 6px;
    top: 7px;
    width: 15px;
    height: 44px;
}

.theme-choice-preview span:nth-child(2) {
    left: 26px;
    top: 9px;
    width: 25px;
    height: 10px;
}

.theme-choice-preview span:nth-child(3) {
    left: 26px;
    top: 24px;
    width: 25px;
    height: 27px;
}

.theme-choice-preview-light {
    background: #F4EFFF;
}

.theme-choice-preview-light span:nth-child(1) { background: #1B1340; }
.theme-choice-preview-light span:nth-child(2) { background: #FFD23F; }
.theme-choice-preview-light span:nth-child(3) { background: #fff; border: 1px solid #D8D0E9; }

.theme-choice-preview-dark {
    background: #0F0B18;
}

.theme-choice-preview-dark span:nth-child(1) { background: #090611; }
.theme-choice-preview-dark span:nth-child(2) { background: #FFD84D; }
.theme-choice-preview-dark span:nth-child(3) { background: #19142A; border: 1px solid #473A62; }

@media (max-width: 650px) {
    .theme-choices {
        grid-template-columns: 1fr;
    }
}

/* ---------- Aperçu de la position de la barre latérale ---------- */
.sidebar-side-preview-right span:nth-child(1) { left: auto; right: 6px; }
.sidebar-side-preview-right span:nth-child(2),
.sidebar-side-preview-right span:nth-child(3) { left: 6px; }

/* ---------- Barre latérale à droite (préférence d'affichage) ---------- */
html[data-sidebar-side="right"] .sidebar { order: 2; }
html[data-sidebar-side="right"] .main-content { order: 1; }
html[data-sidebar-side="right"] .sidebar .sidebar-toggle { right: auto !important; left: 10px !important; }
html[data-sidebar-side="right"] .sidebar.collapsed .sidebar-toggle { right: auto !important; left: 9px !important; }
html[data-sidebar-side="right"] .sidebar::before { left: auto; right: -96px; }
html[data-sidebar-side="right"] .sidebar::after { right: auto; left: -44px; }

/* ---------- Taille du texte (échelle de l'interface) ---------- */
/* On zoome le conteneur de contenu (sans hauteur fixe) : les tailles du CSS
   étant en pixels, `zoom` est la seule façon de les agrandir, et zoomer
   `.content` évite tout débordement avec la mise en page 100dvh de l'app. */
html[data-font-size="small"] .content { zoom: 0.9; }
html[data-font-size="large"] .content { zoom: 1.12; }
html[data-font-size="xlarge"] .content { zoom: 1.25; }

/* Le chat a une mise en page à hauteur calculée (min-height: 100vh - topbar) :
   on ne zoome pas son contenu pour garder la zone de saisie visible. */
html[data-font-size] body.chat-page .content { zoom: 1; }

/* Aperçu de la taille du texte (carré « Aa ») */
.font-size-preview {
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    border: 2px solid rgba(27,19,64,.14);
    background: var(--card, #fff);
    color: var(--ink);
    font-weight: 800;
    line-height: 1;
    overflow: hidden;
}
.font-size-preview-small { font-size: 15px; }
.font-size-preview-normal { font-size: 20px; }
.font-size-preview-large { font-size: 25px; }
.font-size-preview-xlarge { font-size: 30px; }

/* ---------- Croix « Retour à la connexion » (page Créer ton profil) ---------- */
.profile-setup-card { position: relative; }

.setup-close-button {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: color-mix(in srgb, var(--violet, #7C3AED) 12%, transparent);
    color: var(--violet, #7C3AED);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
    z-index: 5;
}

.setup-close-button:hover {
    background: color-mix(in srgb, var(--violet, #7C3AED) 20%, transparent);
}

.setup-close-button:active { transform: scale(.94); }
.setup-close-button:disabled { opacity: .55; cursor: default; }

/* ---------- Badge Collectionneur : variante du thème sombre ---------- */
/* En mode clair, Lynk continue d'utiliser badge-carrot.png. */
html[data-theme="dark"] img[src$="badge-carrot.png"] {
    content: url("../assets/badge-carrot-dark.png");
}

/* En mode sombre, les icônes des badges passent en blanc pour rester lisibles.
   Le filtre est appliqué à l'image elle-même (et non à son conteneur) afin de
   conserver un fond transparent : seuls les tracés du badge deviennent blancs.
   On cible aussi bien les images portant directement la classe .lynk-badge-icon
   que celles imbriquées dans .lynk-badges. */
html[data-theme="dark"] .badge-card-image img,
html[data-theme="dark"] .special-badge-image img,
html[data-theme="dark"] .mission-badge-image img,
html[data-theme="dark"] .equipped-preview img,
html[data-theme="dark"] .profile-meta-icon img,
html[data-theme="dark"] .lynk-badge-icon,
html[data-theme="dark"] .lynk-badge-icon img,
html[data-theme="dark"] .lynk-badges img {
    filter: brightness(0) invert(1);
}

/* Exception : le badge « Vérifié » (check.png) garde toujours son apparence
   d'origine, même lorsque le mode sombre est actif. */
html[data-theme="dark"] img[src$="check.png"],
html[data-theme="dark"] .lynk-badge-icon[src$="check.png"],
html[data-theme="dark"] .lynk-badge-icon img[src$="check.png"],
html[data-theme="dark"] .lynk-badges img[src$="check.png"],
html[data-theme="dark"] .badge-card-image img[src$="check.png"] {
    filter: none !important;
}

/* Exception : le badge « Professeur » (badge-prof.png) garde lui aussi ses
   couleurs d'origine en mode sombre, comme le badge « Vérifié ». */
html[data-theme="dark"] img[src$="badge-prof.png"],
html[data-theme="dark"] .lynk-badge-icon[src$="badge-prof.png"],
html[data-theme="dark"] .lynk-badge-icon img[src$="badge-prof.png"],
html[data-theme="dark"] .lynk-badges img[src$="badge-prof.png"],
html[data-theme="dark"] .badge-card-image img[src$="badge-prof.png"] {
    filter: none !important;
}

/* ---------- Classement intégré aux récompenses ---------- */
.rewards-ranking-section { margin-top: 28px; }
.ranking-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
}
.ranking-sort-button {
    appearance: none;
    border: var(--border);
    border-radius: 999px;
    background: var(--card, #fff);
    color: var(--ink);
    padding: 10px 16px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.ranking-sort-button:hover { transform: translateY(-2px); box-shadow: var(--lift-sm); }
.ranking-sort-button.is-active { background: var(--violet-soft); color: var(--violet-deep); box-shadow: var(--lift-sm); }
.rewards-ranking-card { padding: 14px; }
.rewards-ranking-list {
    max-height: 620px;
    overflow-y: auto;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--violet) transparent;
}
.rewards-ranking-list::-webkit-scrollbar { width: 9px; }
.rewards-ranking-list::-webkit-scrollbar-track { background: transparent; }
.rewards-ranking-list::-webkit-scrollbar-thumb { background: var(--violet); border: 2px solid transparent; background-clip: padding-box; border-radius: 999px; }
.rewards-ranking-list .ranking-row { min-height: 64px; }
@media (max-width: 650px) {
    .ranking-controls { display: grid; grid-template-columns: 1fr; }
    .ranking-sort-button { width: 100%; text-align: left; }
    .rewards-ranking-list { max-height: 540px; }
    .rewards-ranking-list .ranking-row { grid-template-columns: 30px 40px minmax(0,1fr) auto; gap: 8px; padding: 10px 8px; }
    .rewards-ranking-list .ranking-avatar { width: 40px; height: 40px; }
    .rewards-ranking-list .ranking-value { font-size: 12px; }
}

/* Thème sombre : les caractères dans les avatars restent sombres pour garder le contraste avec les fonds d'avatar. */
html[data-theme="dark"] .profile-avatar,
html[data-theme="dark"] .profile-avatar-large,
html[data-theme="dark"] .ranking-avatar,
html[data-theme="dark"] .member-avatar,
html[data-theme="dark"] .avatar-character-preview {
    color: #1B1340;
}

/* =========================================================
   APPELS — écran plein écran « façon appel »
   ========================================================= */
html.lynk-call-active, html.lynk-call-active body { overflow: hidden; }

.lynk-call-overlay {
    position: fixed; inset: 0; z-index: 100000;
    display: none; flex-direction: column; box-sizing: border-box;
    padding: calc(14px + env(safe-area-inset-top)) 18px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(160deg, #1B1340, #2A1E4A 55%, #120C2E);
    color: #fff;
}
.lynk-call-overlay.is-open { display: flex; }
.lynk-call-overlay.is-minimized { display: none; }

.lynk-call-top { display: flex; align-items: center; gap: 12px; padding: 4px 2px 12px; }
.lynk-call-avatar {
    width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
    background: #FFD23F; color: #1B1340; display: grid; place-items: center;
    font-weight: 900; font-size: 22px; border: 2px solid #fff;
}
.lynk-call-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lynk-call-meta { display: flex; flex-direction: column; min-width: 0; }
.lynk-call-title { font-size: 18px; font-weight: 800; }
.lynk-call-status { font-size: 13px; opacity: .85; }
.lynk-call-iconbtn {
    margin-left: auto; width: 40px; height: 40px; border-radius: 12px;
    border: 2px solid rgba(255,255,255,.4); background: transparent;
    color: #fff; font-size: 18px; cursor: pointer;
}

.lynk-call-stage {
    position: relative; flex: 1; display: flex; align-items: center;
    justify-content: center; gap: 12px; flex-wrap: wrap; min-height: 0;
}
.lynk-call-stage.is-grid {
    display: grid; align-content: start;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.lynk-call-tile {
    position: relative; background: rgba(255,255,255,.08);
    border: 2px solid rgba(255,255,255,.25); border-radius: 20px;
    width: min(80vw, 420px); aspect-ratio: 3 / 4; max-height: 58vh;
    display: grid; place-items: center; overflow: hidden;
}
.lynk-call-stage.is-grid .lynk-call-tile { width: 100%; aspect-ratio: 1 / 1; max-height: none; }
.lynk-call-tile video { width: 100%; height: 100%; object-fit: cover; }
.lynk-call-tile.is-local {
    position: absolute; right: 8px; top: 8px; z-index: 3;
    width: 108px; height: 148px; aspect-ratio: auto; border-color: #fff;
}
.lynk-call-tile-avatar {
    width: 88px; height: 88px; border-radius: 50%; background: #FFD23F;
    color: #1B1340; display: grid; place-items: center; font-weight: 900; font-size: 34px;
}
.lynk-call-tile-name {
    position: absolute; left: 10px; bottom: 8px; font-size: 13px; font-weight: 700;
    background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 10px;
}
.lynk-call-tile.is-waiting { font-size: 15px; opacity: .85; }

.lynk-call-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 16px 0 4px; }
.lynk-call-btn {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    min-width: 72px; padding: 10px 12px; cursor: pointer; font-weight: 700;
    border-radius: 18px; border: 2px solid rgba(255,255,255,.35);
    background: rgba(255,255,255,.12); color: #fff;
}
.lynk-call-btn span { font-size: 22px; }
.lynk-call-btn small { font-size: 11px; opacity: .9; }
.lynk-call-btn.is-off { opacity: .6; background: rgba(255,255,255,.05); }
.lynk-call-btn.is-active { background: #7C3AED; border-color: #fff; }
.lynk-call-btn.is-accept { background: #22C55E; border-color: #fff; }
.lynk-call-btn.is-decline { background: #EF4444; border-color: #fff; }

.lynk-call-mini {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100001;
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: #1B1340; color: #fff; border-top: 2px solid #7C3AED;
}
.lynk-call-mini[hidden] { display: none; }
.lynk-call-mini button {
    margin-left: auto; padding: 8px 16px; border-radius: 12px; border: none;
    background: #7C3AED; color: #fff; font-weight: 800; cursor: pointer;
}

/* Boutons d'appel dans l'en-tête de la discussion : masqués par défaut.
   (!important car .conversation-settings-icon-button force display). */
.lynk-call-launch.is-hidden { display: none !important; }


