@font-face { font-family: 'Lilita One'; src: url(fonts/lilita-one.woff2) format('woff2'); font-display: swap; }
/* même famille visuelle que Dédale : nuit violette, panneaux cerclés de noir, ombres pleines ; ici le bronze des automates */
:root {
  --bg: #1a1230; --panel: #2b2050; --panel2: #3a2c68; --edge: #0e0920; --ink: #f6f0e4; --ink2: #b3a8d3;
  --gold: #ffc93c; --bronze: #d08a3c; --bronze2: #8f5524; --red: #ff4458; --blue: #3f8cff; --green: #3ddc97; --stone: #463a70;
  --game: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --cell: min(calc((100vw - 44px) / 7), 54px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); overflow-x: hidden;
  background: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .04) 1px, transparent 0) 0 0 / 14px 14px, radial-gradient(ellipse at 50% 0%, #2e2156, var(--bg) 60%), var(--bg);
  font: 15px/1.35 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 8px) 14px calc(env(safe-area-inset-bottom) + 12px); }
h1, h2, h3 { margin: 0; font-family: var(--game); font-weight: 400; letter-spacing: .02em; }
.muted { color: var(--ink2); }

/* boutons */
.btn { display: block; width: 100%; border: 3px solid var(--edge); border-radius: 16px; padding: 12px 16px; margin: 0;
  font-family: var(--game); font-size: 21px; color: #fff; background: var(--panel2); box-shadow: 0 5px 0 var(--edge); text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--edge); }
.btn:disabled { opacity: .45; }
.btn.primary { background: linear-gradient(#ff6b6b, #e8364f); }
.btn.bronze { background: linear-gradient(#e7a35a, #b76a2b); }
.btn.ghost { background: var(--panel); font-size: 18px; }
.btn small { display: block; font-size: 13px; opacity: .85; margin-top: 1px; }

/* titre */
.title { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; text-align: center; }
.logo-gear { font-size: 80px; line-height: 1; filter: drop-shadow(0 6px 0 var(--edge)); animation: spin 14s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.title h1 { font-size: 66px; color: var(--gold); -webkit-text-stroke: 3px var(--edge); paint-order: stroke fill; text-shadow: 0 6px 0 var(--edge); }
.title p { margin: 0; color: var(--ink2); font-size: 16px; }
.menu { display: flex; flex-direction: column; gap: 12px; }
.proto { font-size: 12px; color: var(--ink2); opacity: .7; }

/* barre du haut */
.top { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 3px solid var(--edge); background: var(--panel); box-shadow: 0 3px 0 var(--edge); font-size: 20px; padding: 0; }
.arena-n { flex: 1; font-family: var(--game); font-size: 18px; color: var(--ink2); }
.arena-n b { color: var(--ink); font-size: 24px; }
.hp { display: flex; gap: 3px; }
.hp i { font-style: normal; width: 19px; height: 19px; border-radius: 50%; border: 2px solid var(--edge); background: radial-gradient(circle at 35% 35%, #ffd38a, var(--bronze) 60%, var(--bronze2)); box-shadow: 0 2px 0 var(--edge); }
.hp i.lost { background: #2a2147; }
.hp i.shield { background: radial-gradient(circle at 35% 35%, #bfe3ff, var(--blue) 60%, #1d4fa8); }

/* consigne */
.say { min-height: 40px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--ink2); font-size: 14px; padding: 0 6px; }
.say b { color: var(--ink); }

/* l'arène */
.board-wrap { display: flex; justify-content: center; }
.board { position: relative; display: grid; grid-template-columns: repeat(7, var(--cell)); grid-auto-rows: var(--cell); gap: 0;
  padding: 6px; border-radius: 18px; background: var(--edge); box-shadow: 0 0 0 3px var(--panel2), 0 6px 0 3px var(--edge); }
.tile { border-radius: 8px; margin: 2px; background: linear-gradient(var(--stone), #3a2f60); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .06), inset 0 -3px 0 rgba(0, 0, 0, .25); position: relative; }
.tile.ghost-path { background: linear-gradient(#5a4b92, #4a3d7e); }
.tile.ghost-hit::after { content: ''; position: absolute; inset: 6px; border-radius: 6px; border: 3px dashed rgba(255, 99, 99, .85); }
.tile.warn::before { content: '!'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--game); font-size: calc(var(--cell) * .5); color: var(--gold); opacity: .8; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.tile.flash { animation: flash .35s ease-out; }
@keyframes flash { 0% { background: #ff8a3c; } 100% { background: linear-gradient(var(--stone), #3a2f60); } }
.unit { position: absolute; left: 6px; top: 6px; width: var(--cell); height: var(--cell); display: flex; align-items: center; justify-content: center;
  transform: translate(calc(var(--x) * var(--cell)), calc(var(--y) * var(--cell))); transition: transform .22s cubic-bezier(.35, .1, .25, 1); pointer-events: none; z-index: 2; }
.bot { z-index: 3; }
.bot .body { width: 74%; height: 74%; border-radius: 30%; border: 3px solid var(--edge); background: radial-gradient(circle at 35% 30%, #ffd38a, var(--bronze) 55%, var(--bronze2));
  box-shadow: 0 4px 0 var(--edge), inset 0 0 0 3px rgba(255, 230, 180, .35); display: flex; align-items: center; justify-content: center;
  transform: rotate(calc(var(--r) * 90deg)); transition: transform .24s cubic-bezier(.35, .1, .25, 1); }
.bot .eye { width: 34%; height: 34%; border-radius: 50%; background: #7ff0ff; border: 3px solid var(--edge); box-shadow: 0 0 10px #7ff0ff; transform: translateY(-62%); }
.bot.ghost { opacity: .4; filter: grayscale(.3); z-index: 1; }
.bot.hurt .body { animation: hurt .5s ease; }
@keyframes hurt { 20%, 60% { background: #ff6b6b; } 30% { translate: -4px 0; } 50% { translate: 4px 0; } }
.foe { font-size: calc(var(--cell) * .58); filter: drop-shadow(0 3px 0 var(--edge)); }
.foe .hpbar { position: absolute; bottom: 3px; left: 18%; right: 18%; display: flex; gap: 2px; }
.foe .hpbar i { flex: 1; height: 5px; border-radius: 3px; background: var(--red); border: 1px solid var(--edge); }
.foe.hit { animation: hit .3s ease; }
@keyframes hit { 40% { scale: 1.3; filter: brightness(2.2) drop-shadow(0 3px 0 var(--edge)); } }
.foe.dead { opacity: 0; transform: translate(calc(var(--x) * var(--cell)), calc(var(--y) * var(--cell))) scale(.2); transition: opacity .3s, transform .3s; }
.fx { position: absolute; z-index: 5; pointer-events: none; font-family: var(--game); font-size: 20px; color: #fff; -webkit-text-stroke: 3px var(--edge); paint-order: stroke fill;
  left: 6px; top: 6px; width: var(--cell); text-align: center; transform: translate(calc(var(--x) * var(--cell)), calc(var(--y) * var(--cell))); animation: fx .7s ease-out forwards; }
@keyframes fx { to { margin-top: -26px; opacity: 0; } }

/* la ligne de commandes */
.line-label { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--game); font-size: 15px; color: var(--ink2); margin-bottom: -4px; }
.line { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 10px; padding: 0 8%; }
.slot { position: relative; width: 100%; height: 74px; border-radius: 12px; border: 3px solid var(--edge); background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .05);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px; }
.slot .n { position: absolute; top: -9px; left: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--panel2); border: 2px solid var(--edge); font-family: var(--game); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.slot.target { cursor: pointer; border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(255, 201, 60, .4); }
.slot.chosen { transform: translateY(-4px); }
.slot.running { box-shadow: 0 0 0 3px #7ff0ff, 0 0 18px rgba(127, 240, 255, .6); }
.card { border-radius: 12px; border: 3px solid var(--edge); box-shadow: 0 4px 0 var(--edge); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 3px; color: var(--edge); text-align: center; }
.slot.filled { box-shadow: 0 4px 0 var(--edge); }
.c-move { background: linear-gradient(#9fd2ff, #5da6f0); }
.c-turn { background: linear-gradient(#c7b8ff, #9479f0); }
.c-hit { background: linear-gradient(#ffb08a, #f0743c); }
.c-fire { background: linear-gradient(#ffd56b, #f0a01c); }
.c-spin { background: linear-gradient(#ff9fb6, #e8507a); }
.c-shield { background: linear-gradient(#a6f0d2, #3dc89a); }
.c-glitch { background: repeating-linear-gradient(135deg, #5a5470 0 8px, #3f3a55 8px 16px); color: #ffb3b3; }
.ic { font-size: 24px; line-height: 1; }
.nm { font-family: var(--game); font-size: 12px; line-height: 1.05; }
.lv { display: flex; gap: 2px; }
.lv i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--edge); background: rgba(255, 255, 255, .4); }
.lv i.on { background: var(--edge); }

/* la main */
.hand { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px; min-height: 104px; }
.hand .card { cursor: pointer; padding: 6px 2px; min-height: 104px; justify-content: flex-start; transition: transform .12s, opacity .12s; }
.hand .card .ic { font-size: 24px; margin-top: 2px; }
.hand .card .nm { font-size: 13px; }
.hand .card .ds { font-size: 10px; line-height: 1.12; font-weight: 600; opacity: .85; }
.hand .card.sel { transform: translateY(-8px); box-shadow: 0 0 0 3px var(--gold), 0 10px 0 var(--edge); }
.hand .card.dim { opacity: .35; }
.actions { display: flex; gap: 10px; }

/* récompenses, fin */
.panel { background: var(--panel); border: 3px solid var(--edge); box-shadow: 0 5px 0 var(--edge); border-radius: 18px; padding: 16px; }
.center { text-align: center; }
.big { font-size: 64px; line-height: 1; }
.rewards { display: flex; flex-direction: column; gap: 10px; }
.reward { display: flex; gap: 12px; align-items: center; text-align: left; background: linear-gradient(var(--panel2), var(--panel)); border: 3px solid var(--edge); box-shadow: 0 4px 0 var(--edge); border-radius: 16px; padding: 12px; color: var(--ink); }
.reward:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.reward .ic { font-size: 34px; width: 44px; text-align: center; }
.reward b { display: block; font-family: var(--game); font-weight: 400; font-size: 19px; color: var(--gold); }
.reward small { color: var(--ink2); font-size: 13px; }
.mods { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mod { font-size: 12px; background: rgba(0, 0, 0, .25); border-radius: 99px; padding: 3px 10px; color: var(--ink2); }

/* feuille, toast, mise à jour, installation */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(14, 9, 32, .7); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { width: 100%; max-width: 480px; max-height: 88dvh; overflow: auto; background: var(--panel); border: 3px solid var(--edge); border-bottom: 0; border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 16px); display: flex; flex-direction: column; gap: 12px; }
.sheet-card h3 { font-size: 24px; color: var(--gold); }
.sheet-card p, .sheet-card li { margin: 0; line-height: 1.45; }
.sheet-card ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--edge);
  font-family: var(--game); padding: 10px 18px; border-radius: 14px; border: 3px solid var(--edge); box-shadow: 0 4px 0 var(--edge); max-width: 90vw; text-align: center; }
.update { position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 50%; transform: translateX(-50%); z-index: 70; display: flex; gap: 10px; align-items: center;
  background: var(--gold); color: var(--edge); border: 3px solid var(--edge); border-radius: 14px; padding: 8px 12px; font-weight: 700; box-shadow: 0 4px 0 var(--edge); }
.update button { border: 0; border-radius: 10px; background: var(--edge); color: var(--gold); padding: 6px 10px; font-weight: 700; }
.install { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 12px); z-index: 40; max-width: 460px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  background: var(--panel2); border: 3px solid var(--edge); border-radius: 16px; padding: 10px; box-shadow: 0 4px 0 var(--edge); }
.install img { width: 40px; height: 40px; border-radius: 10px; }
.install-text { flex: 1; display: flex; flex-direction: column; font-size: 13px; }
.install-btn { border: 3px solid var(--edge); border-radius: 12px; background: var(--gold); color: var(--edge); font-weight: 700; padding: 6px 10px; }
.install-close { border: 0; background: none; font-size: 18px; color: var(--ink2); }
body:not([data-screen="title"]) .install { display: none !important; }

/* gestes de l'automate et des créatures (translate / scale / rotate s'ajoutent au déplacement) */
.unit.lunge { animation: lunge .28s ease; }
@keyframes lunge { 45% { translate: calc(var(--fx) * 16px) calc(var(--fy) * 16px); } }
.unit.bump { animation: bump .22s ease; }
@keyframes bump { 35% { translate: calc(var(--fx) * 7px) calc(var(--fy) * 7px); } 70% { translate: calc(var(--fx) * -3px) calc(var(--fy) * -3px); } }
.unit.spinning { animation: spinning .3s ease-in-out; }
@keyframes spinning { to { rotate: 360deg; } }
.foe.spawn { animation: spawn .35s cubic-bezier(.3, 1.6, .6, 1); }
@keyframes spawn { from { scale: 0; opacity: 0; } }
.fx.flame { font-size: calc(var(--cell) * .55); -webkit-text-stroke: 0; animation: flame .6s ease-out forwards; }
@keyframes flame { from { scale: .5; opacity: 1; } 40% { scale: 1.15; } to { scale: 1; opacity: 0; } }
.slot.glitch-in { animation: glitch .55s ease; }
@keyframes glitch { 0% { scale: 1.4; rotate: -8deg; filter: brightness(2); } 40% { rotate: 6deg; } 100% { scale: 1; rotate: 0deg; } }
/* sur la ligne, ce que deviendrait la case avec la carte choisie */
.slot .tag { position: absolute; bottom: -10px; left: 50%; translate: -50% 0; white-space: nowrap; font-family: var(--game); font-size: 11px; padding: 1px 6px; border-radius: 99px;
  background: var(--panel2); color: var(--ink); border: 2px solid var(--edge); }
.slot .tag.up { background: var(--gold); color: var(--edge); }
.hand .card .up-hint { font-family: var(--game); font-size: 11px; background: var(--edge); color: var(--gold); border-radius: 99px; padding: 1px 6px; margin-top: 2px; }
.line { margin-bottom: 8px; }
/* fiches des niveaux */
.levels { display: flex; flex-direction: column; gap: 6px; }
.level { position: relative; display: flex; gap: 10px; align-items: baseline; background: rgba(0, 0, 0, .22); border-radius: 12px; padding: 8px 10px; }
.level b { font-family: var(--game); font-weight: 400; color: var(--ink2); white-space: nowrap; }
.level.cur { box-shadow: inset 0 0 0 2px var(--gold); }
.level.cur b { color: var(--gold); }
.level em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--gold); }
.card-row { display: flex; flex-direction: column; gap: 6px; }
.card-row > b { font-family: var(--game); font-weight: 400; font-size: 18px; }

/* version « Le Plan » : piliers, fosses, coups annoncés */
.tile.wall { background: linear-gradient(#7d6aa8, #5a4a85); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .18), inset 0 -6px 0 rgba(0, 0, 0, .35), 0 3px 0 var(--edge); }
.tile.wall::before { content: ''; position: absolute; inset: 22%; border-radius: 4px; border: 2px solid rgba(14, 9, 32, .35); }
.tile.pit { background: radial-gradient(circle, #05030c 45%, #1a1236 75%); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .5); }
.tile.danger { background: linear-gradient(#7a3352, #5d2742); }
.tile.pit.danger { background: radial-gradient(circle, #05030c 40%, #6a2542 80%); }
.tile.impact::after { content: ''; position: absolute; inset: 3px; border-radius: 6px; border: 3px solid var(--red); box-shadow: 0 0 10px rgba(255, 68, 88, .7); }
.tile.ghost-path { background: linear-gradient(#5a4b92, #4a3d7e); }
.tile.danger.ghost-path { background: linear-gradient(#8a3a63, #6d2f52); }
.tile.flash-green { animation: flashg .35s ease-out; }
@keyframes flashg { 0% { background: #3ddc97; } }
.foe .intent { position: absolute; inset: 0; transform: rotate(calc(var(--d) * 90deg)); pointer-events: none; }
.foe .intent::after { content: ''; position: absolute; top: -3px; left: 50%; translate: -50% 0; border: 8px solid transparent; border-bottom: 11px solid var(--red); border-top: 0;
  filter: drop-shadow(0 0 2px var(--edge)) drop-shadow(0 0 1px var(--edge)); }
.foe.ghost { opacity: .45; z-index: 1; }
.foe.doomed { opacity: .5; }
.foe.doomed::after { content: '✖'; position: absolute; font-size: calc(var(--cell) * .5); color: var(--red); -webkit-text-stroke: 2px var(--edge); paint-order: stroke fill; }
.foe.falling { transition: transform .45s ease-in, opacity .45s; opacity: 0; transform: translate(calc(var(--x) * var(--cell)), calc(var(--y) * var(--cell))) scale(.1) rotate(160deg); }
.bot.in-danger .body { box-shadow: 0 0 0 3px var(--red), 0 0 14px rgba(255, 68, 88, .8); }
.bot.ghost.in-danger { opacity: .6; }
.fx.spit { font-size: 12px; -webkit-text-stroke: 0; animation: flame .4s ease-out forwards; }
.slot-wrap { position: relative; }
.turn-btn { position: absolute; left: 50%; bottom: -14px; translate: -50% 0; z-index: 2; white-space: nowrap; border: 2px solid var(--edge); border-radius: 99px; background: var(--gold); color: var(--edge);
  font-family: var(--game); font-size: 12px; padding: 2px 8px; box-shadow: 0 2px 0 var(--edge); }
.slot.filled .ic { font-size: 26px; }
.slot.filled .nm { font-size: 13px; }
.slot .n { z-index: 1; }
.line { margin-bottom: 12px; }
.hand .card.used { opacity: .2; transform: scale(.94); }
.hand .card:disabled.c-glitch { opacity: .8; }
.c-push { background: linear-gradient(#f7d2a0, #d99a52); }
.deck-btn { border: 2px solid var(--edge); border-radius: 99px; background: var(--panel); color: var(--ink2); font-size: 12px; padding: 2px 8px; margin-left: 4px; }
.line-label { align-items: center; }
.actions .btn.small { width: auto; flex: 0 0 auto; font-size: 16px; padding: 12px 14px; }
.say .bad { color: #ff8a98; font-weight: 700; }
.say .ok { color: var(--green); font-weight: 700; }
.arena-n small { font-size: 13px; }
.sheet-card .level span { font-size: 14px; }
.arena-n small.late { color: var(--red); }
.foe.late::before { content: '⏳'; position: absolute; top: 1px; right: 2px; font-size: 11px; }
.foe .hpbar b { margin: 0 auto; font: 12px/1 var(--game); color: #fff; background: var(--red); border: 2px solid var(--edge); border-radius: 99px; padding: 1px 6px; }

/* ===== Visuel et animations (v2) ===== */
/* l'arène : dalles de pierre variées, rebord de labyrinthe */
.board-wrap { position: relative; }
.board { background: linear-gradient(#1c1336, #120c26); box-shadow: 0 0 0 3px var(--panel2), 0 0 0 6px var(--edge), 0 9px 0 6px var(--edge), inset 0 0 30px rgba(0, 0, 0, .6); }
.tile { background: linear-gradient(160deg, #4d4079, #3a2f62 70%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .08), inset 0 -3px 0 rgba(0, 0, 0, .3); overflow: visible; }
.tile.v1 { background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, .06) 0 8%, transparent 9%), linear-gradient(160deg, #4a3d75, #382d5f 70%); }
.tile.v2 { background: linear-gradient(115deg, transparent 47%, rgba(14, 9, 32, .35) 48% 50%, transparent 51%), linear-gradient(160deg, #4f427c, #3b3064 70%); }
.tile.v3 { background: radial-gradient(circle at 25% 75%, rgba(14, 9, 32, .3) 0 7%, transparent 8%), radial-gradient(circle at 35% 68%, rgba(14, 9, 32, .25) 0 4%, transparent 5%), linear-gradient(160deg, #4b3e77, #392e60 70%); }
.tile.v4 { background: linear-gradient(160deg, #483b72, #372c5c 70%); }
/* piliers de bronze et de pierre, en relief */
.tile.wall { background: #1a1230; box-shadow: none; z-index: 1; }
.tile.wall::before { content: ''; position: absolute; inset: auto 6% 4% 6%; height: 108%; border-radius: 8px 8px 6px 6px; border: 2.5px solid var(--edge);
  background: linear-gradient(90deg, #6a5a99, #8f80c2 35%, #6a5a99 70%, #514479); box-shadow: 0 4px 0 var(--edge); }
.tile.wall::after { content: ''; position: absolute; left: 6%; right: 6%; top: -10%; height: 34%; border-radius: 8px; border: 2.5px solid var(--edge);
  background: linear-gradient(#c8bcf0, #9d8fd3); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); }
/* fosses : un trou noir qui respire */
.tile.pit { background: #07040f; box-shadow: inset 0 6px 8px rgba(0, 0, 0, .9), inset 0 0 0 2px #2a1f4a; overflow: hidden; }
.tile.pit::before { content: ''; position: absolute; inset: 15%; border-radius: 50%; background: radial-gradient(circle, rgba(120, 90, 200, .25), transparent 70%); animation: abyss 3s ease-in-out infinite; }
@keyframes abyss { 50% { transform: scale(.6); opacity: .4; } }
/* zones de danger : des bandes rouges qui défilent */
.tile.danger { background: repeating-linear-gradient(45deg, rgba(255, 68, 88, .42) 0 6px, rgba(255, 68, 88, .2) 6px 12px), linear-gradient(#5a2a4a, #44203a);
  background-size: 17px 17px, auto; animation: stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 17px 0, 0 0; } }
.tile.pit.danger { background: repeating-linear-gradient(45deg, rgba(255, 68, 88, .3) 0 6px, transparent 6px 12px), #07040f; background-size: 17px 17px, auto; }
.tile.impact::after { inset: 4px; border-radius: 50%; border: 3px solid var(--red); box-shadow: 0 0 12px rgba(255, 68, 88, .8), inset 0 0 8px rgba(255, 68, 88, .5); animation: reticle 1s ease-in-out infinite; z-index: 4; }
@keyframes reticle { 50% { transform: scale(.82); } }
.tile.ghost-hit::after { border-radius: 50%; border-style: dotted; }
.tile.warn::before { z-index: 4; text-shadow: 0 0 10px var(--gold); }
.tile.warn { box-shadow: inset 0 0 0 2px rgba(255, 201, 60, .5), inset 0 0 14px rgba(255, 201, 60, .35); }
/* entrée dans l'arène : les dalles tombent en vague, les pièces apparaissent */
.board.enter .tile { animation: tileIn .45s cubic-bezier(.3, 1.4, .6, 1) backwards; animation-delay: calc((var(--x) + var(--y)) * 35ms); }
@keyframes tileIn { from { transform: translateY(-14px) scale(.6); opacity: 0; } }
.board.enter .unit { animation: spawn .4s cubic-bezier(.3, 1.6, .6, 1) .45s backwards; }

/* l'automate de bronze */
.bot .body { width: 88%; height: 88%; border: 0; border-radius: 0; background: none; box-shadow: none; display: block; filter: drop-shadow(0 3px 0 var(--edge)); }
.bot .body svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bot .tread { fill: #5b3412; stroke: var(--edge); stroke-width: 2; }
.bot .hull { fill: #d08a3c; stroke: var(--edge); stroke-width: 2.5; }
.bot .shine { fill: rgba(255, 233, 190, .7); }
.bot .teeth { fill: #b8742f; stroke: #7a4518; stroke-width: 3.4; stroke-dasharray: 2.1 1.8; }
.bot .hub { fill: var(--gold); stroke: var(--edge); stroke-width: 1.5; }
.bot .eye { fill: #7ff0ff; stroke: var(--edge); stroke-width: 2; width: auto; height: auto; border: 0; box-shadow: none; transform: none; filter: drop-shadow(0 0 3px #7ff0ff); }
.bot .gear { transform-origin: 20px 25px; animation: spin 6s linear infinite; }
.bot.working .gear { animation-duration: .7s; }
.bot.working .eye { fill: #c4fbff; }
.bot.hurt .body { animation: hurt2 .5s ease; }
@keyframes hurt2 { 15%, 55% { filter: drop-shadow(0 3px 0 var(--edge)) brightness(1.8) sepia(1) hue-rotate(-40deg) saturate(4); } 30% { translate: -5px 0; } 45% { translate: 5px 0; } }
.bot.shielded::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; border: 2.5px solid rgba(127, 200, 255, .9); background: radial-gradient(circle, transparent 55%, rgba(63, 140, 255, .35));
  box-shadow: 0 0 12px rgba(63, 140, 255, .6); animation: bubble 2s ease-in-out infinite; }
@keyframes bubble { 50% { scale: 1.06; } }
.bot.ghost .body { filter: none; }
.bot.dead { opacity: 0; scale: .3; transition: opacity .4s, scale .4s; }
.unit.hop .body, .unit.hop .sprite { animation: hop .23s ease-out; }
@keyframes hop { 45% { translate: 0 -7px; } }

/* les créatures, sur leur socle */
.foe { font-size: calc(var(--cell) * .54); filter: none; }
.foe .base { position: absolute; left: 14%; right: 14%; bottom: 9%; height: 26%; border-radius: 50%; border: 2.5px solid var(--edge); box-shadow: 0 3px 0 var(--edge); }
.foe[data-t="skel"] .base { background: linear-gradient(#efe6d2, #b9ad93); }
.foe[data-t="harpy"] .base { background: linear-gradient(#7fe0d4, #2f9c94); }
.foe[data-t="snake"] .base { background: linear-gradient(#9be36b, #4b9a2c); }
.foe[data-t="mino"] .base { background: linear-gradient(#e0794f, #8c3518); left: 4%; right: 4%; }
.foe[data-t="mino"] .sprite { font-size: 1.25em; }
.foe .sprite { position: relative; z-index: 1; margin-top: -14%; filter: drop-shadow(0 2px 0 var(--edge)) drop-shadow(0 0 1px var(--edge)); animation: idle 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.33s); }
.foe[data-t="harpy"] .sprite { animation: fly 1s ease-in-out infinite; animation-delay: calc(var(--i) * -.2s); }
@keyframes idle { 50% { translate: 0 -2px; scale: 1.04 .97; } }
@keyframes fly { 50% { translate: 0 -6px; } }
.foe .hpbar { z-index: 2; bottom: 1px; }
.foe .intent { z-index: 3; animation: aim 1s ease-in-out infinite; }
@keyframes aim { 50% { scale: 1.12; } }
.foe.hit .sprite { animation: hit2 .3s ease; }
@keyframes hit2 { 30% { scale: 1.35; filter: brightness(3) drop-shadow(0 2px 0 var(--edge)); } 60% { translate: 3px 0; } }
.foe.hit { animation: none; }
.foe.dead { transform: translate(calc(var(--x) * var(--cell)), calc(var(--y) * var(--cell))) scale(1.5); opacity: 0; transition: opacity .35s, transform .35s; }
.foe.falling { transform: translate(calc(var(--x) * var(--cell)), calc(var(--y) * var(--cell))) scale(.05) rotate(300deg); opacity: 0; transition: transform .6s cubic-bezier(.5, 0, .9, .5), opacity .6s ease-in; }
.foe.spawn .sprite { animation: rise .45s cubic-bezier(.3, 1.6, .6, 1); }
@keyframes rise { from { translate: 0 60%; scale: .2; opacity: 0; } }
.foe.ghost { opacity: .4; }
.foe.ghost .sprite { animation: none; }
.foe.late .base { box-shadow: 0 3px 0 var(--edge), 0 0 0 2px var(--gold); }

/* repères de l'aperçu : où sera l'automate après chaque carte */
.mark { position: absolute; left: 6px; top: 6px; width: var(--cell); height: var(--cell); transform: translate(calc(var(--x) * var(--cell)), calc(var(--y) * var(--cell))); z-index: 4; pointer-events: none; }
.mark span { position: absolute; top: 1px; left: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: #7ff0ff; color: var(--edge); border: 2px solid var(--edge);
  font: 11px/13px var(--game); text-align: center; animation: spawn .25s ease-out; }

/* effets éphémères */
.float { position: absolute; z-index: 8; pointer-events: none; font-family: var(--game); font-size: 22px; color: #fff; -webkit-text-stroke: 4px var(--edge); paint-order: stroke fill; white-space: nowrap; }
.float.num { color: var(--gold); font-size: 26px; }
.float.num.bad { color: #ff6b7a; font-size: 30px; }
.float.flame { -webkit-text-stroke: 0; font-size: calc(var(--cell) * .6); }
.part { position: absolute; z-index: 7; width: 7px; height: 7px; border-radius: 2px; border: 1.5px solid var(--edge); pointer-events: none; }
.proj { position: absolute; z-index: 7; pointer-events: none; }
.proj.venom { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #e9ffcf, #7fd84a 50%, #3f8a1f); border: 2px solid var(--edge); box-shadow: 0 0 10px #9be36b; }
.chain { position: absolute; z-index: 6; height: 6px; margin-top: -3px; transform-origin: 0 50%; pointer-events: none; border-radius: 3px;
  background: repeating-linear-gradient(90deg, #ffd38a 0 6px, #8f5524 6px 9px); border: 1.5px solid var(--edge); }
.ring { position: absolute; z-index: 6; width: calc(var(--cell) * .8); height: calc(var(--cell) * .8); border-radius: 50%; border: 3px solid #fff; pointer-events: none; }
.ring.wind { border-color: #ff9fb6; border-style: dashed; }
.ring.boom { border-color: var(--gold); border-width: 4px; }
.ring.shield-ring { border-color: #7fc8ff; }
.ring.portal { border-color: var(--gold); box-shadow: 0 0 14px var(--gold); }
.slash { position: absolute; z-index: 6; width: calc(var(--cell) * .7); height: 4px; background: #fff; border-radius: 2px; transform: translate(-50%, -50%) rotate(-35deg); box-shadow: 0 0 8px #fff; pointer-events: none; }
.tile.flash { animation: flash2 .35s ease-out; }
@keyframes flash2 { 0% { box-shadow: inset 0 0 0 40px rgba(255, 170, 90, .75); } }
.board-wrap.shake { animation: shake .3s ease; }
.board-wrap.shake-hard { animation: shake .45s ease; --s: 7px; }
@keyframes shake { 20% { translate: calc(var(--s, 4px) * -1) 1px; } 40% { translate: var(--s, 4px) -1px; } 60% { translate: calc(var(--s, 4px) * -.6) 0; } 80% { translate: calc(var(--s, 4px) * .4) 0; } }
body.ouch::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 30; box-shadow: inset 0 0 80px rgba(255, 40, 60, .7); animation: ouch .55s ease-out forwards; }
@keyframes ouch { to { opacity: 0; } }
.flying-card { position: fixed; z-index: 80; width: 52px; height: 68px; pointer-events: none; }
.deck-btn.pulse { animation: pulse .4s ease; }
@keyframes pulse { 40% { scale: 1.25; background: #5a5470; color: #ffb3b3; } }

/* bannières */
.banner { position: absolute; left: 50%; top: 42%; z-index: 20; translate: -50% -50%; pointer-events: none; text-align: center; white-space: nowrap;
  background: linear-gradient(var(--panel2), var(--panel)); border: 3px solid var(--edge); border-radius: 18px; box-shadow: 0 6px 0 var(--edge); padding: 10px 26px;
  animation: banner 1.7s cubic-bezier(.3, 1.4, .6, 1) forwards; }
.banner b { display: block; font-family: var(--game); font-weight: 400; font-size: 34px; color: var(--gold); -webkit-text-stroke: 2px var(--edge); paint-order: stroke fill; text-shadow: 0 3px 0 var(--edge); }
.banner small { display: block; color: var(--ink2); font-size: 14px; }
.banner.boss b { color: #ff8a5c; }
.banner.win b { color: var(--green); }
.banner.lose b { color: var(--red); }
@keyframes banner { 0% { scale: .3; opacity: 0; } 18% { scale: 1; opacity: 1; } 80% { scale: 1; opacity: 1; } 100% { scale: .9; opacity: 0; } }

/* programme et main */
.slot.running { transform: translateY(-6px) scale(1.06); box-shadow: 0 0 0 3px #7ff0ff, 0 0 20px rgba(127, 240, 255, .7), 0 6px 0 var(--edge); transition: transform .15s; }
.slot.done { opacity: .45; transform: scale(.94); transition: opacity .2s, transform .2s; }
.hand.deal .card { animation: deal .38s cubic-bezier(.3, 1.4, .6, 1) backwards; animation-delay: calc(var(--k) * 70ms); }
@keyframes deal { from { transform: translateY(40px) rotate(-8deg) scale(.7); opacity: 0; } }
.hand .card:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 var(--edge); }
.slot.pop { animation: placed .25s cubic-bezier(.3, 1.6, .6, 1); }
@keyframes placed { from { scale: .7; } }
@media (prefers-reduced-motion: reduce) { .tile.danger, .foe .sprite, .foe .intent, .tile.pit::before, .bot .gear { animation: none !important; } }
.bot .nose { fill: none; stroke: var(--gold); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 1px var(--edge)) drop-shadow(0 0 1px var(--edge)); }
.bot.ghost .nose { stroke: #7ff0ff; }

/* ===== L'atelier de Dédale ===== */
.bz { display: inline-block; width: 15px; height: 10px; vertical-align: -1px; clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  background: linear-gradient(#ffd38a, #d08a3c 55%, #8f5524); box-shadow: inset 0 0 0 1px rgba(14, 9, 32, .6); }
.arena-n small { color: var(--ink2); }
/* ticket de butin, imprimé ligne par ligne */
.ticket { position: relative; background: #f6efe0; color: var(--edge); border: 3px solid var(--edge); border-radius: 6px; padding: 10px 14px 14px; box-shadow: 0 5px 0 var(--edge);
  transform: rotate(-1deg); animation: ticket .5s cubic-bezier(.3, 1.4, .6, 1); }
.ticket::after { content: ''; position: absolute; left: 0; right: 0; bottom: -9px; height: 9px; background: radial-gradient(circle at 6px 0, #f6efe0 5px, transparent 6px) 0 0 / 12px 9px repeat-x; }
@keyframes ticket { from { transform: translateY(-30px) rotate(-6deg); opacity: 0; } }
.ticket-head { font-family: var(--game); font-size: 17px; text-align: center; border-bottom: 2px dashed rgba(14, 9, 32, .3); padding-bottom: 4px; margin-bottom: 4px; }
.ticket-line { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; padding: 2px 0; animation: line-in .3s ease-out backwards; animation-delay: calc(.35s + var(--k) * .22s); }
.ticket-line b { font-family: var(--game); font-weight: 400; font-size: 16px; color: #8f5524; }
@keyframes line-in { from { opacity: 0; transform: translateX(-12px); } }

/* l'atelier : un mur de briques, une enseigne, Dédale */
.workshop { position: relative; margin-top: 24px; padding: 30px 12px 0; border: 3px solid var(--edge); border-radius: 18px; box-shadow: 0 5px 0 var(--edge), inset 0 0 40px rgba(0, 0, 0, .55);
  background: linear-gradient(rgba(14, 9, 32, .25), rgba(14, 9, 32, .55)),
    repeating-linear-gradient(0deg, transparent 0 20px, rgba(14, 9, 32, .5) 20px 22px),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(14, 9, 32, .5) 42px 44px) 0 0 / 88px 44px,
    linear-gradient(#5e3b2a, #4a2d20); }
.ws-sign { position: absolute; top: -20px; left: 50%; transform: translateX(-50%) rotate(-1.5deg); white-space: nowrap; font-family: var(--game); font-size: 21px; color: var(--gold);
  background: linear-gradient(#8a5528, #6a3d1b); border: 3px solid var(--edge); border-radius: 10px; padding: 1px 16px; box-shadow: 0 4px 0 var(--edge); text-shadow: 0 2px 0 var(--edge); }
.keeper { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.keeper-face { font-size: 36px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .5)); animation: idle 3s ease-in-out infinite; }
.keeper-say { position: relative; background: var(--ink); color: var(--edge); font-weight: 700; font-size: 13px; border: 2px solid var(--edge); border-radius: 12px; padding: 5px 10px; }
.keeper-say::before { content: ''; position: absolute; left: -7px; top: 50%; margin-top: -5px; border: 5px solid transparent; border-right-color: var(--edge); border-left: 0; }
.ws-label { font-family: var(--game); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: #f0c98f; margin: 4px 0 6px 2px; text-shadow: 0 2px 0 var(--edge); }
.ws-label small { font-family: system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 12px; color: #d8b98f; opacity: .85; }
/* le tableau de liège et ses plans bleus */
.corkboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 8px 18px; margin-bottom: 8px; border: 3px solid var(--edge); border-radius: 10px;
  background: radial-gradient(circle at 20% 30%, rgba(0, 0, 0, .12) 0 2px, transparent 3px) 0 0 / 11px 13px, radial-gradient(circle at 70% 60%, rgba(255, 255, 255, .1) 0 1.5px, transparent 2.5px) 0 0 / 9px 10px, linear-gradient(#c48a52, #a8703d);
  box-shadow: inset 0 0 0 3px #7c4f26, 0 4px 0 rgba(0, 0, 0, .4); }
.plan { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 128px; padding: 12px 4px 22px; text-align: center; color: #e8f4ff;
  border: 2px solid #0b2a52; border-radius: 4px; box-shadow: 2px 4px 0 rgba(0, 0, 0, .35);
  background: linear-gradient(rgba(255, 255, 255, .13) 1px, transparent 1px) 0 0 / 10px 10px, linear-gradient(90deg, rgba(255, 255, 255, .13) 1px, transparent 1px) 0 0 / 10px 10px, linear-gradient(#2f6fc0, #1f4f94); }
.plan:nth-child(1) { transform: rotate(-2.5deg); } .plan:nth-child(2) { transform: rotate(1.5deg) translateY(4px); } .plan:nth-child(3) { transform: rotate(-1deg); }
.plan:active:not(.sold) { transform: translateY(-4px) scale(1.04); }
.plan .pin { position: absolute; top: -6px; left: 50%; margin-left: -6px; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff9a9a, #d7263d); border: 2px solid var(--edge); }
.plan-ic { font-size: 28px; line-height: 1.1; filter: drop-shadow(0 0 4px rgba(160, 210, 255, .6)); }
.plan b { font-family: var(--game); font-weight: 400; font-size: 14px; color: #fff; }
.plan small { font-size: 10.5px; line-height: 1.15; opacity: .9; }
.plan.sold, .part-item.sold { background: rgba(0, 0, 0, .25); border: 2px dashed rgba(255, 255, 255, .25); box-shadow: none; display: flex; align-items: center; justify-content: center; }
.plan.sold span, .part-item.sold span { font-family: var(--game); color: rgba(255, 255, 255, .45); font-size: 17px; transform: rotate(-12deg); }
.price-tag { position: absolute; bottom: -11px; left: 50%; transform: translateX(-50%) rotate(-4deg); font-family: var(--game); font-size: 16px; color: var(--edge); background: var(--gold);
  border: 2px solid var(--edge); border-radius: 6px 12px 12px 6px; padding: 0 8px 0 12px; box-shadow: 0 2px 0 var(--edge); white-space: nowrap; line-height: 1.35; }
.price-tag::before { content: ''; position: absolute; left: 4px; top: 50%; margin-top: -3px; width: 5px; height: 5px; border-radius: 50%; background: var(--edge); }
.price-tag.poor { background: #b9b0c9; }
/* l'établi et ses pièces de bronze */
.bench { margin-bottom: 8px; }
.bench-row { display: flex; justify-content: center; gap: 10px; padding: 0 6px; position: relative; z-index: 1; }
.part-item { position: relative; flex: 1; max-width: 50%; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 112px; padding: 10px 6px 20px; text-align: center; color: var(--edge);
  background: radial-gradient(circle at 30% 20%, #ffe2ae, #d9a05c 60%, #a8692f); border: 3px solid var(--edge); border-radius: 14px; box-shadow: inset 0 0 0 3px rgba(255, 240, 210, .45), 0 4px 0 rgba(0, 0, 0, .35); }
.part-item:active:not(.sold) { transform: translateY(-4px) scale(1.03); }
.part-ic { font-size: 30px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); animation: idle 2.4s ease-in-out infinite; }
.part-item b { font-family: var(--game); font-weight: 400; font-size: 15px; }
.part-item small { font-size: 11px; line-height: 1.15; font-weight: 600; }
.bench-top { height: 16px; margin: -6px -6px 0; border-radius: 4px; background: linear-gradient(#b07a43, #7c4f26); border: 3px solid var(--edge); box-shadow: 0 6px 0 rgba(0, 0, 0, .35); position: relative; }
.bench-top::before, .bench-top::after { content: ''; position: absolute; top: 100%; width: 14px; height: 12px; background: #5b3412; border: 3px solid var(--edge); border-top: 0; }
.bench-top::before { left: 12%; } .bench-top::after { right: 12%; }
/* la forge : trois services, avec la lueur du feu */
.forge { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 8px 16px; border: 3px solid var(--edge); border-radius: 12px; margin-bottom: 4px;
  background: radial-gradient(ellipse at 50% 120%, rgba(255, 120, 40, .55), transparent 60%), linear-gradient(#3a2a2a, #241818); animation: embers 2.5s ease-in-out infinite; }
@keyframes embers { 50% { background-color: #2a1a14; box-shadow: inset 0 -10px 24px rgba(255, 110, 40, .25); } }
.service { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px 20px; border: 3px solid var(--edge); border-radius: 12px; color: var(--ink);
  background: linear-gradient(#5b5470, #403a52); box-shadow: 0 4px 0 var(--edge); }
.service:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.service:disabled { opacity: .45; }
.svc-ic { font-size: 26px; }
.service b { font-family: var(--game); font-weight: 400; font-size: 15px; }
.service small { font-size: 10.5px; color: var(--ink2); line-height: 1.15; }
/* comptoir : fouiller les caisses, la caisse de bronze */
.ws-counter { display: flex; align-items: center; gap: 10px; margin: 8px -12px 0; padding: 12px; background: linear-gradient(#a8743e, #8a5a2b); border-top: 3px solid var(--edge); border-radius: 0 0 15px 15px; }
.crate { flex: 1; font-family: var(--game); font-size: 16px; background: var(--panel2); color: var(--ink); border: 3px solid var(--edge); border-radius: 12px; padding: 7px 8px; box-shadow: 0 3px 0 var(--edge); }
.crate small { font-size: 14px; color: var(--gold); }
.crate:active { transform: translateY(3px); box-shadow: none; }
.till { position: relative; font-family: var(--game); font-size: 22px; color: var(--gold); background: var(--edge); border-radius: 10px; padding: 3px 12px; text-shadow: 0 0 8px rgba(255, 201, 60, .5); white-space: nowrap; }
.till .bz { width: 18px; height: 12px; }
.till .spent { position: absolute; right: 6px; top: -4px; font-style: normal; color: #ff8a98; font-size: 18px; animation: spent .9s ease-out forwards; }
@keyframes spent { to { transform: translateY(-26px); opacity: 0; } }
.shop-actions { display: flex; gap: 10px; }
.shop-actions .btn.ghost { width: auto; flex: 0 0 auto; }
.restock { animation: restock .4s cubic-bezier(.3, 1.4, .6, 1) backwards; animation-delay: calc(var(--k) * 60ms); }
@keyframes restock { from { transform: translateY(-20px) scale(.6); opacity: 0; } }
.melt-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.melt-list .card { padding: 8px 2px; }
.melt-list .card .ds { font-family: var(--game); font-size: 13px; }
.hp.pulse { animation: pulse .4s ease; }

/* ===== Comment jouer, créatures, cartes, paquet ===== */
.mini { --cell: 46px; display: flex; justify-content: center; }
.mini .board { grid-template-columns: repeat(var(--w), var(--cell)); padding: 6px; }
.mini .foe .intent::after { border-width: 6px; border-bottom-width: 9px; }
.tuto { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; animation: tuto-in .3s ease-out; }
@keyframes tuto-in { from { opacity: 0; transform: translateX(16px); } }
.tuto-step { font-family: var(--game); font-size: 13px; color: var(--ink2); letter-spacing: .08em; }
.tuto-art { min-height: 168px; display: flex; align-items: center; justify-content: center; width: 100%; background: rgba(0, 0, 0, .22); border-radius: 16px; padding: 12px 6px; }
.tuto h3 { font-size: 26px; }
.tuto p { color: var(--ink); font-size: 15px; line-height: 1.45; }
.tuto p b { color: var(--gold); }
.tuto-dots { display: flex; justify-content: center; gap: 7px; }
.tuto-dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 2px solid var(--edge); background: var(--panel2); }
.tuto-dots button.on { background: var(--gold); width: 24px; border-radius: 99px; }
.tuto-nav { display: flex; gap: 10px; }
.tuto-nav .btn.ghost { width: 64px; flex: none; }
.tuto-links { display: flex; justify-content: center; gap: 16px; }
.tuto-links button { background: none; border: 0; color: var(--ink2); text-decoration: underline; font-size: 14px; }
/* petites scènes animées */
.demo-line { display: flex; align-items: center; gap: 6px; }
.demo-line .arrow { color: var(--ink2); font-size: 18px; }
.mini-card { position: relative; width: 70px; height: 86px; animation: placed .4s cubic-bezier(.3, 1.6, .6, 1) backwards; }
.demo-line .mini-card:nth-of-type(2) { animation-delay: .25s; } .demo-line .mini-card:nth-of-type(3) { animation-delay: .5s; }
.mini-card .n { position: absolute; top: -9px; left: -7px; width: 22px; height: 22px; border-radius: 50%; background: var(--panel2); color: var(--ink); border: 2px solid var(--edge); font: 13px/18px var(--game); text-align: center; }
.mini-card .nm { font-size: 13px; }
.demo-dodge { animation: dodge 2.6s ease-in-out infinite; }
@keyframes dodge { 0%, 20% { translate: 0 0; } 45%, 80% { translate: calc(var(--cell) * 2) 0; } 100% { translate: 0 0; } }
.demo-preview .mark { animation: blink 1.3s ease-in-out infinite; }
.demo-shove { animation: shove 2.8s ease-in-out infinite; }
@keyframes shove { 0%, 25%, 40%, 100% { translate: 0 0; } 32% { translate: 12px 0; } }
.demo-pushed { animation: pushed 2.8s ease-in-out infinite; }
@keyframes pushed { 0%, 30% { translate: 0 0; scale: 1; opacity: 1; rotate: 0deg; } 42% { translate: var(--cell) 0; scale: 1; opacity: 1; rotate: 0deg; }
  60% { translate: var(--cell) 0; scale: .1; opacity: 0; rotate: 300deg; } 88% { translate: 0 0; scale: .1; opacity: 0; } 100% { translate: 0 0; scale: 1; opacity: 1; } }
.demo-panne { position: relative; --cell: 64px; width: 230px; height: 90px; }
.demo-panne .bot { left: 0; top: 12px; }
.demo-hurt .body { animation: hurt2 2.6s ease infinite; }
.demo-fly { position: absolute; left: 22px; top: 18px; width: 46px; height: 60px; animation: demo-fly 2.6s ease-in-out infinite; }
.demo-fly .ic { font-size: 18px; } .demo-fly .nm { font-size: 10px; }
@keyframes demo-fly { 0%, 15% { transform: scale(.3); opacity: 0; } 30% { transform: translate(40px, -18px) scale(1.1) rotate(-8deg); opacity: 1; } 75%, 100% { transform: translate(160px, 0) scale(.7) rotate(6deg); opacity: 0; } }
.demo-deck { position: absolute; right: 0; top: 18px; width: 50px; height: 56px; border-radius: 10px; background: var(--panel); border: 3px solid var(--edge); font-size: 26px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 0 var(--edge); }
.demo-shop { display: flex; align-items: center; gap: 14px; }
.demo-shop .keeper-face { font-size: 44px; }
.demo-plan { width: 86px; min-height: 104px; transform: rotate(-3deg); }
.demo-loot { font-family: var(--game); font-size: 26px; color: var(--gold); text-shadow: 0 2px 0 var(--edge); animation: idle 1.6s ease-in-out infinite; }
.demo-loot .bz { width: 20px; height: 13px; }
/* créatures */
.beasts { display: flex; flex-direction: column; gap: 10px; }
.beast { display: flex; align-items: center; gap: 12px; background: rgba(0, 0, 0, .22); border-radius: 14px; padding: 8px; }
.beast-art { flex: none; width: 150px; display: flex; justify-content: center; }
.beast-art .mini { --cell: 30px; }
.beast-art .mini .board { padding: 4px; box-shadow: 0 0 0 2px var(--panel2), 0 4px 0 2px var(--edge); }
.beast-art .unit { left: 4px; top: 4px; }
.beast-text { display: flex; flex-direction: column; gap: 3px; }
.beast-text b { font-family: var(--game); font-weight: 400; font-size: 19px; color: var(--gold); }
.beast-text small { font-size: 13px; color: var(--ink2); line-height: 1.3; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips span { font-size: 12px; font-weight: 700; background: var(--panel2); border: 2px solid var(--edge); border-radius: 99px; padding: 0 7px; }
/* cartes et paquet */
.sheet-card h3 small { font-family: system-ui, sans-serif; font-size: 14px; color: var(--ink2); margin-left: 6px; }
.pile-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.pile { font-size: 13px; color: var(--ink2); background: rgba(0, 0, 0, .25); border-radius: 99px; padding: 3px 10px; }
.pile b { font-family: var(--game); font-weight: 400; font-size: 16px; color: var(--ink); }
.pile.bad { background: rgba(255, 68, 88, .2); } .pile.bad b { color: #ff8a98; }
.pile.ok b { color: var(--green); }
.deck-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 8px; padding-top: 6px; }
.deck-card { position: relative; min-height: 112px; padding: 10px 4px 8px; justify-content: flex-start; animation: deal .35s cubic-bezier(.3, 1.4, .6, 1) backwards; }
.deck-grid .deck-card:nth-child(n+4) { animation-delay: .08s; } .deck-grid .deck-card:nth-child(n+7) { animation-delay: .16s; } .deck-grid .deck-card:nth-child(n+10) { animation-delay: .24s; }
.deck-card .ic { font-size: 28px; }
.deck-card .nm { font-size: 14px; }
.deck-card .ds { font-size: 11px; line-height: 1.15; font-weight: 600; opacity: .85; }
.deck-card .badge { position: absolute; top: -9px; right: -6px; font-family: var(--game); font-size: 14px; border: 2px solid var(--edge); border-radius: 99px; padding: 0 7px; box-shadow: 0 2px 0 var(--edge); }
.badge.count { background: var(--ink); color: var(--edge); }
.badge.start { background: var(--panel2); color: var(--ink); font-size: 11px; }
.badge.price { background: var(--gold); color: var(--edge); }
.deck-card.c-glitch .badge.count { background: var(--red); color: #fff; }
/* l'atelier : l'en-tête reste en haut, avec la bourse de bronze toujours visible */
.shop-top { position: sticky; top: 0; z-index: 25; margin: calc(-8px - env(safe-area-inset-top)) -14px 0; padding: calc(env(safe-area-inset-top) + 8px) 14px 8px;
  background: linear-gradient(var(--bg) 75%, rgba(26, 18, 48, .85)); box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .6); }
.shop-top .arena-n { font-size: 16px; }
.purse { position: relative; font-family: var(--game); font-size: 22px; color: var(--gold); background: var(--edge); border: 2px solid #6a3d1b; border-radius: 12px; padding: 2px 10px;
  text-shadow: 0 0 8px rgba(255, 201, 60, .5); white-space: nowrap; box-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.purse .bz { width: 18px; height: 12px; }
.purse .spent { position: absolute; left: 50%; top: 100%; translate: -50% 0; font-style: normal; color: #ff8a98; font-size: 18px; animation: spent2 .9s ease-out forwards; }
@keyframes spent2 { from { transform: translateY(-6px); opacity: 1; } to { transform: translateY(14px); opacity: 0; } }
.shop-top .hp i { width: 15px; height: 15px; }
/* les boutons des fiches restent visibles en bas, même quand le contenu défile */
.sheet-card > .btn:last-child, .sheet-foot { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); z-index: 5; flex: none; }
.sheet-foot { display: flex; flex-direction: column; gap: 10px; margin: 0 -16px calc(-16px - env(safe-area-inset-bottom)); padding: 10px 16px calc(env(safe-area-inset-bottom) + 14px);
  background: linear-gradient(rgba(43, 32, 80, .85), var(--panel) 18px); box-shadow: 0 -8px 14px -8px rgba(0, 0, 0, .55); }
.sheet-card > .btn:last-child { box-shadow: 0 5px 0 var(--edge), 0 -14px 16px 4px var(--panel); }
/* la vie : un compteur lisible, des pastilles, et la vie sous l'automate */
.hp { flex-direction: column; align-items: flex-end; gap: 3px; }
.hp-num { display: flex; align-items: baseline; gap: 3px; font-family: var(--game); line-height: 1; background: var(--edge); border: 2px solid #6a3d1b; border-radius: 12px; padding: 3px 9px 4px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .4); color: #ffd38a; }
.hp-num b { font-weight: 400; font-size: 24px; color: #ffd38a; text-shadow: 0 0 8px rgba(255, 180, 90, .45); }
.hp-num small { font-size: 15px; color: var(--ink2); }
.hp-gear { font-size: 16px; color: var(--bronze); align-self: center; }
.hp-shield { font-size: 14px; margin-left: 4px; color: #9fd0ff; align-self: center; }
.hp .pips { display: flex; gap: 2px; }
.hp .pips i { width: 11px; height: 11px; border-width: 1.5px; box-shadow: 0 1px 0 var(--edge); }
.hp.low .hp-num { border-color: var(--red); animation: low-hp 1s ease-in-out infinite; }
.hp.low .hp-num b { color: #ff8a98; }
@keyframes low-hp { 50% { box-shadow: 0 3px 0 rgba(0, 0, 0, .4), 0 0 14px rgba(255, 68, 88, .8); } }
.hp.pulse .hp-num { animation: pulse .4s ease; }
.shop-top .hp .pips i { width: 9px; height: 9px; }
.bot-hp { position: absolute; bottom: -1px; left: 10%; right: 10%; display: flex; justify-content: center; gap: 1.5px; z-index: 2; pointer-events: none; }
.bot-hp i { flex: 0 1 7px; height: 5px; border-radius: 3px; background: linear-gradient(#ffd38a, var(--bronze)); border: 1px solid var(--edge); }
.bot-hp i.lost { background: #2a2147; }
.bot-hp i.shield { background: linear-gradient(#bfe3ff, var(--blue)); }
.bot-hp.low i:not(.lost) { background: linear-gradient(#ff9aa6, var(--red)); }
.bot-hp { bottom: -5px; left: 0; right: 0; gap: 2px; }
.bot-hp i { flex: 0 1 8px; height: 7px; border-width: 1.5px; }
/* fiches plus aérées */
.sheet-card { --pad: 24px; padding: 22px var(--pad) calc(env(safe-area-inset-bottom) + 22px); gap: 16px; }
.sheet-foot { margin: 0 calc(var(--pad) * -1) calc(-22px - env(safe-area-inset-bottom)); padding: 14px var(--pad) calc(env(safe-area-inset-bottom) + 22px); gap: 14px; }
.sheet-card > .btn:last-child, .sheet-foot { bottom: calc(-22px - env(safe-area-inset-bottom)); }
.tuto { gap: 14px; padding: 0 4px; }
.tuto-art { padding: 18px 10px; }
.tuto h3 { margin-top: 4px; }
.tuto p { padding: 0 6px; line-height: 1.55; }
.tuto-links { padding-top: 2px; }
.beast { padding: 10px 12px; gap: 14px; }
.beasts { gap: 12px; }
.deck-grid { gap: 14px 10px; }

/* ===== v3 : pièges, objectifs, combos, portes, forge, automates ===== */
/* pics : des pointes métalliques ; leviers : une manette qui bascule */
.tile.spikes { background: radial-gradient(circle at 25% 30%, #d8d8e8 0 9%, transparent 10%), radial-gradient(circle at 70% 28%, #d8d8e8 0 9%, transparent 10%),
  radial-gradient(circle at 48% 62%, #d8d8e8 0 9%, transparent 10%), radial-gradient(circle at 22% 78%, #d8d8e8 0 8%, transparent 9%), radial-gradient(circle at 78% 75%, #d8d8e8 0 8%, transparent 9%),
  linear-gradient(160deg, #4a3f6e, #34295a 70%); }
.tile.spikes::after { content: '▲▲▲'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(var(--cell) * .2); letter-spacing: -1px;
  color: #e8e8f4; text-shadow: 0 2px 0 var(--edge), 0 0 4px rgba(0, 0, 0, .6); line-height: 1; }
.tile.lever::after { content: ''; position: absolute; left: 50%; top: 22%; width: 5px; height: 42%; margin-left: -2.5px; background: linear-gradient(#ffd38a, #8f5524); border: 2px solid var(--edge);
  border-radius: 3px; transform-origin: 50% 100%; transform: rotate(-35deg); transition: transform .3s cubic-bezier(.3, 1.6, .6, 1); }
.tile.lever::before { content: ''; position: absolute; left: 30%; right: 30%; bottom: 22%; height: 18%; border-radius: 4px; background: #5b5470; border: 2px solid var(--edge); }
.tile.lever { box-shadow: inset 0 0 0 2px rgba(255, 201, 60, .55), inset 0 0 14px rgba(255, 201, 60, .35); animation: lever-glow 1.4s ease-in-out infinite; }
@keyframes lever-glow { 50% { box-shadow: inset 0 0 0 2px rgba(255, 201, 60, .9), inset 0 0 20px rgba(255, 201, 60, .6); } }
.tile.lever.on { animation: none; box-shadow: inset 0 0 0 2px rgba(61, 220, 151, .7), inset 0 0 16px rgba(61, 220, 151, .45); }
.tile.lever.on::after { transform: rotate(35deg); background: linear-gradient(#b8ffd9, #3ddc97); }
/* le regard de la Méduse : violet */
.tile.gaze { background: repeating-linear-gradient(-45deg, rgba(180, 120, 255, .45) 0 6px, rgba(180, 120, 255, .18) 6px 12px), linear-gradient(#45306a, #34245a);
  background-size: 17px 17px, auto; animation: stripes 1s linear infinite; }
.foe .intent.gaze::after { border-bottom-color: #c39bff; }
.tile.flash-purple { animation: flashp .4s ease-out; }
@keyframes flashp { 0% { box-shadow: inset 0 0 0 40px rgba(195, 155, 255, .8); } }
.beam { position: absolute; z-index: 6; height: 8px; margin-top: -4px; transform-origin: 0 50%; pointer-events: none; border-radius: 4px;
  background: linear-gradient(#f0e0ff, #b07aff); box-shadow: 0 0 12px #c39bff, 0 0 4px #fff; }
.bot.stoned .body { animation: stoned .7s ease; }
@keyframes stoned { 30%, 70% { filter: grayscale(1) brightness(1.3) drop-shadow(0 3px 0 var(--edge)); } }
/* le bouclier de l'hoplite, du côté où il regarde */
.foe .guard { position: absolute; inset: 0; transform: rotate(calc(var(--d) * 90deg)); pointer-events: none; z-index: 2; }
.foe .guard::after { content: ''; position: absolute; top: 3px; left: 22%; right: 22%; height: 6px; border-radius: 6px 6px 2px 2px; background: linear-gradient(#ffe2ae, #c0392b);
  border: 2px solid var(--edge); }
.foe.parrying .sprite { animation: parry .35s ease; }
@keyframes parry { 40% { scale: 1.15; filter: brightness(1.8) drop-shadow(0 2px 0 var(--edge)); } }
.ring.parry { border-color: #ffd38a; }
.ring.blast { width: calc(var(--cell) * 2.4); height: calc(var(--cell) * 2.4); border: 6px solid #ff8a3c; box-shadow: 0 0 24px #ff8a3c; }
/* tonneau, nid, scarabée, cyclope, méduse : leurs socles */
.foe[data-t="barrel"] .base { background: linear-gradient(#8a5a2b, #5b3412); }
.foe[data-t="scarab"] .base { background: linear-gradient(#5fd0ff, #2b6fb0); }
.foe[data-t="hoplite"] .base { background: linear-gradient(#ffd38a, #c0392b); }
.foe[data-t="cyclops"] .base { background: linear-gradient(#c39bff, #6a3fb0); }
.foe[data-t="medusa"] .base { background: linear-gradient(#b0ffd8, #7a4fc0); }
.foe[data-t="nest"] .base { background: linear-gradient(#d8b98f, #8a5a2b); }
.foe.prop .sprite { animation: none; }
.foe.prop .hpbar { display: none; }
.foe[data-t="barrel"] .sprite { filter: drop-shadow(0 2px 0 var(--edge)) drop-shadow(0 0 6px rgba(255, 138, 60, .7)); }
/* en-tête : l'objectif de l'arène */
.arena-n { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; line-height: 1.15; }
.goal { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--ink); background: rgba(0, 0, 0, .3); border: 2px solid var(--edge); border-radius: 99px; padding: 1px 8px; cursor: pointer; }
.goal-ic { font-size: 13px; }
.elite-mark { color: #ff8a5c !important; }
/* programme : la direction de chaque carte */
.slot .face { position: absolute; top: 3px; right: 4px; font-size: 13px; color: var(--edge); transform: rotate(calc((var(--d) - 1) * 90deg)); line-height: 1; font-weight: 900; }
.mini-card .face { position: absolute; top: 3px; right: 4px; font-size: 13px; transform: rotate(calc((var(--d) - 1) * 90deg)); font-weight: 900; }
.turn-btn.set { background: #7ff0ff; }
/* cartes améliorées : liseré doré */
.card.upgraded { box-shadow: 0 4px 0 var(--edge), inset 0 0 0 3px var(--gold), 0 0 10px rgba(255, 201, 60, .45); }
.hand .card.upgraded .nm, .slot.upgraded .nm, .deck-card.upgraded .nm { color: #5b3412; }
.deck-card .up-line { margin-top: 3px; padding-top: 3px; border-top: 1.5px dashed rgba(14, 9, 32, .3); font-style: italic; }
/* combos et ralenti */
.float.combo { font-size: 24px; color: var(--gold); -webkit-text-stroke: 5px var(--edge); z-index: 9; letter-spacing: .03em; }
.float.combo.big { font-size: 32px; color: #ff8a3c; }
.board.slowmo { animation: slowmo .5s ease-out; }
@keyframes slowmo { 30% { transform: scale(1.03); filter: saturate(1.4) brightness(1.08); } }
.say .combo-hint { color: var(--gold); font-weight: 700; }
.unit.volting { animation: volting .25s ease; }
@keyframes volting { 30% { translate: -6px 0; } 70% { translate: 6px 0; } }
.banner.elite b { color: #ff8a5c; }
.banner small { white-space: normal; max-width: 280px; margin: 2px auto 0; }
/* atelier : étoiles, emplacements, forge en 2×2 */
.ticket-stars { display: flex; justify-content: center; gap: 14px; margin: 2px 0 6px; }
.star { display: flex; flex-direction: column; align-items: center; font-size: 30px; line-height: 1; color: #cfc6b4; text-shadow: 0 2px 0 rgba(14, 9, 32, .25); }
.star small { font-size: 10px; font-weight: 700; color: #8a8070; margin-top: 2px; }
.star.on.lit { color: var(--gold); text-shadow: 0 2px 0 var(--edge), 0 0 12px rgba(255, 201, 60, .8); animation: star-pop .45s cubic-bezier(.3, 1.8, .6, 1); }
.star.on.lit small { color: #8f5524; }
@keyframes star-pop { from { transform: scale(.2) rotate(-90deg); } }
.mounted { float: right; display: inline-flex; gap: 4px; }
.slot-mod { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(#ffe2ae, #c48a52); border: 2px solid var(--edge); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.slot-mod.empty { background: rgba(0, 0, 0, .35); border-style: dashed; border-color: rgba(255, 255, 255, .25); }
.part-item.full { filter: grayscale(.6); opacity: .75; }
.forge { grid-template-columns: repeat(2, 1fr); }
.purse.pulse { animation: pulse .25s ease; }
.upgrade-list { display: flex; flex-direction: column; gap: 8px; }
.up-row { display: flex; gap: 10px; align-items: center; text-align: left; background: rgba(0, 0, 0, .25); border: 2px solid var(--edge); border-radius: 12px; padding: 8px; color: var(--ink); }
.up-row .card.mini { width: 44px; height: 54px; flex: none; padding: 0; }
.up-row .card.mini .ic { font-size: 22px; }
.up-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.up-text b { font-family: var(--game); font-weight: 400; font-size: 16px; }
.up-text small { color: var(--ink2); }
.up-arrow { color: var(--gold); font-size: 12.5px; }
.up-arrow b { font-size: 13px; }
/* les portes du labyrinthe */
.doors-head { text-align: center; margin-top: 6px; }
.doors-head h2 { font-size: 26px; color: var(--gold); text-shadow: 0 3px 0 var(--edge); }
.doors { display: flex; flex-direction: column; gap: 14px; }
.door { display: flex; align-items: center; gap: 14px; text-align: left; color: var(--ink); padding: 12px; border: 3px solid var(--edge); border-radius: 18px; box-shadow: 0 5px 0 var(--edge);
  background: linear-gradient(rgba(14, 9, 32, .2), rgba(14, 9, 32, .5)), repeating-linear-gradient(0deg, transparent 0 18px, rgba(14, 9, 32, .45) 18px 20px), linear-gradient(#5a4a85, #3e3266);
  animation: deal .4s cubic-bezier(.3, 1.4, .6, 1) backwards; animation-delay: calc(var(--k) * 90ms); }
.door:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--edge); }
.arch { flex: none; position: relative; width: 70px; height: 84px; border-radius: 35px 35px 6px 6px; border: 3px solid var(--edge); display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(90deg, #6a3d1b 0 10px, #5b3412 10px 12px); box-shadow: inset 0 0 0 5px #8f80c2, inset 0 0 0 7px var(--edge), 0 3px 0 var(--edge); }
.door-ic { font-size: 30px; filter: drop-shadow(0 2px 0 var(--edge)); }
.door-text { display: flex; flex-direction: column; gap: 3px; }
.door-text b { font-family: var(--game); font-weight: 400; font-size: 21px; color: var(--gold); }
.door-text small { font-size: 13px; color: var(--ink2); line-height: 1.3; }
.door-text em { font-style: normal; font-size: 12px; font-weight: 700; color: #ff8a5c; }
.door.elite { box-shadow: 0 5px 0 var(--edge), 0 0 0 3px #ff8a5c inset; }
.door.elite .arch { box-shadow: inset 0 0 0 5px #ff8a5c, inset 0 0 0 7px var(--edge), 0 3px 0 var(--edge); }
.door.boss .arch { box-shadow: inset 0 0 0 5px #e0794f, inset 0 0 0 7px var(--edge), 0 0 18px rgba(224, 121, 79, .7); }
/* écran titre, choix de l'automate, fin de partie */
.title { position: relative; }
.sound-btn { position: absolute; top: 0; right: 0; }
.models { display: flex; flex-direction: column; gap: 10px; }
.model { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px; color: var(--ink); background: linear-gradient(var(--panel2), var(--panel)); border: 3px solid var(--edge); border-radius: 16px; box-shadow: 0 4px 0 var(--edge); }
.model:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.model.locked { opacity: .55; box-shadow: none; border-style: dashed; }
.model-ic { font-size: 34px; width: 44px; text-align: center; flex: none; }
.model b { display: block; font-family: var(--game); font-weight: 400; font-size: 19px; color: var(--gold); }
.model small { color: var(--ink2); font-size: 13px; }
.score { display: flex; flex-direction: column; align-items: center; margin: 8px 0; }
.score small { color: var(--ink2); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.score b { font-family: var(--game); font-weight: 400; font-size: 54px; line-height: 1; color: var(--gold); text-shadow: 0 4px 0 var(--edge); animation: star-pop .5s cubic-bezier(.3, 1.6, .6, 1); }
.score em { font-style: normal; font-family: var(--game); color: var(--green); font-size: 16px; animation: blink 1s ease-in-out infinite; }
.end-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 8px; }
.end-stats span { font-size: 13px; background: rgba(0, 0, 0, .25); border-radius: 99px; padding: 3px 10px; }
.unlock { margin-top: 8px; padding: 8px; border-radius: 12px; background: rgba(255, 201, 60, .15); border: 2px solid var(--gold); color: var(--ink); animation: pulse 1s ease 2; }
.demo-goals { display: flex; gap: 10px; }
.demo-goal { display: flex; flex-direction: column; align-items: center; gap: 4px; font-family: var(--game); font-size: 13px; background: var(--panel2); border: 2px solid var(--edge); border-radius: 12px; padding: 10px 8px; }
.demo-goal b { font-size: 28px; font-weight: 400; }
/* les machines de Dédale : un engrenage de bronze qui tourne sur un socle */
.tile.machine { background: radial-gradient(circle, #3a2a20 55%, #2a1d16 75%); box-shadow: inset 0 0 0 2px #8f5524, inset 0 -4px 0 rgba(0, 0, 0, .4); z-index: 1; }
.tile.machine::before { content: '⚙'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(var(--cell) * .72); line-height: 1;
  color: #d08a3c; text-shadow: 0 2px 0 var(--edge), 0 0 10px rgba(255, 180, 90, .5); animation: spin 5s linear infinite; }
.tile.machine::after { content: ''; position: absolute; left: 50%; top: 50%; width: 22%; height: 22%; translate: -50% -50%; border-radius: 50%; background: #7ff0ff; border: 2px solid var(--edge);
  box-shadow: 0 0 8px #7ff0ff; }
.tile.machine.danger::before { color: #ff8a5c; }
.tile.machine.danger { box-shadow: inset 0 0 0 3px var(--red), 0 0 12px rgba(255, 68, 88, .6); animation: lever-glow 1s ease-in-out infinite; }
.tile.machine-hit::before { animation: spin .3s linear 3; color: #ff4458; }
.tile.machine-hit { animation: flash2 .5s ease-out; }
.tile.machine.cracked { box-shadow: inset 0 0 0 2px #ff8a5c, inset 0 -4px 0 rgba(0, 0, 0, .4); }
.tile.machine.cracked::before { color: #a8692f; animation-duration: 12s; text-shadow: 0 2px 0 var(--edge), 3px -3px 0 rgba(14, 9, 32, .6); }
.tile.machine.cracked::after { background: #ff8a5c; box-shadow: 0 0 8px #ff8a5c; }
.tile.rubble { background: radial-gradient(circle at 30% 40%, #6b5c99 0 14%, transparent 15%), radial-gradient(circle at 65% 60%, #5a4a85 0 17%, transparent 18%),
  radial-gradient(circle at 45% 75%, #8f5524 0 9%, transparent 10%), radial-gradient(circle at 70% 28%, #7a6aa8 0 10%, transparent 11%), linear-gradient(#2a2147, #1e1636); }
