/* ==========================================================================
   Poca Game – feuille de style
   1. Polices   2. Couleurs (clair / sombre)   3. Base   4. Mise en page
   5. Composants   6. Page de connexion
   Pour changer une couleur : modifier sa variable dans la partie 2.
   ========================================================================== */

/* 1. Polices ------------------------------------------------------------- */
@font-face { font-family: 'Fredoka'; font-weight: 500; font-display: swap; src: url('../fonts/fredoka-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url('../fonts/fredoka-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 700; font-display: swap; src: url('../fonts/fredoka-latin-700-normal.woff2') format('woff2'); }

/* 2. Couleurs ------------------------------------------------------------ */
:root {
  --bg: #FFF7FB;
  --surface: #FFFFFF;
  --text: #1E1535;
  --text-2: #6B6385;
  --border: #E4DAF0;
  --border-soft: #EDE4F3;
  --placeholder: #A39BBF;   /* texte indicatif des champs */

  --primary: #7C3AED;
  --primary-text: #5B21B6;   /* violet lisible en texte */
  --primary-soft: #EDE9FE;
  --on-primary: #FFFFFF;

  --pink: #EC4899;
  --blue: #3B82F6;
  --orange: #F97316;
  --yellow: #FACC15;
  --danger-text: #C2410C;
  --danger-soft: #FFEDD5;
  --success-soft: #DCFCE7;
  --success-text: #166534;

  --gradient: linear-gradient(90deg, #7C3AED, #EC4899);
  --shadow: 0 8px 24px rgba(124, 58, 237, 0.18);
  --radius: 16px;
  --font-title: 'Fredoka', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #160F2E;
  --surface: #221944;
  --text: #F4F0FF;
  --text-2: #B3A9D6;
  --border: #3A2F66;
  --border-soft: #33295A;
  --placeholder: #7F76A6;

  --primary: #A78BFA;
  --primary-text: #C4B5FD;
  --primary-soft: #2E1F5E;
  --on-primary: #221944;

  --danger-text: #FB923C;
  --danger-soft: #3B2214;
  --success-soft: #14341F;
  --success-text: #86EFAC;

  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

/* 3. Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* « masqué » l'emporte toujours sur la mise en page */

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--primary-text); }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::placeholder { color: var(--placeholder); opacity: 1; }

.icon { flex-shrink: 0; }

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

/* 4. Mise en page -------------------------------------------------------- */
.page {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 20px 32px;
}
.has-tabbar .page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

.stack    { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 44px; margin-bottom: 18px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--primary); text-decoration: none;
  font-family: var(--font-title); font-weight: 700; font-size: 22px;
}

.title    { font-family: var(--font-title); font-weight: 600; font-size: 30px; line-height: 1.2; }
.subtitle { font-family: var(--font-title); font-weight: 600; font-size: 21px; }
.muted    { color: var(--text-2); font-size: 14px; }
.small    { font-size: 13px; }
.center   { text-align: center; }

/* Barre de navigation du bas */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  height: calc(72px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1.5px solid var(--border-soft);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text-2); text-decoration: none; font-size: 12px; font-weight: 600;
}
/* Pastille derrière l'icône : même place pour tous les onglets, colorée pour l'onglet actif */
.tabbar .icon { box-sizing: content-box; padding: 4px 18px; border-radius: 16px; transition: background .2s ease; }
.tabbar a[aria-current="page"] { color: var(--primary-text); font-weight: 700; }
.tabbar a[aria-current="page"] .icon { background: var(--primary-soft); color: var(--primary); stroke-width: 2.4; }

/* 5. Composants ---------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
}

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 2px solid transparent; border-radius: var(--radius);
  font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .1s ease, opacity .2s ease;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn--block { width: 100%; }
.btn--primary  { background: var(--primary); color: var(--on-primary); min-height: 54px; font-size: 17px; }
.btn--gradient { background: var(--gradient); color: #FFFFFF; min-height: 60px; font-family: var(--font-title); font-size: 22px; font-weight: 600; border-radius: 18px; }
.btn--outline  { background: var(--surface); border-color: var(--primary); color: var(--primary-text); }
.btn--ghost    { background: var(--surface); border: 1.5px solid var(--border); color: var(--text); }
.btn--danger-text { color: var(--danger-text); }

.icon-btn {
  width: 44px; height: 44px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 22px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.only-dark { display: none; }
[data-theme="dark"] .only-dark  { display: contents; }
[data-theme="dark"] .only-light { display: none; }
.only-light { display: contents; }

/* Champs de formulaire */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 14px; font-weight: 700; }
.input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: 16px;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-wrap { position: relative; display: flex; }
.input-wrap .input { padding-right: 52px; }
.input-wrap__btn {
  position: absolute; right: 2px; top: 2px; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-2); cursor: pointer;
}
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }

/* Messages */
.alert {
  padding: 10px 14px; border-radius: 12px;
  background: var(--danger-soft); color: var(--danger-text); font-size: 14px; font-weight: 600;
}
.flash {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 20;
  width: calc(100% - 40px); max-width: 520px; padding: 12px 16px; border-radius: 14px;
  background: var(--success-soft); color: var(--success-text); font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow); transition: opacity .4s ease;
}
.flash--error { background: var(--danger-soft); color: var(--danger-text); }
.flash--hide { opacity: 0; pointer-events: none; }

/* 6. Page de connexion --------------------------------------------------- */
.page-login .page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center; gap: 28px;
  position: relative; overflow: hidden;
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.login-logo {
  width: 88px; height: 88px; border-radius: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--on-primary);
}
.brand-title { font-family: var(--font-title); font-weight: 700; font-size: 40px; color: var(--primary); }
.login-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 24px; }
.login-card .input { background: var(--bg); }

/* Confettis décoratifs */
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; display: block; border-radius: 4px; }
.confetti i:nth-child(1) { left: 9%;  top: 10%; width: 14px; height: 22px; background: var(--yellow); transform: rotate(-24deg); }
.confetti i:nth-child(2) { left: 31%; top: 7%;  width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.confetti i:nth-child(3) { right: 18%; top: 9%; width: 14px; height: 22px; background: var(--pink); transform: rotate(30deg); }
.confetti i:nth-child(4) { right: 8%; top: 18%; width: 12px; height: 12px; border-radius: 50%; background: var(--orange); }
.confetti i:nth-child(5) { left: 7%;  bottom: 11%; width: 12px; height: 12px; border-radius: 50%; background: var(--pink); }
.confetti i:nth-child(6) { right: 13%; bottom: 8%; width: 14px; height: 22px; background: var(--yellow); transform: rotate(-18deg); }


/* 7. Étape 2 : collection, fiche jeu, réglages ---------------------------- */
.xsmall { font-size: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-label { font-family: var(--font-body); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-bottom: 8px; font-size: 15px; font-weight: 600; color: var(--primary-text); text-decoration: none; }
.btn--sm { min-height: 44px; padding: 0 14px; font-size: 14px; flex-shrink: 0; }
.btn-link { min-height: 44px; padding: 0 8px; border: none; background: none; font-size: 15px; font-weight: 700; cursor: pointer; }
.empty, .empty-state { padding: 14px; }
.empty-state { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.alert p + p { margin-top: 4px; }

/* Grilles du formulaire */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.input--invalid { border-color: var(--danger-text); }
.fieldset { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fieldset legend { padding: 0; margin-bottom: 8px; }

/* Recherche */
.search {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text-2);
}
.search input { flex: 1; min-width: 0; border: none; background: transparent; font-size: 16px; color: var(--text); outline: none; }
.search:focus-within { border-color: var(--primary); }

/* Puces (filtres, étiquettes, propriétaires) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 0 20px 2px; scrollbar-width: none; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  min-height: 40px; padding: 0 16px; border-radius: 20px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 600; cursor: pointer; user-select: none; position: relative;
}
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip--warning { border-color: #EAB308; background: var(--tag-yellow-bg); color: var(--tag-yellow-text); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }
.chip span { display: inline-flex; align-items: center; gap: 6px; }
.chip--owner .icon { display: none; }
.chip--owner:has(input:checked) { background: var(--primary); border-color: var(--primary); color: var(--on-primary); padding-left: 12px; }
.chip--owner:has(input:checked) .icon { display: block; }
.chip--tag { min-height: 36px; padding: 0 14px; font-size: 14px; background: var(--surface); }
.chip--tag:has(input:checked) { font-weight: 700; border-width: 2px; }

/* Couleurs des étiquettes et des vignettes */
:root {
  --tag-pink-bg: #FCE7F3;   --tag-pink-text: #9D174D;
  --tag-blue-bg: #DBEAFE;   --tag-blue-text: #1E40AF;
  --tag-orange-bg: #FFEDD5; --tag-orange-text: #9A3412;
  --tag-violet-bg: #EDE9FE; --tag-violet-text: #5B21B6;
  --tag-yellow-bg: #FEF9C3; --tag-yellow-text: #854D0E;
}
[data-theme="dark"] {
  --tag-pink-bg: #3D1838;   --tag-pink-text: #F9A8D4;
  --tag-blue-bg: #172A4F;   --tag-blue-text: #93C5FD;
  --tag-orange-bg: #3B2214; --tag-orange-text: #FDBA74;
  --tag-violet-bg: #2E1F5E; --tag-violet-text: #C4B5FD;
  --tag-yellow-bg: #3A3415; --tag-yellow-text: #FDE047;
}
.tag { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 15px; font-size: 14px; font-weight: 700; }
.tag--pink   { --c: var(--pink);   background: var(--tag-pink-bg);   color: var(--tag-pink-text); }
.tag--blue   { --c: var(--blue);   background: var(--tag-blue-bg);   color: var(--tag-blue-text); }
.tag--orange { --c: var(--orange); background: var(--tag-orange-bg); color: var(--tag-orange-text); }
.tag--violet { --c: #7C3AED;       background: var(--tag-violet-bg); color: var(--tag-violet-text); }
.tag--yellow { --c: #EAB308;       background: var(--tag-yellow-bg); color: var(--tag-yellow-text); }
.chip--tag.tag--pink, .chip--tag.tag--blue, .chip--tag.tag--orange, .chip--tag.tag--violet, .chip--tag.tag--yellow { background: var(--surface); }
.chip--tag:has(input:checked).tag--pink   { background: var(--tag-pink-bg); }
.chip--tag:has(input:checked).tag--blue   { background: var(--tag-blue-bg); }
.chip--tag:has(input:checked).tag--orange { background: var(--tag-orange-bg); }
.chip--tag:has(input:checked).tag--violet { background: var(--tag-violet-bg); }
.chip--tag:has(input:checked).tag--yellow { background: var(--tag-yellow-bg); }
.chip--tag:has(input:checked) { border-color: var(--c); }

.thumb {
  width: 56px; height: 56px; flex-shrink: 0; border-radius: 12px; object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-weight: 700; font-size: 24px; color: #FFFFFF;
}
.thumb--pink   { background: var(--pink); }
.thumb--blue   { background: var(--blue); }
.thumb--orange { background: var(--orange); }
.thumb--violet { background: #7C3AED; }
.thumb--yellow { background: var(--yellow); color: #1E1535; }

/* Liste de la collection */
.game-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.game-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px;
  background: var(--surface); border: 1.5px solid var(--border-soft); border-radius: var(--radius);
  color: var(--text); text-decoration: none;
}
a.game-row:active { transform: scale(0.99); }
.game-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.game-row__name { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.game-row__chevron { color: var(--text-2); display: flex; }
.badge-incomplete {
  padding: 1px 6px; border-radius: 6px; border: 1px solid #EAB308;
  background: var(--tag-yellow-bg); color: var(--tag-yellow-text); font-size: 11px; font-weight: 700;
}

/* Bouton flottant « Ajouter un jeu » */
.fab {
  position: fixed; right: 20px; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 9;
  display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px;
  border-radius: 26px; background: var(--primary); color: var(--on-primary);
  font-size: 16px; font-weight: 700; text-decoration: none; box-shadow: var(--shadow);
}
@media (min-width: 600px) { .fab { right: calc(50% - 260px); } }

/* Photo de la fiche jeu */
.photo-box { position: relative; }
.photo-box__img {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 180px;
  border-radius: 18px; object-fit: cover;
  font-family: var(--font-title); font-weight: 700; font-size: 72px; color: #FFFFFF;
}
.photo-box__img--empty { background: var(--primary-soft); color: var(--primary-text); border: 2px dashed var(--border); }
.photo-box__btn {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px;
  border-radius: 22px; background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow);
}
.photo-box__btn:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }
.delete-form { margin-top: 8px; }

/* Thème : boutons Clair / Sombre / Auto */
.segmented {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px;
  background: var(--surface); border: 1.5px solid var(--border-soft); border-radius: var(--radius);
}
.segmented button { height: 40px; border: none; border-radius: 12px; background: transparent; color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }

/* Listes modifiables des réglages */
.card--list { padding: 0; overflow: hidden; }
.row-edit { border-bottom: 1px solid var(--border-soft); }
.row-edit summary {
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 8px 0 14px;
  list-style: none; cursor: pointer;
}
.row-edit summary::-webkit-details-marker { display: none; }
.row-edit__name { font-size: 15px; font-weight: 700; }
.row-edit__icon { margin-left: auto; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.row-edit[open] summary { background: var(--primary-soft); }
.row-edit__body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; }
.inline-form { display: flex; gap: 8px; width: 100%; }
.inline-form .input { flex: 1; min-width: 0; }
.row-add { padding: 12px 14px; }


/* 8. Étapes 3 et 4 : journée et tirage ----------------------------------- */
.normal-case { text-transform: none; font-weight: 500; }
.btn--xs { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 18px; }
.btn--big { min-height: 56px; font-family: var(--font-title); font-size: 21px; font-weight: 600; }
.btn--veto { background: var(--surface); border-color: var(--orange); color: var(--danger-text); }

/* Compteurs joueurs / âge */
.stepper {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 8px 14px;
  background: var(--surface); border: 1.5px solid var(--border-soft); border-radius: var(--radius);
}
.stepper__label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.stepper__row { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.stepper__btn {
  width: 44px; height: 44px; flex-shrink: 0; border: none; border-radius: 22px;
  background: var(--primary-soft); color: var(--primary-text); font-size: 22px; font-weight: 700; cursor: pointer;
}
.stepper__value { display: flex; align-items: baseline; justify-content: center; gap: 3px; min-width: 0; }
.stepper__value input {
  width: 2.2ch; padding: 0; border: none; background: transparent; text-align: center;
  font-family: var(--font-title); font-weight: 600; font-size: 26px; color: var(--text); outline: none;
}
.stepper__value input::placeholder { color: var(--placeholder); }
.stepper__unit { font-size: 15px; font-weight: 600; }
.stepper__hint { font-size: 12px; color: var(--text-2); text-align: center; min-height: 16px; }
.stepper.is-set .stepper__hint { visibility: hidden; }
.stepper:not(.is-set) .stepper__unit { display: none; }

/* Boutons radio en ligne (temps disponible) */
.segmented--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.segmented__opt { position: relative; }
.segmented__opt input { position: absolute; opacity: 0; pointer-events: none; }
.segmented__opt span {
  display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.segmented__opt input:checked + span { background: var(--primary); color: var(--on-primary); }
.segmented__opt input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Grille des jeux à décocher */
.pick-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pick-toolbar__btns { display: flex; gap: 8px; }
.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 480px) { .pick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pick {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 6px;
  background: var(--surface); border: 2px solid var(--primary); border-radius: var(--radius);
  cursor: pointer; user-select: none; transition: opacity .15s ease;
}
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick__img { display: block; aspect-ratio: 1 / 1; border-radius: 11px; overflow: hidden; }
.pick__name { font-size: 13px; font-weight: 700; text-align: center; line-height: 1.2; overflow-wrap: anywhere; }
.pick__badge { position: absolute; left: 10px; top: 10px; }
.pick__check {
  position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--on-primary);
}
.pick__check .icon { stroke-width: 3.5; }
.pick:has(input:not(:checked)) { border-color: var(--border); opacity: .45; }
.pick:has(input:not(:checked)) .pick__check { background: var(--surface); border: 2px solid var(--text-2); }
.pick:has(input:not(:checked)) .pick__check .icon { display: none; }
.pick:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }

.thumb--fill { width: 100%; height: 100%; border-radius: inherit; font-size: 36px; }

.sticky-action {
  position: sticky; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 5;
  padding-top: 8px; background: linear-gradient(to bottom, transparent, var(--bg) 30%);
}

/* Animation du tirage */
.reel { display: none; }
.is-drawing .reel { display: flex; justify-content: center; padding: 40px 0 20px; }
.is-drawing .result { display: none; }
.reel__item { display: none; flex-direction: column; align-items: center; gap: 14px; width: 240px; }
.reel__item.is-active { display: flex; }
.reel__item .thumb--fill { width: 240px; height: 240px; border-radius: 24px; font-size: 96px; box-shadow: var(--shadow); }
.reel__name { font-family: var(--font-title); font-weight: 600; font-size: 26px; text-align: center; }

/* Carte du résultat */
.result { display: flex; flex-direction: column; gap: 14px; }
.result-card { position: relative; padding: 18px 8px 8px; }
.result-card .confetti i:nth-child(1) { left: 0;   top: 0; }
.result-card .confetti i:nth-child(2) { left: 22%; top: -8px; }
.result-card .confetti i:nth-child(3) { right: 16%; top: -4px; }
.result-card .confetti i:nth-child(4) { right: 0; top: 40px; }
.result-card .confetti i:nth-child(5) { left: -4px; bottom: 30%; }
.result-card .confetti i:nth-child(6) { right: -2px; bottom: 20%; }
.result-card__inner {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px;
  background: var(--surface); border-radius: 24px;
  box-shadow: 0 0 0 8px rgba(250, 204, 21, 0.32), var(--shadow);
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.result-card__img { display: block; width: 100%; height: 200px; border-radius: 16px; overflow: hidden; }
.result-card__img .thumb--fill { font-size: 96px; }
.result-card__kicker { margin-top: 6px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tag-pink-text); }
.result-card__name { font-family: var(--font-title); font-weight: 700; font-size: 34px; line-height: 1.15; text-align: center; }
.result-card__meta { font-size: 14px; font-weight: 600; }
.result-card__tags { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.result-actions { display: flex; flex-direction: column; gap: 10px; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Récap */
.recap-row {
  display: flex; align-items: center; gap: 12px; padding: 8px;
  background: var(--surface); border: 1.5px solid var(--border-soft); border-radius: var(--radius);
}
.recap-row .thumb { width: 48px; height: 48px; font-size: 22px; }
.stat { display: flex; flex-direction: column; padding: 14px; border-radius: var(--radius); font-size: 14px; font-weight: 600; }
.stat__num { font-family: var(--font-title); font-weight: 700; font-size: 32px; line-height: 1.1; }
.stat--violet { background: var(--tag-violet-bg); color: var(--tag-violet-text); }
.stat--orange { background: var(--tag-orange-bg); color: var(--tag-orange-text); }


/* 9. Journées multiples et historique ------------------------------------ */
.day-kicker { font-size: 13px; font-weight: 700; color: var(--primary-text); margin-bottom: 2px; }
.day-card { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; }
.day-card__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.day-card__title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.day-card__num {
  display: inline-block; margin-right: 4px; padding: 0 7px; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary-text); font-family: var(--font-title); font-weight: 700;
}
.link-card { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.link-card > .icon { color: var(--text-2); }
.link-card__icon {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary-text);
}
.link-card__text { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.link-card__title { font-weight: 700; }
.rename-day { padding: 0; }
.rename-day summary {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px;
  font-size: 15px; font-weight: 700; color: var(--primary-text); cursor: pointer; list-style: none;
}
.rename-day summary::-webkit-details-marker { display: none; }
.rename-day form, .rename-day p { padding: 0 16px; }
.rename-day p { padding-bottom: 14px; margin-top: 6px; }
.rename-day__num { align-self: center; font-family: var(--font-title); font-weight: 700; font-size: 18px; color: var(--primary-text); }
.top-list__rank { width: 20px; text-align: center; font-family: var(--font-title); font-weight: 700; font-size: 18px; color: var(--primary-text); }


/* 10. Réglages : sommaire, sous-pages, comptes --------------------------- */
.segmented--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segmented__opt input:disabled + span { cursor: not-allowed; opacity: .7; }

/* Lignes du sommaire (et de la liste des comptes) */
.menu-row {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft); color: var(--text); text-decoration: none;
}
.menu-row:last-child { border-bottom: none; }
.menu-row > .icon { color: var(--text-2); flex-shrink: 0; }
.menu-row:active { background: var(--primary-soft); }
.menu-row__icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.menu-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.menu-row__title { font-size: 16px; font-weight: 700; }
.menu-row__value { font-size: 14px; font-weight: 600; color: var(--text-2); }
.menu-row--off .menu-row__title { color: var(--text-2); text-decoration: line-through; }
.menu-row--off .avatar { background: var(--border); }

/* Badges de rôle */
.badge { flex-shrink: 0; padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.badge--admin  { background: var(--tag-violet-bg); color: var(--tag-violet-text); }
.badge--member { background: var(--tag-blue-bg);   color: var(--tag-blue-text); }
.badge--off    { background: var(--danger-soft);   color: var(--danger-text); }

/* Initiale ronde (comptes) et carte « Mon compte » */
.avatar {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary-text);
  font-family: var(--font-title); font-weight: 700; font-size: 18px;
}
.avatar--big { width: 56px; height: 56px; font-size: 26px; background: var(--primary); color: var(--on-primary); }
.identity { display: flex; align-items: center; gap: 14px; padding: 14px; }
.identity__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.identity__name { font-size: 17px; font-weight: 700; }

/* Vignettes du thème (Apparence) */
.theme-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-tile {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 8px;
  border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--surface); cursor: pointer;
}
.theme-tile[aria-pressed="true"] { border: 2.5px solid var(--primary); padding: 7px; }
.theme-tile__preview { display: flex; flex-direction: column; gap: 5px; height: 96px; padding: 10px; border-radius: 10px; }
.theme-tile__preview--light { background: #FFF7FB; --line: #1E1535; --card: #FFFFFF; }
.theme-tile__preview--dark  { background: #160F2E; --line: #F4F0FF; --card: #221944; }
.theme-tile__preview--auto  { background: linear-gradient(135deg, #FFF7FB 50%, #160F2E 50%); --line: #6B6385; --card: #E4DAF0; }
.theme-tile__line { width: 60%; height: 8px; border-radius: 4px; background: var(--line); }
.theme-tile__card { height: 22px; border-radius: 6px; background: var(--card); }
.theme-tile__btn  { height: 22px; border-radius: 6px; background: var(--gradient); }
.theme-tile__label { font-size: 14px; font-weight: 700; color: var(--text); text-align: center; }
.theme-tile__check {
  display: none; position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 12px;
  align-items: center; justify-content: center; background: var(--primary); color: var(--on-primary);
}
.theme-tile__check .icon { stroke-width: 3.5; }
.theme-tile[aria-pressed="true"] .theme-tile__check { display: flex; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
