feat: harmonisation charte OKI dark/light, command bar, local-first stats & SEO

This commit is contained in:
2026-08-16 22:21:29 -04:00
parent 9b867243fd
commit 6a041a938e
21 changed files with 2152 additions and 410 deletions
+87 -74
View File
@@ -1,6 +1,7 @@
/* Styles partagés des écrans de jeu : /jeu/[mode] et /defi/[seed].
Layout « app » verrouillé au viewport (100dvh via +layout) : la page ne
scrolle jamais, seuls les panneaux internes défilent. Mobile-first. */
/* ==========================================================================
STYLES DU JEU — /jeu/[mode] et /defi/[seed]
ORGANISATION KA INTERNATIONALE · Layout viewport 100dvh & Dark/Light OKI
========================================================================== */
.jeu {
flex: 1;
@@ -18,7 +19,7 @@
gap: 1rem;
padding: 1rem;
overflow-y: auto;
color: var(--oki-encre-doux);
color: var(--muted);
}
/* — Split photo | carte — */
@@ -34,17 +35,24 @@
/* Mobile : la photo s'adapte (plafond ~42dvh), la carte garde au minimum
35dvh utiles + la barre de sauts (~3,5rem). */
.panneau-photo {
position: relative; /* ancre du panneau d'indices */
position: relative;
flex: 1 1 0;
min-height: 5rem;
max-height: 42dvh;
border-radius: var(--radius-md);
overflow: hidden;
background: var(--card-bg);
border: 1px solid var(--line);
}
.panneau-carte {
position: relative; /* ancre de la puce de statut et de l'aide */
position: relative;
flex: 1 1 0;
min-height: calc(35dvh + 3.5rem);
display: flex;
border-radius: var(--radius-md);
overflow: hidden;
border: 1px solid var(--line);
}
.panneau-carte > * {
@@ -55,6 +63,8 @@
/* État résultat : le panneau photo devient une fiche scrollable interne. */
.split.resultat .panneau-photo {
max-height: none;
border: none;
background: transparent;
}
.split.resultat .panneau-carte {
@@ -64,15 +74,15 @@
.resultat-scroll {
height: 100%;
overflow-y: auto;
background: var(--oki-blanc);
border-radius: var(--oki-radius);
background: var(--noir-profond);
border: 1px solid var(--line);
border-radius: var(--radius-md);
box-shadow: var(--oki-ombre);
padding: 1rem;
padding: 1.2rem;
color: var(--blanc-creme);
}
/* — Puce de statut unique (manche, seed, minuteur) : haut-droite, une ligne.
Aucun élément absolu au-dessus des zones interactives : les badges sont
décoratifs, les clics les traversent. — */
/* — Puce de statut unique (manche, seed, minuteur) : haut-droite, une ligne — */
.statut {
position: absolute;
top: 0.5rem;
@@ -87,23 +97,28 @@
}
.badge-manche {
background: rgba(255, 253, 248, 0.94);
color: var(--oki-vert);
border-radius: 999px;
background: var(--noir-profond);
color: var(--or-oki);
border: 1px solid var(--line);
border-radius: var(--radius-sm);
padding: 0.25rem 0.8rem;
font-size: 0.82rem;
font-weight: 700;
font-family: var(--font-display);
letter-spacing: 0.03em;
text-transform: uppercase;
white-space: nowrap;
box-shadow: var(--oki-ombre);
}
/* Seed visible mais discrète : les joueurs vérifient qu'ils jouent le même défi */
/* Seed visible mais discrète */
.badge-seed {
background: rgba(255, 253, 248, 0.8);
color: var(--oki-encre-doux);
border-radius: 999px;
background: var(--noir-profond);
color: var(--muted);
border: 1px solid var(--line);
border-radius: var(--radius-sm);
padding: 0.15rem 0.7rem;
font-size: 0.72rem;
font-size: 0.75rem;
font-weight: 600;
white-space: nowrap;
box-shadow: var(--oki-ombre);
@@ -113,8 +128,7 @@
display: flex;
}
/* — Indices : panneau scrollable interne, en surimpression de la photo
(zone non interactive) — jamais au-dessus de la carte. — */
/* — Indices : panneau scrollable en surimpression de la photo — */
.indices {
position: absolute;
left: 0.4rem;
@@ -124,39 +138,40 @@
max-height: calc(100% - 0.8rem);
overflow-y: auto;
margin: 0;
padding: 0.4rem 0.6rem;
background: rgba(255, 253, 248, 0.96);
border-radius: var(--oki-radius-petit);
padding: 0.5rem 0.7rem;
background: var(--noir-profond);
border: 1px solid var(--line);
border-radius: var(--radius-sm);
box-shadow: var(--oki-ombre);
}
.indice {
margin: 0.25rem 0;
background: var(--oki-bleu-doux);
border-left: 4px solid var(--oki-bleu);
border-radius: var(--oki-radius-petit);
background: var(--card-bg);
border-left: 4px solid var(--or-oki);
border-radius: var(--radius-sm);
padding: 0.5rem 0.8rem;
font-size: 0.95rem;
color: var(--blanc-creme);
}
/* — Aide « poser le marqueur » : pastille décorative sur la carte, les clics
la traversent (pointer-events: none). Sur mobile elle flotte au bas du
canevas, juste au-dessus de la barre de sauts (~3,65rem) ; sur desktop elle
est décalée à droite pour ne pas chevaucher les sauts en overlay bas-gauche. — */
/* — Aide « poser le marqueur » — */
.aide-carte {
position: absolute;
left: 50%;
bottom: 3.9rem; /* 48px de sauts + espacements, arrondi au-dessus */
bottom: 3.9rem;
transform: translateX(-50%);
z-index: 3;
margin: 0;
padding: 0.3rem 0.9rem;
padding: 0.35rem 0.9rem;
max-width: calc(100% - 5rem);
background: rgba(255, 253, 248, 0.92);
color: var(--oki-encre-doux);
border-radius: 999px;
background: var(--noir-profond);
color: var(--blanc-creme);
border: 1px solid var(--line);
border-radius: var(--radius-sm);
box-shadow: var(--oki-ombre);
font-size: 0.85rem;
font-weight: 600;
text-align: center;
white-space: nowrap;
overflow: hidden;
@@ -164,8 +179,7 @@
pointer-events: none;
}
/* — Barre d'actions : en bas du flux (la page ne scrolle pas), opaque,
au-dessus de la carte grâce au z-index explicite. — */
/* — Barre d'actions — */
.barre-actions {
position: sticky;
bottom: 0;
@@ -175,12 +189,12 @@
justify-content: space-between;
gap: 0.6rem;
padding: 0.6rem 0.8rem calc(0.6rem + env(safe-area-inset-bottom));
background: var(--oki-blanc);
border-top: 1px solid var(--oki-sable-fonce);
background: var(--noir-profond);
border-top: 1px solid var(--line);
}
.barre-actions .btn {
min-height: 48px; /* cible tactile */
min-height: 48px;
}
.actions-secondaires {
@@ -205,7 +219,7 @@
white-space: nowrap;
}
/* Écrans très étroits : tout doit tenir sur une ligne. */
/* Écrans très étroits */
@media (max-width: 420px) {
.actions-secondaires .btn {
padding: 0.55rem 0.7rem;
@@ -222,7 +236,7 @@
}
}
/* Paysage / écrans très bas : on relâche les planchers pour éviter le rognage. */
/* Paysage */
@media (max-height: 540px) {
.panneau-photo {
min-height: 3.5rem;
@@ -234,7 +248,7 @@
}
}
/* Desktop : split 50/50 qui remplit exactement la hauteur disponible. */
/* Desktop : split 50/50 */
@media (min-width: 768px) {
.split {
flex-direction: row;
@@ -258,7 +272,7 @@
.aide-carte {
left: auto;
right: 0.8rem;
bottom: 3.4rem; /* au-dessus de la rangée de sauts en overlay bas-gauche */
bottom: 3.4rem;
transform: none;
}
@@ -268,7 +282,7 @@
}
}
/* — Écran bilan du défi : compact, scroll interne en dernier recours. — */
/* — Écran bilan du défi — */
.bilan {
flex: 1;
min-height: 0;
@@ -286,11 +300,9 @@
margin: 0;
text-align: center;
font-size: 1.6rem;
color: var(--oki-vert);
color: var(--or-oki);
}
/* Filet drapeau du bilan : 3 segments francs aux couleurs OKI qui se
dessinent (scaleX) en cascade syncopée — sobre, pas de confettis. */
.filet-drapeau {
display: flex;
width: 132px;
@@ -306,23 +318,22 @@
}
.filet-drapeau .seg-vert {
background: var(--oki-vert);
background: var(--vert-oki);
}
.filet-drapeau .seg-corail {
background: var(--oki-corail);
background: var(--or-oki);
}
.filet-drapeau .seg-bleu {
background: var(--oki-bleu);
background: var(--turquoise-caraibes);
}
/* Seed rappelée sous le titre du bilan (page /defi/[seed]) */
.seed-discret {
margin: 0;
text-align: center;
font-size: 0.9rem;
color: var(--oki-encre-doux);
color: var(--muted);
}
.total {
@@ -333,19 +344,22 @@
.total .valeur {
font-size: 2.4rem;
font-weight: 800;
color: var(--oki-vert);
font-family: var(--font-display);
color: var(--or-oki);
}
.total .unite {
margin-left: 0.4rem;
color: var(--oki-encre-doux);
color: var(--muted);
}
/* Carte SVG du récap : hauteur plafonnée à 44dvh via la largeur
(viewBox 600×620 → hauteur ≈ largeur × 1,033). */
.bilan-carte {
width: min(100%, 42.5dvh, 520px);
margin: 0 auto;
border-radius: var(--radius-md);
border: 1px solid var(--line);
background: var(--noir-profond);
overflow: hidden;
}
.recap {
@@ -361,25 +375,28 @@
display: flex;
align-items: baseline;
gap: 0.6rem;
background: var(--oki-blanc);
border-radius: var(--oki-radius-petit);
background: var(--noir-profond);
border: 1px solid var(--line);
border-radius: var(--radius-sm);
box-shadow: var(--oki-ombre);
padding: 0.5rem 0.9rem;
}
.r-nom {
font-weight: 700;
color: var(--oki-vert);
color: var(--blanc-creme);
}
.r-region {
flex: 1;
color: var(--oki-encre-doux);
color: var(--muted);
font-size: 0.9rem;
}
.r-score {
font-weight: 800;
font-family: var(--font-display);
color: var(--or-oki);
}
.bilan-actions {
@@ -397,18 +414,18 @@
margin: 0;
text-align: center;
font-size: 0.85rem;
color: var(--oki-encre-doux);
color: var(--muted);
}
.puce.joueur {
color: var(--oki-corail);
color: var(--rouge-oki);
}
.puce.reelle {
color: var(--oki-vert);
color: var(--vert-oki);
}
/* Bilan desktop : deux colonnes (carte | récap) pour tenir sans scroll. */
/* Bilan desktop */
@media (min-width: 900px) {
.bilan {
display: grid;
@@ -432,7 +449,6 @@
}
}
/* Hauteur limitée : resserre le bilan pour rester sans scroll dès 800px. */
@media (max-height: 800px) {
.bilan {
gap: 0.55rem;
@@ -448,11 +464,8 @@
}
}
/* Motion (playbook §1.7) : transform/opacity uniquement, tout est sous
gate html.js + no-preference — contenu statique complet sans JS ni motion. — */
/* Motion */
@media (prefers-reduced-motion: no-preference) {
/* Moment révélation : la fiche résultat monte pendant que la carte prend
l'emphase (léger zoom de reprise, --dur-mesure --ease-ka). */
html.js .resultat-scroll {
animation: jwe-montee var(--dur-mesure) var(--ease-ka);
}
@@ -461,14 +474,12 @@
animation: jwe-emphase var(--dur-mesure) var(--ease-ka);
}
/* Pastilles de statut (manche, seed, minuteur) : apparition en pop. */
html.js .badge-manche,
html.js .badge-seed,
html.js .badge-timer {
animation: oki-pop var(--dur-mesure) var(--ease-ka) backwards;
}
/* Filet drapeau du bilan : segments qui se dessinent 0 / 120 / 300 ms. */
html.js .filet-drapeau .seg {
animation: jwe-filet var(--dur-mesure) var(--ease-ka) backwards;
}
@@ -507,8 +518,10 @@
@keyframes jwe-filet {
from {
transform: scaleX(0);
opacity: 0;
}
to {
transform: scaleX(1);
opacity: 1;
}
}