/* ===== Salle de jeux ===== */
.stage-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.stage-bar h1 { font-size: clamp(1.4rem, 5vw, 2rem); margin: 0; }
.stage-bar .back { text-decoration: none; padding: 8px 16px; box-shadow: none; }
.tile .chip { margin-top: 12px; display: inline-block; }
.game-box { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.game-box.page, .game-box.mot { max-width: 620px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.seg .tab { padding: 6px 14px; font-size: .92rem; }
.status { display: flex; justify-content: space-between; margin: 0; font-weight: 800; color: var(--ink-soft); }
.wd-msg { text-align: center; min-height: 1.6em; margin: 0; font-weight: 700; }

/* confettis */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 12px; height: 16px; border-radius: 80% 0 80% 0; animation: fall linear forwards; }

/* sudoku */
.sk-grid { display: grid; grid-template-columns: repeat(9, 1fr); border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--card); aspect-ratio: 1; touch-action: manipulation; }
.cell { font: inherit; font-weight: 800; font-size: clamp(1.1rem, 5.2vw, 1.7rem); color: var(--pink-deep); background: var(--card); border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0; cursor: pointer; display: grid; place-items: center; min-width: 0; }
.cell.br { border-right: 2px solid var(--ink); } .cell.bb { border-bottom: 2px solid var(--ink); }
.cell:nth-child(9n) { border-right: 0; } .cell:nth-child(n+73) { border-bottom: 0; }
.cell.given { color: var(--ink); font-weight: 900; }
.cell.peer { background: color-mix(in srgb, var(--pink) 16%, var(--card)); }
.cell.same { background: color-mix(in srgb, var(--gold) 38%, var(--card)); }
.cell.sel { background: color-mix(in srgb, var(--pink) 55%, var(--card)); }
.cell.bad { color: #c1121f; background: repeating-linear-gradient(135deg, color-mix(in srgb, #e63946 22%, var(--card)) 0 5px, color-mix(in srgb, #e63946 34%, var(--card)) 5px 10px); font-weight: 900; text-decoration: underline wavy #c1121f 1.5px; text-underline-offset: 3px; }
.nt { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; height: 100%; font-size: clamp(.5rem, 2.2vw, .72rem); font-weight: 700; color: var(--ink-soft); line-height: 1; }
.nt i { font-style: normal; display: grid; place-items: center; }
.sk-pad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; }
.sk-pad button { font: inherit; font-weight: 900; font-size: 1.3rem; padding: 8px 0 3px; border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px; cursor: pointer; display: grid; line-height: 1.1; }
.sk-pad button small { font-size: .62rem; color: var(--ink-soft); font-weight: 700; }
.sk-pad button.full { opacity: .35; }
.row-actions .btn.ghost.on, .btn.ghost[aria-pressed="true"] { background: var(--pink); color: #5a1d36; border-color: var(--pink); }
.game-box .row-actions { justify-content: center; margin-top: 4px; }
.game-box .row-actions .btn { padding: 9px 16px; box-shadow: none; }
.game-box .row-actions .btn:not(.ghost) { box-shadow: 0 5px 0 #b94d70; }

/* mot du jour */
.wd-grid { display: grid; gap: 6px; width: min(320px, 100%); margin: 0 auto; }
.wd-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wd-cell { aspect-ratio: 1; display: grid; place-items: center; font-weight: 900; font-size: clamp(1.4rem, 7vw, 2rem); text-transform: uppercase; border: 2px solid var(--line); border-radius: 10px; background: var(--card); }
.wd-cell.filled { border-color: var(--ink-soft); animation: bump .12s; }
.wd-cell.s-g { background: #78b98a; border-color: #78b98a; color: #fff; animation: flip .5s both; }
.wd-cell.s-y { background: var(--gold); border-color: var(--gold); color: #4a3406; animation: flip .5s both; }
.wd-cell.s-x { background: var(--ink-soft); border-color: var(--ink-soft); color: #fff; animation: flip .5s both; }
@keyframes flip { from { transform: rotateX(90deg); } to { transform: rotateX(0); } }
@keyframes bump { 50% { transform: scale(1.1); } }
.wd-row.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.wd-kb { display: grid; gap: 6px; margin-top: 4px; }
.wd-kb div { display: flex; justify-content: center; gap: 4px; }
.wd-kb button { font: inherit; font-weight: 800; flex: 1 1 0; max-width: 42px; height: 50px; border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); border-radius: 9px; background: var(--card, #fff); color: var(--ink); cursor: pointer; padding: 0;
  box-shadow: 0 2px 0 color-mix(in srgb, var(--ink) 16%, transparent); transition: transform .06s, box-shadow .06s, background .15s; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.wd-kb button:active { transform: translateY(2px); box-shadow: 0 0 0 transparent; background: color-mix(in srgb, var(--pink) 18%, var(--card, #fff)); }
.wd-kb button.wide { font-size: 1.15rem; }
.wd-kb button.wide { flex: 1.6 1 0; max-width: 64px; }
.wd-kb .k-g { background: #78b98a; color: #fff; } .wd-kb .k-y { background: var(--gold); color: #4a3406; } .wd-kb .k-x { background: color-mix(in srgb, var(--ink-soft) 55%, var(--bg)); color: #fff; opacity: .8; border-color: transparent; box-shadow: none; }

/* devine la page */
.pg-text p { margin: 0 0 .8em; }
.pg-title { margin-bottom: .6em; }
.pw { white-space: normal; }
.pw.hid { display: inline-block; width: calc(var(--n) * .6ch + .2ch); height: .9em; background: var(--ink); opacity: .82; border-radius: 4px; vertical-align: -.1em; margin: 0 .05em; }
.pw.hit { background: color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 4px; padding: 0 2px; }
.pg-form { display: flex; gap: 8px; }
.pg-form input { flex: 1; min-width: 0; font-size: 1rem; }
.pg-hist { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-result { font-family: var(--font-title); font-size: 1.2rem; margin: 10px 0; }
.pg-img { max-width: 100%; max-height: 260px; border-radius: 14px; display: block; margin: 8px 0; }

/* mots mêlés */
.mm-grid { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); max-width: 100%; box-sizing: border-box; gap: 2px; touch-action: none; user-select: none; -webkit-user-select: none; background: var(--card); padding: 8px; border-radius: 16px; border: 1px solid var(--line); }
.mm-c { aspect-ratio: 1; display: grid; place-items: center; font-weight: 900; font-size: clamp(.7rem, calc(42vw / var(--n)), 1.35rem); border-radius: 8px; color: var(--ink); min-width: 0; }
.mm-c.pick { background: var(--pink); color: #5a1d36; }
.mm-c.rate { background: color-mix(in srgb, #ff4d6d 40%, var(--card, #fff)); color: #8a1530; animation: gmTremble .38s ease; }
.myst-mots.plus-bas { -webkit-mask-image: linear-gradient(#000 calc(100% - 22px), rgba(0, 0, 0, .2)); mask-image: linear-gradient(#000 calc(100% - 22px), rgba(0, 0, 0, .2)); }
.mm-c.ok { background: color-mix(in srgb, var(--green) 55%, transparent); }
.mm-words { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mm-words li { background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: .88rem; }
.mm-words li.found { text-decoration: line-through; opacity: .5; }
@media (max-width: 640px) { .sk-pad { grid-template-columns: repeat(5, 1fr); gap: 6px; } .sk-pad button { font-size: 1.25rem; min-height: 48px; } .wd-kb button { height: 48px; } }
.sk-pad button, .wd-kb button, .cell { -webkit-tap-highlight-color: transparent; }
.btn { min-height: 44px; }
/* duo */
.duo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-weight: 800; }
.duo-pres { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); font-size: .9rem; }
.duo-pres::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-soft); }
.duo-pres.on::before { background: #5aa56e; }
.duo-code { font-family: var(--font-title); font-size: 2.4rem; letter-spacing: .25em; text-align: center; margin: 4px 0; }
.duo-form { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.duo-form input { font: inherit; font-weight: 800; text-transform: uppercase; letter-spacing: .2em; text-align: center; width: 9ch; min-height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); }
.duo-score { display: flex; justify-content: center; gap: 18px; font-weight: 900; font-size: 1.1rem; }
.duo-score b { color: var(--pink-deep); }
.tt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(320px, 100%); margin: 0 auto; }
.tt-c { aspect-ratio: 1; font: inherit; font-size: 2.6rem; font-weight: 900; border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 16px; cursor: pointer; }
.tt-c:disabled { cursor: default; }
.tt-c.win { background: color-mix(in srgb, var(--green) 55%, var(--card)); }
.c4-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; width: min(380px, 100%); margin: 0 auto; background: #4a6fa5; padding: 8px; border-radius: 16px; }
.c4-col { display: grid; gap: 4px; padding: 0; border: 0; background: transparent; cursor: pointer; min-height: 44px; }
.c4-col:disabled { cursor: default; }
.c4-d { aspect-ratio: 1; border-radius: 50%; background: var(--bg); }
.c4-d.a { background: #e0698f; } .c4-d.b { background: #f2c14e; }
/* la ligne gagnante : anneau foncé + petite pulsation ; la colonne survolée s'éclaire (ordinateur) */
.c4-d.win { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--ink); animation: c4Gagne 1s ease-in-out 3; }
@keyframes c4Gagne { 50% { transform: scale(.82); } }
@media (prefers-reduced-motion: reduce) { .c4-d.win { animation: none; } }
@media (hover: hover) { .c4-col:not(:disabled):hover { background: color-mix(in srgb, var(--gold) 22%, transparent); border-radius: 10px; } }
.mm-c.mine { background: color-mix(in srgb, var(--pink) 60%, transparent); }
.mm-c.theirs { background: color-mix(in srgb, var(--gold) 60%, transparent); }
.mm-words li.mine { opacity: 1; text-decoration: none; background: color-mix(in srgb, var(--pink) 50%, var(--card)); }
.mm-words li.theirs { opacity: 1; text-decoration: none; background: color-mix(in srgb, var(--gold) 50%, var(--card)); }
.chip.mine { background: color-mix(in srgb, var(--pink) 50%, var(--card)); }
.chip.theirs { background: color-mix(in srgb, var(--gold) 50%, var(--card)); }
.wd-grid.small { width: min(170px, 100%); gap: 3px; margin: 8px 0 0; }
.wd-grid.small .wd-row { gap: 3px; } .wd-grid.small .wd-cell { border-radius: 5px; font-size: .8rem; border-width: 1px; }
.wd-row.mini { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
@media (prefers-reduced-motion: reduce) { .wd-cell, .wd-row.shake { animation: none !important; } }

/* mots fléchés */
.fl-def { margin: 0; min-height: 3.2em; padding: 8px 12px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); font-weight: 700; }
.fl-grid { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 2px; padding: 6px; border-radius: 14px; background: var(--fl-block); touch-action: manipulation; }
.fl-c { aspect-ratio: 1; display: grid; place-items: center; min-width: 0; padding: 0; border: 0; border-radius: 5px; font: inherit; font-weight: 900; font-size: clamp(1rem, 4.8vw, 1.4rem); color: var(--ink); background: var(--fl-cell); cursor: pointer; }
.fl-x { background: var(--fl-block); cursor: default; }
.fl-k { background: color-mix(in srgb, var(--pink) 35%, var(--card)); font-size: .8rem; line-height: 1; grid-template-rows: auto auto; align-content: center; gap: 1px; }
.fl-k i { font-style: normal; font-size: .85rem; color: var(--pink-deep); }
.fl-k.on { background: var(--pink); }
.fl-l.inw { background: color-mix(in srgb, var(--pink) 22%, var(--card)); }
.fl-l.sel { background: color-mix(in srgb, var(--pink) 60%, var(--card)); }
.fl-l.bad { color: #d6336c; background: color-mix(in srgb, #ff4d6d 24%, var(--card)); }
.fl-l.hinted { color: var(--ink-soft); }
.fl-l.mine { color: var(--pink-deep); } .fl-l.theirs { color: #b8860b; }
.fl-lists { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; font-size: .88rem; }
.fl-lists h3 { font-size: 1rem; margin: 0 0 4px; } .fl-lists ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fl-lists li { padding: 4px 6px; border-radius: 8px; cursor: pointer; line-height: 1.3; } .fl-lists li.cur { background: var(--bg-2); } .fl-lists li.ok { opacity: .5; text-decoration: line-through; }
@media (max-width: 520px) { .fl-lists { grid-template-columns: 1fr; } }
.fl-grid { --fl-block: #4a2c3a; --fl-cell: #ffffff; }
:root[data-theme="dark"] .fl-grid { --fl-block: #1d1017; --fl-cell: #5a3547; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fl-grid { --fl-block: #1d1017; --fl-cell: #5a3547; } }
.fl-k { background: color-mix(in srgb, var(--pink) 45%, var(--fl-cell)); color: #3b1d2b; }
.fl-k i { color: #8a2f55; }

/* Carnet */
.cn-cal, .cn-mois { --t: clamp(16px, 3.4vw, 26px); }
.cn-cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 4px; justify-content: start; }
.cn-cal i { width: var(--t); height: var(--t); border-radius: 5px; background: var(--bg-2); border: 1px solid var(--line); }
.cn-mois { display: grid; grid-auto-flow: column; grid-auto-columns: var(--t); gap: 4px; height: 1.3em; margin: 0 0 4px; font-size: .75rem; font-weight: 700; color: var(--ink-soft); }
.cn-mois span { white-space: nowrap; overflow: visible; }
.cn-legende { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 10px 0 0; font-size: .8rem; color: var(--ink-soft); }
.cn-legende i { width: 13px; height: 13px; border-radius: 3px; background: var(--bg-2); border: 1px solid var(--line); }
.cn-legende i:first-of-type { margin-left: 4px; } .cn-legende i:last-of-type { margin-right: 4px; }
.cn-legende i.d1 { background: var(--pink); border-color: color-mix(in srgb, var(--pink-deep, #e0698f) 45%, var(--pink)); } .cn-legende i.d2 { background: color-mix(in srgb, var(--pink-deep, #e0698f) 55%, var(--pink)); border-color: transparent; } .cn-legende i.d3 { background: var(--pink-deep, #e0698f); }
.cn-cal i.blank { visibility: hidden; }
/* un jour joué se voit nettement (audit ordinateur 3, F10 : rose très pâle sur rose pâle) */
.cn-cal i.d1 { background: var(--pink); border-color: color-mix(in srgb, var(--pink-deep, #e0698f) 45%, var(--pink)); }
.cn-cal i.d2 { background: color-mix(in srgb, var(--pink-deep, #e0698f) 55%, var(--pink)); border-color: transparent; }
.cn-cal i.d3 { background: var(--pink-deep, #e0698f); }
.cn-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.cn-bar span { width: 1.2em; font-weight: 800; }
.cn-bar b { display: block; background: var(--pink); color: #5a1d36; border-radius: 6px; padding: 2px 8px; min-width: 2em; }
.cn-link { display: inline-block; margin-top: 18px; }
#cn-games { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 12px; }
#cn-games .tile { padding: 14px; } #cn-games .ico { font-size: 1.8rem; } #cn-games h3 { font-size: 1.05rem; } #cn-games p { font-size: .88rem; }

/* Quiz, Mémo, Plus ou moins */
.qz-q { font-size: 1.25rem; margin: .6em 0; }
.qz-choices { display: grid; gap: 10px; }
.qz-c { text-align: left; min-height: 48px; }
.qz-c.good { background: #cfe8cf; border-color: #7fb685; color: #20401f; }
.qz-c.bad { background: #f6cdd3; border-color: #e0698f; color: #5a1d36; }
.mo-grid { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 8px; margin: 12px 0; }
.mo-c { aspect-ratio: 1; font-size: 1.8rem; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; min-height: 44px; }
.mo-c.up { background: var(--card); } .mo-c.ok { background: color-mix(in srgb, var(--pink) 40%, var(--card)); }
.mo-c:disabled { opacity: 1; }
.pm input[type=number] { width: 100%; }

/* Finitions : tactile, champs lisibles sans zoom iPhone, transitions courtes, aide repliable */
button, .btn, .tab, a.tile { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
input, select, textarea { font-size: 16px; }
.btn, .tab, .mo-c, .qz-c, .cell, .tile { transition: background-color .18s, transform .18s, border-color .18s; }
.btn:active, .tab:active, .mo-c:active, .qz-c:active { transform: scale(.97); }
.how { margin: 0 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; }
.how summary { cursor: pointer; font-weight: 800; min-height: 40px; display: flex; align-items: center; }
.how ul { margin: 0 0 10px; padding-left: 1.2em; color: var(--ink-soft); }
.tile.done { border-color: var(--pink-deep); }
@media (prefers-reduced-motion: reduce) { .btn, .tab, .mo-c, .qz-c, .cell, .tile { transition: none; } .btn:active, .tab:active, .mo-c:active, .qz-c:active { transform: none; } }
.pm input[type=number], .pg-form input { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; background: var(--card); color: var(--ink); min-height: 44px; font-family: inherit; }

/* ---------- jeux du jour : barre commune (partie.js) ---------- */
.pt-barre { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.pt-chrono { font-weight: 900; font-variant-numeric: tabular-nums; min-width: 4.5em; }
.pt-mid { display: flex; gap: 6px; align-items: center; }
.pt-rond, .pt-jetons, .pt-menu-btn { font: inherit; font-weight: 800; border: 0; cursor: pointer; border-radius: 999px; min-height: 38px; }
.pt-rond { width: 38px; background: var(--bg-2, #fdeaf0); color: var(--ink); font-size: 1.25rem; line-height: 1; }
.pt-jetons { padding: 0 12px; background: var(--gold); color: #4a3406; }
.pt-menu-btn { padding: 0 14px; background: var(--ink); color: var(--card); }
.pt-pop { position: absolute; right: 8px; top: calc(100% + 6px); z-index: 30; min-width: 250px; padding: 6px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 2px; }
.pt-pop[data-pop="aides"] { right: auto; left: 50%; transform: translateX(-50%); }
.pt-pop button { font: inherit; display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; border: 0; background: none; color: var(--ink); padding: 10px 12px; border-radius: 10px; cursor: pointer; font-weight: 700; }
.pt-pop button:hover, .pt-pop button:focus-visible { background: var(--bg-2, #fdeaf0); }
.pt-pop small { color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
.pt-pop-t { margin: 4px 12px 6px; font-weight: 900; }
.pt-fin { text-align: center; }
.pt-fin-t { font-family: var(--font-title); font-size: 1.5rem; margin: 0 0 10px; }
/* les chiffres de la partie sur une seule ligne, même en 360 px (« jours de suite » passe sur deux lignes dans sa case) */
.pt-fin-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; max-width: 420px; margin: 0 auto; }
.pt-fin-stats div { min-width: 0; padding: 8px 4px; border-radius: 14px; background: var(--bg-2, #fdeaf0); display: grid; align-content: center; }
.pt-fin-stats span { line-height: 1.15; }
.pt-fin-stats b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.pt-fin-stats span { font-size: .8rem; color: var(--ink-soft); font-weight: 700; }
.pt-fin-r { font-weight: 800; color: var(--pink-deep); }
.pt-fin-cadeau { margin: 8px 0 0; font-weight: 700; font-size: .9rem; color: var(--ink-soft); animation: cadeauVient .4s ease both; }
@keyframes cadeauVient { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .pt-fin-cadeau { animation: none; } }
body.en-jeu .pt-fin.reduit .pt-fin-cadeau { display: none; }
.pt-fin-suiv { display: block; margin-top: 10px; padding: 10px 12px; border-radius: 12px; text-align: center; font-weight: 700; text-decoration: none; color: var(--ink); background: color-mix(in srgb, var(--gold) 28%, var(--card)); border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--line)); }
.pt-fin-suiv:hover { background: color-mix(in srgb, var(--gold) 40%, var(--card)); }
.pt-fin.reduit .pt-fin-suiv { display: none; }
.pt-arch { border: 0; border-radius: 20px; padding: 18px; width: min(420px, calc(100vw - 32px)); background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.pt-arch::backdrop { background: rgba(40, 15, 28, .45); }
.pt-arch h2 { margin: 0 0 10px; font-family: var(--font-title); }
.pt-arch ul { list-style: none; margin: 0 0 12px; padding: 0; max-height: 60vh; overflow: auto; display: grid; gap: 4px; }
.pt-arch li button { font: inherit; width: 100%; display: flex; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); cursor: pointer; font-weight: 700; }
.pt-arch li button.cur { border-color: var(--pink-deep); background: var(--bg-2, #fdeaf0); }
.pt-arch small { color: var(--pink-deep); }
.btn.petit { min-height: 36px; padding: 6px 12px; font-size: .9rem; }

/* ---------- mots fléchés / croisés façon journal (grilles-mots.js) ---------- */
.game-box.gm { max-width: 760px; }
.gm-titre { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.gm-titre p { margin: 0; color: var(--ink-soft); }
.gm-titre b { color: var(--ink); }
.gm-jeu { display: grid; gap: 10px; }
.gm-bandeau { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 6px; min-height: 3.4em; padding: 6px; border-radius: 14px; background: color-mix(in srgb, var(--gold) 30%, var(--card)); border: 1px solid color-mix(in srgb, var(--gold) 60%, var(--line)); }
.gm-bandeau p { flex: 1; margin: 0; font-weight: 700; line-height: 1.3; text-align: center; }
.gm-bandeau p b { display: block; font-size: .78rem; color: var(--ink-soft); }
.gm-prec, .gm-suiv { font: inherit; font-size: 1.6rem; line-height: 1; border: 0; background: none; color: var(--ink); width: 40px; min-height: 44px; cursor: pointer; border-radius: 10px; }
.gm-tout { font: inherit; font-size: 1.15rem; line-height: 1; border: 0; background: color-mix(in srgb, var(--card) 70%, transparent); width: 40px; min-height: 40px; cursor: pointer; border-radius: 10px; flex: none; }
.gm-prec:hover, .gm-suiv:hover, .gm-tout:hover { background: color-mix(in srgb, var(--card) 85%, transparent); }
.gm-cadre { overflow: auto; border-radius: 12px; -webkit-overflow-scrolling: touch; max-height: 75vh; }
.gm-grille { --gm-k: #e4e7ec; --gm-l: #ffffff; --gm-trait: #c9ced6; --gm-noir: #2d2730; --gm-mot: #ffe8a3; --gm-sel: #ffcf3f; container-type: inline-size;
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); width: 100%; border: 2px solid var(--gm-noir); background: var(--gm-trait); gap: 1px; touch-action: manipulation; }
.gm-grille.z1 { width: 145%; } .gm-grille.z2 { width: 195%; } .gm-grille.z3 { width: 260%; }
:root[data-theme="dark"] .gm-grille { --gm-k: #4a3340; --gm-l: #2f1d27; --gm-trait: #5a3547; --gm-noir: #120a0f; --gm-mot: #6b5320; --gm-sel: #a8801c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gm-grille { --gm-k: #4a3340; --gm-l: #2f1d27; --gm-trait: #5a3547; --gm-noir: #120a0f; --gm-mot: #6b5320; --gm-sel: #a8801c; } }
.gm-c { position: relative; aspect-ratio: 1; min-width: 0; padding: 0; border: 0; margin: 0; font: inherit; color: var(--ink); background: var(--gm-l); }
.gm-l { display: grid; place-items: center; font-weight: 800; font-size: calc(100cqi / var(--cols) * .56); cursor: pointer; text-transform: uppercase; }
.gm-l.mot { background: var(--gm-mot); }
.gm-l.sel { background: var(--gm-sel); box-shadow: inset 0 0 0 3px var(--gm-noir); z-index: 1; }
.gm-l.faux { color: #d6336c; background: color-mix(in srgb, #ff4d6d 22%, var(--gm-l)); }
.gm-l.revele { color: #2f6fd6; }
.gm-noire { background: var(--gm-noir); }
/* case sans lettre ni définition (grilles sur mesure) : hachurée, pour qu'on ne la prenne pas pour une définition manquante */
.gm-vide { background: repeating-linear-gradient(135deg, var(--gm-k) 0 5px, color-mix(in srgb, var(--gm-trait) 60%, var(--gm-k)) 5px 6px); }
.gm-k { display: grid; grid-template-rows: 1fr; background: var(--gm-k); }
.gm-k.deux { grid-template-rows: 1fr 1fr; }
.gm-k.deux .gm-def + .gm-def { border-top: 1px solid var(--gm-trait); }
.gm-def { font: inherit; min-width: 0; min-height: 0; overflow: hidden; border: 0; padding: 1px; background: none; color: var(--ink); cursor: pointer; text-transform: uppercase; font-weight: 700;
  font-size: calc(100cqi / var(--cols) * var(--f, .135)); line-height: 1.08; display: flex; align-items: center; justify-content: center; text-align: center; hyphens: manual; overflow-wrap: normal; }
.gm-def.casse { overflow-wrap: anywhere; hyphens: auto; }
.gm-def > span { max-width: 100%; }
.gm-def.abrege > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lc, 1); line-clamp: var(--lc, 1); overflow: hidden; overflow-wrap: anywhere; hyphens: auto; }
.gm-def.on { background: var(--gm-mot); color: #2b1f05; box-shadow: inset 0 0 0 2px var(--gm-sel); }
/* petites flèches : à gauche d'un mot horizontal, en haut d'un mot vertical */
.gm-l.fl-g::before, .gm-l.fl-h::after { content: ""; position: absolute; width: 0; height: 0; border: calc(100cqi / var(--cols) * .09) solid transparent; }
.gm-l.fl-g::before { left: 0; top: 50%; transform: translateY(-50%); border-left-color: var(--gm-noir); border-right-width: 0; }
.gm-l.fl-h::after { top: 0; left: 50%; transform: translateX(-50%); border-top-color: var(--gm-noir); border-bottom-width: 0; }
:root[data-theme="dark"] .gm-l.fl-g::before { border-left-color: #f4a6bb; } :root[data-theme="dark"] .gm-l.fl-h::after { border-top-color: #f4a6bb; }
/* mots croisés : en-têtes de lignes et colonnes */
.gm-grille.croises { border: 0; background: transparent; gap: 0; }
.gm-grille.croises .gm-c { outline: 1px solid var(--gm-trait); }
/* mots croisés sur mesure : les mots se croisent librement, les cases hors des mots restent vides (ni noir, ni trait) */
.gm.mesure .gm-grille.croises .gm-noire { background: transparent; outline: 0; }
.gm.mesure .gm-grille.croises .gm-l { outline: 1.5px solid color-mix(in srgb, var(--gm-noir) 75%, transparent); }
.gm-ent { display: grid; place-items: center; font-weight: 800; color: var(--ink-soft); font-size: calc(100cqi / var(--cols) * .38); aspect-ratio: 1; }
.gm-listes { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; font-size: .92rem; }
.gm-listes h3 { margin: 0 0 6px; font-size: 1rem; }
.gm-listes ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gm-listes li b { display: inline-block; min-width: 1.4em; color: var(--pink-deep); }
.gm-li { cursor: pointer; border-radius: 6px; padding: 0 2px; }
.gm-li.on { background: var(--gm-mot, #ffe8a3); }
.gm-li.ok { opacity: .45; text-decoration: line-through; }
@media (max-width: 560px) { .gm-listes { grid-template-columns: 1fr; } }
.gm-kb { position: sticky; bottom: 0; z-index: 5; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); background: var(--bg); }
@media (pointer: fine) { .gm-kb { display: none; } }
.pt-pop[hidden] { display: none; }
.pt-jetons, .pt-menu-btn, .pt-chrono { white-space: nowrap; }
.gm-cadre:has(.gm-grille.z0) { max-height: none; }
@media (max-width: 480px) { .pt-barre { padding: 6px 8px; gap: 4px; } .pt-rond { width: 34px; min-height: 34px; } .pt-jetons, .pt-menu-btn { min-height: 34px; padding: 0 10px; } }
.sk-msg { margin: 0; min-height: 1.3em; text-align: center; font-weight: 800; color: var(--pink-deep); }
.sk-outils { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px !important; }
.sk-outils .btn { padding: 6px 4px !important; font-size: .82rem; min-height: 46px; line-height: 1.15; min-width: 0; overflow-wrap: anywhere; }
.cell.revele { color: #2f6fd6; }

/* ---------- mots mystères ---------- */
.game-box.myst { max-width: 760px; }
.myst-jeu { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) 190px; align-items: start; }
@media (max-width: 680px) { .myst-jeu { grid-template-columns: minmax(0, 1fr); } }
.myst-grid .mm-c { font-size: clamp(.8rem, 3.6vw, 1.15rem); }
@media (hover: hover) { .myst-grid .mm-c { cursor: pointer; } .pz-cv { cursor: grab; } .pz-cv:active { cursor: grabbing; } }
.myst-grid { position: relative; }
.myst-grid .mm-gel { position: absolute; left: 0; top: 0; pointer-events: none; opacity: .7; z-index: 0; }
.myst-grid .mm-c { position: relative; z-index: 1; }
.myst-grid .mm-c.ok { background: transparent; }
:root[data-theme="dark"] .myst-grid .mm-gel { opacity: .45; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .myst-grid .mm-gel { opacity: .45; } }
.myst-grid .mm-c.reste { background: var(--gold); color: #4a3406; }
.myst-grid .mm-c.flash { animation: myst-flash 1s ease-in-out infinite; }
@keyframes myst-flash { 50% { background: var(--gold); } }
#myst-in.non { animation: shake .4s; border-color: #e0698f; }
@media (prefers-reduced-motion: reduce) { .myst-grid .mm-c.flash { animation: none; outline: 3px solid var(--gold); } }
.myst-mots { columns: 2; column-gap: 10px; font-size: .9rem; }
@media (max-width: 680px) { .myst-mots { columns: 3; } }
.myst-form { display: grid; gap: 8px; }
.myst-ligne { display: flex; gap: 8px; }
.myst-ligne input { flex: 1; min-width: 0; font: inherit; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); }

/* ---------- alphamo ---------- */
.game-box.alpha { max-width: 520px; }
.al-jeu { display: grid; gap: 12px; justify-items: center; }
.al-prog { width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; }
.al-prog span { text-align: right; color: var(--ink-soft); font-weight: 700; font-size: .9rem; }
.al-barre { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: var(--bg-2, #fdeaf0); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.al-barre i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--pink-deep)); border-radius: inherit; }
.al-saisie { margin: 0; min-height: 2.2em; font-size: 1.7rem; font-weight: 900; letter-spacing: .08em; text-align: center; }
.al-saisie .c { color: var(--pink-deep); } .al-saisie .x { color: var(--ink-soft); opacity: .5; } .al-saisie .vide { font-size: 1rem; font-weight: 700; color: var(--ink-soft); letter-spacing: 0; }
.al-fleur { position: relative; width: 264px; height: 264px; }
.al-l { --a: calc((var(--k) - 1) * 60deg); position: absolute; left: 50%; top: 50%; width: 82px; height: 82px; margin: -41px 0 0 -41px; border: 0; cursor: pointer; font: inherit; font-size: 1.6rem; font-weight: 900; color: var(--ink);
  background: var(--bg-2, #fdeaf0); clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); transform: rotate(var(--a)) translateY(-88px) rotate(calc(-1 * var(--a))); }
.al-l.centre { transform: none; background: var(--pink-deep); color: #fff; }
.al-l:active { filter: brightness(.92); }
.al-actions { width: 100%; justify-content: center; }
.al-liste { width: 100%; } .al-liste summary { cursor: pointer; font-weight: 800; }
.al-liste span { display: inline-block; margin: 2px 6px 2px 0; } .al-liste .pg { color: var(--pink-deep); font-weight: 900; }
.al-aides { width: 100%; } .al-aides ul { margin: 6px 0 0; padding-left: 1.2em; }
.al-manques { font-size: .92rem; color: var(--ink-soft); }

/* Puzzle */
.game-box.pz, .game-box.err { max-width: 1100px; }
.pz-zone { width: 100%; }
.pz-cv { display: block; margin: 0 auto; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pz-outils { display: flex; flex-wrap: wrap; }
.pz-outils .btn[aria-pressed="true"] { background: var(--pink); color: #5a1d36; }

/* 7 erreurs */
.err-duo { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .err-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.err-duo canvas { width: 100%; display: block; border-radius: 14px; border: 1px solid var(--line); cursor: crosshair; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.err-points { display: flex; align-items: center; gap: 6px; margin: 0; flex-wrap: wrap; }
.err-points i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--pink); }
.err-points i.ok { background: var(--pink); }
.err-points span { margin-left: 6px; color: var(--ink-soft); font-weight: 700; }

/* Cartes : Solitaire et FreeCell */
.game-box.cj { max-width: 820px; }
.cj-table { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.cj-haut, .cj-bas { display: grid; gap: var(--gap); justify-content: center; align-items: start; }
.cj-solitaire .cj-haut, .cj-solitaire .cj-bas { grid-template-columns: repeat(7, var(--cw)); }
.cj-freecell .cj-haut, .cj-freecell .cj-bas { grid-template-columns: repeat(8, var(--cw)); }
.cj-bas { margin-top: 14px; min-height: calc(var(--ch) * 2.6); }
.pile { position: relative; width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * .12); }
.pile.fond, .pile.cellule, .pile.stock.vide, .pile.col:empty { background: color-mix(in srgb, var(--pink) 14%, transparent); outline: 2px dashed var(--line); outline-offset: -2px; }
.pile.stock { cursor: pointer; }
.cj-as, .cj-recycle { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--cw) * .5); color: var(--ink-soft); opacity: .45; pointer-events: none; }
.cj-recycle { opacity: .8; font-weight: 900; }
.cj-n { position: absolute; top: 3px; right: 3px; padding: 0 5px; border-radius: 99px; background: rgba(255, 255, 255, .85); color: #8a3b5a; font-size: .7rem; font-weight: 800; }
.cd { position: absolute; left: 0; width: var(--cw); height: var(--ch); box-sizing: border-box; border-radius: calc(var(--cw) * .12); background: #fffdfb; border: 1px solid #e3c6d0; box-shadow: 0 1px 2px rgba(90, 29, 54, .18); color: #2b2330; touch-action: none; cursor: grab; }
.cd b { position: absolute; top: 2px; left: 4px; display: flex; align-items: baseline; gap: 1px; font-size: calc(var(--cw) * .34); line-height: 1; font-weight: 900; letter-spacing: -.04em; }
.cd b i { font-style: normal; font-size: .82em; }
.cd span { position: absolute; bottom: 5%; right: 9%; font-size: calc(var(--cw) * .58); line-height: 1; }
.cd.r { color: #d0344f; }
.cd.dos { background: repeating-linear-gradient(45deg, #f4a6be 0 6px, #f8c6d5 6px 12px); border-color: #e88aa8; cursor: default; }
.pile.stock .cd.dos { cursor: pointer; }
.cd.indice, .pile.indice { outline: 3px solid var(--gold); outline-offset: 1px; z-index: 5; }
.pile.indice-dst { outline: 3px dashed var(--gold); outline-offset: 2px; border-radius: 8px; animation: cjDst 1.2s ease-in-out infinite; }
@keyframes cjDst { 50% { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .pile.indice-dst { animation: none; } }
.cd.non { animation: cd-non .3s; }
@keyframes cd-non { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.cd-vol { position: fixed; z-index: 100; pointer-events: none; }
.cd-vol .cd { box-shadow: 0 8px 18px rgba(90, 29, 54, .3); }
.cj-outils { display: flex; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .cd.non { animation: none; } }
/* Mot du jour : la lettre offerte par l'aide, en filigrane */
.wd-cell[data-aide]::after { content: attr(data-aide); opacity: .35; }

/* Accueil des jeux : le programme du jour, puis les rayons */
.jdj { margin: 4px 0 8px; display: grid; gap: 12px; }
.jdj-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.jdj-tete h2 { margin: 0; font-size: 1.3rem; }
.jdj-tete p { margin: 0; color: var(--ink-soft); }
.jdj-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.jdj-j { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; min-width: 0; }
.jdj-j span { grid-row: span 2; font-size: 1.5rem; }
.jdj-j b { font-size: .95rem; line-height: 1.15; overflow-wrap: anywhere; }
.jdj-j small { color: var(--ink-soft); font-weight: 700; font-size: .78rem; }
.jdj-j.fait { background: color-mix(in srgb, var(--green) 22%, var(--card)); }
.jdj-j.fait small { color: inherit; }
.jdj-j:hover, .jdj-j:focus-visible { border-color: var(--pink); }
@media (max-width: 420px) { .jdj-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
h2.rayon { margin: 26px 0 10px; font-size: 1.15rem; }
/* Sur téléphone, pendant une partie, la bulle de l'assistant cacherait le clavier : elle revient sur l'accueil des jeux */
@media (pointer: coarse) { body:has(#stage:not([hidden])) .chat-fab, body:has(#stage:not([hidden])) .chat-preview { display: none; } }

/* Mode d'emploi (didacticiel) et boutons d'aide de la barre du jeu */
.stage-aides { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.stage-aides .btn { padding: 7px 12px; font-size: .9rem; box-shadow: none; min-height: 40px; }
@media (max-width: 640px) { .stage-bar { gap: 8px; } .stage-aides { margin-left: 0; width: 100%; } .stage-aides .btn { flex: 1; } }
.tuto { position: fixed; inset: 0; z-index: 200; }
.tuto-trou { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(42, 24, 34, .62); outline: 3px solid var(--gold); transition: all .25s ease; pointer-events: none; }
.tuto-trou[hidden] { display: block; box-shadow: none; outline: 0; width: 100vw !important; height: 100vh !important; left: 0 !important; top: 0 !important; background: rgba(42, 24, 34, .62); }
.tuto-bulle { position: fixed; width: min(360px, calc(100vw - 20px)); box-sizing: border-box; background: var(--card); color: var(--ink); border-radius: 18px; padding: 16px 18px 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); border: 2px solid var(--line); transition: top .25s ease, left .25s ease; }
.tuto-bulle h2 { margin: 0 0 6px; font-size: 1.15rem; font-family: var(--font-title); }
.tuto-bulle p { margin: 0 0 12px; line-height: 1.45; }
.tuto-bulle .tuto-n { margin: 0 0 4px; font-size: .8rem; font-weight: 800; color: var(--ink-soft); }
.tuto-btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.tuto-btns .btn { padding: 8px 14px; min-height: 42px; }
.tuto-btns [data-t="passer"] { margin-right: auto; }
@media (prefers-reduced-motion: reduce) { .tuto-trou, .tuto-bulle { transition: none; } }

/* Mots fléchés et croisés : mot juste en vert (petite vague), mot plein mais faux qui tremble */
.gm-l.bon { color: #2e8a4e; }
:root[data-theme="dark"] .gm-l.bon { color: #8fe0a8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gm-l.bon { color: #8fe0a8; } }
.gm-l.vague { animation: gmVague .55s ease calc(var(--d, 0) * 70ms) both; }
@keyframes gmVague { 0% { transform: scale(1); } 40% { transform: scale(1.18); background: #b8ecc6; color: #1f6b3a; z-index: 2; } 100% { transform: scale(1); } }
.gm-l.tremble { animation: gmTremble .4s ease; }
@keyframes gmTremble { 20%, 60% { transform: translateX(-3px); } 40%, 80% { transform: translateX(3px); } }
/* La bulle se pose AU-DESSUS du bandeau (jamais sur la nouvelle définition), et le bandeau s'allume en vert (ou rose). */
.gm-bravo { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); margin: 0; z-index: 6; pointer-events: none; padding: 4px 14px; border-radius: 999px; font-weight: 800; font-size: .92rem; line-height: 1.3; background: #2e8a4e; color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .2); animation: gmBravo 1.5s ease both; white-space: nowrap; }
.gm-bravo.non { background: var(--pink-deep); }
@keyframes gmBravo { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.85); } 15%, 75% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -8px); } }
.gm-bandeau.flash-ok { animation: gmFlashOk .9s ease; }
.gm-bandeau.flash-non { animation: gmFlashNon .9s ease; }
@keyframes gmFlashOk { 30% { box-shadow: 0 0 0 3px #2e8a4e; border-color: #2e8a4e; } }
@keyframes gmFlashNon { 30% { box-shadow: 0 0 0 3px var(--pink-deep); border-color: var(--pink-deep); } }
@media (prefers-reduced-motion: reduce) { .gm-l.vague, .gm-l.tremble { animation: none; } .gm-bravo { animation-duration: 2s; } .gm-bandeau.flash-ok, .gm-bandeau.flash-non { animation: none; } }

/* Défis entre amis (js/jeux/defi.js) */
.defi-bandeau { flex: none; display: flex; align-items: center; gap: 6px; margin: 0 0 6px; padding: 4px 4px 4px 12px; border-radius: 12px; font-size: .92rem; background: color-mix(in srgb, var(--gold) 22%, var(--card)); border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--line)); }
.defi-bandeau > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.defi-bandeau > button { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); font: inherit; font-weight: 800; cursor: pointer; }
.defi-bandeau > button:hover { background: color-mix(in srgb, var(--gold) 30%, var(--card)); }
.defi-fin { margin-top: 10px; display: grid; gap: 8px; justify-items: center; }
.defi-res { margin: 0; font-weight: 800; }
.defi-res.gagne { color: var(--pink-deep); }
.defi-duel { display: flex; gap: 10px; justify-content: center; }
.defi-duel div { display: grid; min-width: 110px; padding: 6px 10px; border-radius: 12px; background: var(--bg-2, #fdeaf0); }
.defi-duel span { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 700; font-size: .9rem; }
.pt-fin.reduit .defi-fin { display: none; }
@media (max-width: 380px) { .defi-bandeau { font-size: .84rem; padding-left: 8px; gap: 2px; } }
/* Course à deux en direct (js/jeux/course.js) : la barre rose qui se remplit = où en est l'autre. */
.course-bandeau { --pct: 0%; flex: none; display: flex; align-items: center; gap: 6px; margin: 0 0 6px; padding: 4px 4px 4px 12px; border-radius: 12px; font-size: .92rem; font-variant-numeric: tabular-nums;
  border: 1px solid color-mix(in srgb, var(--pink) 55%, var(--line));
  background: linear-gradient(90deg, color-mix(in srgb, var(--pink) 30%, var(--card)) var(--pct), color-mix(in srgb, var(--pink) 8%, var(--card)) var(--pct)); transition: background .6s; }
.course-bandeau > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-bandeau > button { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); font: inherit; font-weight: 800; cursor: pointer; }
.course-bandeau > button:hover { background: color-mix(in srgb, var(--pink) 25%, var(--card)); }
.course-bandeau > .course-y { flex: none; padding: 4px 10px; font-weight: 800; color: var(--pink-deep); text-decoration: none; }
.course-bandeau[data-mode="ailleurs"] { --pct: 0%; }
.course-dlg .course-code { margin: 4px 0 6px; text-align: center; font: 800 2.2rem/1.1 var(--font-title, inherit); letter-spacing: .25em; color: var(--pink-deep); }
.course-dlg .course-stop { display: block; margin: 12px auto 0; border: 0; background: none; color: var(--ink-soft); font: inherit; font-size: .88rem; text-decoration: underline; cursor: pointer; }
@media (max-width: 380px) { .course-bandeau { font-size: .84rem; padding-left: 8px; gap: 2px; } }

/* Mots mystères sur mesure (mots choisis par l'IA) */
.gm-titre-btns { display: inline-flex; gap: 6px; flex: none; }
.mesure-dlg { width: min(92vw, 480px); box-sizing: border-box; }
.mesure-dlg h2 { margin: 0 0 6px; outline: none; }
.mesure-dlg p { margin: 0 0 10px; color: var(--ink-soft); }
.mes-ligne { display: flex; gap: 8px; margin-bottom: 6px; }
.mes-ligne input { flex: 1; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); }
.mes-ligne .btn { flex: none; }
.mesure-dlg .mes-t { margin: 10px 0 6px; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.mes-puces { display: flex; flex-wrap: wrap; gap: 6px; }
.mes-puce { font: inherit; font-size: .9rem; font-weight: 700; padding: 6px 12px; min-height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.mes-puce:hover, .mes-puce:focus-visible { border-color: var(--pink-deep); background: color-mix(in srgb, var(--pink) 18%, var(--card)); }
.mes-puce.a-moi { background: color-mix(in srgb, var(--gold) 22%, var(--card)); }
.mesure-dlg .row-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.mes-attente { text-align: center; display: grid; gap: 4px; justify-items: center; padding: 24px 16px; }
.mes-attente p { margin: 0; }
.mes-baguette { font-size: 2.6rem; animation: mesBaguette 1.4s ease-in-out infinite; }
.mes-etape { color: var(--pink-deep); font-weight: 800; }
@keyframes mesBaguette { 0%, 100% { transform: rotate(-12deg) scale(1); } 50% { transform: rotate(14deg) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .mes-baguette { animation: none; } }
@media (max-width: 420px) { .gm-titre .lbl-mesure { display: none; } }
.jdj-carnet { font-weight: 800; color: var(--pink-deep); text-decoration: none; white-space: nowrap; }
.jdj-carnet:hover { text-decoration: underline; }
.jdj-mesure { margin-top: 10px; padding: 8px 12px; border-radius: 12px; font-size: .92rem; color: var(--ink); text-decoration: none; background: color-mix(in srgb, var(--pink) 14%, var(--card)); border: 1px dashed color-mix(in srgb, var(--pink-deep) 45%, var(--line)); }
.jdj-mesure { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.jdj-mes-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.jdj-mes-btns a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; font-weight: 800; font-size: .88rem; color: var(--ink); text-decoration: none; background: var(--card); border: 1px solid color-mix(in srgb, var(--pink-deep) 35%, var(--line)); }
.jdj-mes-btns a:hover { background: color-mix(in srgb, var(--pink) 24%, var(--card)); }


/* Quiz sur mesure (js/jeux/quiz-mesure.js) */
.qm .qm-accueil { text-align: center; }
.qm .qm-accueil p { color: var(--ink-soft); max-width: 46ch; margin: 0 auto 14px; }
.qm .qm-grand { font-size: 2.6rem; margin: 0; line-height: 1.1; }
.qm h2 { margin: .3em 0 .4em; }
.qm .mes-t { margin: 16px 0 8px; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.qm-miens { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.qm-mien { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.qm-mien:hover { border-color: var(--pink-deep); }
.qm-mien small { color: var(--ink-soft); white-space: nowrap; }
.qm-haut { gap: 10px; align-items: center; }
.qm-haut .qm-titre { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.2; }   /* titre sur 2 lignes plutôt que coupé */
.qm-haut > span:last-child { flex: none; }
.qm-points { display: flex; gap: 5px; justify-content: center; margin: 6px 0 2px; }
.qm-points i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.qm-points i.ok { background: #7fb685; } .qm-points i.ko { background: #e0698f; } .qm-points i.ici { background: var(--pink-deep); transform: scale(1.25); }
.qm .qm-q { font-size: clamp(1.05rem, 2.6vw + .5rem, 1.35rem); line-height: 1.3; }
.qm-choix .qz-c { display: flex; align-items: center; gap: 10px; }
.qm-l { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: .8rem; font-weight: 800; background: color-mix(in srgb, var(--pink) 22%, var(--card)); }
.qm-expl { min-height: 2.6em; text-align: left; }
.qm-choix .qz-c:disabled { opacity: 1; cursor: default; }
.qm-choix .qz-c:disabled:not(.good):not(.bad) { opacity: .5; }
.qm-suite { min-height: 48px; }
.qm-fin { text-align: center; }
.qm-score { font-size: 1.4rem; margin: 0; } .qm-score b { font-size: 2.6rem; color: var(--pink-deep); }
.qm-fin .row-actions { justify-content: center; flex-wrap: wrap; }
@media (max-width: 420px) { .qm-choix { gap: 8px; } .qm-choix .qz-c { min-height: 44px; padding-top: 6px; padding-bottom: 6px; } .qm .qm-q { margin: .4em 0; } }

/* Carnet : la carte du Jardin respire (avant, « Voir le Jardin » mordait sur la dernière ligne du texte) */
.cn-jar-carte { margin-top: 16px; }
.cn-jar-lien { margin: 16px 0 4px; }

/* Accueil des jeux sur téléphone : tuiles en ligne (vignette à gauche, texte à droite), deux fois moins hautes :
   l'accueil passe d'environ 8 300 px à moins de la moitié, on voit trois ou quatre jeux par écran au lieu d'un et demi. */
@media (max-width: 640px) {
  #hub .tiles { grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
  #hub .tile { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 14px; align-items: center; padding: 12px 14px; }
  #hub .tile > .ico { grid-row: 1 / span 3; grid-column: 1; align-self: center; width: 64px; height: 64px; margin: 0; font-size: 2.2rem; text-align: center; line-height: 64px; }
  #hub .tile > h3 { grid-column: 2; margin: 0; font-size: 1.08rem; }
  #hub .tile > p { grid-column: 2; font-size: .9rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #hub .tile > .chip { grid-column: 2; justify-self: start; margin-top: 6px; }
}
/* mode sobre : pas de vignette, le texte reprend toute la largeur */
@media (max-width: 640px) {
  :root[data-mode="sobre"] #hub .tile { grid-template-columns: minmax(0, 1fr); }
  :root[data-mode="sobre"] #hub .tile > :is(h3, p, .chip) { grid-column: 1; }
}

/* Sudoku : une ligne, une colonne ou un carré complet s'éclaire une seconde, case après case */
@keyframes skEclat { 40% { background-color: color-mix(in srgb, var(--pink) 60%, var(--card)); transform: scale(1.06); } }
.sk-grid .cell.eclat { animation: skEclat .75s ease-out both; animation-delay: calc(var(--k, 0) * 40ms); }
@media (prefers-reduced-motion: reduce) { .sk-grid .cell.eclat { animation: none; } }

/* Course à deux : voile sur la grille avant le départ commun (js/jeux/course.js) */
body.en-jeu #stage { position: relative; }
.course-voile { position: absolute; z-index: 30; display: grid; place-items: center; padding: 16px; box-sizing: border-box; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.course-voile .card { max-width: 380px; text-align: center; }
.course-voile .cv-grand { font-size: 3rem; font-weight: 900; margin: 0 0 6px; color: var(--pink-deep, #c2456e); animation: cvPop .6s ease-out; }
@keyframes cvPop { from { transform: scale(.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .course-voile .cv-grand { animation: none; } }

/* Carnet : retour aux jeux aussi en haut de la page (audit téléphone 3, F10) */
.cn-haut { margin: 4px 0 6px; }
.cn-haut .btn { display: inline-flex; align-items: center; min-height: 42px; padding: 0 14px; }
.course-reessai { float: right; margin-left: 6px; min-height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--pink-deep); background: var(--card); color: var(--ink); font: inherit; font-weight: 800; font-size: .85rem; cursor: pointer; }
@media (pointer: coarse) {
  .mes-puce { min-height: 42px; }
  .jdj-carnet { display: inline-block; padding: 10px 4px; margin: -10px -4px; }
  .game-box.qm a[data-accueil] { display: inline-block; padding: 12px 6px; margin: -12px -6px; }
}
/* Puissance 4 sur grand écran : un plateau plus grand (audit ordinateur 3, F15 : 380 px, 42 % de la hauteur), sans faire défiler */
@media (min-width: 1000px) and (min-height: 760px) { .c4-grid { width: min(520px, 100%, calc((100dvh - 340px) * 7 / 6)); } }

/* ===== Classement (js/jeux/classement.js) ===== */
.cl-bandeau { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 14px; }
.cl-bandeau .cl-txt { flex: 1; color: var(--ink-soft); font-size: .95rem; line-height: 1.4; }
.cl-bandeau .cl-txt b { color: var(--ink); margin-right: 4px; }
.cl-bandeau .btn { flex: none; white-space: nowrap; }
@media (max-width: 520px) { .cl-bandeau { padding: 10px 12px; gap: 10px; } .cl-bandeau .cl-txt { font-size: .86rem; } }
.cl-dlg { width: min(520px, calc(100vw - 24px)); max-width: none; height: min(640px, calc(100dvh - 32px)); padding: 0; display: none; flex-direction: column; overflow: hidden; }
.cl-dlg[open] { display: flex; }
.cl-tete { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.cl-tete h2 { margin: 0; font-size: 1.3rem; }
.cl-onglets { display: flex; gap: 6px; padding: 0 18px; }
.cl-onglets .tab { flex: 1 1 auto; padding: 7px 8px; font-size: .88rem; white-space: nowrap; min-width: 0; }
@media (max-width: 400px) { .cl-onglets { gap: 4px; padding: 0 12px; } .cl-onglets .tab { font-size: .8rem; padding: 6px 6px; } }
.cl-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 18px 4px; min-height: 36px; color: var(--ink-soft); font-weight: 700; }
.cl-corps { flex: 1; overflow-y: auto; padding: 4px 18px 18px; overscroll-behavior: contain; }
.cl-corps h3 { margin: 14px 0 6px; font-size: 1rem; }
.cl-aide { margin: 0 0 6px; color: var(--ink-soft); font-size: .85rem; }
.cl-vide { color: var(--ink-soft); text-align: center; margin: 24px 0; }
.cl-liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.cl-liste li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; background: var(--bg); }
.cl-liste li.moi { background: var(--pink); font-weight: 700; }
.cl-m { width: 28px; text-align: center; font-size: 1.15rem; flex: none; }
.cl-rang { font-size: .9rem; font-weight: 800; color: var(--ink-soft); }
.cl-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-n small, .cl-v small { color: var(--ink-soft); font-weight: 600; }
.cl-v { flex: none; font-size: .9rem; white-space: nowrap; }
:root[data-look="jeu"] .cl-liste li.moi { color: var(--jeu-sur); }
