/* ==========================================================
   Blip & Blop : le jeu de 2002 (canvas 640 x 480 agrandi) dans l'article /blip-et-blop/ (BlipBlop::bloc()),
   écrans d'accueil et d'attente du jeu en ligne.
   ========================================================== */

/* ── Scène ─────────────────────────────────────────────── */
.bb {
    position: relative; display: grid; place-items: center; overflow: hidden;
    height: min(80vh, 1000px); min-height: 360px; border-radius: 24px;
    background: #05060d; border: 2px solid rgba(255, 255, 255, .08); box-shadow: 0 30px 80px -30px rgba(91, 79, 245, .65);
}
.bb:fullscreen { height: 100vh; border: 0; border-radius: 0; }
.bb [hidden] { display: none !important; }
.bb button { font-family: inherit; cursor: pointer; }
.bb-canvas { display: block; width: 640px; height: 480px; outline: none; background: #000; }
.bb-canvas.net { image-rendering: pixelated; }
.bb:not([data-ecran="jeu"]) .bb-canvas { visibility: hidden; }

/* Écrans (un seul visible, selon data-ecran) */
.bb-ecran {
    position: absolute; inset: 0; z-index: 2; display: none; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; padding: 32px; text-align: center;
    background: radial-gradient(ellipse at 50% 30%, rgba(91, 79, 245, .35), transparent 60%), #0b0d1c;
}
.bb[data-ecran="accueil"] .bb-accueil, .bb[data-ecran="multi"] .bb-multi,
.bb[data-ecran="fin"] .bb-fin, .bb[data-ecran="erreur"] .bb-erreur { display: flex; }
.bb-ecran .bb-titre {
    margin: 0; color: #fff; font-family: var(--police-titres); font-size: clamp(1.8rem, 5vw, 3.4rem); line-height: 1.05;
    text-shadow: 0 4px 0 var(--color-primary-dark), 0 0 30px rgba(91, 79, 245, .8);
}
.bb-accueil .bb-titre { font-size: clamp(2.4rem, 8vw, 5rem); }
.bb-ecran p { max-width: 560px; margin: 0; color: rgba(255, 255, 255, .78); }
.bb-ecran .bb-note { font-size: .9rem; color: rgba(255, 255, 255, .55); }
.bb-etat { font-weight: 700; color: #fff !important; }

.bb-boutons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 8px 0; }
.bb-bouton {
    display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border: 0; border-radius: 14px;
    color: #fff; font-size: 1.05rem; font-weight: 800; background: var(--color-primary); box-shadow: 0 5px 0 var(--color-primary-dark);
    transition: transform .1s, box-shadow .1s;
}
.bb-bouton:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--color-primary-dark); }
.bb-bouton:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--color-primary-dark); }
.bb-bouton-2 { background: var(--achat); box-shadow: 0 5px 0 var(--achat-fonce); }
.bb-bouton-2:hover { box-shadow: 0 7px 0 var(--achat-fonce); }
.bb-bouton-petit { padding: 10px 16px; font-size: .95rem; }
.bb-bouton kbd {
    display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-family: var(--police-titres);
    font-size: .9rem; color: #fff; background: var(--touche-0); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25);
}
.bb-bouton-2 kbd { background: var(--touche-1); }
.bb-retour { margin-top: 6px; padding: 6px 12px; border: 0; color: rgba(255, 255, 255, .6); background: none; text-decoration: underline; }

.bb-partage { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(100%, 620px); }

/* Bandeaux par-dessus la partie */
.bb-chargement, .bb-attente, .bb-desync {
    position: absolute; left: 50%; z-index: 3; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px;
    font-size: .9rem; font-weight: 700; white-space: nowrap; background: rgba(12, 14, 30, .85); border: 1px solid rgba(255, 255, 255, .15);
}
.bb-chargement { bottom: 16px; }
.bb-chargement::before {
    content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: bb-tourne .8s linear infinite;
}
.bb-attente { top: 16px; color: var(--achat); }
.bb-desync { top: 56px; max-width: 90%; white-space: normal; text-align: center; color: #ffd2dc; border-color: var(--rose); }
@keyframes bb-tourne { to { transform: rotate(360deg); } }
.bb-focus {
    position: absolute; inset: auto 0 50% 0; z-index: 3; width: max-content; margin: 0 auto; padding: 12px 20px; border: 2px solid #fff;
    border-radius: 14px; color: #fff; font-weight: 800; background: rgba(12, 14, 30, .88);
}
.bb-plein {
    position: absolute; top: 12px; right: 12px; z-index: 4; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
    border: 2px solid rgba(255, 255, 255, .2); border-radius: 12px; background: rgba(12, 14, 30, .6); opacity: .65; transition: opacity .2s;
}
.bb-plein:hover { opacity: 1; }
.bb-plein svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bb-noscript { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }

@media (max-width: 700px) {
    .bb { height: auto; aspect-ratio: 4 / 3; min-height: 0; border-radius: 14px; }
    .bb-ecran { padding: 16px; gap: 8px; }
    .bb-ecran .bb-note { display: none; }
    .bb-bouton { padding: 10px 16px; font-size: .95rem; }
}

/* Rappel des commandes sur l'écran d'accueil, bandeau des cookies masqué pendant la partie (il cachait Blip) */
.bb-commandes { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: .9rem; }
.bb-commandes kbd {
    display: inline-block; min-width: 1.8em; margin-right: 3px; padding: 1px 6px; border-radius: 6px; text-align: center;
    font: 700 .8rem/1.5 var(--police); color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25);
}
body.bb-en-jeu .consentement { display: none !important; }

/* Écran d'accueil : l'écran titre du jeu en fond, assombri */
.bb-ecran.bb-accueil {
    background: linear-gradient(rgba(11, 13, 28, .84), rgba(11, 13, 28, .93)), url('/js/blip-et-blop/titre.webp') no-repeat, #000;
    background-size: 100% 100%, contain;
    background-position: center;
}
