/* Arène (duels de héros) : cartes (sur la feuille de manga de jump/v2.css), deck, écran de duel plein écran */

/* ---------- Carte : coût, Attaque, PV, mots-clés ---------- */
.acard .mc-sheet { gap: 1.6cqw; }
.acard .mc-head { padding-left: 15cqw; min-height: 11cqw; }
.acard.mini .mc-head { display: none; }
.ac-cost {
  position: absolute;
  left: 2cqw;
  top: 2cqw;
  z-index: 2;
  min-width: 16cqw;
  padding: 1.5cqw 3cqw;
  text-align: center;
  font: 700 11cqw/1 var(--pen);
  color: var(--ink);
  background: #fff6cf;
  border: 1.2cqw solid var(--ink);
  border-radius: 50% 44% 52% 46% / 48% 54% 44% 52%;
  box-shadow: 0.6cqw 0.6cqw 0 var(--ink);
}
.ac-cost small { font-size: 0.6em; }
.ac-body { display: grid; gap: 1.2cqw; min-height: 0; flex: 1; overflow: hidden; }
.ac-kws { display: flex; flex-wrap: wrap; gap: 1.2cqw; }
.ac-kw {
  font-style: normal;
  font-weight: 700;
  font-size: 5.2cqw;
  line-height: 1;
  padding: 1.2cqw 2cqw;
  border: 0.6cqw solid var(--ink);
  border-radius: 2cqw;
  background: repeating-linear-gradient(-35deg, rgba(0, 0, 0, 0.1) 0 1.2cqw, transparent 1.2cqw 3.6cqw), var(--paper-2);
}
.ac-fx { display: grid; gap: 0.4cqw; padding: 1.4cqw 2cqw; border: 0.6cqw solid var(--ink); border-radius: 2cqw; font-size: 5cqw; line-height: 1.12; background: var(--paper-2); }
.ac-fx b { font-size: 5.2cqw; }
.ac-fx.entry { background: repeating-linear-gradient(-35deg, rgba(232, 180, 0, 0.35) 0 1.2cqw, transparent 1.2cqw 3.6cqw), #fff6cf; }
.ac-fx.death { background: repeating-linear-gradient(-35deg, rgba(60, 40, 80, 0.2) 0 1.2cqw, transparent 1.2cqw 3.6cqw), #ece6f4; }
.ac-stats { display: flex; justify-content: space-between; gap: 2cqw; }
.ac-stats b {
  min-width: 26cqw;
  padding: 1.5cqw 3cqw;
  text-align: center;
  font: 700 9cqw/1 var(--pen);
  color: var(--ink);
  border: 1.2cqw solid var(--ink);
  border-radius: 50% 44% 52% 46% / 48% 54% 44% 52%;
  background: var(--paper);
}
.ac-stats .ac-atk { background: #ffe0b8; }
.ac-stats .ac-hp { background: #ffcfd6; }
.ac-stats .up, .mcard.mini.acard .ac-atk.up { color: #1d7a2d; }
.ac-stats .down, .mcard.mini.acard .ac-hp.down { color: #b3122b; }
.ac-token-art { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30cqw; background: var(--paper-2); }
.acard.spell .mc-panel { background: #fff6cf; }
.acard.playable .mc-sheet { box-shadow: 0 0 0 1.6cqw var(--pop), 0.8cqw 1.2cqw 0 rgba(0, 0, 0, 0.55); }
.acard.playable { cursor: pointer; }
.acard.selected .mc-sheet { box-shadow: 0 0 0 2cqw #e3122b, 0.8cqw 1.2cqw 0 rgba(0, 0, 0, 0.55); }
.acard.disabled { opacity: 0.6; }
#ad-pool .acard { cursor: pointer; }
#ad-pool .acard.selected .mc-sheet { box-shadow: 0 0 0 2cqw var(--pop), 0.8cqw 1.2cqw 0 rgba(0, 0, 0, 0.55); }
#ad-pool .acard.selected::after { content: "✓"; position: absolute; right: -4px; top: -6px; z-index: 3; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--pop); color: var(--ink-black); font-weight: 700; border: 2px solid var(--ink-black); }

/* carte de la main en format compact (téléphone) */
.mcard.mini.acard.hand-mini .ac-cost { left: 2cqw; top: 2cqw; min-width: 28cqw; padding: 1.5cqw 3cqw; font-size: 22cqw; border-width: 2.5cqw; box-shadow: none; }
.mcard.mini.acard.hand-mini .ac-icons { left: auto; right: 2cqw; top: 2cqw; justify-content: flex-end; max-width: 60%; }
.mcard.mini.acard.hand-mini.playable .mc-sheet { box-shadow: 0 0 0 3cqw var(--pop), 0.8cqw 1.2cqw 0 rgba(0, 0, 0, 0.55); }
.mcard.mini.acard.hand-mini.disabled { opacity: 0.6; }
.mcard.mini.acard.hand-mini.spell .mc-panel { background: #fff6cf; }

/* carte du plateau */
.mcard.mini.acard .ac-atk, .mcard.mini.acard .ac-hp {
  position: absolute;
  bottom: 2cqw;
  min-width: 30cqw;
  padding: 1.5cqw 3cqw;
  text-align: center;
  font: 700 22cqw/1 var(--pen);
  color: var(--ink);
  border: 2.5cqw solid var(--ink);
  border-radius: 50% 44% 52% 46% / 48% 54% 44% 52%;
}
.mcard.mini.acard .ac-atk { left: 2cqw; background: #ffe0b8; }
.mcard.mini.acard .ac-hp { right: 2cqw; background: #ffcfd6; }
.ac-icons { position: absolute; left: 2cqw; top: 2cqw; display: flex; flex-wrap: wrap; gap: 1cqw; max-width: 70%; }
.ac-icons i { font-style: normal; font-size: 12cqw; line-height: 1; padding: 1cqw; border-radius: 50%; background: var(--paper); border: 1.5cqw solid var(--ink); }
.ac-state { position: absolute; right: 2cqw; top: 2cqw; font-size: 16cqw; line-height: 1; filter: drop-shadow(0 0 2px #fff); }
.mcard.mini.acard { cursor: default; transition: transform 0.15s ease; }
.mcard.mini.acard.ready { cursor: pointer; }
.mcard.mini.acard.ready .mc-sheet { box-shadow: 0 0 0 3cqw #2fd36a, 0.8cqw 1.2cqw 0 rgba(0, 0, 0, 0.55); }
.mcard.mini.acard.selected { transform: translateY(-8px); }
.mcard.mini.acard.selected .mc-sheet { box-shadow: 0 0 0 3cqw #e3122b, 0.8cqw 1.2cqw 0 rgba(0, 0, 0, 0.55); }
.mcard.mini.acard.target { cursor: crosshair; animation: ar-pulse 0.9s ease-in-out infinite; }
.mcard.mini.acard.target .mc-sheet { box-shadow: 0 0 0 3cqw var(--pop), 0.8cqw 1.2cqw 0 rgba(0, 0, 0, 0.55); }
.mcard.mini.acard.garde .mc-sheet { border-color: #4a6fa5; }
.mcard.mini.acard.shield .mc-sheet { outline: 2.5cqw solid #e8b400; outline-offset: 1cqw; }
.mcard.mini.acard.stealth { opacity: 0.55; }
.mcard.mini.acard.fresh:not(.ready) .mc-panel img { filter: saturate(0.7); }
.mcard.mini.acard.hit { animation: ar-hit 0.4s ease; }
.ar.arming .ar-row .acard:not(.target) { opacity: 0.45; }
.ar.arming .ar-hero:not(.target) { opacity: 0.55; }
@keyframes ar-pulse { 50% { transform: scale(1.05); } }
@keyframes ar-hit { 30% { transform: translateY(-14px) scale(1.08); } }
.ar-float {
  position: absolute;
  left: 50%;
  top: 30%;
  z-index: 20;
  transform: translateX(-50%);
  font: 700 1.3rem "Dela Gothic One", sans-serif;
  color: #fff;
  -webkit-text-stroke: 1px var(--ink);
  text-shadow: 2px 2px 0 var(--ink);
  pointer-events: none;
  animation: ar-float 0.9s ease-out forwards;
}
.ar-float.dmg { color: #ff4a5c; }
.ar-float.heal { color: #4ee07a; }
@keyframes ar-float { to { transform: translate(-50%, -40px); opacity: 0; } }

/* ---------- Zoom ---------- */
.ar-zoom { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: rgba(8, 6, 12, 0.85); cursor: pointer; }
.ar-zoom-card .mcard { --w: min(78vw, 56vh, 360px); }

/* ---------- Lobby ---------- */
.ar-subtabs { margin-bottom: 10px; }
.ar-lobby { display: grid; gap: 12px; }
.ar-lobby-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.ar-hero-card { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 240px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 12px; border-left: 6px solid var(--g); }
.ar-hero-card img, .ar-hero-card > span { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; border: 3px solid var(--text); display: grid; place-items: center; font-size: 1.6rem; }
.ar-hero-card b { display: block; font-size: 1.05rem; }
.ar-hero-card small { color: var(--muted); }
.ar-lobby-stats { font-size: 1rem; line-height: 1.5; }
.ar-lobby-stats b { font-size: 1.4rem; color: var(--pop); }
.ar-last { padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); }
.ar-last.win { color: #4ee07a; }

/* ---------- Deck ---------- */
.ad-layout { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ad-heroes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ad-hero { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: 2px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); cursor: pointer; font-size: 0.72rem; line-height: 1.1; }
.ad-hero img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; border: 3px solid var(--g); }
.ad-hero span { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ad-hero small { color: var(--muted); font-size: 0.65rem; }
.ad-hero.sel { border-color: var(--pop); box-shadow: 3px 3px 0 var(--accent); }
.ad-power { font-size: 0.85rem; margin: 6px 0 0; }
.ad-curve { display: flex; gap: 4px; align-items: flex-end; height: 48px; margin: 4px 0 8px; }
.ad-bar { flex: 1; display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; font-size: 0.65rem; color: var(--muted); }
.ad-bar i { align-self: end; background: var(--pop); border-radius: 3px 3px 0 0; min-height: 2px; }
.ad-slots { display: grid; gap: 3px; }
.ad-slot { display: grid; grid-template-columns: 38px 1fr auto; gap: 6px; align-items: center; padding: 4px 8px; border: 2px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); text-align: left; cursor: pointer; font-size: 0.85rem; }
.ad-slot:hover { border-color: var(--accent); }
.ad-slot b { color: var(--pop); }
.ad-slot span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ad-slot small { color: var(--muted); }
.ad-slot.rarity-legendary, .ad-slot.rarity-special { border-color: var(--legendary); }
.ad-slot.rarity-superrare { border-color: var(--superrare); }
.ad-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.ad-filters input, .ad-filters select { padding: 6px 10px; border-radius: 8px; border: 2px solid var(--line); background: var(--panel); color: var(--text); }
.ad-pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ad-pool .mcard { --w: 100%; }

/* ---------- Écran de duel (plein écran) ---------- */
.ar {
  --hw: clamp(88px, min(8.5vw, 17vh), 150px);
  --bw: clamp(64px, min(8vw, 15vh), 110px);
  position: fixed;
  inset: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  background:
    radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1.4px) 0 0 / 7px 7px,
    #1a1420;
  font-family: var(--pen);
}
.ar-menu { display: flex; flex-direction: column; gap: 4px; padding: 14px 8px; background: #121117; border-right: 3px solid var(--text); box-shadow: 3px 0 0 var(--accent); overflow: hidden auto; }
.ar-menu hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.ar-main { grid-column: 2; position: relative; min-width: 0; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 6px; padding: 6px 12px 0; }
.ar-top { display: grid; grid-template-columns: minmax(230px, 320px) minmax(0, 1fr); align-items: center; gap: 12px; }
.ar-opp-hand { position: relative; height: calc(var(--hw) * 0.4 * 88 / 63); --ow: calc(var(--hw) * 0.4); --step: min(calc(var(--ow) * 0.5), calc((100% - var(--ow)) / max(1, var(--n) - 1))); }
.ar-oslot { position: absolute; top: 0; width: var(--ow); left: calc(50% - var(--ow) / 2 + var(--off) * var(--step)); transform: rotate(calc(var(--off) * 3deg)); }
.ar-oslot .mcard { --w: 100%; }

/* héros */
.ar-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 10px 14px 9px 13px / 12px 9px 14px 10px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
  transition: box-shadow 0.2s;
}
.ar-hero.turn { box-shadow: 0 0 0 3px var(--pop), 3px 3px 0 rgba(0, 0, 0, 0.6); }
.ar-hero.target { cursor: crosshair; box-shadow: 0 0 0 4px var(--pop), 3px 3px 0 rgba(0, 0, 0, 0.6); animation: ar-pulse 0.9s ease-in-out infinite; }
.ar-portrait { position: relative; width: 64px; height: 64px; border: 3px solid var(--ink); border-radius: 50% 46% 52% 48%; background: var(--g); }
.ar-portrait img, .ar-portrait > span { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; border-radius: inherit; display: grid; place-items: center; font-size: 1.6rem; }
.ar-hp { position: absolute; right: -10px; bottom: -8px; min-width: 30px; padding: 3px 6px; text-align: center; font: 700 1.1rem/1 var(--pen); color: var(--ink); background: #ffcfd6; border: 2.5px solid var(--ink); border-radius: 50% 44% 52% 46% / 48% 54% 44% 52%; }
.ar-hp.low { background: #ff6b7a; color: #fff; }
.ar-hinfo { display: grid; gap: 2px; min-width: 0; line-height: 1.1; }
.ar-hinfo > b { font-size: 1rem; }
.ar-hinfo small { font-size: 0.78rem; color: var(--ink-soft); }
.ar-hinfo em { color: #b3122b; font-style: normal; font-weight: 700; }
.ar-sudden { color: #b3122b !important; font-weight: 700; }
.ar-ki { display: flex; align-items: center; gap: 2px; }
.ar-ki i { width: 10px; height: 14px; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--paper-2); }
.ar-ki i.on { background: #2fb5f0; box-shadow: inset 0 0 0 1px #fff; }
.ar-ki b { margin-left: 4px; font-size: 0.9rem; }
.ar-power {
  justify-self: start;
  margin-top: 2px;
  padding: 3px 8px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: repeating-linear-gradient(-35deg, rgba(232, 180, 0, 0.45) 0 3px, transparent 3px 8px), #fff6cf;
  color: var(--ink);
  font: 700 0.78rem var(--pen);
  cursor: default;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
button.ar-power.ready { cursor: pointer; animation: cb-glow 1.4s ease-in-out infinite; }
.ar-power.used { opacity: 0.45; text-decoration: line-through; }
.ar-power.passive { background: var(--paper-2); }

/* plateau */
.ar-board { display: grid; grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; min-height: 0; }
.ar-row { position: relative; display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 0; padding: 6px 10px; border-radius: 14px; border: 2px dashed rgba(255, 255, 255, 0.14); overflow: visible; }
.ar-row.me { border-color: rgba(255, 212, 0, 0.3); }
.ar-row .mcard { --w: var(--bw); position: relative; }
.ar-empty { color: rgba(255, 255, 255, 0.3); font-size: 0.9rem; }
.ar-mid { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 4px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); color: #f2ead6; }
.ar-turn { display: grid; line-height: 1; text-align: center; }
.ar-turn b { font-size: 1rem; }
.ar-turn span { font-size: 0.8rem; opacity: 0.8; font-variant-numeric: tabular-nums; }
.ar-event, .ar-hint { font-size: 0.95rem; line-height: 1.2; min-width: 0; }
.ar-hint { display: flex; align-items: center; gap: 10px; color: var(--pop); font-weight: 700; }
.ar-mid-btns { display: flex; gap: 6px; align-items: center; }
.ar-end { min-width: 150px; }
.ar-mini { display: none; padding: 6px 10px; }
.ar.my-turn .ar-end { animation: cb-glow 1.4s ease-in-out infinite; }

/* bas : mon héros, ma main en éventail */
.ar-bottom { display: grid; grid-template-columns: minmax(230px, 320px) minmax(0, 1fr); align-items: end; gap: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.ar-hand { position: relative; height: calc(var(--hw) * 88 / 63 + 8px); --step: min(calc(var(--hw) * 0.7), calc((100% - var(--hw)) / max(1, var(--n) - 1))); }
.ar-hand.dim { opacity: 0.8; }
.ar-slot { position: absolute; bottom: 0; width: var(--hw); left: calc(50% - var(--hw) / 2 + var(--off) * var(--step)); transform: translateY(calc(var(--y) * -1%)) rotate(calc(var(--off) * 2.5deg)); transform-origin: 50% 100%; transition: transform 0.15s ease; z-index: 1; }
@media (hover: hover) { .ar-slot:hover { z-index: 5; transform: translateY(-6%) scale(1.06); } }
/* carte choisie d'un premier toucher : soulevée et agrandie pour la lire, un second toucher la joue */
.ar-slot.picked, .ar-slot.picked:hover { z-index: 9; transform: translateY(-40%) scale(1.35) rotate(0); }
.ar-end { min-height: 44px; }
.ar-mini { min-width: 40px; min-height: 40px; }
.ar-slot .mcard { --w: 100%; }

/* règles */
.ar-rules ul { padding-left: 18px; line-height: 1.5; }
.ar-rules h4 { margin: 14px 0 4px; }

@media (max-width: 900px) {
  .ad-layout { grid-template-columns: 1fr; }
  .ar { grid-template-columns: 0 minmax(0, 1fr); }
  .ar-menu { display: none; }
  .ar-mini { display: inline-block; }
  .ar-top, .ar-bottom { grid-template-columns: minmax(170px, 215px) minmax(0, 1fr); }
  .ar-hero { padding: 4px 8px; gap: 6px; }
  .ar-portrait { width: 46px; height: 46px; }
  .ar-hp { right: -8px; bottom: -6px; font-size: 0.95rem; min-width: 26px; padding: 2px 5px; }
  .ar-hinfo > b { font-size: 0.85rem; }
  .ar-hinfo > b + small { display: none; } /* nom du héros : visible sur le portrait */
  .ar-hinfo small { font-size: 0.7rem; }
  .ar-ki i { width: 8px; height: 11px; }
  .ar-power { font-size: 0.68rem; padding: 2px 6px; }
  .ar-main { padding: 4px 8px 0; }
  /* carte touchée : en grand, centrée au-dessus de la main (un second toucher la joue) */
  .ar-slot.picked, .ar-slot.picked:hover { left: calc(50% - min(22vh, 95px)); bottom: 6px; width: min(44vh, 190px); transform: translateY(-38%) rotate(0); }
  .ar-event, .ar-hint { font-size: 0.82rem; }
  #jump-arena .tuto-bubble { width: min(280px, calc(100vw - 16px)); font-size: 0.86rem; padding: 8px 12px 10px; }
  .ar-mid { gap: 8px; padding: 3px 8px; }
  .ar-row { gap: 6px; padding: 4px 6px; }
  .ar-empty { font-size: 0.75rem; }
}
@media (max-width: 900px) and (orientation: landscape) {
  .ar { --hw: clamp(70px, 18vh, 110px); --bw: clamp(52px, 15vh, 80px); }
  .ar-end { min-width: 110px; padding: 8px 12px; }
  .ar-opp-hand { height: calc(var(--hw) * 0.3 * 88 / 63); --ow: calc(var(--hw) * 0.3); }
}
/* très petits téléphones à l'horizontale (ex. 667 × 375) */
@media (max-height: 400px) {
  .ar-top, .ar-bottom { grid-template-columns: minmax(160px, 200px) minmax(0, 1fr); }
  .ar-main { gap: 3px; }
  .ar-board { gap: 3px; }
  .ar-hinfo small:last-of-type { display: none; }
}
