/* FAB-05bis — Table de jeu de l'Arène (préparation et plis), posée sur la scène 3D. Téléphone d'abord.
   Jetons-blasons, main en éventail, emplacements lumineux, présentoir, plaques gravées, bouton doré en relief. */
.arene-scene { position: relative; height: clamp(540px, calc(100dvh - 262px), 780px); scroll-margin-top: 160px; margin: 8px 0; border-radius: 18px; overflow: hidden; background: #050919; border: 2px solid var(--ar-or); box-shadow: inset 0 0 0 3px #0a1030, 0 10px 30px rgba(0, 0, 0, .5); isolation: isolate; }
.arene-scene > .arene3d-hote { position: absolute; left: 0; right: 0; top: 0; height: 100%; }
.arene-scene.mode-jeu > .arene3d-hote { height: 40%; }
.arene-scene.mode-fin > .arene3d-hote { height: 62%; }
.arene-scene.revelation > .arene3d-hote { height: 100%; }
.arene-scene.revelation > .at { opacity: 0; pointer-events: none; }
.arene-scene > .arene3d-hote.arene3d-perdue { background: radial-gradient(600px 300px at 50% 0, #1b2a68, #070a1a 70%); }
.at { position: absolute; inset: 0; display: grid; gap: 6px; padding: 8px; box-sizing: border-box; color: #f4ead0; font: 500 .9rem/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; pointer-events: none; transition: opacity .2s; }
.at > * { pointer-events: auto; min-width: 0; }
.at-prep { grid-template-rows: auto minmax(0, 1fr) auto auto auto; }
.at-prep > .at-haut { grid-row: 1; } .at-prep > .at-plateau { grid-row: 3; } .at-prep > .at-main { grid-row: 4; } .at-prep > .at-pied { grid-row: 5; }
.at-jeu, .at-fin { top: 40%; grid-auto-rows: max-content; align-content: start; background: linear-gradient(180deg, rgba(10, 16, 48, 0) 0, #0c1440 26px, #0a1030 100%); padding-top: 14px; overflow-y: auto; }
.at-fin { top: 62%; align-content: start; }

/* Plaques gravées (étiquettes). */
.at-plaque { display: inline-block; padding: 2px 10px; border-radius: 999px; font: 700 .72rem var(--ar-titre); letter-spacing: .08em; color: var(--ar-or2); background: linear-gradient(180deg, #1d2c78, #0a1030); border: 1px solid var(--ar-or); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 6px rgba(0, 0, 0, .5); white-space: nowrap; }
.at-plaque.rouge { color: #ffd9d4; background: linear-gradient(180deg, #a3141f, #5a0c16); }

/* Haut : jetons de format (blasons) et dos des cartes adverses. */
.at-haut { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding-right: 52px; }
.at-jetons { display: flex; gap: 8px; }
.at-jeton { position: relative; z-index: 0; width: 58px; height: 68px; border: 0; padding: 6px 0 12px; cursor: pointer; display: grid; justify-items: center; align-content: center; line-height: 1; color: #c9d1f2; background: linear-gradient(180deg, #caa44a, #7a5a12); clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%); transition: transform .12s; }
.at-jeton::before { content: ""; position: absolute; inset: 3px; z-index: -1; background: radial-gradient(circle at 50% 25%, #2a3f9c, #0a1030 80%); clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%); }
.at-jeton b { font: 800 1.15rem var(--ar-titre); color: #f4ead0; } .at-jeton small { font-size: .55rem; letter-spacing: .08em; }
.at-jeton.actif { background: linear-gradient(180deg, #fff6d2, #e3b84f 45%, #9a6a1c); transform: translateY(3px) scale(1.08); }
.at-jeton.actif::before { background: radial-gradient(circle at 50% 25%, #e02a36, #6f0a12 85%); } .at-jeton.actif b { color: #fff; text-shadow: 0 0 10px #ffd27a; } .at-jeton.actif small { color: #ffe1dc; }
.at-jeton:active { transform: translateY(5px) scale(1.02); }
.at-jeton:focus-visible, .at-carte:focus-visible, .at-effet:focus-visible, .at-or:focus-visible, .at-lien:focus-visible, .at-indice:focus-visible, .at-sanseffet:focus-visible, .at-loupe:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.at-adverse { display: grid; justify-items: end; gap: 6px; }
.at-dosrang { display: flex; padding-right: 6px; }
.at-dos { width: 38px; aspect-ratio: 860 / 1170; margin-left: -10px; border-radius: 4px; overflow: hidden; box-shadow: 0 4px 10px rgba(0, 0, 0, .7), 0 0 0 1px rgba(246, 215, 122, .5); transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 7deg)); transform-origin: 50% 160%; }
.at-dos img, .at-carte img, .at-effet img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }

/* Plateau : la table, velours bleu nuit serti d'or. */
.at-plateau { display: grid; gap: 8px; padding: 10px 10px 8px; border-radius: 16px 16px 10px 10px; background: radial-gradient(120% 90% at 50% 0, rgba(42, 63, 156, .8), rgba(12, 19, 56, .88) 70%); border: 2px solid var(--ar-or); box-shadow: inset 0 0 0 2px rgba(10, 16, 48, .9), inset 0 0 0 3px rgba(246, 215, 122, .35), inset 0 14px 30px rgba(120, 150, 255, .16), 0 -6px 22px rgba(0, 0, 0, .55); }
.at-emplacements { display: flex; justify-content: center; gap: 12px; }
.at-emplacement { position: relative; width: 68px; aspect-ratio: 860 / 1170; border-radius: 7px; display: grid; place-items: center; }
.at-emplacement.vide { border: 2px dashed rgba(246, 215, 122, .55); background: radial-gradient(circle at 50% 40%, rgba(246, 215, 122, .16), rgba(246, 215, 122, 0) 70%); color: rgba(246, 215, 122, .8); align-content: center; text-align: center; }
.at-emplacement.vide b { font: 800 1.5rem var(--ar-titre); } .at-emplacement.vide small { font-size: .6rem; padding: 0 4px; }
.at-emplacement.vide.suivant { border-style: solid; border-color: var(--ar-or2); box-shadow: 0 0 16px rgba(246, 215, 122, .65), inset 0 0 14px rgba(246, 215, 122, .35); animation: at-souffle 1.6s ease-in-out infinite; }
@keyframes at-souffle { 50% { box-shadow: 0 0 26px rgba(246, 215, 122, .95), inset 0 0 20px rgba(246, 215, 122, .5); } }
.at-emplacement .at-carte { width: 100%; height: 100%; }
.at-loupe { position: absolute; right: -9px; top: -9px; width: 24px; height: 24px; min-width: 0; min-height: 0; padding: 0; box-sizing: border-box; border-radius: 50%; border: 1.5px solid var(--ar-or); background: #0a1030; cursor: pointer; display: grid; place-items: center; }
.at-loupe span { width: 8px; height: 8px; border: 2px solid var(--ar-or2); border-radius: 50%; box-shadow: 4px 4px 0 -2.5px var(--ar-or2); }
.at-presentoir { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 50px; padding: 4px 6px; border-radius: 10px; background: linear-gradient(180deg, rgba(5, 9, 25, .5), rgba(5, 9, 25, .2)); box-shadow: inset 0 -3px 0 rgba(202, 164, 74, .7), inset 0 1px 0 rgba(255, 255, 255, .08); }
.at-effets { display: flex; gap: 8px; overflow-x: auto; padding: 12px 6px 4px; flex: 1; scrollbar-width: none; }
.at-effet, .at-carte { position: relative; flex: none; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 6px; -webkit-tap-highlight-color: transparent; }
.at-effet { width: 36px; aspect-ratio: 860 / 1170; transform: rotate(-4deg); box-shadow: 0 4px 8px rgba(0, 0, 0, .6); transition: transform .14s, box-shadow .14s; }
.at-effet:nth-child(even) { transform: rotate(3deg); }
.at-effet.choisie { transform: translateY(-6px) scale(1.14); box-shadow: 0 0 0 2px var(--ar-or2), 0 0 16px rgba(246, 215, 122, .9); z-index: 2; }
.at-vide { color: #c9d1f2; font-size: .82rem; }
.at-sansimage { display: grid; place-items: center; align-content: center; gap: 2px; width: 100%; height: 100%; padding: 4px; box-sizing: border-box; border-radius: 6px; text-align: center; color: #fff; font-size: .68rem; background: linear-gradient(180deg, #1d2c78, #090f30); border: 2px solid var(--ar-or); overflow: hidden; }
.at-sansimage.effet { background: linear-gradient(180deg, #9c0707 0 45%, #0a0a0a 45%); font-size: .5rem; } .at-sansimage small { color: var(--ar-or2); font-size: .58rem; }

/* Main en éventail : les cartes pivotent autour d'un point situé sous la table. */
.at-main { display: flex; justify-content: center; align-items: flex-end; height: 148px; padding: 0 22px 8px; box-sizing: border-box; --pas: 6deg; }
.at-main .at-carte { width: 80px; aspect-ratio: 860 / 1170; margin: 0 -11px; transform-origin: 50% 330%; transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * var(--pas))); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .65)); transition: transform .16s, filter .16s; }
.at-main .at-carte.grand { width: 98px; margin: 0 2px; } .at-jeu .at-main { height: 158px; padding-top: 20px; --pas: 3deg; }
.at-jeu .at-main .at-carte.choisie { transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * var(--pas))) translateY(-10px) scale(1.04); }
.at-main .at-carte:hover, .at-main .at-carte:focus-visible { transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * var(--pas))) translateY(-10px); z-index: 3; }
.at-main .at-carte.choisie { transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * var(--pas))) translateY(-16px) scale(1.06); filter: drop-shadow(0 0 10px rgba(246, 215, 122, .95)) drop-shadow(0 8px 10px rgba(0, 0, 0, .7)); z-index: 2; }
.at-main.defile { justify-content: safe center; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; padding: 26px 16px 8px; --pas: 0deg; scrollbar-width: none; }
.at-main.defile .at-carte { margin: 0 -6px; scroll-snap-align: center; transform: none; }
.at-main.defile .at-carte:nth-child(odd) { transform: translateY(-5px) rotate(-2deg); } .at-main.defile .at-carte:nth-child(even) { transform: rotate(2deg); }
.at-main.defile .at-carte.choisie { transform: translateY(-10px) scale(1.04); z-index: 2; }
.at-rarete { position: absolute; left: 50%; bottom: -5px; width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg); background: var(--rc, #9aa7c4); border: 1.5px solid #fff; box-shadow: 0 0 8px var(--rc, #9aa7c4); }
.at-fort { position: absolute; bottom: 10px; right: -6px; display: flex; align-items: baseline; gap: 3px; padding: 1px 6px; border-radius: 999px; font-size: .62rem; color: #2a1802; background: linear-gradient(180deg, #fff1bd, #e3b84f); border: 1px solid #7a5a12; box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.at-fort i { font-style: normal; font-weight: 700; letter-spacing: .04em; } .at-fort b { font-size: .8rem; font-variant-numeric: tabular-nums; }
.at-fort.annonce { background: linear-gradient(180deg, #eaffea, #37d67a); border-color: #0f6b34; }
.at-coche { position: absolute; left: -7px; top: -7px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 800 .8rem system-ui; color: #2a1802; background: radial-gradient(circle at 35% 30%, #fff6d2, #e3b84f 70%); border: 1.5px solid #7a5a12; box-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
.at-nom { display: none; }
.at-sansimage ~ .at-nom { display: none; }

/* Pied : récapitulatif et bouton doré en relief, toujours visible. */
.at-pied { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "recap or" "sec sec"; gap: 2px 10px; align-items: center; padding: 6px 10px 4px; border-radius: 12px; background: linear-gradient(180deg, #1b2870, #0a1030 85%); border: 1.5px solid var(--ar-or); box-shadow: inset 0 3px 0 rgba(217, 210, 192, .9), 0 -4px 14px rgba(0, 0, 0, .45); }
.at-recap { grid-area: recap; display: grid; gap: 1px; font-size: .74rem; color: #c9d1f2; } .at-recap b { font: 700 .98rem var(--ar-titre); color: var(--ar-or2); letter-spacing: .03em; } .at-compte { color: #f4ead0; }
.at-or { grid-area: or; position: relative; min-width: 132px; min-height: 54px; margin-bottom: 5px; padding: 6px 18px 9px; border: 0; border-radius: 14px; cursor: pointer; display: grid; justify-items: center; color: #2a1802; background: linear-gradient(180deg, #fff6d2 0, #f6d77a 22%, #e3b84f 55%, #b98522 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .85), inset 0 -3px 0 rgba(122, 76, 8, .55), 0 5px 0 #7a4c08, 0 9px 16px rgba(0, 0, 0, .55); transition: transform .08s, box-shadow .08s; overflow: hidden; }
.at-or::after { content: ""; position: absolute; left: 8%; right: 8%; top: 4px; height: 38%; border-radius: 10px; background: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0)); pointer-events: none; }
.at-or-texte { font: 800 1.12rem var(--ar-titre); letter-spacing: .05em; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); } .at-or small { font-size: .68rem; font-weight: 700; }
.at-or:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(122, 76, 8, .5), 0 1px 0 #7a4c08, 0 3px 6px rgba(0, 0, 0, .5); }
.at-or:disabled { cursor: not-allowed; color: #4a4f66; background: linear-gradient(180deg, #c9cddb, #8e93a8); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 5px 0 #4a4f66, 0 9px 16px rgba(0, 0, 0, .5); }
.at-secondaires { grid-area: sec; display: flex; flex-wrap: wrap; gap: 2px 14px; justify-content: center; }
.at-lien { min-height: 30px; padding: 2px 4px; border: 0; background: none; cursor: pointer; color: var(--ar-or2); font: 600 .8rem system-ui, sans-serif; text-decoration: underline; text-decoration-color: rgba(246, 215, 122, .5); text-underline-offset: 3px; }

/* Jeu pli par pli. */
.at-statut { display: grid; gap: 1px; padding: 6px 12px; border-radius: 12px; text-align: center; background: linear-gradient(180deg, #1d2c78, #0e1746); border: 1.5px solid var(--ar-or); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .14); }
.at-statut b { font: 700 .98rem var(--ar-titre); color: var(--ar-or2); letter-spacing: .04em; } .at-statut span { font-size: .8rem; color: #dfe5ff; }
.at-statut.adverse { background: linear-gradient(180deg, #8f1420, #4a0810); } .at-statut.adverse b { color: #ffe1dc; }
.at-indices { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.at-indice, .at-sanseffet { min-width: 50px; min-height: 44px; padding: 3px 6px; border-radius: 12px; cursor: pointer; display: grid; justify-items: center; align-content: center; line-height: 1.05; color: #f4ead0; background: radial-gradient(circle at 50% 20%, #2a3f9c, #0a1030 85%); border: 1.5px solid rgba(246, 215, 122, .6); box-shadow: 0 3px 0 #05081e, inset 0 1px 0 rgba(255, 255, 255, .2); }
.at-indice i { font-style: normal; font-size: .66rem; font-weight: 700; letter-spacing: .05em; color: var(--ar-or2); } .at-indice b { font-size: .95rem; font-variant-numeric: tabular-nums; }
.at-indice.actif, .at-sanseffet.actif { color: #2a1802; background: linear-gradient(180deg, #fff6d2, #e3b84f 60%, #b98522); border-color: #7a4c08; transform: translateY(2px); box-shadow: 0 1px 0 #7a4c08, 0 0 12px rgba(246, 215, 122, .7); }
.at-indice.actif i { color: #5a3d08; } .at-indices.petit .at-indice { min-height: 34px; min-width: 44px; }
.at-sanseffet { font: 700 .74rem system-ui; min-height: 40px; align-self: center; flex: none; }
.at-presentoir.jeu { min-height: 0; position: relative; z-index: 3; } .at-effettexte { margin: 0; padding: 0 6px; font-size: .76rem; color: #dfe5ff; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.at-historique { font-size: .8rem; background: rgba(5, 9, 25, .6); border-radius: 10px; padding: 4px 8px; } .at-historique summary { cursor: pointer; color: var(--ar-or2); font-weight: 700; min-height: 30px; display: flex; align-items: center; }
.combatview:has(.arene-scene) > .combatbar { display: none; }
.combatview .arene-scene { height: min(900px, calc(100dvh - 16px)); margin: 0; }

@media (min-width: 860px) {
  .arene-scene { height: clamp(600px, calc(100dvh - 176px), 780px); }
  .at-plateau { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; } .at-prep .at-presentoir { align-self: stretch; }
  .at { padding: 14px 18px; gap: 10px; font-size: 1rem; }
  .at-prep { justify-items: center; } .at-prep > * { width: min(100%, 900px); box-sizing: border-box; }
  .at-haut { padding-right: 60px; } .at-jeton { width: 74px; height: 86px; } .at-jeton b { font-size: 1.5rem; } .at-jeton small { font-size: .66rem; } .at-dos { width: 58px; }
  .at-emplacement { width: 92px; } .at-emplacements { gap: 20px; } .at-effet { width: 60px; }
  .at-main { height: 170px; } .at-main .at-carte { width: 100px; margin: 0 -8px; } .at-main .at-carte.grand { width: 118px; } .at-jeu .at-main { height: 196px; }
  .at-jeu, .at-fin { top: 50%; left: 50%; right: auto; width: min(100%, 900px); transform: translateX(-50%); }
  .at-fin { top: 62%; }
  .arene-scene.mode-jeu > .arene3d-hote { height: 52%; }
  .at-or { min-width: 190px; min-height: 62px; } .at-or-texte { font-size: 1.35rem; } .at-recap { font-size: .86rem; }
}
@media (prefers-reduced-motion: reduce) { .at-emplacement.vide.suivant { animation: none; } .at-main .at-carte, .at-effet, .at-jeton, .at-or { transition: none; } }
/* Séquence de jeu en plein écran, la scène garde le même cadrage entre les plis. */
html.arena-active, html.arena-active body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.arena-fullscreen.arene-scene {
  --duel-width: min(35.94vw, 30.9dvh);
  --duel-gap: min(29.24vw, 25.15dvh);
  --duel-center: 46.7%;
  position: fixed; inset: 0; height: 100dvh; margin: 0; border: 0; border-radius: 0; box-shadow: none; overflow: clip;
}
@media (max-aspect-ratio: 1.35) {
  .arena-fullscreen.arene-scene {
    --duel-gap: min(19.47vw, 16.74dvh);
    --duel-center: max(34%, calc(154px + var(--duel-width) * 1170 / 1720));
  }
}
.arena-fullscreen.arene-scene > .arene3d-hote { inset: 0; height: 100%; }
.arena-fullscreen .arena-options, .arena-fullscreen .arena-quit { position: absolute; z-index: 8; top: max(8px, env(safe-area-inset-top)); min-height: 36px; }
.arena-fullscreen .arena-options { right: 8px; }
.arena-fullscreen .arena-quit { left: 8px; }
.arena-fullscreen .at-prep { padding-top: max(50px, calc(env(safe-area-inset-top) + 42px)); }
.arena-fullscreen .at-jeu, .arena-fullscreen .at-fin {
  inset: auto max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  margin-inline: auto; width: min(760px, calc(100% - 16px)); padding: 6px; overflow: visible; gap: 4px;
}
.arena-fullscreen .at-jeu { z-index: 1; background: linear-gradient(180deg, #090f2ded, #080d24); border-top: 1px solid #e3b84faa; border-radius: 14px; }
.arena-fullscreen .at-statut { padding: 2px 6px; min-height: 24px; margin: 0; gap: 8px; }
.arena-fullscreen .at-jeu .at-statut span { font-size: 14px; flex: none; }
.at-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 6px; align-items: start; }
.at-controls > .at-indices { grid-column: 1 / -1; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; }
.at-controls > .at-indices .at-indice { display: flex; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 30px; padding: 2px; font-size: 12px; }
.at-controls > .at-indices .at-indice b { font-size: 14px; }
.at-controls > .at-indices .at-indice:disabled { cursor: default; opacity: .65; }
.at-indice-aide { grid-column: 1 / -1; margin: 2px 0 0; text-align: center; font-size: .82rem; }
.at-controls .at-effets.jeu { grid-column: 1 / -1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; overflow: visible; padding: 0; gap: 4px; }
.at-effect-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px; align-items: center; color: #fff; background: #141d42; border: 1px solid #5d6a91; border-radius: 8px; padding: 3px; min-width: 0; max-width: 280px; }
.at-effect-item.choisie { border-color: #f6d77a; }
.at-effect-item .at-effet, .at-effect-item .at-effet:nth-child(even) { width: 46px; transform: none; }
.at-effect-copy { display: grid; min-width: 0; font: 500 14px/1.15 system-ui, sans-serif; }
.at-effect-summary { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.at-effect-choice, .at-placed { min-height: 32px; background: #273567; color: #fff; border: 1px solid #9da9d4; border-radius: 8px; cursor: pointer; }
.at-effect-choice[aria-pressed=true] { background: #f6d77a; color: #291900; }
.at-prep .at-effets { flex-basis: 100%; padding: 2px; }
.at-prep .at-effect-item { flex: 0 0 min(260px, 83%); }
.at-prep .at-effect-item .at-effet { width: 56px; }
.at-confirm { display: flex; justify-content: center; align-items: center; gap: 8px; }
.at-confirm .at-or { min-height: 40px; padding: 4px 12px; margin-bottom: 5px; }
.at-confirm .at-or-texte { font: 800 1rem system-ui, sans-serif; letter-spacing: 0; }
.at-placed { max-width: 38%; padding: 2px 6px; }
.arena-fullscreen .at-jeu .at-main { --hand-width: clamp(118px, 30vw, 154px); position: relative; height: calc(var(--hand-width) * 1.36 + 32px); align-items: center; justify-content: center; padding: 0; gap: 0; overflow: visible; }
.arena-fullscreen .at-jeu .at-main:has(.at-carte:nth-child(4)) .at-carte { margin-inline: calc(clamp(58px, 19vw, 125px) / 2 - var(--hand-width) / 2); }
.arena-fullscreen .at-jeu .at-main .at-carte { width: var(--hand-width); min-height: 0; margin-inline: -4px; transform-origin: center bottom; transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 2deg)); z-index: calc(var(--i) + 1); }
.arena-fullscreen .at-jeu .at-main .at-carte:is(:hover, :focus-visible) { z-index: 7; }
.arena-fullscreen .at-jeu .at-main .at-carte .at-nom {
  position: absolute; top: 2px; left: 2px; right: 2px; display: block;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font: 700 14px/1.15 system-ui, sans-serif; color: #fff; background: #080e2ae8;
}
.arena-fullscreen .at-jeu .at-main:has(.at-carte:nth-child(4)) .at-nom { right: 38%; }
.arena-fullscreen .at-jeu .at-main .at-fort { left: 2px; right: auto; }
.arena-fullscreen .at-jeu .at-main:not(:has(.at-carte)) { height: 0; }
.at-carte .character-portrait { width: 100%; height: 100%; border-radius: inherit; }
.arena-fullscreen .at-fin {
  grid-template-columns: auto auto; justify-content: center; justify-items: center; align-items: center;
  background: none; padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.arena-fullscreen .at-fin .at-or { grid-area: auto; }
.arena-fullscreen .at-fin .at-statut { grid-column: 1 / -1; background: #101535; border-radius: 8px; }
.arena-fullscreen .at-fin .at-or:only-of-type { grid-column: 1 / -1; }
@media (min-width: 700px) {
  .arena-fullscreen .at-fin { display: flex; justify-content: center; }
  .arena-fullscreen .at-fin .at-or { min-height: 44px; margin-bottom: 0; }
}
.arena-reveal-content { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
.arena-reveal-label { position: absolute; top: max(48px, 11dvh); margin: 0; color: #fff6d2; text-shadow: 0 2px 8px #000; font: 700 1rem var(--ar-titre); }
.arena-reveal-label.decisive { padding: 5px 12px; border: 1px solid #e3b84f; background: #0a1030; border-radius: 6px; }
.arena-flat-duel, .arena-flat-table {
  position: absolute; top: calc(var(--duel-center) - var(--duel-width) * 1170 / 1720); left: 50%; transform: translateX(-50%);
  display: grid; grid-template-columns: repeat(2, var(--duel-width)); column-gap: var(--duel-gap); pointer-events: none;
}
.arena-flat-duel > p { grid-column: 1 / -1; margin: 8px 0 0; text-align: center; }
.arena-flat-card { display: block; width: 100%; aspect-ratio: 860 / 1170; object-fit: contain; border-radius: 6px; box-shadow: 0 4px 13px #000a; }
.mode-jeu .arena-flat-table {
  top: calc(var(--choix-centre) - var(--choix-hauteur) / 2);
  grid-template-columns: repeat(2, var(--choix-largeur));
  column-gap: calc(2 * var(--choix-decalage) - var(--choix-largeur));
}
.arena-card-inspect {
  position: absolute; z-index: 1;
  top: calc(var(--choix-centre) - var(--choix-hauteur) / 2);
  left: calc(50% - var(--choix-decalage) - var(--choix-largeur) / 2);
  width: var(--choix-largeur); height: var(--choix-hauteur);
  padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: zoom-in;
}
.arena-fullscreen:has(> .arene3d-hote[data-mode="attente"]) .arena-card-inspect { visibility: hidden; }
.arena-flat-duel .acard, .arena-flat-table .acard {
  position: relative; width: 100%; min-height: 0; aspect-ratio: 860 / 1170; padding: 0; overflow: clip;
}
.arena-flat-duel .acard:first-child, .arena-flat-table .acard:first-child { border-color: #62a6ff; }
.arena-flat-duel .acard:nth-child(2), .arena-flat-table .acard:nth-child(2) { border-color: #ff6b61; }
.arena-flat-duel .acard > :is(img, picture, button), .arena-flat-table .acard > :is(img, picture, button) { width: 100%; height: 100%; object-fit: contain; }
.arena-flat-duel .acard .row, .arena-flat-table .acard .row {
  position: absolute; inset: auto 0 0; padding: 4px; background: #080e2a; font-size: .78rem;
}
.arena-fullscreen:has(> .arene3d-hote:not([data-mode="repli"])) :is(.arena-flat-duel, .arena-reveal-label) {
  position: absolute; width: 1px; height: 1px; padding: 0; clip-path: inset(50%); overflow: clip; }
.arena-fullscreen:has(> .arene3d-hote:not([data-mode="repli"])) .arena-flat-table { display: none; }
.arena-effect-live {
  pointer-events: auto; position: absolute; bottom: max(10px, env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%); width: min(500px, calc(100% - 20px));
  display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 2px 10px; padding: 6px;
  border: 1px solid #cba856; border-radius: 10px; background: #101835; color: #fff; font: 500 14px/1.2 system-ui, sans-serif;
}
.arena-effect-live:has(.arena-effect-image) { grid-template-columns: auto minmax(0, 1fr); }
.arena-effect-image { grid-row: 1 / span 3; width: 46px; padding: 0; border: 0; background: none; cursor: pointer; }
.arena-effect-image img { display: block; width: 100%; }
@media (min-width: 700px) and (min-aspect-ratio: 1.35) {
  .arena-effect-live { left: max(10px, env(safe-area-inset-left)); width: min(320px, 24vw); transform: none; }
}
@media (max-width: 450px) {
  .arena-fullscreen .at-prep .at-emplacement { width: min(54px, 15%); }
  .arena-fullscreen .at-prep .at-emplacement small { font-size: 10px; padding: 0; }
  .arena-fullscreen .at-prep .at-emplacements { gap: 6px; }
  .arena-fullscreen .at-prep .at-pied { grid-template-columns: minmax(0,1fr) auto; }
  .arena-fullscreen .at-jeu .at-main:has(.at-carte:nth-child(3)) .at-carte { margin-inline: -2px; }
  .arena-fullscreen .at-jeu .at-main:has(.at-carte:nth-child(4)) .at-carte { margin-inline: calc(clamp(54px, 17vw, 66px) / 2 - var(--hand-width) / 2); }
  .at-controls .at-effect-item .at-effet { width: 38px; }
  .at-controls .at-effect-choice { padding: 2px 6px; }
}
@media (max-height: 690px) {
  .arena-fullscreen .at-prep .at-main { height: 118px; padding-top: 10px; }
  .arena-fullscreen .at-prep .at-haut { padding-right: 0; }
  .arena-fullscreen .at-prep .at-effets { max-height: 98px; }
  .arena-fullscreen .at-jeu .at-main { --hand-width: clamp(88px, 25vw, 124px); }
}
@media (prefers-reduced-motion: reduce) {
  .arena-fullscreen *, .arena-fullscreen *::before { animation: none !important; transition: none !important; }
}
.arena-fullscreen .at-jeu, .arena-fullscreen .at-fin { transform: none; }
.arena-fullscreen .at-status-row { display: flex; align-items: center; justify-content: space-between; }
.arena-fullscreen .at-main .at-rarete { bottom: 0; }
.arena-fullscreen .at-jeu .at-main .at-fort { bottom: 6px; }
.arena-fullscreen .at-fin .at-detail { justify-self: center; }
.arene3d-hote:has(+ .arena-reveal-content) .arena-options { opacity: .9; }
.arena-fullscreen .arena-pending { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 8; min-height: 36px; white-space: nowrap; }
.arena-fullscreen .at-controls .at-indice.actif { transform: none; }
.arena-fullscreen .at-effect-copy { line-height: 17px; padding-bottom: 2px; }
.arena-fullscreen .at-jeu .at-main { align-items: start; padding-top: 10px; }
.arena-fullscreen .at-jeu .at-main .at-carte { align-self: start; }
.arena-fullscreen .arena-pending[hidden] { display: none; }

@media (min-width: 700px) {
  .arena-fullscreen .at-jeu {
    width: min(940px, calc(100% - 16px)); grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    grid-template-areas: "statut statut" "main commandes" "main confirmer"; gap: 4px 10px;
  }
  .arena-fullscreen .at-jeu .at-statut { grid-area: statut; }
  .arena-fullscreen .at-jeu .at-controls { grid-area: commandes; }
  .arena-fullscreen .at-jeu .at-main {
    grid-area: main; align-self: center; --hand-width: clamp(82px, 15dvh, 122px);
    height: calc(var(--hand-width) * 1.36 + 15px);
  }
  .arena-fullscreen .at-jeu .at-confirm { grid-area: confirmer; margin-top: auto; }
}
@media (max-width: 699px) and (max-height: 720px) {
  .arena-fullscreen .at-jeu .at-main { --hand-width: clamp(72px, 13dvh, 98px); height: calc(var(--hand-width) * 1.36 + 18px); }
  .arena-fullscreen .at-jeu .at-effect-item { gap: 3px; }
  .arena-fullscreen .at-jeu .at-effect-item .at-effet { width: 35px; }
  .arena-fullscreen .at-jeu .at-effect-copy { font-size: .75rem; line-height: 14px; }
}
.at-prep > .at-troupe { grid-row: 4; }
.at-troupe { display: grid; justify-items: center; }
.at-troupe > .at-main { width: 100%; }
.at-presentoir-titre { display: flex; align-items: center; justify-content: space-between; gap: 4px; width: 100%; }
.at-pagination { display: flex; align-items: center; gap: 6px; color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; }
.at-pagination button { min-width: 30px; min-height: 28px; padding: 0; border-radius: 6px; border: 1px solid #a39165; background: #111a42; color: #fff; cursor: pointer; font-size: 20px; }
.at-pagination button:disabled { opacity: .4; cursor: default; }
.at-prep .at-effets { flex-basis: auto; overflow: visible; }
.at-prep .at-effect-item { flex: 1 1 100%; }
.arena-fullscreen .at-prep .at-main { height: 155px; }
.arena-fullscreen .at-prep .at-main .at-carte { width: clamp(106px, 30vw, 130px); margin-inline: -10px; transform-origin: center bottom; }
.arena-fullscreen .at-prep .at-main .at-carte .at-nom { display: block; top: 0; bottom: auto; }
@media (max-width: 450px) {
  .arena-fullscreen .at-prep .at-main { height: 168px; --pas: 2deg; }
  .arena-fullscreen .at-prep .at-main:has(.at-carte:nth-child(4)) .at-carte { margin-inline: -18px; }
  .arena-fullscreen .at-prep .at-emplacement .character-portrait { --portrait-size: 100%; }
}
@media (max-height: 690px) {
  .arena-fullscreen .at-prep .at-main { height: 155px; padding-top: 0; }
  .arena-fullscreen .at-prep .at-main img { max-height: 146px; }
}
.at-effect-item { grid-template-columns: auto minmax(0, 1fr); }
.at-effect-copy.at-effect-choice { width: 100%; padding: 4px; text-align: left; background: transparent; border-color: transparent; }
.at-effect-copy.at-effect-choice[aria-pressed=true] { color: #fff4c8; background: #332c1c; border-color: #d7b66b; }

/* Téléphone à l'horizontale (essai du propriétaire, 02/12) : la préparation tient dans l'écran sans défilement.
   À gauche, les emplacements et les cartes Effet ; à droite, la main de combattants et le bouton de lancement. */
@media (orientation: landscape) and (max-height: 540px) {
  .arena-fullscreen .at-prep { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 6px 8px; padding: 6px 8px; }
  .arena-fullscreen .at-prep > .at-haut { grid-column: 1 / -1; grid-row: 1; }
  .arena-fullscreen .at-prep > .at-plateau { grid-column: 1; grid-row: 2 / 4; min-height: 0; overflow-y: auto; align-content: start; padding: 6px; }
  /* Main de combattants dans un cadre assorti au plateau : cartes alignées (pas d'éventail), pagination dessous. */
  .arena-fullscreen .at-prep > .at-troupe { grid-column: 2; grid-row: 2; min-height: 0; align-self: stretch; align-content: center; gap: 4px; padding: 6px; border-radius: 14px; background: radial-gradient(120% 90% at 50% 0, rgba(42, 63, 156, .8), rgba(12, 19, 56, .88) 70%); border: 2px solid var(--ar-or); box-shadow: inset 0 0 0 2px rgba(10, 16, 48, .9), 0 -6px 22px rgba(0, 0, 0, .55); }
  .arena-fullscreen .at-prep .at-troupe .at-main { height: auto; padding: 4px 0 0; gap: 6px; align-items: center; }
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte { margin: 0; transform: none; }
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte:is(:hover, :focus-visible) { transform: translateY(-4px); }
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte.choisie { transform: translateY(-4px) scale(1.04); }
  .arena-fullscreen .at-prep .at-troupe .at-pagination { position: static; justify-content: center; }
  .arena-fullscreen .at-prep > .at-main { grid-column: 2; grid-row: 2; }
  .arena-fullscreen .at-prep > .at-pied { grid-column: 2; grid-row: 3; }
  .arena-fullscreen .at-prep .at-haut { padding: 0 44px 0 92px; } /* laisse la place à « Quitter » et à l'aide */
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte .at-nom { display: none; } /* le nom est déjà imprimé sur la carte */
  .arena-fullscreen .at-prep .at-jeton { width: 46px; height: 54px; }
  .arena-fullscreen .at-prep .at-jeton b { font-size: 1rem; } .arena-fullscreen .at-prep .at-jeton small { font-size: .55rem; }
  .arena-fullscreen .at-prep .at-dos { width: 34px; }
  .arena-fullscreen .at-prep .at-emplacement { width: 58px; } .arena-fullscreen .at-prep .at-emplacements { gap: 8px; }
  .arena-fullscreen .at-prep .at-effets { max-height: 82px; }
  .arena-fullscreen .at-prep .at-main { height: 112px; padding: 6px 10px 0; }
  .arena-fullscreen .at-prep .at-main .at-carte { width: 62px; } .arena-fullscreen .at-prep .at-main .at-carte.grand { width: 72px; }
}

/* Très petite hauteur (téléphone avec barres du navigateur, ~250 à 340 px ; capture du propriétaire, 02/12) :
   en-tête sur une seule ligne fine, pied réduit à l'essentiel, cartes plus petites ; tout reste visible sans défilement. */
@media (orientation: landscape) and (max-height: 340px) {
  .arena-fullscreen .at-prep { gap: 4px 6px; padding: 4px 6px; }
  .arena-fullscreen .at-prep .at-haut { padding: 0 40px 0 78px; align-items: center; }
  .arena-fullscreen .at-prep .at-adverse { display: none; }
  .arena-fullscreen .at-prep .at-jeton { width: 34px; height: 38px; }
  .arena-fullscreen .at-prep .at-jeton b { font-size: .8rem; } .arena-fullscreen .at-prep .at-jeton small { font-size: .45rem; }
  .arena-fullscreen .at-prep > .at-plateau { padding: 4px; gap: 4px; }
  .arena-fullscreen .at-prep .at-emplacement { width: 46px; } .arena-fullscreen .at-prep .at-emplacements { gap: 6px; }
  .arena-fullscreen .at-prep .at-effets { max-height: 64px; padding-top: 2px; }
  .arena-fullscreen .at-prep > .at-troupe { padding: 4px; gap: 2px; }
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte { width: 48px; } .arena-fullscreen .at-prep .at-troupe .at-main .at-carte.grand { width: 54px; }
  .arena-fullscreen .at-prep .at-troupe .at-pagination button { min-height: 24px; }
  .arena-fullscreen .at-prep .at-pied { padding: 4px 8px; gap: 2px 8px; }
  .arena-fullscreen .at-prep .at-recap > :not(.at-compte) { display: none; } /* le coût est déjà sur le bouton « Combattre » */
  .arena-fullscreen .at-prep .at-secondaires { display: flex; flex-wrap: nowrap; white-space: nowrap; justify-content: center; }
  .arena-fullscreen .at-prep .at-recap { font-size: .75rem; line-height: 1.2; }
  .arena-fullscreen .at-prep .at-secondaires { font-size: .75rem; gap: 10px; }
  .arena-fullscreen .at-prep .at-or { min-height: 0; padding: 4px 14px; font-size: 1rem; }
}

/* Duel à l'horizontale, même sur un téléphone étroit (< 700 px) : main à gauche, indices et confirmation à droite. */
@media (orientation: landscape) and (max-height: 540px) {
  .arena-fullscreen .at-jeu {
    width: calc(100% - 12px); grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "statut statut" "main commandes" "main confirmer"; gap: 4px 10px;
  }
  .arena-fullscreen .at-jeu .at-statut { grid-area: statut; }
  .arena-fullscreen .at-jeu .at-controls { grid-area: commandes; align-self: center; }
  .arena-fullscreen .at-jeu .at-main { grid-area: main; align-self: center; flex-direction: row; --hand-width: clamp(56px, 24dvh, 110px); height: calc(var(--hand-width) * 1.36 + 12px); padding-top: 4px; }
  .arena-fullscreen .at-jeu .at-confirm { grid-area: confirmer; margin-top: auto; }
  .arena-fullscreen .at-jeu .at-indices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .arena-fullscreen .at-jeu .at-indice-aide { grid-column: 1 / -1; margin: 2px 0 0; }
}
@media (orientation: landscape) and (max-height: 340px) {
  .arena-fullscreen .at-jeu { gap: 2px 8px; padding: 4px 6px; }
  .arena-fullscreen .at-jeu .at-indice { min-height: 28px; padding: 2px 4px; font-size: .75rem; }
  .arena-fullscreen .at-jeu .at-confirm .fi-btn, .arena-fullscreen .at-jeu .at-confirm button { min-height: 36px; padding-block: 4px; }
}

/* Demande du propriétaire (02/12) : le panneau du bas à droite ne sert pas au choix des cartes. À l'horizontale, il devient
   une bande fine (bouton « Combattre » et liens), et la main de combattants prend la place libérée avec des cartes plus grandes. */
@media (orientation: landscape) and (max-height: 540px) {
  .arena-fullscreen .at-prep .at-pied { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "sec or"; padding: 3px 6px; gap: 0 6px; }
  .arena-fullscreen .at-prep .at-pied .at-recap { display: none; }
  .arena-fullscreen .at-prep .at-pied .at-secondaires { grid-area: sec; display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .72rem; justify-content: flex-start; white-space: nowrap; }
  .arena-fullscreen .at-prep .at-pied .at-or { grid-area: or; min-height: 0; padding: 4px 16px; font-size: .95rem; }
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte { width: clamp(52px, 23dvh, 104px); }
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte.grand { width: clamp(56px, 25dvh, 112px); }
}
@media (orientation: landscape) and (max-height: 540px) {
  /* La bande « Combattre » passe sur toute la largeur, en bas, sur une seule ligne fine ; la main garde toute la colonne de droite. */
  .arena-fullscreen .at-prep > .at-plateau { grid-row: 2; }
  .arena-fullscreen .at-prep > .at-troupe { grid-row: 2; }
  .arena-fullscreen .at-prep > .at-pied { grid-column: 1 / -1; grid-row: 3; }
  .arena-fullscreen .at-prep .at-pied .at-secondaires { flex-wrap: nowrap; gap: 14px; font-size: .78rem; align-items: center; }
  .arena-fullscreen .at-prep .at-pied .at-lien { flex: 0 0 auto; font-size: inherit; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte { width: clamp(56px, 30dvh, 112px); }
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte.grand { width: clamp(60px, 32dvh, 120px); }
}
@media (orientation: landscape) and (max-height: 540px) {
  /* Quatre cartes par page doivent tenir dans la largeur de la colonne. */
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte { width: clamp(52px, min(30dvh, 10.2vw), 112px); }
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte.grand { width: clamp(56px, min(32dvh, 10.8vw), 120px); }
}

@media (orientation: portrait) and (max-width: 659px) {
  .arena-fullscreen :is(.arena-options, .arena-quit, .at-pagination button, .at-placed, .at-effect-choice, .at-lien, .arena-card-inspect) {
    min-width: 40px;
    min-height: 40px;
  }
  .arena-fullscreen .at-prep {
    overflow: auto;
    pointer-events: auto;
    overscroll-behavior: contain;
    padding-top: max(56px, calc(env(safe-area-inset-top) + 48px));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .arena-fullscreen .at-prep .at-haut { padding-right: 0; }
  .arena-fullscreen .at-prep .at-pied { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .arena-fullscreen .at-prep .at-pied .at-or { min-width: 0; padding-inline: 5px; }
  .arena-fullscreen .at-prep .at-pied .at-or-texte { font-size: 1rem; }
  .arena-fullscreen .at-prep .at-emplacement { flex: 0 1 62px; min-width: 0; width: auto; }
  .arena-fullscreen .at-prep .at-emplacement small { overflow-wrap: anywhere; }
  .arena-fullscreen .at-prep .at-secondaires:empty { display: none; }
  .arena-fullscreen .at-prep .at-presentoir-titre { flex-wrap: wrap; }
  .arena-fullscreen .at-prep .at-presentoir-titre .at-plaque { white-space: normal; }
  .arena-fullscreen .at-prep .at-effets { max-height: none; }

  .arena-fullscreen .at-prep .at-troupe .at-main { height: auto; gap: 6px; padding: 6px 0 8px; }
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte {
    width: min(96px, calc((100% - 18px) / 4));
    margin: 0;
    transform: none;
  }
  .arena-fullscreen .at-prep .at-troupe .at-main:has(.at-carte:nth-child(4)) .at-carte { margin: 0; }
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte .at-nom {
    position: absolute;
    inset: 2px 2px auto;
    border-radius: 4px;
    background: #080e2ae8;
    font-size: .75rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte .at-sansimage { overflow-wrap: anywhere; }
  .arena-fullscreen .at-prep .at-troupe .at-main .at-carte .at-sansimage ~ .at-nom { display: none; }
  .arena-fullscreen .at-prep .at-troupe .at-main .at-fort { right: 2px; bottom: 4px; padding-inline: 3px; }
  .arena-fullscreen .at-effect-summary { white-space: normal; overflow-wrap: anywhere; }
  .arena-fullscreen .at-controls > .at-indices .at-indice { min-height: 40px; }
}
