/* ==========================================
   BETLEITZ — "ticket de bistrot", version douce
   Pensé d'abord pour le téléphone (future appli Android) et lisible de 15 à 70 ans :
   texte confortable, grandes zones à toucher, couleurs franches mais pas criardes.
   ========================================== */

:root {
    /* Fond et encre */
    --paper: #FBF7EF;
    --paper-2: #F3EBDC;
    --card: #FFFFFF;
    --ink: #2A2621;
    --ink-soft: #4F4840;
    --muted: #6E665C;
    --line: #E6DCCB;
    --shadow-soft: #E2D6C1;

    /* Couleurs BetLeitz, adoucies */
    --yellow: #FFD54F;
    --yellow-soft: #FFF1C4;
    --red: #E3000F;          /* rouge du logo, des tickets et des alertes */
    --green: #2F9B5F;
    --green-soft: #E4F4EA;
    --blue: #3F6FC4;
    --blue-soft: #E8EFFB;
    --orange: #E07B39;
    --orange-soft: #FCEBDD;
    --rose: #C9587F;
    --rose-soft: #F8E6ED;
    --red-soft: #FBE6E8;

    /* Bordures et nuances dérivées */
    --blue-line: #C9D7F0;
    --yellow-line: #F0D98A;
    --yellow-line-strong: #D9B84A;
    --green-line: #BFE3CC;
    --input-line: #CFC4B2;
    --placeholder: #958B7E;
    --silver: #E8ECF2;
    --bronze: #F5DCC3;
    --on-dark-muted: #CFC6B8;
    --overlay: rgba(42, 38, 33, 0.45);

    --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --radius: 16px;
    --tap: 48px; /* taille minimale d'une zone à toucher */

    /* Zones système du téléphone (encoche, barre de gestes) */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    min-height: 100vh;
    padding: calc(20px + var(--safe-top)) 20px 20px;
    -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

button, [role="button"], a {
    touch-action: manipulation; /* pas de délai ni de zoom au double appui */
}

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

.container {
    max-width: 960px;
    margin: 0 auto;
}

/* ==========================================
   TITRES
   ========================================== */
h1, h2, h3 {
    font-family: var(--display);
    line-height: 1.1;
    color: var(--ink);
}

h1 {
    font-style: italic;
    font-weight: 900;
    font-size: 2.6em;
    text-align: center;
    margin-bottom: 24px;
}

/* Titre de section avec un léger coup de surligneur */
h2 {
    display: inline-block;
    font-weight: 700;
    font-size: 1.9em;
    margin-bottom: 16px;
    padding: 0 4px;
    background: linear-gradient(transparent 62%, var(--yellow-soft) 62%, var(--yellow-soft) 94%, transparent 94%);
}

h3 {
    font-weight: 700;
    font-size: 1.4em;
    margin: 28px 0 12px;
}

/* ==========================================
   LOGO ET MARQUE
   ========================================== */
:root {
    --brand-red: var(--red); /* alias historique */
}

.brand-mark {
    display: block;
    width: 120px;
    aspect-ratio: 172 / 106; /* proportions du dessin "BL" */
    height: auto;
    color: var(--brand-red);
}

/* En-tête de ticket : bandeau rouge à bord dentelé (connexion, création de pari...) */
.logo,
.ticket-band {
    position: relative;
    margin: 0 -26px 26px;
    padding: 30px 20px 36px;
    text-align: center;
    color: #FFFFFF;
    background-color: var(--brand-red);
    /* fines rayures de vitesse, dans l'inclinaison du logo */
    background-image: repeating-linear-gradient(-72deg,
        rgba(255, 255, 255, 0.045) 0 12px,
        transparent 12px 30px);
    /* bord du bas dentelé, comme un ticket qu'on détache */
    -webkit-mask: radial-gradient(circle at 50% 100%, transparent 7px, #000 7.5px) 50% 0 / 24px 100% repeat-x;
            mask: radial-gradient(circle at 50% 100%, transparent 7px, #000 7.5px) 50% 0 / 24px 100% repeat-x;
}

.logo .brand-mark {
    width: 124px;
    margin: 0 auto 4px;
    color: #FFFFFF;
    filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.18));
}

.brand-name {
    margin: 0 0 12px;
    font-size: 2.7em;
    color: #FFFFFF;
    letter-spacing: 0.01em;
}

/* Slogan en petit autocollant jaune */
.tagline {
    display: inline-block;
    font-family: var(--display);
    font-style: italic;
    font-weight: 700;
    font-size: 1.15em;
    color: var(--ink);
    background: var(--yellow);
    border-radius: 8px;
    padding: 2px 12px;
    transform: rotate(-2deg);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

/* ==========================================
   TICKET (carte avec bandeau rouge et pied détachable)
   ========================================== */
.ticket {
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: 22px;
    box-shadow: 5px 5px 0 var(--shadow-soft);
    overflow: hidden;
}

.ticket-band {
    margin: 0;
    padding: 24px 22px 32px;
}

.ticket-kicker {
    display: inline-block;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.9;
}

.ticket-title {
    display: block;
    margin: 2px 0 4px;
    padding: 0;
    font-style: italic;
    font-weight: 900;
    font-size: 2.6em;
    color: #FFFFFF;
    background: none;
}
.ticket-body {
    padding: 6px 22px 4px;
}

/* Pied du ticket : ligne pointillée avec deux encoches, comme un talon à détacher */
.ticket-foot {
    position: relative;
    padding: 20px 22px 22px;
    border-top: 2px dashed var(--line);
}

.ticket-foot::before,
.ticket-foot::after {
    content: '';
    position: absolute;
    top: -12px;
    width: 22px;
    height: 22px;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 50%;
}

.ticket-foot::before { left: -13px; }
.ticket-foot::after { right: -13px; }

.btn-publish {
    width: 100%;
    margin: 0;
    min-height: 58px;
    font-size: 19px;
}

/* ==========================================
   CRÉATION DE PARI
   ========================================== */
.create-step {
    padding: 20px 0;
    border-bottom: 2px dashed var(--line);
}

.create-step:last-child {
    border-bottom: none;
}

.step-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    font-style: normal;
    font-size: 1.35em;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    font-family: var(--body);
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    background: var(--yellow);
    border-radius: 50%;
}

.input-big {
    font-size: 19px;
    font-weight: 600;
    min-height: 56px;
}

textarea {
    resize: vertical;
    line-height: 1.4;
}

/* Choix du type : trois grandes cartes */
.type-choices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.type-choice {
    --accent: var(--blue);
    --accent-soft: var(--blue-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 14px 10px;
    text-align: center;
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.08s;
}

.type-choice.type-libre { --accent: var(--orange); --accent-soft: var(--orange-soft); }
.type-choice.type-vraifalse { --accent: var(--rose);   --accent-soft: var(--rose-soft); }

.type-choice:active {
    transform: scale(0.98);
}

.type-choice.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.type-icon {
    font-size: 28px;
    line-height: 1.2;
}

.type-name {
    font-weight: 700;
    font-size: 17px;
}

.type-hint {
    font-size: 14px;
    line-height: 1.3;
    color: var(--muted);
}

.type-panel {
    margin-top: 14px;
    padding: 14px;
    background: var(--paper);
    border-radius: 14px;
    color: var(--ink-soft);
}
/* Choix du sondage : une ligne par réponse */
.option-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    font-weight: 700;
    color: var(--blue);
    background: var(--blue-soft);
    border-radius: 10px;
}

.option-field input {
    margin: 0;
}

.option-remove {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    font-size: 16px;
    color: var(--muted);
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.btn-add-option {
    width: 100%;
    min-height: var(--tap);
    margin-top: 2px;
    font-weight: 700;
    color: var(--blue);
    background: var(--card);
    border: 2px dashed var(--blue-line);
    border-radius: 12px;
    cursor: pointer;
}

.vf-preview {
    display: flex;
    gap: 10px;
}

.vf-preview span {
    flex: 1;
    padding: 12px;
    font-weight: 700;
    text-align: center;
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: 12px;
}

/* Points : des cotes à choisir */
.points-choices {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.points-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.08s;
}

.points-choice:active {
    transform: scale(0.97);
}

.points-odd {
    font-family: var(--display);
    font-style: italic;
    font-weight: 800;
    font-size: 1.35em;
    white-space: nowrap;
    padding: 0 10px;
    background: var(--paper-2);
    border-radius: 8px;
}

.points-hint {
    font-size: 14px;
    color: var(--muted);
}

.points-choice.active {
    background: var(--yellow-soft);
    border-color: var(--ink);
}

.points-choice.active .points-odd {
    background: var(--yellow);
    box-shadow: 0 0 0 2px var(--ink);
    transform: rotate(-3deg);
}

/* Date limite : raccourcis */
.deadline-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    min-height: 44px;
    padding: 8px 16px;
    font-weight: 600;
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}

.chip.active {
    color: var(--yellow);
    background: var(--ink);
    border-color: var(--ink);
}

#pariDeadline {
    margin-top: 12px;
}

.deadline-summary {
    margin-top: 10px;
    color: var(--muted);
    font-size: 15px;
}

/* ==========================================
   EN-TÊTE DE PAGE (Paris en cours, Historique) : un talon de ticket arraché
   ========================================== */
.page-band {
    margin-bottom: 22px;
    border: 2px solid var(--ink);
    border-bottom: none;
    border-radius: 22px 22px 0 0;
}

.page-band .tagline {
    margin-top: 10px;
}

#searchHistory.band-search {
    display: block;
    width: 100%;
    max-width: 440px;
    margin: 14px auto 0;
    border-color: transparent;
}

#searchHistory.band-search:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.35);
}

.empty-state .btn {
    margin-top: 14px;
    font-family: var(--body);
    font-style: normal;
    font-size: 17px;
}

/* ==========================================
   CLASSEMENT : podium et tableau
   ========================================== */
.ticket-band .period-tabs {
    justify-content: center;
    margin: 14px 0 0;
}

.ticket-band .period-tab {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.14);
    border-color: transparent;
}

.ticket-band .period-tab.active {
    color: var(--brand-red);
    background: #FFFFFF;
    border-color: #FFFFFF;
}

.podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 10px;
    max-width: 560px; /* reste groupé sur grand écran */
    margin: 18px auto 8px;
}

.podium-spot {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    text-align: center;
}

/* 2e à gauche, 1er au centre, 3e à droite */
.podium-spot.place-1 { order: 2; }
.podium-spot.place-2 { order: 1; }
.podium-spot.place-3 { order: 3; }

.podium-medal {
    font-size: 30px;
    line-height: 1.1;
}

.place-1 .podium-medal {
    font-size: 40px;
}

.podium-name {
    max-width: 100%;
    font-weight: 700;
    overflow-wrap: anywhere;
    line-height: 1.2;
}

.podium-first {
    font-size: 14px;
    color: var(--muted);
    min-height: 1.2em;
}

.podium-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 8px;
    background: var(--paper-2);
    border: 2px solid var(--ink);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
}

.place-1 .podium-block { height: 118px; background: var(--yellow); }
.place-2 .podium-block { height: 88px;  background: var(--silver); }
.place-3 .podium-block { height: 66px;  background: var(--bronze); }

.podium-score {
    font-family: var(--display);
    font-style: italic;
    font-weight: 900;
    font-size: 2em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.place-1 .podium-score {
    font-size: 2.6em;
}

.podium-pts {
    font-weight: 600;
    font-size: 14px;
}

/* Sol du podium */
.podium::after {
    content: '';
    grid-column: 1 / -1;
    order: 4;
    height: 6px;
    margin-top: -10px;
    background: var(--ink);
    border-radius: 3px;
}

.me-tag {
    display: inline-block;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
    background: var(--yellow);
    border-radius: 6px;
    vertical-align: middle;
}

.ranking {
    list-style: none;
    margin: 18px 0 14px;
    border-top: 2px dashed var(--line);
}

.ranking-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 8px 4px;
    border-bottom: 2px dashed var(--line);
}

.ranking-row:last-child {
    border-bottom: none;
}

.ranking-row.me {
    margin: 0 -8px;
    padding: 8px 12px;
    background: var(--yellow-soft);
    border-radius: 12px;
}

.ranking-row .rank {
    min-width: 36px;
    font-size: 1.5em;
    color: var(--muted);
}

.ranking-row .username small {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: var(--muted);
}

.ranking-row .score {
    font-size: 1.35em;
}

.ranking-row .score small {
    font-family: var(--body);
    font-style: normal;
    font-weight: 600;
    font-size: 0.55em;
}

/* ==========================================
   CARTES DE PARIS : talon détachable
   ========================================== */
.pari-stub {
    position: relative;
    margin: 16px -20px -18px;
    padding: 12px 20px 14px;
    border-top: 2px dashed var(--line);
}

/* Encoches à chaque bout de la ligne pointillée */
.pari-stub::before,
.pari-stub::after {
    content: '';
    position: absolute;
    top: -12px;
    width: 22px;
    height: 22px;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 50%;
}

.pari-stub::before { left: -13px;  clip-path: inset(0 0 0 50%); }
.pari-stub::after { right: -13px; clip-path: inset(0 50% 0 0); }

.pari-stub-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 15px;
}

.pari-stub-count {
    color: var(--muted);
    font-weight: 600;
}

.countdown.open {
    color: var(--muted);
    font-weight: 600;
}

.participant-line {
    margin: 4px 0;
}

.participant-line strong::after {
    content: ' :';
}

/* ==========================================
   MON COMPTE
   ========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.stat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 6px;
    text-align: center;
    background: var(--paper);
    border-radius: 14px;
}

.stat-value {
    font-family: var(--display);
    font-style: italic;
    font-weight: 900;
    font-size: 2em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-tile:first-child {
    background: var(--yellow-soft);
}

.stat-label {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.2;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

.form-row .form-group {
    margin-bottom: 8px;
}

.account-note {
    margin: 4px 0 10px;
    font-size: 15px;
    color: var(--muted);
}

.account-email {
    font-weight: 700;
    font-size: 1.1em;
    overflow-wrap: anywhere;
}

#accountTab .create-step .btn {
    margin: 8px 0 0;
}

/* Interrupteurs (préférences de notifications) */
.switch-list {
    border-top: 2px dashed var(--line);
}

.switch-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    margin: 0;
    font-weight: 600;
    font-size: 16px;
    border-bottom: 2px dashed var(--line);
    cursor: pointer;
}

.switch-row input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    min-height: 0;
}

.switch {
    position: relative;
    flex-shrink: 0;
    width: 52px;
    height: 30px;
    background: var(--input-line);
    border-radius: 999px;
    transition: background 0.15s;
}

.switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: var(--card);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(42, 38, 33, 0.3);
    transition: transform 0.15s;
}

.switch-row input:checked + .switch {
    background: var(--green);
}

.switch-row input:checked + .switch::after {
    transform: translateX(22px);
}

.switch-row input:focus-visible + .switch {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

.notif-banner-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.notif-banner-actions .btn {
    margin: 0;
}

.notif-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

#accountTab .create-step .notif-actions .btn {
    display: inline-flex;
    margin: 12px 0 0;
}

.user-info-left[role="button"] {
    cursor: pointer;
}

/* ==========================================
   ADMINISTRATION
   ========================================== */
.email-progress {
    margin-bottom: 10px;
    color: var(--ink-soft);
}

.member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 0;
    border-bottom: 2px dashed var(--line);
}

.member-row:last-of-type {
    border-bottom: none;
}

.member-name {
    min-width: 0;
}

.member-name small {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

.admin-tools p {
    margin-bottom: 10px;
    color: var(--ink-soft);
}

.admin-tools .btn {
    width: 100%;
    margin: 0;
}

/* ==========================================
   SECTIONS
   ========================================== */
.card {
    margin-bottom: 20px;
}

/* Écran de connexion : un ticket centré */
#loginScreen {
    max-width: 460px;
    margin: 28px auto;
    padding: 0 26px 28px;
    overflow: hidden; /* le bandeau rouge suit les coins arrondis */
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: 22px;
    box-shadow: 5px 5px 0 var(--shadow-soft);
}

#loginScreen .btn {
    width: 100%;
    margin: 6px 0;
}

/* ==========================================
   BOUTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: var(--tap);
    padding: 10px 22px;
    margin: 5px;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.2;
    text-align: center;
    border: 2px solid var(--ink);
    border-radius: 12px;
    box-shadow: 0 3px 0 var(--ink);
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s;
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--ink);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary { background: var(--yellow); color: var(--ink); }
.btn-secondary { background: var(--card);   color: var(--ink); }
.btn-success { background: var(--green);  color: #FFFFFF; }
.btn-danger { background: var(--red);    color: #FFFFFF; }
.btn-info { background: var(--blue);   color: #FFFFFF; }
.btn-warning { background: var(--orange-soft); color: var(--ink); }

.btn-small {
    min-height: 42px;
    padding: 7px 14px;
    font-size: 15px;
}

/* Liens discrets */
.btn-text-link {
    min-height: 44px;
    padding: 8px 4px;
    background: none;
    border: none;
    font-weight: 600;
    font-size: 16px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    color: inherit;
    opacity: 0.8;
}

/* ==========================================
   FORMULAIRES
   ========================================== */
.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 15px;
}

input, select, textarea {
    width: 100%;
    min-height: var(--tap);
    padding: 11px 14px;
    margin: 4px 0;
    font-size: 17px; /* >= 16px : évite le zoom automatique sur téléphone */
    background: var(--card);
    border: 2px solid var(--input-line);
    border-radius: 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 4px var(--yellow-soft);
}

input::placeholder, textarea::placeholder {
    color: var(--placeholder);
}

.help-text {
    text-align: center;
    margin-top: 14px;
    color: var(--ink-soft);
}

.form-intro {
    margin-bottom: 18px;
    color: var(--ink-soft);
}
#searchHistory {
    width: 300px;
    max-width: 100%;
    margin: 0 0 12px;
}

/* ==========================================
   EN-TÊTE : barre claire, logo rouge posé directement dessus
   (le rouge est réservé aux tickets, pour qu'ils ressortent)
   ========================================== */
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 4px 2px 16px;
    margin-bottom: 14px;
    color: var(--ink);
    border-bottom: 2px dashed var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
}

.brand-word {
    font-family: var(--display);
    font-style: italic;
    font-weight: 900;
    font-size: 3em;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

/* Joueur : pseudo + points en étiquette jaune (comme une cote) */
.user-info-left {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 0;
    text-align: right;
}

.user-name {
    max-width: 100%;
    font-weight: 600;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-points {
    font-family: var(--display);
    font-style: italic;
    font-weight: 800;
    font-size: 1.05em;
    line-height: 1.2;
    color: var(--ink);
    background: var(--yellow);
    border-radius: 8px;
    padding: 1px 10px;
    transform: rotate(-2deg);
    box-shadow: 2px 2px 0 var(--ink);
    white-space: nowrap;
}

#currentUserScore {
    font-weight: 900;
    font-size: 1.35em;
    font-variant-numeric: tabular-nums;
}

.btn-create-pari {
    margin: 0;
    white-space: nowrap;
    color: #FFFFFF;
    background: var(--brand-red);
}

.badge-admin {
    display: inline-block;
    font-family: var(--body);
    font-weight: 700;
    font-size: 0.7em;
    letter-spacing: 0.05em;
    color: #FFFFFF;
    background: var(--red);
    padding: 1px 7px;
    margin-left: 8px;
    border-radius: 6px;
    vertical-align: middle;
}

.count-badge {
    display: inline-block;
    min-width: 22px;
    font-size: 0.8em;
    font-weight: 700;
    text-align: center;
    color: #FFFFFF;
    background: var(--red);
    border-radius: 11px;
    padding: 0 7px;
    margin-left: 6px;
}

/* ==========================================
   ONGLETS (ordinateur)
   ========================================== */
.tabs {
    display: flex;
    gap: 6px;
    padding: 6px;
    margin-bottom: 22px;
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: 18px;
}

.tabs-desktop {
    display: flex;
}

.mobile-navbar {
    display: none;
}

.tab {
    flex: 1;
    min-height: var(--tap);
    padding: 10px 14px;
    font-weight: 700;
    font-size: 17px;
    white-space: nowrap;
    color: var(--ink-soft);
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.tab.active {
    background: var(--yellow);
    color: var(--ink);
}

/* Périodes du classement */
.period-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.period-tab {
    min-height: 44px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 16px;
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.period-tab.active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--yellow);
}

/* ==========================================
   PARIS : des tickets
   ========================================== */
.pari-card {
    --accent: var(--yellow);
    --accent-soft: var(--yellow-soft);
    --accent-label: 'Pari';
    position: relative;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    padding: 24px 20px 18px;
    margin: 20px 0 22px;
    box-shadow: 4px 4px 0 var(--shadow-soft);
}

/* Étiquette du type de pari, posée sur le bord du ticket */
.pari-card::after {
    content: var(--accent-label);
    position: absolute;
    top: -13px;
    left: 18px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.03em;
    color: var(--ink);
    background: var(--accent-soft);
    border: 2px solid var(--accent);
    border-radius: 8px;
    padding: 0 9px;
    line-height: 21px;
}

.pari-card.type-sondage { --accent: var(--blue);   --accent-soft: var(--blue-soft);   --accent-label: 'Sondage'; }
.pari-card.type-libre { --accent: var(--orange); --accent-soft: var(--orange-soft); --accent-label: 'Réponse libre'; }
.pari-card.type-vraifalse { --accent: var(--rose);   --accent-soft: var(--rose-soft);            --accent-label: 'Vrai / Faux'; }

.pari-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 6px;
}

.pari-title {
    flex: 1;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.55em;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

/* Les points présentés comme une cote */
.pari-points {
    flex-shrink: 0;
    font-family: var(--display);
    font-style: italic;
    font-weight: 800;
    font-size: 1.25em;
    white-space: nowrap;
    background: var(--yellow);
    border: 2px solid var(--ink);
    border-radius: 10px;
    padding: 1px 11px;
    transform: rotate(2deg);
}

/* Ligne pointillée "à détacher" sous les infos */
.pari-meta {
    color: var(--muted);
    font-size: 0.92em;
    margin-bottom: 4px;
}

.pari-meta strong {
    color: var(--ink-soft);
}

.pari-desc {
    margin: 12px 0 4px;
    color: var(--ink-soft);
    overflow-wrap: anywhere;
}

.pari-options {
    margin-top: 14px;
}

/* Une option = une grande ligne à toucher */
.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 10px 8px 14px;
    margin: 8px 0;
    font-weight: 600;
    background: var(--paper);
    border: 2px solid var(--line);
    border-radius: 12px;
    overflow-wrap: anywhere;
    transition: border-color 0.15s, background 0.15s, transform 0.08s;
}

.option-item.votable {
    cursor: pointer;
}

.option-item.votable:active {
    transform: scale(0.99);
    border-color: var(--ink);
}

.option-item.selected {
    background: var(--yellow-soft);
    border-color: var(--ink);
}

.option-item small {
    color: var(--ink-soft);
    font-weight: 500;
    text-align: right;
}

.vote-count {
    display: inline-block;
    min-width: 26px;
    margin-left: 6px;
    padding: 0 7px;
    font-size: 0.85em;
    font-weight: 700;
    text-align: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.vote-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    min-width: 84px;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: 10px;
    cursor: pointer;
}

.vote-btn.voted {
    background: var(--green);
    border-color: var(--green);
    color: #FFFFFF;
}

.response-input {
    display: inline-block;
    width: calc(100% - 150px);
    margin-right: 8px;
    vertical-align: middle;
}

.participants {
    margin-top: 12px;
    font-size: 0.95em;
    color: var(--ink-soft);
    overflow-wrap: anywhere;
}

.participants:not(:empty) {
    background: var(--paper);
    border-radius: 12px;
    padding: 6px 14px;
}

.countdown {
    color: var(--brand-red); /* même rouge que les tickets */
    font-weight: 700;
}

.countdown.expired {
    color: var(--muted);
    font-style: italic;
}

.expired-message {
    margin-top: 10px;
    padding: 10px 14px;
    font-size: 15px;
    background: var(--yellow-soft);
    border-radius: 12px;
}

.pari-result {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--green-soft);
    border: 2px solid var(--green);
    border-radius: 12px;
}

.pari-result-label {
    flex-shrink: 0;
    padding: 1px 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #FFFFFF;
    background: var(--green);
    border-radius: 6px;
}

.pari-result strong {
    font-family: var(--display);
    font-size: 1.3em;
    overflow-wrap: anywhere;
}
/* Paris terminés : repliables et plus calmes */
/* Pari terminé : même ticket, en plus sobre, avec un talon cliquable */
.pari-card.termine {
    margin: 18px 0;
    padding-top: 20px;
    box-shadow: 3px 3px 0 var(--shadow-soft);
}

.pari-card.termine .pari-stub {
    margin-top: 14px;
    cursor: pointer;
}

.stub-result strong {
    font-family: var(--display);
    font-size: 1.2em;
    color: var(--green);
}

.pari-winners {
    margin-top: 10px;
    font-weight: 600;
    color: var(--ink-soft);
    overflow-wrap: anywhere;
}

/* Tampon "Gagné" / "Perdu", comme sur un ticket validé */
.stamp {
    display: inline-block;
    padding: 1px 9px;
    font-family: var(--display);
    font-style: italic;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border: 2px solid currentColor;
    border-radius: 6px;
    transform: rotate(-5deg);
}

.stamp-won { color: var(--green); background: var(--green-soft); }
.stamp-lost { color: var(--muted); }

.pari-card.termine .pari-header {
    cursor: pointer;
    margin-bottom: 0;
    min-height: 40px;
    align-items: center;
}

.pari-card.termine .pari-title {
    font-size: 1.3em;
}

.pari-card.termine .pari-points {
    font-size: 1.05em;
    background: var(--paper-2);
    transform: none;
}

.pari-card.termine.collapsed .pari-content {
    display: none;
}

.pari-content {
    margin-top: 12px;
}

.expand-icon {
    display: inline-block;
    margin-right: 6px;
    font-size: 0.7em;
    transition: transform 0.2s;
}

.pari-card.termine:not(.collapsed) .expand-icon {
    transform: rotate(90deg);
}

/* Formulaire "Terminer le pari" */
.finish-form {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--green-soft);
    border: 2px dashed var(--green);
    border-radius: 14px;
}

.link-email-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.link-email-actions .btn {
    margin: 4px 6px 4px 0;
}

.empty-state {
    text-align: center;
    padding: 36px 16px;
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.3em;
    color: var(--muted);
}

/* ==========================================
   CLASSEMENT
   ========================================== */
.rank {
    min-width: 44px;
    font-family: var(--display);
    font-style: italic;
    font-weight: 800;
    font-size: 1.7em;
    line-height: 1;
    text-align: center;
}

.username {
    flex: 1;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.score {
    font-family: var(--display);
    font-style: italic;
    font-weight: 800;
    font-size: 1.5em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ==========================================
   ADMINISTRATION
   ========================================== */
.member-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px 8px;
}

.member-actions .btn {
    margin: 0;
}

.member-actions .score {
    font-size: 1.25em;
}

.pending-user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin: 10px 0;
    background: var(--yellow-soft);
    border: 2px dashed var(--yellow-line-strong);
    border-radius: 14px;
}

.pending-info {
    flex: 1;
}

.pending-info strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 2px;
}

.pending-info small {
    color: var(--muted);
}

.pending-actions {
    display: flex;
    gap: 8px;
}

.link-email-form {
    margin: -4px 0 14px;
}

/* ==========================================
   ENCADRÉS
   ========================================== */
.alert {
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 2px solid;
    border-radius: 14px;
}

.alert-info { background: var(--blue-soft);   border-color: var(--blue-line); }
.alert-warning { background: var(--yellow-soft); border-color: var(--yellow-line); }
.alert-success { background: var(--green-soft);  border-color: var(--green-line); }

.migration-banner strong {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.3em;
}

.migration-banner p {
    margin: 4px 0 10px;
}

.migration-banner .form-group {
    margin-bottom: 10px;
}

.user-info-box {
    padding: 16px 18px;
    margin: 18px 0;
    background: var(--paper);
    border-radius: 14px;
}

/* ==========================================
   NOTIFICATIONS
   ========================================== */
.notification {
    position: fixed;
    top: calc(16px + var(--safe-top));
    right: 16px;
    z-index: 1300;
    max-width: 380px;
    padding: 12px 16px;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(42, 38, 33, 0.18);
    animation: pop-in 0.25s ease-out;
}

@keyframes pop-in {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.notification.success { background: var(--green-soft); }
.notification.info { background: var(--blue-soft); }
.notification.warning { background: var(--yellow-soft); }
.notification.error { background: var(--red-soft); }

/* ==========================================
   FENÊTRE DE DIALOGUE (confirmation, saisie)
   ========================================== */
.dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--overlay);
    animation: fade-in 0.15s ease-out;
}

.dialog {
    width: 100%;
    max-width: 420px;
    padding: 22px 20px 16px;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(42, 38, 33, 0.25);
}

.dialog-title {
    margin: 0 0 8px;
    font-size: 1.5em;
}

.dialog-message {
    color: var(--ink-soft);
    margin-bottom: 12px;
}

.dialog-input {
    margin-bottom: 8px;
}

.dialog-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.dialog-actions .btn {
    flex: 1;
    margin: 0;
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ==========================================
   MENU "PLUS" (feuille qui monte du bas, mobile)
   ========================================== */
.sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    background: var(--overlay);
    animation: fade-in 0.15s ease-out;
}

.sheet {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 10px 14px calc(14px + var(--safe-bottom));
    background: var(--card);
    border-radius: 22px 22px 0 0;
    animation: slide-up 0.2s ease-out;
}

@keyframes slide-up {
    from { transform: translateY(40px); }
    to   { transform: none; }
}

.sheet-handle {
    width: 44px;
    height: 5px;
    margin: 2px auto 12px;
    border-radius: 3px;
    background: var(--line);
}

.sheet-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 12px 16px;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 18px;
    text-align: left;
    background: var(--paper);
    border: 2px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
}

.sheet-item:active {
    background: var(--yellow-soft);
}

.sheet-close {
    justify-content: center;
    background: var(--card);
    color: var(--ink-soft);
}

/* ==========================================
   CHARGEMENT
   ========================================== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--muted);
    font-weight: 600;
}

.spinner {
    width: 38px;
    height: 38px;
    margin: 0 auto 16px;
    border: 4px solid var(--line);
    border-top-color: var(--red);
    border-right-color: var(--yellow);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   ICÔNES DE LA BARRE MOBILE
   ========================================== */
.mobile-icon {
    position: relative;
}

.mobile-icon svg,
.fab-icon svg {
    display: block;
    width: 26px;
    height: 26px;
}

.fab-icon svg {
    width: 30px;
    height: 30px;
}

/* Les icônes suivent la couleur du texte (le CSS l'emporte sur l'attribut fill) */
/* (pas pour les icônes maison, qui sont au trait) */
.mobile-icon svg:not(.icon) path {
    fill: currentColor;
}

.mobile-icon .icon {
    stroke-width: 1.6;
}

.fab-icon svg:not(.icon) path {
    fill: var(--ink);
}

.fab-icon .icon {
    color: var(--ink);
    stroke-width: 2.2;
}

/* Pastille rouge sur "Plus" quand des inscriptions attendent */
.tab-dot {
    position: absolute;
    top: -2px;
    right: -4px;
    width: 10px;
    height: 10px;
    background: var(--red);
    border: 2px solid var(--ink);
    border-radius: 50%;
}

/* ==========================================
   ICÔNES MAISON (trait noir, même style que la barre du bas)
   ========================================== */
.icon {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.2em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn .icon,
.sheet-item .icon {
    width: 1.25em;
    height: 1.25em;
}

.step-label .icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.1em;
    stroke-width: 2;
}

.type-icon .icon {
    width: 1.1em;
    height: 1.1em;
    stroke-width: 1.6;
}

.option-remove .icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.expand-icon .icon {
    width: 1.5em;
    height: 1.5em;
    stroke-width: 2.4;
}

/* Médaille du podium : icône + numéro */
.medal {
    position: relative;
    display: inline-block;
    width: 1em;
    height: 1em;
}

.medal .icon {
    width: 100%;
    height: 100%;
    vertical-align: top;
    stroke-width: 1.6;
}

.medal b {
    position: absolute;
    left: 0;
    right: 0;
    top: 63%;
    transform: translateY(-50%);
    font-family: var(--display);
    font-style: italic;
    font-weight: 800;
    font-size: 0.36em;
    line-height: 1;
    text-align: center;
}

/* Champ de recherche avec loupe */
.search-field {
    position: relative;
    display: block;
    max-width: 440px;
    margin: 14px auto 0;
}

.search-field .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--muted);
    pointer-events: none;
}

#searchHistory.band-search {
    max-width: none;
    margin: 0;
    padding-left: 44px;
}

/* ==========================================
   BOUTONS D'ACTION À DROITE (à portée de pouce)
   Le bouton principal est toujours le plus à droite.
   ========================================== */
.pari-stub {
    display: flex;
    flex-direction: column;
}

.pari-stub > .btn,
#accountTab .create-step .btn,
.migration-banner .btn {
    display: flex;
    width: fit-content;
    margin-left: auto;
    margin-right: 0;
}

.pari-stub > .btn {
    margin-top: 10px;
}

.migration-banner .btn {
    margin-top: 6px;
    margin-bottom: 0;
}

#accountTab .create-step .btn {
    margin-top: 10px;
}

/* Groupes de boutons : [Annuler] [Valider] alignés à droite */
.link-email-actions,
.pending-actions {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.member-actions {
    justify-content: flex-end;
}

/* ==========================================
   SURVOL : seulement avec une souris (évite les effets "collés" au doigt)
   ========================================== */
@media (hover: hover) {
    .btn:hover { filter: brightness(1.04); box-shadow: 0 4px 0 var(--ink); }
    .btn-create-pari:hover { box-shadow: none; filter: brightness(1.06); }
    .tab:not(.active):hover { background: var(--paper); color: var(--ink); }
    .period-tab:not(.active):hover { border-color: var(--ink); }
    .option-item.votable:hover { border-color: var(--ink); }
    .vote-btn:hover { background: var(--yellow-soft); }
    .vote-btn.voted:hover { background: var(--green); }
    .btn-text-link:hover { opacity: 1; }
    .pari-card.termine .pari-header:hover .pari-title { color: var(--red); }
    .sheet-item:hover { border-color: var(--ink); }
    .type-choice:not(.active):hover { border-color: var(--accent); }
    .points-choice:not(.active):hover { border-color: var(--ink); }
    .chip:not(.active):hover { border-color: var(--ink); }
    .option-remove:hover { color: var(--red); background: var(--red-soft); }
    .btn-add-option:hover { background: var(--blue-soft); }
}

/* ==========================================
   UTILITAIRES
   ========================================== */
.hidden {
    display: none !important;
}

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

/* ==========================================
   TÉLÉPHONE
   ========================================== */
@media (max-width: 768px) {
    body {
        padding: calc(12px + var(--safe-top)) 12px calc(110px + var(--safe-bottom));
    }

    h2 {
        font-size: 1.7em;
    }

    #loginScreen {
        margin: 8px auto;
        padding: 0 18px 24px;
        border-radius: 20px;
        box-shadow: 3px 3px 0 var(--shadow-soft);
    }

    .logo {
        margin: 0 -18px 22px;
        padding: 26px 16px 32px;
    }

    .logo .brand-mark {
        width: 104px;
    }

    .brand-name {
        font-size: 2.3em;
    }

    /* En-tête compact : logo à gauche, joueur et points à droite */
    .user-header {
        gap: 10px;
        padding: 2px 2px 12px;
        margin-bottom: 14px;
    }

    .brand-word {
        font-size: 2.3em;
    }

    .user-name {
        font-size: 15px;
    }

    .btn-create-pari,
    .tabs-desktop {
        display: none !important;
    }

    /* Barre de navigation du bas */
    .mobile-navbar {
        display: flex !important;
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(10px + var(--safe-bottom));
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        padding: 4px;
        background: var(--ink);
        border-radius: 22px;
        box-shadow: 0 6px 20px rgba(42, 38, 33, 0.25);
    }

    .mobile-tab {
        flex: 1;
        min-height: 60px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--on-dark-muted);
        background: none;
        border: none;
        border-radius: 16px;
        cursor: pointer;
        transition: color 0.15s, background 0.15s;
    }

    .mobile-tab.active {
        color: var(--yellow);
        background: rgba(255, 213, 79, 0.12);
    }

    .mobile-label {
        font-size: 13px;
        font-weight: 600;
        line-height: 1.1;
    }

    .mobile-fab {
        position: relative;
        top: -18px;
        flex: 0 0 auto;
        width: 68px;
        height: 68px;
        margin: 0 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0;
        background: var(--yellow);
        border: 3px solid var(--ink);
        border-radius: 50%;
        box-shadow: 0 4px 0 var(--ink);
        cursor: pointer;
        transition: transform 0.08s, box-shadow 0.08s;
    }

    .mobile-fab:active {
        transform: translateY(3px);
        box-shadow: 0 1px 0 var(--ink);
    }

    .fab-label {
        font-weight: 700;
        font-size: 13px;
        color: var(--ink);
        line-height: 1;
    }

    /* Paris */
    .pari-card {
        padding: 22px 14px 16px;
        box-shadow: 3px 3px 0 var(--shadow-soft);
    }

    .pari-card::after {
        left: 12px;
    }

    .pari-title {
        font-size: 1.4em;
    }

    .pari-points {
        font-size: 1.1em;
        padding: 0 9px;
    }

    .response-input {
        width: 100%;
        margin: 0 0 8px;
    }

    /* "Répondre" sous le champ, à droite */
    .pari-options > .vote-btn {
        display: flex;
        width: fit-content;
        margin-left: auto;
    }

    .finish-form .btn,
    .link-email-actions .btn {
        flex: 1;
    }

    .period-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        margin-left: -12px;
        margin-right: -12px;
        padding: 0 12px 4px;
    }

    .period-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Admin */
    .pending-user {
        flex-direction: column;
        align-items: stretch;
    }

    .pending-actions .btn {
        flex: 1;
        margin: 0;
    }

    #activeUsersList .member-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .notification {
        left: 12px;
        right: 12px;
        top: calc(12px + var(--safe-top));
        max-width: none;
    }

    #searchHistory {
        width: 100%;
    }

    /* Mon compte */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Talon des cartes de paris (suit le padding mobile de la carte) */
    .pari-stub {
        margin: 14px -14px -16px;
        padding: 12px 14px 14px;
    }

    /* Classement */
    /* Les 4 périodes tiennent sur une ligne, sans défilement */
    .ticket-band .period-tabs {
        flex-wrap: nowrap;
        gap: 6px;
        margin: 14px 0 0;
        padding: 0;
        overflow: visible;
    }

    .ticket-band .period-tab {
        flex: 1 1 auto;
        padding: 6px 8px;
        font-size: 15px;
    }

    .podium {
        gap: 8px;
    }

    .podium-medal { font-size: 26px; }
    .place-1 .podium-medal { font-size: 34px; }
    .podium-score { font-size: 1.7em; }
    .place-1 .podium-score { font-size: 2.2em; }
    .place-1 .podium-block { height: 104px; }
    .place-2 .podium-block { height: 78px; }
    .place-3 .podium-block { height: 58px; }

    .admin-tools .btn,
    .member-actions .btn {
        flex: 1 1 auto;
    }

    /* Création de pari */
    .ticket {
        border-radius: 20px;
        box-shadow: 3px 3px 0 var(--shadow-soft);
    }

    .ticket-band {
        padding: 20px 16px 30px;
    }

    .ticket-title {
        font-size: 2.2em;
    }

    .ticket-body {
        padding: 0 16px 4px;
    }

    .ticket-foot {
        padding: 18px 16px 18px;
    }

    /* Types : empilés, icône à gauche */
    .type-choices {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .type-choice {
        display: grid;
        grid-template-columns: 44px 1fr;
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 10px;
        row-gap: 0;
        padding: 12px 14px;
        text-align: left;
    }

    .type-icon {
        grid-row: 1 / 3;
        font-size: 30px;
        text-align: center;
    }

    .points-choices {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Fenêtre de dialogue : posée en bas, à portée de pouce */
    .dialog-overlay {
        align-items: flex-end;
        padding: 12px 12px calc(12px + var(--safe-bottom));
    }
}
