/* ===================================================
   WORDLE FR × DARIJA — Design System Lebrief v2
   =================================================== */
:root {
    --lw-navy:   #1a1a2e;
    --lw-red:    #c8102e;
    --lw-red-dk: #a00d24;
    --lw-bg:     #f8f9fa;
    --lw-white:  #ffffff;
    --lw-border: #e0e0e0;
    --lw-text:   #333;
    --lw-muted:  #888;
    --lw-green:  #2d6a4f;
    --lw-amber:  #d97706;
    --lw-gray:   #6b7280;
    --lw-score:  #f59e0b;
    --lw-radius: 10px;
    --lw-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* ── Wrapper jeu — colonne unique centrée ────────── */
.lw-wrapper {
    font-family: inherit;
    max-width: 500px;
    margin: 0 auto;
    user-select: none;
}

/* Layout : colonne unique simple */
.lw-game-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Zone grille */
.lw-left-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Zone clavier */
.lw-right-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

/* ── Header ───────────────────────────────────────── */
.lw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 0 8px;
    border-bottom: 1px solid var(--lw-border);
    margin-bottom: 8px;
    flex-shrink: 0;
}
.lw-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--lw-navy);
    margin: 0;
    letter-spacing: -0.5px;
}
.lw-subtitle {
    font-size: 0.8rem;
    color: var(--lw-muted);
    margin: 2px 0 0;
    line-height: 1.4;
}
.lw-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.lw-date-badge {
    background: var(--lw-navy);
    color: #fff;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.lw-archive-badge {
    background: var(--lw-amber);
    color: #fff;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ── Méta ─────────────────────────────────────────── */
.lw-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.lw-theme-badge {
    background: #f0f4ff;
    color: var(--lw-navy);
    border: 1px solid #d0d8ff;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.82rem;
    font-weight: 600;
}
.lw-length-badge {
    font-size: 0.82rem;
    color: var(--lw-muted);
}

/* ── Barre Darija ─────────────────────────────────── */
.lw-darija-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--lw-navy);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}
.lw-darija-label {
    font-size: 0.8rem;
    opacity: 0.75;
    white-space: nowrap;
}
.lw-darija-chars {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.lw-dc {
    font-size: 1.05rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
    transition: all 0.3s;
}
.lw-dc-hidden {
    color: rgba(255,255,255,0.3);
    border-bottom: 2px solid rgba(255,255,255,0.3);
    letter-spacing: 2px;
}
.lw-dc-shown {
    color: #fff;
    animation: lwReveal 0.35s ease;
}
@keyframes lwReveal {
    from { transform: scale(1.6) translateY(-4px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);    opacity: 1; }
}
.lw-darija-arabic {
    font-size: 1.05rem;
    direction: rtl;
    font-weight: 700;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.5s;
}
.lw-arabic-visible { opacity: 1 !important; }

/* ── Grille — taille NYT (cellules ~62px desktop) ─── */
.lw-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    padding: 8px 0;
}
.lw-row {
    display: flex;
    gap: 5px;
}
.lw-cell {
    width: 52px;
    height: 52px;
    border: 2px solid var(--lw-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--lw-white);
    color: var(--lw-navy);
    transition: border-color 0.15s;
}
.lw-cell-filled { border-color: #9ca3af; }
.lw-pop { animation: lwPop 0.12s ease; }
@keyframes lwPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}
.lw-cell.lw-correct { background: var(--lw-green); color: #fff; border-color: var(--lw-green); }
.lw-cell.lw-present { background: var(--lw-amber); color: #fff; border-color: var(--lw-amber); }
.lw-cell.lw-absent  { background: var(--lw-gray);  color: #fff; border-color: var(--lw-gray);  }
.lw-flip { animation: lwFlip 0.4s ease; }
@keyframes lwFlip {
    0%   { transform: rotateX(0deg);   }
    45%  { transform: rotateX(90deg);  }
    55%  { transform: rotateX(90deg);  }
    100% { transform: rotateX(0deg);   }
}
@keyframes lwShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-7px); }
    40%       { transform: translateX(7px);  }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px);  }
}
.lw-shake { animation: lwShake 0.45s ease; }

/* ── Score live ───────────────────────────────────── */
.lw-score-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 0 8px;
    font-size: 0.88rem;
    color: var(--lw-muted);
}
.lw-score-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--lw-score);
}
.lw-score-pts { font-size: 0.8rem; }

/* ── Clavier — style NYT ──────────────────────────── */
.lw-keyboard {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    width: 100%;
    padding: 0 4px;
    box-sizing: border-box;
}
.lw-key-row {
    display: flex;
    gap: 4px;
    justify-content: center;
    width: 100%;
}
.lw-key {
    flex: 1;
    max-width: 38px;
    height: 50px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: #d3d6da;
    color: var(--lw-navy);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    text-transform: uppercase;
}
.lw-key:active { filter: brightness(0.88); }
.lw-key-wide { flex: 1.5; max-width: 58px; font-size: 0.68rem; }
.lw-key-correct { background: var(--lw-green) !important; color: #fff !important; }
.lw-key-present { background: var(--lw-amber) !important; color: #fff !important; }
.lw-key-absent  { background: #787c7e !important; color: #fff !important; }

/* ── Hint button ──────────────────────────────────── */
.lw-hint-row {
    display: flex;
    justify-content: center;
    width: 100%;
}
.lw-hint-btn {
    background: transparent;
    border: 1.5px solid var(--lw-border);
    color: var(--lw-muted);
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.lw-hint-btn:hover:not(:disabled) {
    border-color: var(--lw-red);
    color: var(--lw-red);
}
.lw-hint-used {
    background: #fff3cd;
    border-color: var(--lw-score);
    color: var(--lw-score);
    cursor: default;
}
.lw-hint-cost { opacity: 0.6; font-size: 0.75rem; }

/* ── Toast ────────────────────────────────────────── */
.lw-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--lw-navy);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 9999;
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
}
.lw-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* ── Lien "Comment jouer" ─────────────────────────── */
.lw-how-link {
    background: none;
    border: none;
    color: var(--lw-muted);
    font-size: 0.78rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    margin-top: 2px;
    font-family: inherit;
    transition: color 0.15s;
}
.lw-how-link:hover { color: var(--lw-navy); }

/* ── Modal overlay ────────────────────────────────── */
.lw-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.lw-modal-overlay.lw-modal-open {
    display: flex;
    animation: lwFadeIn 0.2s ease;
}
@keyframes lwFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal boîte ──────────────────────────────────── */
.lw-modal {
    background: #fff;
    border-radius: 16px;
    padding: 18px 20px 16px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    animation: lwSlideUp 0.22s ease;
    max-height: 88vh;
    overflow-y: auto;
}
@keyframes lwSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.lw-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--lw-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}
.lw-modal-close:hover { color: var(--lw-navy); }
.lw-modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--lw-navy);
    margin: 0 0 6px;
    text-align: center;
}
.lw-modal-intro {
    font-size: 0.85rem;
    color: var(--lw-text);
    text-align: center;
    margin: 0 0 10px;
    line-height: 1.4;
}

/* ── Exemples ─────────────────────────────────────── */
.lw-modal-examples {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    border-top: 1px solid var(--lw-border);
    border-bottom: 1px solid var(--lw-border);
    padding: 10px 0;
}
.lw-modal-example p {
    font-size: 0.8rem;
    color: var(--lw-text);
    margin: 4px 0 0;
}
.lw-modal-row {
    display: flex;
    gap: 4px;
}
.lw-modal-cell {
    width: 34px;
    height: 34px;
    border: 2px solid var(--lw-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--lw-navy);
    background: #fff;
}
.lw-modal-cell.lw-correct { background: var(--lw-green); color: #fff; border-color: var(--lw-green); }
.lw-modal-cell.lw-present { background: var(--lw-amber); color: #fff; border-color: var(--lw-amber); }
.lw-modal-cell.lw-absent  { background: var(--lw-gray);  color: #fff; border-color: var(--lw-gray);  }

/* ── Bloc Darija ──────────────────────────────────── */
.lw-modal-darija-block {
    background: var(--lw-navy);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 10px;
    font-size: 0.82rem;
    line-height: 1.4;
}
.lw-modal-darija-block p { margin: 0 0 6px; opacity: 0.9; }
.lw-modal-darija-block .lw-modal-rules li { color: #fff; }
.lw-modal-darija-title {
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}
.lw-modal-tag {
    display: inline-block;
    font-size: 0.9rem;
}
.lw-modal-darija-example {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 6px 10px;
    margin: 6px 0 4px;
    flex-wrap: wrap;
}
.lw-modal-darija-label {
    font-size: 0.78rem;
    opacity: 0.7;
    white-space: nowrap;
}
.lw-modal-darija-chars {
    display: flex;
    gap: 4px;
}
.lw-modal-dc {
    font-size: 1rem;
    font-weight: 700;
    min-width: 14px;
    text-align: center;
}
.lw-modal-dc.lw-dc-shown { color: #fff; }
.lw-modal-dc.lw-dc-hidden {
    color: rgba(255,255,255,0.3);
    border-bottom: 2px solid rgba(255,255,255,0.3);
}
.lw-modal-darija-ar {
    font-size: 1.1rem;
    direction: rtl;
    font-weight: 700;
    margin-left: auto;
    opacity: 0.85;
}
.lw-modal-darija-hint {
    font-size: 0.75rem !important;
    opacity: 0.65 !important;
    font-style: italic;
    margin: 0 !important;
}

/* ── Règles ───────────────────────────────────────── */
.lw-modal-rules {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.lw-modal-rules li {
    font-size: 0.82rem;
    color: var(--lw-text);
    padding-left: 18px;
    position: relative;
}
.lw-modal-rules li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--lw-red);
    font-weight: 800;
}

/* ===================================================
   PAGE RÉSULTAT
   =================================================== */
.lwr-wrapper {
    font-family: inherit;
    max-width: 560px;
    margin: 1.5rem auto;
}

/* ── Carte principale ─────────────────────────────── */
.lwr-card {
    background: var(--lw-white);
    border: 1px solid var(--lw-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--lw-shadow);
    margin-bottom: 1.5rem;
}

/* ── Pas encore joué ──────────────────────────────── */
.lwr-no-game {
    text-align: center;
    padding: 1rem 0;
}
.lwr-no-game-text {
    color: var(--lw-muted);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.lwr-play-btn {
    display: inline-block;
    background: var(--lw-red);
    color: #fff;
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.2s;
}
.lwr-play-btn:hover { background: var(--lw-red-dk); color: #fff; }

/* ── Header résultat ──────────────────────────────── */
.lwr-result-header {
    text-align: center;
    margin-bottom: 1.2rem;
}
.lwr-result-icon { font-size: 3rem; line-height: 1; }
.lwr-result-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--lw-navy);
    margin: 0.4rem 0 0.2rem;
}
.lwr-result-sub { font-size: 0.85rem; color: var(--lw-muted); margin: 0; }

/* ── Mot révélé ───────────────────────────────────── */
.lwr-word-reveal {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--lw-bg);
    border-radius: var(--lw-radius);
    padding: 14px 18px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.lwr-word-fr {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--lw-navy);
}
.lwr-word-eq { color: var(--lw-muted); font-size: 1.2rem; }
.lwr-word-darija { display: flex; flex-direction: column; gap: 2px; }
.lwr-phonetic { font-size: 1.1rem; font-weight: 700; color: var(--lw-green); }
.lwr-arabic { font-size: 1.1rem; direction: rtl; color: var(--lw-navy); opacity: 0.7; }
.lwr-theme-badge {
    margin-left: auto;
    background: #f0f4ff;
    color: var(--lw-navy);
    border: 1px solid #d0d8ff;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Grille emoji ─────────────────────────────────── */
.lwr-emoji-grid {
    font-size: 1.5rem;
    line-height: 1.4;
    letter-spacing: 3px;
    white-space: pre;
    font-family: monospace;
    text-align: center;
    margin-bottom: 1rem;
}

/* ── Score ────────────────────────────────────────── */
.lwr-score-block {
    text-align: center;
    background: linear-gradient(135deg, #1a1a2e, #2d3561);
    color: #fff;
    border-radius: var(--lw-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}
.lwr-score-num {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--lw-score);
    line-height: 1.1;
}
.lwr-score-unit { font-size: 1rem; opacity: 0.7; }
.lwr-score-stars { font-size: 1.4rem; margin-top: 4px; letter-spacing: 4px; }

/* ── Boutons partage ──────────────────────────────── */
.lwr-share-btns {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.lwr-btn-whatsapp, .lwr-btn-copy {
    flex: 1;
    min-width: 140px;
    padding: 12px 16px;
    border: none;
    border-radius: var(--lw-radius);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.lwr-btn-whatsapp { background: #25D366; color: #fff; }
.lwr-btn-copy     { background: var(--lw-navy); color: #fff; }
.lwr-btn-whatsapp:hover, .lwr-btn-copy:hover { opacity: 0.88; }

/* ── Compte à rebours ─────────────────────────────── */
.lwr-countdown-block {
    text-align: center;
    font-size: 0.85rem;
    color: var(--lw-muted);
    padding-top: 0.5rem;
}

/* ── Archive ──────────────────────────────────────── */
.lwr-archive {
    background: var(--lw-white);
    border: 1px solid var(--lw-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--lw-shadow);
}
.lwr-archive-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--lw-navy);
    margin: 0 0 1rem;
}
.lwr-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}
.lwr-archive-card {
    background: var(--lw-bg);
    border: 1px solid var(--lw-border);
    border-radius: var(--lw-radius);
    padding: 12px 8px;
    text-align: center;
    transition: box-shadow 0.15s;
}
.lwr-archive-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.lwr-archive-current { border-color: var(--lw-red); background: #fff5f5; }
.lwr-archive-date { font-size: 0.72rem; color: var(--lw-muted); margin-bottom: 4px; }
.lwr-archive-word { font-size: 0.85rem; font-weight: 700; color: var(--lw-navy); margin-bottom: 6px; }
.lwr-archive-play-btn {
    display: inline-block;
    background: var(--lw-red);
    color: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s;
}
.lwr-archive-play-btn:hover { background: var(--lw-red-dk); color: #fff; }
.lwr-archive-play-btn:has(.lwr-done),
.lwr-archive-play-done { background: var(--lw-green); }
.lwr-done { font-size: 0.72rem; color: #fff; font-weight: 600; display: block; }

/* ── Responsive mobile ────────────────────────────── */
@media (max-width: 500px) {
    .lw-wrapper { padding: 0 8px; box-sizing: border-box; }
    .lw-title { font-size: 1.3rem; }
    .lw-cell { width: 52px; height: 52px; font-size: 1.6rem; }
    .lw-grid { gap: 4px; }
    .lw-row  { gap: 4px; }
    .lw-key  { height: 50px; font-size: 0.78rem; }
    .lw-key-wide { font-size: 0.65rem; }
    .lw-keyboard { gap: 6px; padding: 0 4px; }
    .lw-key-row  { gap: 5px; }
    .lwr-card { padding: 1rem; }
    .lwr-word-fr { font-size: 1.2rem; }
}

/* ── Très petits écrans ──────────────────────────── */
@media (max-width: 380px) {
    .lw-cell { width: 44px; height: 44px; font-size: 1.3rem; }
    .lw-key  { height: 44px; font-size: 0.72rem; }
    .lw-key-row { gap: 4px; }
    .lw-keyboard { gap: 5px; padding: 0 2px; }
}

/* ===================================================
   WORDLE TEASER — shortcode fin d'article
   =================================================== */
.lwt-wrapper {
    width: 80%;
    max-width: 350px;
    margin: 28px auto;
    text-align: center;
    user-select: none;
    padding: 12px 16px 14px !important;
}
.lwt-top-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 6px;
}
.lwt-jeux-label {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--lw-navy);
    letter-spacing: 3px;
    line-height: 1;
}
.lwt-game-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--lw-navy);
    margin-bottom: 2px;
}
.lwt-game-sub {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--lw-muted);
    margin-left: 6px;
}
.lwt-desc {
    font-size: 0.76rem;
    color: var(--lw-muted);
    margin: 0 0 8px;
}
/* Grille */
.lwt-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 6px;
    margin: 10px 0;
}
.lwt-cell {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    border: 2px solid var(--card-border, #d0d8ff) !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--card-color, var(--lw-navy));
    background: #fff;
    transition: border-color 0.1s, background 0.1s;
    box-sizing: border-box !important;
}
.lwt-cell.lwt-filled {
    border-color: var(--card-color, var(--lw-navy)) !important;
    background: var(--card-light, #f0f4ff);
}
/* Clavier */
.lwt-keyboard {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 5px;
    margin: 8px 0 10px;
}
.lwt-kb-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 4px;
}
.lwt-key {
    height: 28px;
    min-width: 22px;
    padding: 0 2px;
    background: #e9ecef;
    border: 1px solid #d0d4d8;
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--lw-navy);
    cursor: pointer;
    transition: background 0.12s;
    box-sizing: border-box;
    line-height: 1;
}
.lwt-key:hover { background: #d0d4d8; }
.lwt-key-wide {
    min-width: 36px;
    font-size: 0.56rem;
    background: var(--lw-red);
    color: #fff;
    border-color: var(--lw-red);
}
.lwt-key-wide:hover { background: var(--lw-red-dk); border-color: var(--lw-red-dk); }
.lwt-redirect-note {
    font-size: 0.68rem;
    color: var(--lw-muted);
    margin: 4px 0 0;
}

/* ===================================================
   HUB JEUX — /jeux/
   =================================================== */
.ljh-wrapper {
    font-family: inherit;
    max-width: 860px;
    margin: 0 auto;
    padding: 0.5rem 0 2rem;
}

/* ── En-tête ──────────────────────────────────────── */
.ljh-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1.8rem;
    padding-bottom: 1.2rem;
    border-bottom: 2px solid var(--lw-border);
}
.ljh-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--lw-navy);
    margin: 0 0 4px;
}
.ljh-subtitle {
    font-size: 0.9rem;
    color: var(--lw-muted);
    margin: 0;
}
.ljh-date-badge {
    background: var(--lw-navy);
    color: #fff;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: center;
}

/* ── Grille des jeux ──────────────────────────────── */
.ljh-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 2rem;
}

/* ── Card ─────────────────────────────────────────── */
.ljh-card {
    position: relative;
    background: var(--card-light, #f8f9fa);
    border: 1.5px solid var(--card-border, #e0e0e0);
    border-radius: 16px;
    padding: 1.4rem 1.2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.2s, transform 0.2s;
    overflow: hidden;
}
.ljh-card-active:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}
.ljh-card-soon {
    opacity: 0.72;
}
.ljh-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--card-color, #1a1a2e);
    border-radius: 16px 16px 0 0;
}

/* ── Badge ────────────────────────────────────────── */
.ljh-badge {
    position: absolute;
    top: 12px; right: 12px;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ljh-badge-new  { background: var(--lw-red); color: #fff; }
.ljh-badge-soon { background: #e5e7eb; color: #6b7280; }

/* ── Top card ─────────────────────────────────────── */
.ljh-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ljh-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}
.ljh-card-titles {
    flex: 1;
    min-width: 0;
}
.ljh-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--lw-navy);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ljh-card-subtitle {
    font-size: 0.75rem;
    color: var(--lw-muted);
    font-weight: 500;
}

/* ── Indicateur statut du jour ────────────────────── */
.ljh-status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #d1d5db;
    transition: background 0.3s;
}
.ljh-dot-done    { background: var(--lw-green); }
.ljh-dot-pending { background: #f59e0b; }

/* ── Description ──────────────────────────────────── */
.ljh-card-desc {
    font-size: 0.82rem;
    color: #555;
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

/* ── Actions ──────────────────────────────────────── */
.ljh-card-actions {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: auto;
    padding-top: 4px;
}
.ljh-btn-play {
    display: block;
    text-align: center;
    background: var(--card-color, #1a1a2e);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s;
}
.ljh-btn-play:hover { opacity: 0.85; color: #fff; }
.ljh-btn-archive {
    display: block;
    text-align: center;
    background: transparent;
    color: var(--card-color, #1a1a2e);
    border: 1.5px solid var(--card-border, #e0e0e0);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.ljh-btn-archive:hover {
    background: var(--card-light, #f0f4ff);
    color: var(--card-color, #1a1a2e);
}
.ljh-btn-disabled {
    display: block;
    text-align: center;
    background: #f3f4f6;
    color: #9ca3af;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: default;
}

/* ── Footer card (statut du jour) ─────────────────── */
.ljh-card-footer {
    border-top: 1px solid var(--card-border, #e0e0e0);
    padding-top: 8px;
    font-size: 0.75rem;
    text-align: center;
}
.ljh-footer-done    { color: var(--lw-green); font-weight: 600; }
.ljh-footer-lost    { color: var(--lw-gray);  font-weight: 600; }
.ljh-footer-pending { color: var(--lw-amber); font-weight: 600; }

/* ── Section "Comment ça marche" ──────────────────── */
.ljh-how {
    background: var(--lw-bg);
    border: 1px solid var(--lw-border);
    border-radius: 16px;
    padding: 1.6rem;
}
.ljh-how-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--lw-navy);
    margin: 0 0 1.2rem;
}
.ljh-how-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.ljh-how-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ljh-how-icon { font-size: 1.6rem; line-height: 1; }
.ljh-how-item strong { font-size: 0.85rem; color: var(--lw-navy); }
.ljh-how-item p { font-size: 0.78rem; color: var(--lw-muted); margin: 0; line-height: 1.4; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 700px) {
    .ljh-grid { grid-template-columns: 1fr; }
    .ljh-how-grid { grid-template-columns: repeat(2, 1fr); }
    .ljh-card-soon { display: none; } /* masquer "bientôt" sur mobile pour clarté */
}
@media (max-width: 480px) {
    .ljh-title { font-size: 1.4rem; }
    .ljh-how-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* ===================================================
   BON CALCUL — Styles (.lbc-*)
   =================================================== */

@keyframes lbc-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes lbc-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}

/* ── Wrapper ──────────────────────────────────────── */
.lbc-wrapper {
    font-family: inherit;
    max-width: 480px;
    margin: 0 auto;
    user-select: none;
    border-radius: var(--lw-radius);
    overflow: hidden;
    box-shadow: var(--lw-shadow);
}

/* ── Header ───────────────────────────────────────── */
.lbc-header {
    background: var(--lw-navy);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.lbc-header-left { display: flex; flex-direction: column; gap: 2px; }
.lbc-title  { font-size: 1rem; font-weight: 800; color: #fff; letter-spacing: .03em; }
.lbc-date   { font-size: 0.75rem; color: rgba(255,255,255,.5); }
.lbc-header-right { display: flex; align-items: center; gap: 10px; }

.lbc-target-box { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.lbc-target-label { font-size: 0.68rem; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .06em; }
.lbc-target-number { font-size: 1.9rem; font-weight: 900; color: var(--lw-score); line-height: 1; }

.lbc-help-btn {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.35); background: transparent;
    color: #fff; font-size: .95rem; font-weight: 800; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.lbc-help-btn:hover { background: rgba(255,255,255,.15); }

/* ── Body ─────────────────────────────────────────── */
.lbc-body {
    background: #fff;
    border: 1px solid var(--lw-border);
    border-top: none;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Historique ───────────────────────────────────── */
.lbc-history {
    min-height: 72px;
    background: var(--lw-bg);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.lbc-history-empty {
    font-size: 0.8rem; color: var(--lw-muted); font-style: italic;
    text-align: center; padding: 8px 0;
}
.lbc-history-row {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.9rem; font-weight: 600; color: var(--lw-navy);
    animation: lbc-fade-in .2s ease;
}
.lbc-hist-op   { color: var(--lw-navy); }
.lbc-hist-result { font-weight: 800; color: var(--lw-green); font-size: 1rem; }
.lbc-hist-exact  { color: var(--lw-red) !important; }
.lbc-hist-close  { color: var(--lw-amber) !important; }

/* ── Tuiles ───────────────────────────────────────── */
.lbc-tiles-section { display: flex; flex-direction: column; gap: 6px; }
.lbc-section-label { font-size: 0.72rem; color: var(--lw-muted); text-transform: uppercase; letter-spacing: .05em; }
.lbc-tiles {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.lbc-tile {
    min-width: 58px; height: 58px; padding: 0 8px;
    border-radius: 10px;
    border: 2px solid var(--lw-border);
    background: #fff;
    font-size: 1.1rem; font-weight: 800; color: var(--lw-navy);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform .12s, border-color .12s, background .12s, color .12s, box-shadow .12s;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.lbc-tile:hover {
    border-color: var(--lw-navy);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.lbc-tile.lbc-tile-selected {
    background: var(--lw-red); border-color: var(--lw-red-dk); color: #fff;
    transform: translateY(-2px) scale(1.07);
    box-shadow: 0 4px 14px rgba(200,16,46,.3);
}
.lbc-tile.lbc-tile-result {
    background: var(--lw-green); border-color: var(--lw-green); color: #fff;
    animation: lbc-pop .3s ease;
}

/* ── Zone opération ───────────────────────────────── */
.lbc-op-zone {
    background: var(--lw-bg); border-radius: 10px;
    padding: 12px 14px;
    display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.lbc-op-row {
    display: flex; align-items: center; gap: 8px; width: 100%; justify-content: center;
}
.lbc-op-slot {
    min-width: 62px; height: 48px; padding: 0 6px;
    border-radius: 8px; border: 2px dashed var(--lw-border);
    background: #fff; font-size: 1.1rem; font-weight: 800; color: var(--lw-navy);
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s;
}
.lbc-op-slot.filled { border-style: solid; border-color: var(--lw-red); }
.lbc-op-btns { display: flex; gap: 6px; }
.lbc-op-btn {
    width: 46px; height: 46px; border-radius: 8px;
    border: 2px solid var(--lw-border); background: #fff;
    font-size: 1.25rem; font-weight: 800; color: var(--lw-navy);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .12s, border-color .12s, color .12s;
}
.lbc-op-btn:hover, .lbc-op-btn.lbc-op-active {
    background: var(--lw-navy); border-color: var(--lw-navy); color: #fff;
}
.lbc-validate-btn {
    width: 100%; max-width: 200px; padding: 11px 0;
    border-radius: 8px; border: none;
    background: var(--lw-red); color: #fff;
    font-size: 0.95rem; font-weight: 800; letter-spacing: .03em;
    cursor: pointer; transition: background .12s, transform .1s;
}
.lbc-validate-btn:hover:not(:disabled) { background: var(--lw-red-dk); transform: translateY(-1px); }
.lbc-validate-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Message / erreur ─────────────────────────────── */
.lbc-error-msg {
    font-size: 0.82rem; color: var(--lw-red); font-weight: 600;
    text-align: center; min-height: 20px;
}
.lbc-error-msg.lbc-msg-show { animation: lbc-fade-in .2s ease; }

/* ── Footer score + steps + reset ────────────────── */
.lbc-footer-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 2px 0;
    border-top: 1px solid var(--lw-border);
}
.lbc-score-display { display: flex; align-items: baseline; gap: 5px; }
.lbc-score-label { font-size: 0.75rem; color: var(--lw-muted); text-transform: uppercase; letter-spacing: .04em; }
.lbc-score-value { font-size: 1.35rem; font-weight: 900; color: var(--lw-score); line-height: 1; }
.lbc-steps-indicator { display: flex; gap: 5px; align-items: center; }
.lbc-step-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--lw-border); transition: background .2s;
}
.lbc-step-dot.done { background: var(--lw-red); }
.lbc-reset-btn {
    width: 36px; height: 36px; border-radius: 8px;
    border: 2px solid var(--lw-border); background: #fff;
    font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .12s;
}
.lbc-reset-btn:hover:not(:disabled) { border-color: var(--lw-navy); }
.lbc-reset-btn:disabled { opacity: .35; cursor: not-allowed; }

.lbc-stop-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 8px 0 4px;
    background: var(--lw-green);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: opacity .15s;
}
.lbc-stop-btn:hover { opacity: .85; }

/* ── Lien retour hub ─────────────────────────────── */
.ljh-back-link {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--lw-muted);
    text-decoration: none;
    margin-bottom: 4px;
    opacity: 0.8;
    transition: opacity .15s;
}
.ljh-back-link:hover { opacity: 1; color: var(--lw-navy); }
.ljh-back-link-light { color: rgba(255,255,255,0.7); }
.ljh-back-link-light:hover { color: #fff; opacity: 1; }

/* ── Page résultat Bon Calcul (réutilise .lwr-*) ───── */
/* L'historique des opérations dans la page résultat */
.lbc-history-result {
    margin-bottom: 1rem;
    min-height: 40px;
}

/* Ligne cible = résultat en ligne */
.lbc-result-target-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 2rem;
    font-weight: 900;
    color: var(--lw-navy);
    margin: 4px 0 2px;
}
.lbc-result-icon { font-size: 1.6rem; }
.lbc-result-eq { color: var(--lw-muted); font-weight: 400; }
.lbc-result-best { color: var(--lw-green); }
.lbc-result-dist {
    text-align: center;
    font-size: 0.85rem;
    color: var(--lw-muted);
    margin-bottom: 6px;
}

/* ── Modal Bon Calcul (réutilise .lw-modal, styles additionnels) ── */
.lbc-modal-example {
    display: flex; flex-direction: column; gap: 6px;
    margin: 4px 0 6px;
}
.lbc-modal-ex-tiles { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 2px; }
.lbc-modal-tile {
    width: 36px; height: 36px; border-radius: 6px;
    border: 2px solid var(--lw-border); background: #fff;
    font-size: 0.85rem; font-weight: 800; color: var(--lw-navy);
    display: flex; align-items: center; justify-content: center;
}
.lbc-modal-tile.lbc-tile-sel {
    background: var(--lw-red); border-color: var(--lw-red-dk); color: #fff;
}
.lbc-modal-score-table {
    display: flex; flex-direction: column;
    margin-top: 10px; background: var(--lw-bg); border-radius: 8px; padding: 8px 12px;
}
.lbc-modal-score-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.8rem; color: var(--lw-text);
    padding: 4px 0; border-bottom: 1px solid var(--lw-border);
}
.lbc-modal-score-row:last-child { border-bottom: none; }
.lbc-modal-score-row strong { color: var(--lw-navy); font-weight: 800; }
.lbc-modal-score-row.bonus strong { color: var(--lw-green); }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 480px) {
    .lbc-tile { min-width: 50px; height: 50px; font-size: 1rem; }
    .lbc-target-number { font-size: 1.6rem; }
    .lbc-op-slot { min-width: 52px; height: 42px; }
    .lbc-op-btn { width: 40px; height: 40px; font-size: 1.1rem; }
    .lbc-result-target-val, .lbc-result-found-val { font-size: 1.7rem; }
}
