/* ==========================================================================
   Lecteurs de jeux — habillage « Ciel »
   Utilisé par /jeux/games/game.html, Flash.html, Emulator.html et /jeux/unity.html.
   Écran de chargement (ciel de nuit, nom Michoko, barre de progression) et
   petit menu flottant (retour aux jeux, plein écran). Le jeu garde tout l'écran.
   ========================================================================== */

/* polices de secours aux mêmes dimensions (le texte ne bouge pas quand les vraies polices arrivent) */
@font-face { font-family: 'Instrument Serif Fallback'; src: local('Times New Roman'), local('Liberation Serif'), local('Tinos'); size-adjust: 83.99%; ascent-override: 117.87%; descent-override: 36.91%; line-gap-override: 0%; }
@font-face { font-family: 'Inter Fallback'; src: local('Arial'), local('Liberation Sans'), local('Arimo'); size-adjust: 106.56%; ascent-override: 90.91%; descent-override: 22.64%; line-gap-override: 0%; }

html, body { margin: 0; height: 100%; overflow: hidden; background: #050B1A; color: #F4F6FF; font-family: Inter, 'Inter Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif; }
*, *::before, *::after { box-sizing: border-box; }
#game { display: block; width: 100%; height: 100vh; height: 100dvh; border: 0; background: #000; }

/* ---------- écran de chargement ---------- */
.cp-load { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; overflow: hidden; background: #050B1A; transition: opacity .8s; }
.cp-load::before, .cp-load::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
/* lueurs en dégradé (même rendu qu'un flou, mais sans faire ramer les téléphones) */
.cp-load::before { top: -444px; left: -384px; width: 1088px; height: 1088px; background: radial-gradient(closest-side, rgb(37 89 217 / 1) 0%, rgb(37 89 217 / .946) 26%, rgb(37 89 217 / .55) 50%, rgb(37 89 217 / .275) 66%, rgb(37 89 217 / .099) 82%, rgb(37 89 217 / 0) 100%); opacity: .5; }
.cp-load::after { right: -396px; bottom: -456px; width: 952px; height: 952px; background: radial-gradient(closest-side, rgb(23 169 196 / 1) 0%, rgb(23 169 196 / .946) 26%, rgb(23 169 196 / .55) 50%, rgb(23 169 196 / .275) 66%, rgb(23 169 196 / .099) 82%, rgb(23 169 196 / 0) 100%); opacity: .3; }
.cp-stars {
    position: absolute; inset: 0; pointer-events: none; opacity: .9;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(255,255,255,.9) 1px, transparent 2.2px),
        radial-gradient(circle at 27% 64%, rgba(255,255,255,.5) .6px, transparent 1.4px),
        radial-gradient(circle at 41% 31%, rgba(255,255,255,.7) .6px, transparent 1.4px),
        radial-gradient(circle at 58% 82%, rgba(255,255,255,.9) 1px, transparent 2.2px),
        radial-gradient(circle at 66% 12%, rgba(255,255,255,.5) .6px, transparent 1.4px),
        radial-gradient(circle at 79% 47%, #8EC5FF 1.2px, transparent 3px),
        radial-gradient(circle at 88% 74%, rgba(255,255,255,.7) .6px, transparent 1.4px),
        radial-gradient(circle at 6% 88%, rgba(255,255,255,.5) .6px, transparent 1.4px),
        radial-gradient(circle at 51% 52%, rgba(255,255,255,.35) .6px, transparent 1.4px),
        radial-gradient(circle at 94% 22%, rgba(255,255,255,.9) 1px, transparent 2.2px);
    background-size: 420px 420px;
    animation: cp-tw 7s ease-in-out infinite;
}
.cp-box { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.cp-brand { margin: 0; font: 400 clamp(52px, 10vw, 76px)/1 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif; color: #fff; }
.cp-text { margin: 0; font-size: 16px; color: #C3CDE3; }
.cp-pct { color: #F4F6FF; font-variant-numeric: tabular-nums; }
.cp-bar { position: relative; width: min(320px, 72vw); height: 4px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; }
.cp-bar::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: inherit; background: linear-gradient(90deg, #2559D9, #17A9C4); animation: cp-slide 1.4s ease-in-out infinite; }
.cp-back {
    margin-top: 6px; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 20px;
    border-radius: 999px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.05);
    color: #F4F6FF; font: 500 15px/1 Inter, system-ui, sans-serif; text-decoration: none; transition: background .25s, transform .25s;
}
.cp-back:hover { background: rgba(255,255,255,.12); }
.cp-back svg, .cp-menu svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
@keyframes cp-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@keyframes cp-tw { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* ---------- menu flottant ---------- */
.cp-menu {
    position: fixed; left: 12px; bottom: 12px; z-index: 50; display: flex; gap: 2px; padding: 4px;
    border-radius: 999px; background: rgba(5,11,26,.72); border: 1px solid rgba(255,255,255,.15);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); opacity: .65; transition: opacity .25s;
}
.cp-menu:hover, .cp-menu:focus-within { opacity: 1; }
.cp-menu a, .cp-menu button {
    width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: #F4F6FF; cursor: pointer; text-decoration: none; transition: background .25s;
}
.cp-menu :is(a, button):hover { background: rgba(255,255,255,.14); }
:focus-visible { outline: 2px solid #8EC5FF; outline-offset: 2px; }
@media (hover: hover) { .cp-back:hover { transform: translateY(-2px); } }
@media (pointer: coarse) { .cp-menu a, .cp-menu button { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) {
    .cp-bar::before { animation-duration: 3s; }
    .cp-stars { animation: none; }
    .cp-load { transition: none; }
}
