/* Carte de l'aventure et fiche de niveau (voir js/carte.js). Autonome : de style.css ne viennent que .btn (boutons) et .ico (icônes).
   Tout ce qui bouge n'anime que transform et opacity, et s'arrête si le joueur a demandé moins d'animations. */
.screen.v-map { padding: 0; }
.carte, .fiche { --e: #1D2433; --p: #FFF6E5; }
.carte { position: relative; background: #6EC1FF; }

/* Couleurs de chaque monde : sol et taches, chemin (bord, fond, traverses), flaque et sa rive, bandeau */
.m-base { --sol: #E9C58C; --tache: #DDB273; --bord: #8E2F1A; --route: #E4572E; --trav: #FFD9A0; --mare: #8E79D6; --rive: #FFF3DC; --acc: #D9603B; }
.m-plage { --sol: #F6DFA6; --tache: #EFCF8A; --bord: #8A5A2B; --route: #E7C089; --trav: #B98A4E; --mare: #4FC3F7; --rive: #FFFFFF; --acc: #17A398; }
.m-nord { --sol: #F2F8FD; --tache: #DCEAF6; --bord: #5F9BCB; --route: #BFE6FA; --trav: #FFFFFF; --mare: #A8DCF5; --rive: #FFFFFF; --acc: #3C8AC9; }
.m-espace { --sol: #1B1440; --tache: #2A1E63; --bord: #0B0720; --route: #3A2F7A; --trav: #5FF3E0; --mare: #8E94AB; --rive: #B4B9CC; --acc: #6B4BD6; }
.m-chateau { --sol: #7DB56E; --tache: #6BA55F; --bord: #5E6676; --route: #C3C9D3; --trav: #8C95A2; --mare: #5DB7E8; --rive: #CFEFFF; --acc: #B5453C; }
.m-gourmand { --sol: #FFD9E8; --tache: #FFC4DA; --bord: #9A5B2C; --route: #F3C987; --trav: #D99A4E; --mare: #8B5A3C; --rive: #FFF3DC; --acc: #E0528C; }

/* Un monde */
.ca-monde { position: relative; overflow: hidden; contain: layout paint; background-color: var(--sol); }
.ca-sol { position: absolute; inset: 0; width: 100%; height: 100%; }
.ca-sol .o { fill: rgba(29, 36, 51, .14); }
.ca-sol .m { fill: var(--mare); stroke: var(--rive); stroke-width: 6; vector-effect: non-scaling-stroke; }
.ca-sol path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.ca-sol .r1 { stroke: var(--bord); stroke-width: 32; }
.ca-sol .r2 { stroke: var(--route); stroke-width: 25; }
.ca-sol .r3 { stroke: var(--trav); stroke-width: 25; stroke-dasharray: 3 11; stroke-linecap: butt; }
.m-base .r3 { stroke-width: 9; stroke-dasharray: none; stroke-linecap: round; }
.m-base .m { stroke-dasharray: 3 4; stroke-width: 9; }   /* un tapis et ses franges */
.m-espace .r3 { stroke-width: 6; stroke-dasharray: 1 15; stroke-linecap: round; }
.m-nord .r3 { stroke-dasharray: 2 16; }
/* Sol peint de chaque monde (generation/PROMPTS-IMAGES.md), assemblé avec son miroir pour se répéter sans couture */
.ca-monde { background: var(--sol) url(assets/sol/base.webp) 0 0 / 100% auto repeat-y; }
.ca-monde.m-plage { background-image: url(assets/sol/plage.webp); }
.ca-monde.m-nord { background-image: url(assets/sol/nord.webp); }
.ca-monde.m-espace { background-image: url(assets/sol/espace.webp); }
.ca-monde.m-chateau { background-image: url(assets/sol/chateau.webp); }
.ca-monde.m-gourmand { background-image: url(assets/sol/gourmand.webp); }
.m-plage .ca-sol .m, .m-chateau .ca-sol .m { fill: url(#eau); }   /* lagons et douves : eau peinte */
.ca-deco, .ca-porte { position: absolute; max-width: none; pointer-events: none; z-index: 1; }
.ca-vent { transform-origin: 50% 96%; animation: ca-vent 2.8s ease-in-out infinite alternate; }
.m-espace .ca-vent { animation-name: ca-flotte; animation-duration: 3.4s; }

/* Les niveaux : pastilles rendues sous Blender, numéro posé dessus */
.cn { position: absolute; z-index: 2; width: 62px; height: 50px; margin: -21px 0 0 -31px; padding: 0 0 9px; border: 0; display: grid; place-items: center;
  background: url(assets/carte/pastille_lock.webp) center / 100% 100% no-repeat; font-family: inherit; font-weight: 900; font-size: 19px; line-height: 1; color: #8A93A6;
  -webkit-tap-highlight-color: transparent; transition: transform .08s; }
.cn:active { transform: translateY(3px); }
.cn.fait { background-image: url(assets/carte/pastille_fait.webp); color: #7A4A00; }
.cn.cur { background-image: url(assets/carte/pastille_cur.webp); z-index: 3; }
.cn.boss { width: 84px; height: 66px; margin: -27px 0 0 -42px; padding-bottom: 14px; font-size: 22px; background-image: url(assets/carte/boss_lock.webp); }
.cn.boss.fait { background-image: url(assets/carte/boss_fait.webp); }
.cn.boss.cur { background-image: url(assets/carte/boss_cur.webp); }
.cn .cn-boss { position: absolute; left: 50%; top: -24px; width: 32px; height: 32px; margin-left: -16px; }
.cn.cur .cn-boss { top: -62px; }
.cn-et { position: absolute; left: 50%; bottom: -11px; display: flex; transform: translateX(-50%); }
.cn-et .ico { width: 19px; height: 19px; margin: 0 -1.5px; }
.cn-et .ico:nth-child(2) { transform: translateY(3px); }
.cn-nom { position: absolute; left: 50%; top: 100%; margin-top: 1px; transform: translateX(-50%); white-space: nowrap; background: #FF5A3C; color: #fff; border: 2px solid var(--e); border-radius: 999px; padding: 3px 10px 4px; font-size: 13px; }
.cn.cur::before { content: ''; position: absolute; left: 50%; top: 21px; width: 72px; height: 48px; margin: -24px 0 0 -36px; border: 3px solid #fff; border-radius: 50%; opacity: 0; animation: ca-halo 1.5s ease-out infinite; }
.cn.boss.cur::before { top: 27px; width: 96px; height: 62px; margin: -31px 0 0 -48px; }

/* La vache : debout sur le niveau en cours, avec ses yeux */
.ca-vache { position: absolute; left: 50%; bottom: 25px; width: 62px; margin-left: -29px; pointer-events: none; animation: ca-saut .9s ease-in-out infinite alternate; }
.boss .ca-vache { bottom: 36px; }
.ca-vache img { display: block; width: 100%; }
.ca-vache i { position: absolute; left: 72.7%; top: 24.2%; width: 10%; aspect-ratio: 1; margin: -5% 0 0 -5%; border: 1px solid var(--e); border-radius: 50%; background: radial-gradient(circle at 60% 58%, #15161F 0 36%, #fff 40%); animation: ca-clin 3.8s infinite; }
.ca-vache i + i { left: 82.9%; }
.ca-vache.ca-attend { margin-left: 26px; bottom: 86px; z-index: 2; }

/* Bandeau d'un monde : son nom, sa règle, ses étoiles */
.ca-bandeau { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 12px 9px; text-align: left; font-family: inherit;
  background: var(--acc); color: #fff; border: 0; border-top: 2.5px solid var(--e); border-bottom: 2.5px solid var(--e); }
.ca-bandeau div { flex: 1; min-width: 0; }
.ca-bandeau b { display: block; font-size: 21px; font-weight: 900; line-height: 1.15; text-shadow: 0 2px 0 var(--e), 1.5px 0 0 var(--e), -1.5px 0 0 var(--e), 0 -1.5px 0 var(--e); }
.ca-bandeau span { display: inline-block; margin-top: 3px; font-size: 13px; font-weight: 800; line-height: 1.25; background: rgba(29, 36, 51, .28); border-radius: 8px; padding: 2px 8px 3px; }
.ca-bandeau em { flex: none; display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-weight: 900; font-size: 14px; white-space: nowrap; background: var(--p); color: var(--e); border: 2px solid var(--e); border-radius: 999px; padding: 4px 10px; }
.ca-bandeau .ico { width: 18px; height: 18px; vertical-align: 0; }

/* Le monde suivant, encore fermé, sous les nuages */
.ca-ferme { height: 340px; }
.ca-ferme .ca-bandeau { min-height: 84px; }
.ca-ciel { position: absolute; left: 0; right: 0; top: 0; height: 190px; z-index: 2; pointer-events: none; background: linear-gradient(#6EC1FF, #E4F3FF 84px, #fff 108px, rgba(255, 255, 255, 0)); }
.ca-cadenas.ico { position: absolute; left: 50%; top: 174px; width: 54px; height: 54px; margin-left: -27px; z-index: 2; }
.ca-nuage { position: absolute; z-index: 2; max-width: none; pointer-events: none; animation: ca-nuage 7s ease-in-out infinite alternate; }
.ca-nuage:nth-of-type(odd) { animation-duration: 9s; animation-direction: alternate-reverse; }

/* Barre du haut (étoiles, retour au niveau en cours) et changement de page */
.ca-hud { position: sticky; top: calc(var(--st, 0px) + 8px); z-index: 6; height: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 0 10px; pointer-events: none; }
.ca-chip { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 13px; background: var(--p); color: var(--e); border: 2.5px solid var(--e); border-radius: 999px; box-shadow: 0 3px 0 var(--e); font-family: inherit; font-weight: 900; font-size: 16px; }
.ca-chip .ico { width: 24px; height: 24px; vertical-align: 0; }
.ca-nav { background: var(--sol); padding: calc(var(--st, 0px) + 62px) 16px 16px; }
.ca-nav .btn { margin: 0; }
.ca-pied { padding: 14px 16px calc(var(--sb, 0px) + 84px); }

@keyframes ca-halo { from { transform: scale(.75); opacity: .95; } to { transform: scale(1.45); opacity: 0; } }
@keyframes ca-saut { to { transform: translateY(-5px); } }
@keyframes ca-clin { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes ca-vent { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
@keyframes ca-flotte { from { transform: translateY(-4px); } to { transform: translateY(4px); } }
@keyframes ca-nuage { from { transform: translateX(-7px); } to { transform: translateX(7px); } }
@media (prefers-reduced-motion: reduce) { .carte *, .carte *::before { animation: none !important; transition: none !important; } }

/* Fiche d'un niveau (dans la fenêtre #modal) */
.fiche { width: 100%; max-height: 88dvh; overflow-y: auto; text-align: center; background: var(--p); color: var(--e); border: 2.5px solid var(--e); border-radius: 22px; box-shadow: 0 5px 0 var(--e); }
.fi-tete { position: relative; overflow: hidden; min-height: 128px; padding: 14px 16px 12px; text-align: left; background: var(--sol); border-bottom: 2.5px solid var(--e); }
.fi-tete > img { position: absolute; right: -52px; bottom: -34px; width: 180px; max-width: none; }
.fi-monde { position: relative; display: inline-flex; align-items: center; gap: 5px; background: var(--acc); color: #fff; border: 2px solid var(--e); border-radius: 999px; padding: 2px 11px 3px; font-size: 13.5px; font-weight: 900; }
.fi-monde .ico { width: 18px; height: 18px; vertical-align: 0; }
.fi-titre { position: relative; margin: 7px 0 5px; font-size: 36px; font-weight: 900; line-height: 1; color: #fff; text-shadow: 0 3px 0 var(--e), 2px 0 0 var(--e), -2px 0 0 var(--e), 0 -2px 0 var(--e), 2px 2px 0 var(--e), -2px 2px 0 var(--e); }
.fi-etoiles { position: relative; display: flex; gap: 1px; }
.fi-etoiles .ico { width: 38px; height: 38px; }
.fi-corps { padding: 12px 14px 14px; }
.fi-but { font-size: 15px; font-weight: 700; line-height: 1.25; }
.fi-but b { display: block; font-size: 21px; font-weight: 900; }
.fi-paliers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 10px; }
.fi-paliers > div { background: #fff; border: 2px solid var(--e); border-radius: 13px; padding: 5px 3px 6px; font-size: 13px; font-weight: 900; line-height: 1.2; }
.fi-paliers > div.ok { background: #FFD23F; }
.fi-paliers span { display: block; height: 22px; }
.fi-paliers .ico { width: 20px; height: 20px; margin: 0 -2px; vertical-align: 0; }
.fi-regle { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 6px 10px; text-align: left; background: #EFE7FF; border: 2px solid var(--e); border-radius: 13px; font-size: 13.5px; font-weight: 700; line-height: 1.25; }
.fi-regle i { flex: none; width: 34px; height: 34px; display: grid; place-items: center; background: #8E6CEF; border: 2px solid var(--e); border-radius: 50%; font-style: normal; font-size: 17px; }
.fi-regle b { display: block; font-size: 15px; font-weight: 900; }
.fi-objets { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 4px 6px; margin-top: 10px; padding: 6px 6px 8px; background: rgba(29, 36, 51, .07); border-radius: 13px; }
.fi-objets span { flex-basis: 100%; font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; opacity: .6; }
.fi-objets img { height: 36px; max-width: 40px; object-fit: contain; }
.fiche .fi-jouer { font-size: 25px; padding: 17px 16px; }
