/* ---------------------------------------------------------------------------
   Motchi / Motchi — thème « feutre bleu & or », mascotte panda roux.
   Porté depuis le prototype design (Motchi/theme.css).
--------------------------------------------------------------------------- */

:root {
    --primary: #4A7EC8;
    --primary-dark: #35619F;
    --gold: #FACC15;
    --gold-dark: #D9AC06;
    --panda: #B24E2A;
    --felt-1: #33578C;
    --felt-2: #264268;
    --cream: #FBF7EE;
    --cream-2: #F3ECDC;
    --paper-border: #E2D6BB;
    --ink: #23375E;
    --ink-soft: #4A3D28;
    --cream-sub: #9C8A66;
    --light: #EAF2FF;
    --light-sub: #C7D5EC;
    --success: #16A34A;
    --danger: #EF4444;
    --warning: #FB923C;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    font-family: 'Nunito', sans-serif;
    color: var(--light);
    background:
        radial-gradient(90% 60% at 50% -10%, rgba(255,255,255,.08), transparent),
        repeating-linear-gradient(45deg, rgba(0,0,0,.035) 0 2px, transparent 2px 4px),
        linear-gradient(160deg, var(--felt-1) 0%, var(--felt-2) 100%);
    background-attachment: fixed;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* ── App shell ── */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 26px; padding-top: calc(16px + env(safe-area-inset-top));
    position: sticky; top: 0; z-index: 40;
    backdrop-filter: blur(6px); background: rgba(38,66,104,.55);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand {
    display: flex; align-items: center; gap: 10px;
    font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 20px;
    color: #fff; text-decoration: none; white-space: nowrap;
}
.brand-badge {
    width: 36px; height: 36px; border-radius: 11px; background: var(--cream);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    box-shadow: inset 0 0 0 1.5px var(--paper-border), 0 2px 6px rgba(0,0,0,.2);
}
.brand-badge svg { width: 30px; height: 30px; }
.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topnav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topnav-user {
    color: var(--light-sub); font-size: 13px; font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    text-decoration: none; transition: color .12s;
}
a.topnav-user:hover { color: #fff; }

.stats { display: flex; align-items: center; gap: 10px; }
.manche { font-weight: 800; font-size: 14px; padding: 5px 14px; border-radius: 20px; background: rgba(255,255,255,.14); color: var(--light); white-space: nowrap; }
.score { font-weight: 900; font-size: 15px; padding: 5px 16px; border-radius: 20px; background: var(--gold); color: #3A2E00; display: flex; gap: 6px; align-items: center; white-space: nowrap; }

.stage { flex: 1; padding: 26px; display: flex; justify-content: center; }
.wrap { width: 100%; max-width: 940px; animation: fade .2s ease; }
.wrap-narrow { max-width: 460px; }
.col-narrow { max-width: 460px; margin: 0 auto; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Mascotte + bulle ── */
.mascot-row { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.mascot-row .panda { flex-shrink: 0; filter: drop-shadow(0 6px 10px rgba(0,0,0,.2)); }
.bubble {
    background: linear-gradient(180deg, var(--cream), var(--cream-2));
    border-radius: 18px 18px 18px 5px; padding: 14px 18px; flex: 1;
    font-family: 'Fredoka', sans-serif; font-weight: 500; font-size: 16px;
    color: var(--ink-soft); line-height: 1.4;
    box-shadow: 0 8px 22px rgba(0,0,0,.2); align-self: center;
}
.bubble b, .bubble strong { color: var(--panda); }

/* ── Grille ── */
.grid2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 720px) { .grid2 { grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: start; } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.center { text-align: center; }

/* ── Panneaux ── */
.paper {
    background: linear-gradient(180deg, var(--cream), var(--cream-2));
    border-radius: 20px; padding: 22px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.04), 0 12px 30px rgba(0,0,0,.22);
}
.glass {
    background: rgba(255,255,255,.1); border-radius: 20px; padding: 20px;
    border: 1px solid rgba(255,255,255,.14);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.count { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 13px; color: #3A2E00; background: var(--gold); padding: 4px 12px; border-radius: 20px; }

/* ── Labels & hints ── */
.label { font-family: 'Space Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; margin-bottom: 10px; display: block; }
.label.on-felt { color: var(--light-sub); }
.label.on-paper { color: var(--cream-sub); }
.hint { font-size: 13px; margin-top: 10px; }
.hint.on-felt { color: var(--light-sub); }
.hint.on-paper { color: var(--cream-sub); }
.hint a { color: inherit; font-weight: 800; }
.paper-title { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 18px; color: var(--ink); }
.h1 { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 26px; color: #fff; }
.muted { color: var(--light-sub); font-size: 15px; line-height: 1.55; }

/* ── Carte mot mystère ── */
.word-card {
    background: #fff; border-radius: 24px; padding: 28px 24px; text-align: center;
    box-shadow: 0 10px 0 #E7D9BC, 0 22px 34px rgba(0,0,0,.28);
    transform: rotate(-1.5deg); position: relative; margin: 14px 0 22px; border: 3px solid #fff;
}
.word-ribbon {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    background: var(--gold); color: #5A4300; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 12px;
    padding: 5px 16px; border-radius: 20px; box-shadow: 0 4px 0 var(--gold-dark); white-space: nowrap;
}
.word-big { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 46px; color: var(--ink); letter-spacing: 1px; margin-top: 6px; text-transform: uppercase; }
.word-sm { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 22px; color: var(--ink); letter-spacing: 1px; background: #fff; display: inline-block; padding: 6px 20px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.18); text-transform: uppercase; }
@media (max-width: 520px) { .word-big { font-size: 38px; } }

/* ── Champs ── */
.field {
    width: 100%; border-radius: 16px; padding: 16px 18px;
    font-family: 'Fredoka', sans-serif; font-weight: 500; font-size: 22px;
    outline: none; background: #fff; border: 3px solid var(--paper-border); color: var(--ink);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.field:focus { border-color: var(--gold); box-shadow: 0 6px 18px rgba(0,0,0,.18); transform: translateY(-1px); }
.field.code { text-align: center; letter-spacing: 8px; font-size: 28px; font-weight: 700; text-transform: uppercase; }
.field.small { font-size: 17px; padding: 13px 16px; font-family: 'Nunito', sans-serif; font-weight: 700; }
.field-group { margin-bottom: 16px; }
.form-errors, ul.form-errors { list-style: none; margin: 6px 0 0; padding: 0; color: var(--danger); font-size: 13px; font-weight: 700; }

/* ── Boutons ── */
.btn {
    width: 100%; border: none; cursor: pointer; text-decoration: none; text-align: center;
    display: inline-block;
    font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 19px;
    padding: 16px; border-radius: 18px; background: var(--primary); color: #fff;
    box-shadow: 0 6px 0 var(--primary-dark);
    transition: transform .12s cubic-bezier(.34,1.56,.64,1), box-shadow .12s, opacity .12s;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 0 var(--primary-dark); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--primary-dark); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.gold { background: var(--gold); color: #3A2E00; box-shadow: 0 6px 0 var(--gold-dark); }
.btn.gold:hover:not(:disabled) { box-shadow: 0 8px 0 var(--gold-dark); }
.btn.gold:active:not(:disabled) { box-shadow: 0 2px 0 var(--gold-dark); }
.btn-outline {
    width: 100%; cursor: pointer; text-decoration: none; text-align: center; display: inline-block;
    font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 16px;
    padding: 14px; border-radius: 16px; background: transparent; color: var(--light);
    border: 2px solid rgba(255,255,255,.4); transition: background .12s;
}
.btn-outline:hover { background: rgba(255,255,255,.1); }
.btn-ghost { background: none; border: none; color: var(--light-sub); font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 14px; cursor: pointer; padding: 8px; text-decoration: none; display: inline-block; }
.btn-ghost:hover { color: #fff; }
.btn-top { width: auto; font-size: 14px; padding: 8px 16px; border-radius: 12px; box-shadow: 0 4px 0 var(--primary-dark); }
.btn-top:hover:not(:disabled) { box-shadow: 0 5px 0 var(--primary-dark); }
.btn-outline.btn-top { padding: 7px 14px; border-radius: 12px; box-shadow: none; }
.btn-icon { padding: 7px 11px; font-size: 15px; line-height: 1; }
.btn-row { display: flex; gap: 12px; }
.btn-row .grow { flex: 2; }
.btn-row .shrink { flex: 1; }

/* ── Flashes ── */
.flash { border-radius: 14px; padding: 12px 16px; font-size: 14px; font-weight: 700; margin-bottom: 14px; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.flash-error, .flash-danger { background: #FEE2E2; color: #B91C1C; }
.flash-success { background: #DCFCE7; color: #15803D; }
.flash-warning, .flash-info { background: #FEF3C7; color: #92400E; }

/* ── Joueurs ── */
.players { display: flex; flex-direction: column; gap: 9px; }
.prow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.prow.me { box-shadow: 0 0 0 2px var(--gold), 0 2px 6px rgba(0,0,0,.06); }
.pav { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 16px; color: #fff; text-transform: uppercase; }
.pname { flex: 1; font-weight: 700; font-size: 15px; color: #2A3F66; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pstatus { font-size: 13px; font-weight: 700; }
.pstatus.done { color: var(--success); }
.pstatus.wait { color: #9AA7BD; }
.prow.empty { background: transparent; border: 2px dashed rgba(255,255,255,.25); box-shadow: none; color: var(--light-sub); font-size: 14px; }
.pav.empty { background: transparent; border: 2px dashed rgba(255,255,255,.3); color: var(--light-sub); }

.game-list { display: flex; flex-direction: column; gap: 10px; }
.game-row { text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; letter-spacing: 1px; }
.game-row:hover { transform: translateY(-2px); box-shadow: 0 5px 12px rgba(0,0,0,.12); }
.game-row .pname { display: flex; flex-direction: column; gap: 1px; font-family: 'Space Mono', monospace; letter-spacing: 1.5px; }
.game-row-sub { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 12px; color: #9AA7BD; letter-spacing: 0; }

/* ── Code de partie ── */
.code-row { display: flex; gap: 10px; align-items: stretch; }
.code-display {
    flex: 1; border-radius: 16px; padding: 14px 18px; background: #fff; border: 3px solid var(--paper-border);
    font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 28px; color: var(--ink);
    text-align: center; letter-spacing: 8px; text-transform: uppercase;
}
.code-copy { width: auto; padding: 0 18px; font-size: 20px; }

/* ── Cartes indices (révision) ── */
.clue-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-radius: 12px; border: 2px solid var(--paper-border); background: #fff; margin-bottom: 8px; transition: all .15s; }
.clue-card .cw { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 18px; color: var(--ink); overflow-wrap: anywhere; }
.clue-card .cp { font-size: 12px; color: var(--cream-sub); margin-top: 2px; }
.clue-reason { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 800; color: var(--danger); background: #FEE2E2; border: 1px solid var(--danger); border-radius: 10px; padding: 1px 8px; }
.clue-card.dup { border-color: var(--danger); background: #FEF2F2; opacity: .78; }
.clue-card.dup .cw { color: #9CA3AF; text-decoration: line-through; }
.clue-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mark-btn {
    width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--paper-border);
    background: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; color: var(--cream-sub); flex-shrink: 0; cursor: pointer;
    transition: all .15s;
}
.mark-btn:hover { border-color: var(--danger); color: var(--danger); background: #FEE2E2; }
.mark-off { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--danger); background: #FEE2E2; color: var(--danger); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; flex-shrink: 0; }
.mark-off.ok { border-color: var(--success); background: #DCFCE7; color: var(--success); }
.vote-btn { width: 38px; height: 34px; border-radius: 12px; border: 2px solid var(--paper-border); background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; cursor: pointer; line-height: 1; transition: all .15s; filter: grayscale(1); opacity: .55; }
.vote-btn:hover { border-color: var(--warning); filter: none; opacity: 1; }
.vote-btn.on { border-color: var(--warning); background: #FFF7ED; filter: none; opacity: 1; }
.vote-count { font-family: 'Nunito', sans-serif; font-size: 11px; font-weight: 800; color: var(--warning); background: #FFF7ED; border: 1px solid #FED7AA; border-radius: 10px; padding: 1px 7px; white-space: nowrap; }

/* ── Palmarès de fin de partie ── */
.palmares-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.palmares-label { font-family: 'Space Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; margin: 16px 0 10px; }
.palmares-label.good { color: var(--gold-dark); }
.palmares-label.tease { color: var(--panda); }
.palmares-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.award-card { display: flex; flex-direction: column; align-items: center; text-align: center; border: 2px solid var(--paper-border); border-radius: 14px; padding: 12px 10px 10px; background: #fff; }
.award-card.good { background: linear-gradient(180deg, #FFF8DC, #fff 62%); border-color: #EFD778; }
.award-card.tease { background: linear-gradient(180deg, #FBEDE6, #fff 62%); border-color: #E7C6B4; }
.award-panda { width: 74px; height: 74px; display: flex; align-items: center; justify-content: center; }
.award-title { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 16px; color: var(--ink); margin-top: 2px; }
.award-desc { font-size: 12px; color: var(--cream-sub); margin: 4px 0 10px; line-height: 1.35; }
.award-stat { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-family: 'Space Mono', monospace; font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: #F6EEDD; border: 1px solid var(--paper-border); }
.award-stat .who { color: var(--ink); }
.award-stat .val { color: var(--panda); }
.award-card.good .award-stat .val { color: var(--gold-dark); }
.award-stat .dot { color: var(--cream-sub); }

/* ── Chips & tags ── */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.chip.blue { background: #E8F0FE; color: var(--primary); }
.chip.gold { background: var(--gold); color: #3A2E00; }
.chip.green { background: #DCFCE7; color: var(--success); }
.chip.danger { background: #FEE2E2; color: var(--danger); }
.chip.pill-felt { background: rgba(255,255,255,.14); color: var(--light); }
.chip.pill-paper { background: rgba(0,0,0,.06); color: var(--ink-soft); }
.recap-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Récap : manches dépliables ── */
.recap-round { padding: 0; overflow: hidden; }
.recap-summary { list-style: none; cursor: pointer; padding: 15px 18px; display: flex; flex-direction: column; gap: 8px; -webkit-tap-highlight-color: transparent; }
.recap-summary::-webkit-details-marker { display: none; }
.recap-summary:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 20px; }
.recap-summary-top { display: flex; align-items: center; gap: 8px; }
.recap-chevron { margin-left: auto; color: var(--cream-sub); font-size: 20px; line-height: 1; transition: transform .2s ease; }
.recap-round[open] .recap-chevron { transform: rotate(180deg); }
.recap-word { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 19px; color: var(--ink); letter-spacing: 1px; text-transform: uppercase; overflow-wrap: anywhere; }
.recap-body { padding: 4px 18px 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: #fff; border: 1.5px solid var(--paper-border); border-radius: 10px; padding: 7px 14px; font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; text-transform: uppercase; }
.tag.ghost { background: transparent; border-style: dashed; border-color: rgba(255,255,255,.3); color: var(--light-sub); font-weight: 500; text-transform: none; }
.tag.on-paper-ghost { background: transparent; border-style: dashed; border-color: var(--paper-border); color: var(--cream-sub); font-weight: 500; text-transform: none; }

/* ── Attente ── */
.waiting-note { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 700; }
.waiting-note.on-felt { color: var(--light-sub); }
.waiting-note.on-paper { color: var(--cream-sub); }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); animation: pulse 1.2s ease-in-out infinite; flex-shrink: 0; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }

/* ── Confettis ── */
.confetti-piece { position: fixed; width: 10px; height: 10px; z-index: 90; pointer-events: none; will-change: transform, opacity; }

/* ── Mode Blitz ── */
.mode-picker { border: 0; margin: 0 0 18px; min-width: 0; }
.mode-intro { color: var(--ink-soft); font-size: 14px; line-height: 1.45; margin-bottom: 12px; }
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-option { position: relative; cursor: pointer; }
.mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.mode-option span {
    min-height: 76px; display: flex; flex-direction: column; justify-content: center; gap: 3px;
    padding: 12px 14px; border: 2px solid var(--paper-border); border-radius: 14px;
    background: #fff; color: var(--ink); transition: border-color .15s, background .15s, transform .15s;
}
.mode-option b { font-family: 'Fredoka', sans-serif; font-size: 17px; }
.mode-option small { color: var(--cream-sub); font-size: 12px; font-weight: 700; }
.mode-option input:checked + span { border-color: var(--gold-dark); background: #FFF8D1; box-shadow: 0 3px 0 var(--gold-dark); transform: translateY(-2px); }
.mode-option input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.mode-summary { min-height: 38px; margin-top: 12px; padding: 9px 11px; border-radius: 10px; background: rgba(35,55,94,.07); color: var(--ink-soft); font-size: 13px; font-weight: 800; line-height: 1.35; }

.blitz-rules { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 16px; background: #FFF8D1; border: 2px solid var(--gold-dark); color: var(--ink-soft); box-shadow: 0 5px 0 rgba(217,172,6,.65); }
.blitz-rules strong { color: #5A4300; font-family: 'Fredoka', sans-serif; font-size: 17px; }
.blitz-rules span { font-size: 13px; font-weight: 800; }

.blitz-phase { padding: 13px 16px; border-radius: 16px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); box-shadow: 0 8px 18px rgba(0,0,0,.13); }
.blitz-phase-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.blitz-phase-label { color: var(--light); font-family: 'Space Mono', monospace; font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; }
.blitz-clock { color: var(--gold); font-family: 'Space Mono', monospace; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.blitz-progress { height: 7px; margin-top: 10px; overflow: hidden; border-radius: 6px; background: rgba(255,255,255,.14); }
.blitz-progress > span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--gold); transition: width .2s linear, background-color .2s; }
.blitz-phase-note { margin-top: 7px; color: var(--light-sub); font-size: 12px; font-weight: 800; }
.blitz-phase.urgent .blitz-clock { color: var(--warning); }
.blitz-phase.urgent .blitz-progress > span { background: var(--warning); }
.blitz-phase.critical .blitz-clock { color: #FCA5A5; }
.blitz-phase.critical .blitz-progress > span { background: var(--danger); }
.blitz-phase.review { background: rgba(250,204,21,.12); border-color: rgba(250,204,21,.35); }
.blitz-phase.review .blitz-clock { color: var(--light); font-size: 13px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

/* ── Résultat de manche ── */
.result-card { border-radius: 22px; padding: 26px 22px; text-align: center; }
.result-card.win { background: #DCFCE7; border: 2px solid #86EFAC; }
.result-card.lose { background: #FEE2E2; border: 2px solid #FCA5A5; }
.result-card.skip { background: #FEF3C7; border: 2px solid #FCD34D; }
.result-card .r-title { display: inline-block; font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 28px; border: 3px solid currentColor; border-radius: 14px; padding: 4px 26px; margin-bottom: 8px; background: rgba(255,255,255,.5); transform: rotate(-3deg); }
.result-card .r-title.win-t { color: var(--success); }
.result-card .r-title.lose-t { color: var(--danger); }
.result-card .r-title.skip-t { color: var(--warning); }
.result-card .r-sub { font-size: 15px; color: #6B7280; margin: 4px 0 14px; }
.result-card .r-note { font-size: 13px; color: #6B7280; margin-top: 12px; }
.guess-bubble { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 18px; }
.guess-bubble .gb-label { font-family: 'Space Mono', monospace; font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #C08A90; }
.guess-bubble .gb-word { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 15px; color: #B4474D; background: #fff; padding: 5px 18px; border-radius: 12px; box-shadow: 0 3px 10px rgba(180,71,77,.18); text-transform: uppercase; letter-spacing: .5px; }

/* ── Score final ── */
.bigscore { display: inline-flex; align-items: baseline; gap: 6px; background: #fff; border: 3px solid var(--paper-border); border-radius: 20px; padding: 16px 40px; box-shadow: 0 10px 0 #E7D9BC; }
.bigscore .n { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 68px; color: var(--ink); line-height: 1; }
.bigscore .d { font-size: 26px; color: var(--cream-sub); }
.progress { height: 12px; border-radius: 6px; background: rgba(255,255,255,.16); overflow: hidden; }
.progress > div { height: 100%; border-radius: 6px; background: var(--gold); transition: width .6s; }
.score-split { display: flex; gap: 24px; justify-content: center; font-size: 15px; }
.score-split .ok { color: #4ADE80; font-weight: 700; }
.score-split .ko { color: #FCA5A5; font-weight: 700; }

/* ── Stats joueur ── */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 520px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-tile { background: #fff; border: 2px solid var(--paper-border); border-radius: 14px; padding: 14px 10px; text-align: center; }
.stat-tile .num { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 30px; line-height: 1; color: var(--ink); }
.stat-tile .lbl { display: block; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--cream-sub); }
.stat-tile .sub { display: block; margin-top: 3px; font-size: 11px; font-weight: 700; color: var(--panda); }
.stat-tile.good { background: linear-gradient(180deg, #FFF8DC, #fff 62%); border-color: #EFD778; }
.stat-tile.good .num { color: var(--gold-dark); }
.stat-tile.tease { background: linear-gradient(180deg, #FBEDE6, #fff 62%); border-color: #E7C6B4; }
.stat-tile.tease .num { color: var(--panda); }

/* ── Tuiles « système de points » (côté devineur) ── */
.pt-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pt-tile { background: #fff; border: 2px solid var(--paper-border); border-radius: 14px; padding: 14px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pt-tile.win { background: linear-gradient(180deg, #F0FDF4, #fff 62%); border-color: #A7E9BE; }
.pt-tile.skip { background: linear-gradient(180deg, #FEFCE8, #fff 62%); border-color: #F2E08C; }
.pt-tile.auto { background: linear-gradient(180deg, #FEF2F2, #fff 62%); border-color: #F6C2C2; }
.pt-badge { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 22px; line-height: 1; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.pt-tile.win .pt-badge { background: #DCFCE7; color: var(--success); }
.pt-tile.skip .pt-badge { background: #FEF3C7; color: var(--gold-dark); }
.pt-tile.auto .pt-badge { background: #FEE2E2; color: var(--danger); font-size: 20px; }
.pt-name { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 13px; color: var(--ink); }
.pt-txt { font-size: 11.5px; color: var(--cream-sub); line-height: 1.35; }
@media (max-width: 560px) { .pt-tiles { grid-template-columns: 1fr; } }

/* ── Mémo « mots interdits » (écran de révision) ── */
.rules-memo { border: 1px dashed var(--paper-border); border-radius: 13px; margin-top: 14px; background: rgba(255, 255, 255, .35); }
.rules-memo > summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 14.5px; color: var(--ink); padding: 12px 14px;
}
.rules-memo > summary::-webkit-details-marker { display: none; }
.rules-memo > summary .caret { color: var(--cream-sub); font-size: 12px; transition: transform .2s; }
.rules-memo[open] > summary .caret { transform: rotate(180deg); }
.rules-inner { padding: 2px 10px 13px; }
.rule-tiles { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.rule-tile {
    background: #fff; border: 1.5px solid var(--paper-border); border-radius: 12px; padding: 9px 5px 8px;
    text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px;
    flex: 1 1 95px; min-width: 90px; max-width: 118px;
}
.rule-tile .panda { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .14)); }
.rt-name { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 11.5px; color: var(--ink); line-height: 1.12; }
.rt-ex { font-size: 9.5px; color: var(--cream-sub); line-height: 1.25; }
.rt-ex i { font-style: italic; color: var(--panda); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .rules-memo > summary .caret { transition: none; } }

/* ── Modal de confirmation ── */
.modal-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 22px; background: rgba(20,34,58,.72); backdrop-filter: blur(3px); animation: modal-fade .16s ease; }
.modal-overlay[hidden] { display: none; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card { width: 100%; max-width: 340px; background: linear-gradient(180deg, var(--cream), var(--cream-2)); border-radius: 22px; padding: 24px 22px; box-shadow: 0 24px 60px rgba(0,0,0,.45); text-align: center; animation: modal-pop .18s cubic-bezier(.34,1.56,.64,1); }
@keyframes modal-pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-mascot { display: flex; justify-content: center; margin-bottom: 8px; }
.modal-mascot .panda { filter: drop-shadow(0 4px 8px rgba(0,0,0,.15)); }
.modal-title { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 21px; color: var(--ink); margin-bottom: 6px; text-wrap: balance; }
.modal-detail { font-size: 13.5px; color: var(--cream-sub); margin-bottom: 18px; line-height: 1.45; }
.modal-detail[hidden] { display: none; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions > * { flex: 1; }
.modal-actions .btn { padding: 13px; font-size: 16px; }
.btn-cancel { padding: 13px; border: 2px solid var(--paper-border); background: #fff; color: var(--ink-soft); border-radius: 16px; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 16px; cursor: pointer; transition: background .12s; }
.btn-cancel:hover { background: #F6EEDD; }
body.modal-open { overflow: hidden; }

/* ── Divers ── */
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.mt-12 { margin-top: 12px; }
.mb-16 { margin-bottom: 16px; }

@media (max-width: 520px) {
    .topbar { padding: 14px 18px; padding-top: calc(14px + env(safe-area-inset-top)); }
    .stage { padding: 18px; }
    .mascot-row .panda { width: 64px; height: 64px; }
    .bubble { font-size: 15px; }
    .topnav-user { display: none; }
    .mode-options { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .blitz-progress > span { transition: none; }
    .pulse-dot { animation: none; }
    .modal-overlay, .modal-card { animation: none; }
}
