/* =====================================================================
   AU SUIVANT ! — bois sombre, carton, moutarde, gros traits de cartoon
   ===================================================================== */
:root {
    --bois: #2a1c12; --bois2: #3b2819; --bois3: #5a3d25; --trait: #1d120a;
    --carton: #f2e6cf; --carton2: #e2d0ac; --moutarde: #f2c13e; --vert: #4f9d5f; --rouge: #cf4a35; --bleu: #4c88a8;
    --titre: 'Lilita One', 'Nunito', system-ui, sans-serif;
    --corps: 'Nunito', system-ui, sans-serif;
    --haut: env(safe-area-inset-top, 0px); --bas: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bois); color: var(--carton); font-family: var(--corps); }
body { user-select: none; -webkit-user-select: none; touch-action: none; }
button { font: inherit; color: inherit; }
#jeu { position: fixed; inset: 0; display: block; touch-action: none; }
#voile { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
    background: radial-gradient(ellipse at 50% 40%, rgba(29,18,10,.45), rgba(29,18,10,.9) 78%); }
body.au-menu #voile { opacity: 1; }
.ico { width: 1.3em; height: 1.3em; flex: none; }

/* ---------------- boutons cube ---------------- */
.cube {
    --c: var(--carton2); --o: #8f7a55;
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 50px; padding: 9px 16px; border: 3px solid var(--trait); border-radius: 16px; cursor: pointer;
    background: linear-gradient(180deg, color-mix(in srgb, var(--c) 78%, #fff) 0%, var(--c) 58%);
    box-shadow: 0 5px 0 var(--o), inset 0 2px 0 rgba(255,255,255,.4);
    color: var(--trait); font-family: var(--titre); font-size: 18px; letter-spacing: .3px;
    transition: transform .08s, box-shadow .08s, filter .15s; position: relative; text-align: center;
}
.cube:hover { filter: brightness(1.07); }
.cube:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--o), inset 0 2px 0 rgba(255,255,255,.3); }
.cube:disabled { filter: grayscale(.75) brightness(.72); cursor: default; }
.cube:focus-visible { outline: 3px solid var(--moutarde); outline-offset: 3px; }
.cube small { display: block; font-family: var(--corps); font-weight: 800; font-size: 12px; opacity: .85; }
.cube-moutarde { --c: var(--moutarde); --o: #9c7616; }
.cube-vert { --c: var(--vert); --o: #2a6238; color: #fff; }
.cube-rouge { --c: var(--rouge); --o: #80281a; color: #fff; }
.cube-bleu { --c: var(--bleu); --o: #2b5870; color: #fff; }
.cube-geant { font-size: 28px; min-height: 72px; width: 100%; border-radius: 20px; }
.cube-carre { width: 50px; height: 50px; min-height: 0; padding: 0; }
#btn-pause { position: fixed; z-index: 4; top: calc(8px + var(--haut)); right: 8px; width: 44px; height: 44px; }

/* ---------------- écrans ---------------- */
.ecran { position: fixed; inset: 0; z-index: 5; overflow-y: auto; touch-action: pan-y; padding: calc(12px + var(--haut)) 14px calc(16px + var(--bas)); }
.ecran:empty { display: none; }
.boite { width: 100%; max-width: 700px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.logo { text-align: center; font-family: var(--titre); font-size: clamp(50px, 12vw, 104px); line-height: .92; color: var(--moutarde);
    -webkit-text-stroke: 4px var(--trait); paint-order: stroke fill; text-shadow: 0 6px 0 var(--trait), 6px 11px 0 var(--rouge);
    transform: rotate(-3deg); margin: 6px 0 12px; animation: flotte 3.2s ease-in-out infinite; }
@keyframes flotte { 50% { transform: rotate(-1.5deg) translateY(-4px); } }
.sous-titre { text-align: center; font-weight: 800; font-size: 15px; margin: -4px 0 4px; }
.grille2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grille3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grille-jours { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.entete { display: flex; align-items: center; gap: 10px; }
.entete h2 { flex: 1; margin: 0; font-family: var(--titre); font-weight: 400; font-size: 28px; color: var(--moutarde);
    -webkit-text-stroke: 2px var(--trait); paint-order: stroke fill; }
.pastille { display: inline-flex; gap: 5px; padding: 6px 12px; border-radius: 999px; border: 3px solid var(--trait); background: var(--moutarde); color: var(--trait); font-family: var(--titre); font-size: 16px; white-space: nowrap; }
.etoiles { font-family: var(--corps); font-size: 12px; font-weight: 900; color: inherit; }
.etoile { display: inline-block; width: 13px; height: 13px; margin: 0 1px; vertical-align: -1px; }
.titre-rubrique { font-family: var(--titre); font-size: 20px; margin: 8px 0 -2px; }

/* ---------------- rapport de fin de journée (dossier) ---------------- */
.dossier { position: relative; background: var(--carton); color: var(--trait); border: 4px solid var(--trait); border-radius: 18px; padding: 22px 20px 18px; box-shadow: 0 8px 0 #000; }
.dossier h2 { margin: 0 0 8px; font-family: var(--titre); font-weight: 400; font-size: clamp(30px, 6vw, 44px); line-height: 1.02; }
.dossier p { margin: 5px 0; font-weight: 800; font-size: 16px; }
.dossier .ligne { display: flex; justify-content: space-between; gap: 12px; font-weight: 800; padding: 4px 0; border-bottom: 2px dashed rgba(29,18,10,.2); }
.dossier .ligne:last-of-type { border-bottom: 0; }
.dossier .ligne b { font-family: var(--titre); font-weight: 400; font-size: 18px; }
.tampon { float: right; margin: -4px -4px 8px 14px; font-family: var(--titre); font-size: clamp(20px, 4.4vw, 32px); padding: 3px 11px; border: 5px solid currentColor; border-radius: 10px; transform: rotate(-9deg); animation: tampon .28s cubic-bezier(.2,1.3,.4,1) backwards; }
.tampon.vert { color: #2c7a43; } .tampon.rouge { color: #b5301f; }
@keyframes tampon { 0% { transform: rotate(-9deg) scale(2.5); opacity: 0; } 100% { transform: rotate(-9deg) scale(1); opacity: 1; } }
.gros-etoiles { display: flex; gap: 6px; margin: 2px 0 8px; }
.gros-etoiles svg { width: 38px; height: 38px; }

.reglage { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 800; }
.tourner { position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; text-align: center; padding: 20px; background: var(--bois); font-family: var(--titre); font-size: 26px; color: var(--moutarde); }
@media (orientation: portrait) and (max-width: 640px) { body.en-jeu .tourner { display: flex; } }

body.photosensible *, body.photosensible *::before, body.photosensible *::after { animation: none !important; transition: none !important; }
@media (max-width: 560px) { .grille-jours { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grille3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-height: 460px) { .logo { font-size: 58px; margin: 0 0 8px; } .cube-geant { min-height: 56px; font-size: 22px; } }
