/* Spike Castle — jeu.css : l'écran de jeu (plateau, pions, trois panneaux). Même direction artistique que base.css. */

.jeu { display: flex; flex-wrap: wrap; align-items: stretch; min-height: calc(100vh - 64px); }
.panneau { box-sizing: border-box; padding: var(--e6) var(--e5); display: flex; flex-direction: column; gap: var(--e6); min-width: 0; }
.panneau.gauche { flex: 0 1 300px; min-width: 260px; border-right: 2px solid var(--encre); }
.panneau.droit { flex: 0 1 330px; min-width: 280px; border-left: 2px solid var(--encre); }
.centre-jeu { flex: 999 1 660px; min-width: 0; box-sizing: border-box; padding: var(--e6) var(--e7); display: flex; flex-direction: column; align-items: center; gap: var(--e5); }
.centre-jeu .tete { align-self: stretch; display: flex; flex-direction: column; gap: var(--e1); }
.section-jeu { display: flex; flex-direction: column; gap: var(--e3); }
.section-jeu > h2 { margin: 0; font-family: var(--mono); font-size: var(--t-mini); letter-spacing: .12em; color: var(--encre-douce); font-weight: 700; text-transform: uppercase; }

/* Binômes : qui est qui ? */
.accordeon { display: flex; flex-direction: column; background: var(--papier-clair); border: 2px solid var(--encre); box-shadow: var(--ombre-1); }
.accordeon > button { height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--e4); border: 0; background: var(--papier-fonce); font-family: var(--mono); font-size: var(--t-mini); letter-spacing: .12em; font-weight: 700; cursor: pointer; }
.bande-equipe { padding: var(--e1) 10px; color: var(--papier-clair); font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .12em; font-weight: 700; }
.rang { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: var(--e3); align-items: center; width: 100%; min-height: 32px; padding: 3px 10px; border: 0; border-top: 1px solid var(--trait-clair); text-align: left; background: transparent; color: var(--encre); cursor: pointer; }
.rang[aria-pressed='true'] { background: var(--encre); color: var(--papier); }
.rang.eteint { color: var(--encre-pale); }
.rang .code { font-family: var(--mono); font-size: var(--t-petit); font-weight: 700; }
.rang .noms { font-size: var(--t-petit); line-height: 1.25; }
.rang .etat { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .04em; text-align: right; white-space: nowrap; }

/* Pions */
.pion { position: relative; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--encre); box-shadow: 3px 3px 0 var(--encre); flex: none; }
.pion svg { stroke: var(--papier-clair); }
.pion.choisi { outline: 3px solid var(--encre); outline-offset: 3px; }
.pion.pop { animation: pop 1.8s cubic-bezier(.3, 1.6, .5, 1) infinite; z-index: 3; }
@keyframes pop { 0% { transform: scale(1); } 14% { transform: scale(1.45); } 32% { transform: scale(.94); } 42%, 100% { transform: scale(1); } }
.pixel { position: absolute; left: 50%; top: 50%; opacity: 0; animation: fumee 1.8s steps(6) infinite; pointer-events: none; }
@keyframes fumee { 0%, 24% { opacity: 0; transform: translate(0, 0); } 30% { opacity: 1; transform: translate(calc(var(--dx) * .35), calc(var(--dy) * .35)); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)); } }
.unite { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.unite .legende { font-family: var(--mono); font-size: var(--t-mini); font-weight: 700; white-space: nowrap; }
.vide-place { width: 40px; height: 40px; border: 2px dashed var(--trait); }
.vide-etiquette { font-family: var(--mono); font-size: var(--t-mini); color: var(--encre-pale); }
.jeton-reserve { display: flex; align-items: center; gap: var(--e3); padding: 6px 10px 6px 6px; background: var(--papier-clair); border: 2px solid var(--encre); }
.jeton-reserve .infos { display: flex; flex-direction: column; font-family: var(--mono); }
.jeton-reserve .infos b { font-size: var(--t-petit); }
.jeton-reserve .infos span { font-size: var(--t-mini); color: var(--encre-douce); }
.renfort { display: flex; align-items: center; gap: 10px; padding: var(--e3) var(--e4); border: 2px dashed var(--trait); background: transparent; }
.renfort.pret { border: 2px solid var(--encre); background: var(--papier-clair); }
.renfort b { font-family: var(--mono); font-size: var(--t-petit); }
.renfort span { font-size: var(--t-petit); color: var(--encre-douce); }

/* Plateau */
.cadre-plateau { width: 100%; max-width: 640px; }
.plateau { position: relative; width: 640px; height: 590px; transform-origin: 0 0; background: var(--papier-clair); border: 3px solid var(--encre); box-shadow: var(--ombre-3); box-sizing: border-box; }
.plateau > svg { position: absolute; left: 0; top: 0; }
.tour { position: absolute; width: 128px; height: 128px; box-sizing: border-box; display: flex; flex-direction: column; background: var(--papier-clair); border: 3px solid var(--encre); }
.tour .tete-tour { display: flex; justify-content: space-between; align-items: center; height: 22px; padding: 0 8px; color: var(--papier-clair); font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .12em; font-weight: 700; }
.tour .corps-tour { flex: 1; display: flex; gap: 10px; align-items: center; justify-content: center; }
.tour .pied-tour { height: 18px; display: flex; align-items: center; justify-content: center; border-top: 1px solid var(--trait-clair); font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .12em; color: var(--encre-douce); }
.centre-plateau { position: absolute; width: 120px; height: 120px; box-sizing: border-box; border: 3px dashed var(--encre-pale); background: var(--papier); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--e2); text-align: center; }
.centre-plateau.ouvert { border: 3px solid var(--encre); background: var(--papier-clair); box-shadow: 4px 4px 0 var(--or); }
.centre-plateau .titre-centre { font-family: var(--mono); font-size: var(--t-mini); letter-spacing: .12em; font-weight: 700; }
.centre-plateau .detail { font-family: var(--mono); font-size: var(--t-mini); color: var(--encre-douce); }
.route-ouverte { animation: marche .9s linear infinite; }
@keyframes marche { to { stroke-dashoffset: -18; } }

.pied-plateau { align-self: stretch; display: flex; justify-content: space-between; align-items: center; gap: var(--e5); flex-wrap: wrap; }
.legende-jeu { display: flex; gap: var(--e5); flex-wrap: wrap; font-size: var(--t-petit); color: var(--encre-douce); }

/* Panneau droit */
.score { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; background: var(--papier-clair); border: 2px solid var(--encre); padding: var(--e4); }
.score .equipe { display: flex; flex-direction: column; gap: 2px; font-size: var(--t-base); font-weight: 700; }
.score .equipe small { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .12em; color: var(--encre-douce); font-weight: 400; }
.score .total { font-family: var(--mono); font-size: var(--t-nombre); font-weight: 700; text-align: center; }
.manches { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--e2); }
.manche { height: 28px; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--trait); font-family: var(--mono); font-size: var(--t-mini); letter-spacing: .12em; color: var(--encre-douce); }
.manche.encours { background: var(--encre); color: var(--papier); border: 2px solid var(--encre); }
.manche.terminee { background: var(--papier-clair); color: var(--encre); border: 2px solid var(--encre); }
.vague { display: flex; gap: var(--e4); align-items: center; min-height: 30px; padding: 0 10px; box-sizing: border-box; border: 2px dashed var(--trait); color: var(--encre-douce); }
.vague.faite { background: var(--papier-clair); border: 2px solid var(--encre); color: var(--encre); }
.vague.encours { background: var(--encre); border: 2px solid var(--encre); color: var(--papier); }
.vague b { font-family: var(--mono); font-size: var(--t-petit); }
.vague span { font-size: var(--t-petit); }
.tableau-camps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--e2); font-size: var(--t-base); }
.tableau-camps .num { font-family: var(--mono); text-align: right; }
.tableau-camps .entete-col { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .12em; text-align: right; }

/* Téléphone et petit écran : le plateau d'abord, les panneaux ensuite. */
@media (max-width: 1100px) {
  .panneau.gauche, .panneau.droit { flex: 1 1 100%; border: 0; border-top: 2px solid var(--encre); }
  .centre-jeu { order: -1; flex-basis: 100%; padding: var(--e5) var(--e4); }
}

/* Tours à saisir, bandeau de confirmation, feuille de résultat */
.tour.jouable, .centre-plateau.jouable { cursor: pointer; outline: 3px dashed var(--brique); outline-offset: 6px; }
.tour.jouable:hover, .centre-plateau.jouable:hover { background: var(--papier-fonce); }
.bandeau-action { display: flex; align-items: center; gap: var(--e4); padding: var(--e3) var(--e7); background: var(--encre); color: var(--papier); border-bottom: 3px solid var(--or); }
.bandeau-action.alerte { background: var(--alerte); border-bottom-color: var(--encre); }
.bandeau-action .texte-bandeau { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: var(--t-base); }
.bandeau-action .texte-bandeau span { font-size: var(--t-petit); color: var(--trait-clair); }
.bandeau-action .bouton { color: var(--encre); }
.voile { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: var(--e5); background: rgba(34, 30, 24, .42); }
.feuille { width: min(560px, 100%); max-height: 100%; overflow: auto; display: flex; flex-direction: column; gap: var(--e5); padding: var(--e5); background: var(--papier-clair); border: 3px solid var(--encre); box-shadow: var(--ombre-3); }
.duel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e4); }
.choix-binome { display: flex; align-items: center; gap: var(--e4); min-height: 76px; padding: var(--e3) var(--e4); text-align: left; cursor: pointer; background: var(--papier-clair); border: 3px solid var(--encre); color: var(--encre); }
.choix-binome[aria-pressed='true'] { background: var(--encre); color: var(--papier); box-shadow: 4px 4px 0 var(--or); }
.choix-binome .qui { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choix-binome .qui b { font-family: var(--mono); font-size: var(--t-lisant); }
.choix-binome .qui span { font-size: var(--t-petit); }
.choix-binome .qui small { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .12em; opacity: .8; }
.cases-vies { display: flex; flex-wrap: wrap; gap: var(--e2); }
.case-vie { min-width: 52px; min-height: 44px; padding: 0 var(--e3); font-family: var(--mono); font-size: var(--t-base); font-weight: 700; cursor: pointer; background: var(--papier-clair); border: 2px solid var(--encre); box-shadow: 2px 2px 0 var(--encre); color: var(--encre); }
.case-vie[aria-pressed='true'] { background: var(--encre); color: var(--papier); box-shadow: 3px 3px 0 var(--or); }
@media (max-width: 600px) { .duel { grid-template-columns: 1fr; } .bandeau-action { padding: var(--e3) var(--e4); } }

/* Déplacements : binômes mobiles, destinations, glisser-déposer */
.unite.mobile, .jeton-reserve.mobile, .renfort.mobile { cursor: grab; outline: 2px dashed var(--brique); outline-offset: 3px; }
.unite.choisi, .jeton-reserve.choisi, .renfort.choisi { outline: 3px solid var(--encre); outline-offset: 3px; background: var(--papier-fonce); }
[data-glisser] { touch-action: none; -webkit-user-select: none; user-select: none; }
.glisse { opacity: .35; }
.fantome-glisse { opacity: .95; filter: none; }
.tour.cible, .centre-plateau.cible { outline: 3px dashed var(--brique); outline-offset: 6px; cursor: pointer; animation: halo 1.4s ease-in-out infinite; }
@keyframes halo { 50% { outline-offset: 10px; } }
.glisse-possible { outline: 3px dashed var(--brique); outline-offset: 6px; }
.glisse-survol { background: var(--papier-fonce) !important; outline: 3px solid var(--encre); outline-offset: 6px; }
.rang.mobile .code::after { content: ' ·'; }
.chrono { font-family: var(--mono); font-size: var(--t-petit); color: var(--encre-pale); letter-spacing: .04em; }
.chrono.ecoule { color: var(--alerte); font-weight: 700; }
.bilan { align-self: stretch; display: flex; flex-direction: column; gap: var(--e3); padding: var(--e5); background: var(--papier-clair); border: 3px solid var(--encre); box-shadow: 4px 4px 0 var(--or); }
@media (prefers-reduced-motion: reduce) { .tour.cible, .centre-plateau.cible { animation: none; } }

/* Priorité d'entrée */
.badge-prio { display: inline-block; font-family: var(--mono); font-size: var(--t-petit); font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border: 2px solid currentColor; }

/* Cartes bonus */
.carte-jeu { display: flex; flex-direction: column; gap: var(--e2); padding: var(--e3) var(--e4); background: var(--papier-clair); border: 2px solid var(--encre); border-left-width: 8px; }
.carte-jeu.active { background: var(--papier-fonce); }
.carte-jeu small { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .08em; color: var(--encre-pale); text-transform: uppercase; }
.texte-carte { font-size: var(--t-petit); }
.cartes-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--e3); }
.carte-choix { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; min-height: 64px; padding: var(--e3); text-align: left; cursor: pointer; background: var(--papier-clair); border: 3px solid var(--encre); }
.carte-choix[aria-pressed='true'] { background: var(--encre); color: var(--papier); box-shadow: 3px 3px 0 var(--or); }
.carte-choix:disabled { opacity: .45; cursor: not-allowed; }
.carte-choix small { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: .08em; text-transform: uppercase; }
.case-vie.large { min-width: 96px; }

/* Animations sobres (coupées si l'appareil demande moins d'animations) */
.tour.prise .tete-tour { animation: bascule .6s steps(6) both; transform-origin: top; }
.tour.prise { outline: 3px solid var(--or); outline-offset: 4px; animation: eclat .9s ease-out both; }
@keyframes bascule { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes eclat { from { outline-offset: 12px; outline-color: var(--or); } to { outline-offset: 4px; outline-color: transparent; } }
.panneau.gauche { perspective: 800px; }
.carte-jeu.volte { animation: volte .6s ease-out both; }
@keyframes volte { from { transform: rotateY(90deg); opacity: 0; } to { transform: rotateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tour.prise, .tour.prise .tete-tour, .carte-jeu.volte { animation: none; outline: 0; } }
