/* Mamie Riposte : interface « atelier de mamie » (bois teinte, plaques de metal vissees, peint comme le decor).
   Les cadres peints sont dans ui/ et s'etirent en 9 morceaux (border-image) : les vis et les bords ne se deforment pas. */
@font-face { font-family: 'Bricolage'; src: url(polices/bricolage.woff2) format('woff2'); font-weight: 500 800; font-stretch: 75% 100%; font-display: block; }
@font-face { font-family: 'Atkinson'; src: url(polices/atkinson.woff2) format('woff2'); font-weight: 200 800; font-display: block; }
/* garde pour les textes dessines dans le canvas du jeu (render.js) */
@font-face { font-family: 'Lilita One'; src: url(polices/lilita-one.woff2) format('woff2'); font-display: block; }

:root {
  --ink: #2a1633; --ink2: #1c0f22; --cream: #fff4dc; --pink: #ff5c8a; --pinkd: #d12a62; --yellow: #ffcf3f; --mustard: #d9a63a;
  --goo: #9be564; --cyan: #5ce8ff; --wood: #3a2630; --steel: #b9bcc4; --muted: #d9c6b6;
  --display: "Bricolage", "Atkinson", system-ui, sans-serif;
  --body: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;
  --drop: drop-shadow(0 4px 0 rgba(10, 4, 14, 0.55));
  /* cadres peints */
  --bi-bois: url(ui/cadre_bois.webp) 52 fill / 24px stretch;
  --bi-planche: url(ui/planche.webp) 46 56 fill / 18px 22px stretch;
  --bi-metal: url(ui/plaque_metal.webp) 46 58 fill / 13px 17px stretch;
  --bi-creme: url(ui/plaque_creme.webp) 46 58 fill / 13px 17px stretch;
  --bi-rose: url(ui/plaque_rose.webp) 46 58 fill / 13px 17px stretch;
  --bi-moutarde: url(ui/plaque_moutarde.webp) 46 58 fill / 13px 17px stretch;
  --bi-sombre: url(ui/plaque_sombre.webp) 40 fill / 12px stretch;
  --bi-jauge: url(ui/jauge.webp) 34 46 fill / 10px 14px stretch;
  /* zones sures (encoche, barres) : Capacitor injecte --safe-area-inset-* dans l'appli Android, le navigateur fournit env() */
  --sa-t: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --sa-r: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
  --sa-b: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --sa-l: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #120a18; color: var(--cream); font-family: var(--body); font-weight: 600; user-select: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.hidden { display: none !important; }
h1, h2, h3, h4 { font-family: var(--display); font-stretch: 75%; font-weight: 800; margin: 0; letter-spacing: 0; line-height: 1; }
kbd { font-family: var(--display); font-stretch: 75%; font-weight: 800; color: var(--ink); border: solid transparent; border-width: 6px 8px; border-image: url(ui/plaque_metal.webp) 46 58 fill / 6px 8px stretch; padding: 0 3px; font-size: 0.92em; display: inline-block; line-height: 1.1; }
.muted { color: var(--muted); margin: 4px 0 12px; }
.coin { display: inline-block; width: 1.15em; height: 1.15em; background: url(ui/piece.webp) center / contain no-repeat; vertical-align: -0.22em; margin-right: 4px; }

/* ---------- Boutons : plaques de metal vissees ---------- */
.btn { font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 22px; line-height: 1.1; color: var(--ink); background: none;
  border: solid transparent; border-width: 13px 17px; border-image: var(--bi-metal); padding: 3px 14px; cursor: pointer;
  filter: var(--drop); transition: transform 0.08s, filter 0.12s; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45); min-height: 48px; }
.btn:hover { transform: translateY(-2px); filter: var(--drop) brightness(1.07); }
.btn:active { transform: translateY(3px); filter: drop-shadow(0 1px 0 rgba(10, 4, 14, 0.55)); }
.btn.big { font-size: 32px; padding: 6px 46px; border-image: var(--bi-rose); color: var(--ink); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn.small { font-size: 17px; padding: 0 8px; border-width: 10px 13px; border-image-width: 10px 13px; min-height: 44px; }
.btn.ghost { border-image: var(--bi-planche); color: var(--cream); text-shadow: 0 2px 0 var(--ink2); }
.btn.danger { color: #ffb3c4; }
.btn:not(.ghost).danger { color: #a3123f; }
.btn.off { filter: var(--drop) grayscale(0.85) brightness(0.8); opacity: 0.7; }
.btn.off:hover { transform: none; }

/* ---------- Ecrans ---------- */
#screen { position: fixed; inset: 0; z-index: 20; display: flex; align-items: safe center; justify-content: center; padding-block: calc(20px + var(--sa-t)) calc(20px + var(--sa-b)); padding-left: max(16px, var(--sa-l)); padding-right: max(16px, var(--sa-r)); overflow: auto; }
#screen.full { background: radial-gradient(ellipse at 30% 50%, rgba(18, 8, 24, 0.5), rgba(12, 5, 16, 0.9)); }
#screen.overlay { background: rgba(14, 6, 20, 0.64); backdrop-filter: blur(2px); }
#screen.overlay.dark { background: rgba(12, 5, 16, 0.86); }

.title { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
.logo { display: block; width: min(560px, 62vw); height: auto; transform: rotate(-2deg); filter: drop-shadow(0 12px 10px rgba(0, 0, 0, 0.45)); margin-bottom: -6px; }
.logo.anim { animation: logo 3.6s ease-in-out infinite; }
.tagline { font-family: var(--display); font-stretch: 75%; font-weight: 700; font-size: clamp(16px, 1.8vw, 22px); margin: 0 0 4px; color: var(--cream); max-width: 34em; text-shadow: 0 2px 0 var(--ink2), 0 0 12px var(--ink2); }
.accueil { width: 100%; max-width: 1180px; }
/* choix du personnage : portrait peint dans un hublot, plaque du nom en dessous */
.accueil .gauche, .accueil .droite { display: flex; flex-direction: column; align-items: center; gap: 12px; }
@media (min-aspect-ratio: 5/4) {
  .accueil { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: center; }
  .accueil .droite { border: 24px solid transparent; border-image: var(--bi-bois); padding: 6px 10px 10px; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5)); }
  .accueil .droite .quetes { border: 0; filter: none; padding: 0; min-width: 0; width: 100%; }
  .accueil .logo { width: min(540px, 42vw, 56vh); }
  .accueil .gauche { gap: 8px; } .accueil .menu { gap: 7px; }
}
.menu { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.menu .btn:not(.big):not(.small) { min-width: 300px; }
.foot { display: flex; gap: 16px; align-items: center; color: var(--muted); font-size: 15px; margin-top: 4px; flex-wrap: wrap; justify-content: center; text-shadow: 0 1px 0 var(--ink2); }
.wallet { font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 24px; color: var(--yellow); border: solid transparent; border-width: 10px 12px; border-image: var(--bi-sombre); border-image-width: 10px 12px; padding: 0 8px; white-space: nowrap; }
.wallet .coin { width: 26px; height: 26px; vertical-align: -6px; }
.vols { display: flex; gap: 12px 22px; font-size: 15px; color: var(--muted); flex-wrap: wrap; justify-content: center; align-items: center; }
.vols label { display: flex; align-items: center; gap: 8px; }
.vols input { accent-color: var(--pink); width: 120px; height: 28px; }

/* panneau = cadre de planches avec fond prune fonce peint */
.panel { border: 24px solid transparent; border-image: var(--bi-bois); padding: 8px 14px 10px; max-width: 660px; width: 100%; animation: pop 0.28s cubic-bezier(0.2, 1.3, 0.4, 1); max-height: calc(100vh - 40px); overflow: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5)); scrollbar-color: #6b4a5a transparent; }
.panel.wide { max-width: 1080px; }
.panel header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.panel h2 { font-size: 40px; color: var(--cream); text-shadow: 0 3px 0 var(--ink2); }
.panel h4 { font-size: 22px; color: var(--yellow); margin: 16px 0 8px; text-shadow: 0 2px 0 var(--ink2); }
.panel footer { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; align-items: center; }

.districts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.district { text-align: left; font: inherit; color: var(--cream); border: 16px solid transparent; border-image: url(ui/cadre_bois.webp) 52 / 16px stretch; background-clip: padding-box; padding: 10px 12px; cursor: pointer; filter: var(--drop); transition: transform 0.12s; position: relative; min-height: 196px; display: flex; flex-direction: column; text-shadow: 0 2px 0 rgba(20, 8, 26, 0.7); }
.district.d0 { background-color: #6a3f64; background-image: linear-gradient(160deg, #7a4a7c, #b0603f); }
.district.d1 { background-image: linear-gradient(160deg, #26356e, #5f4f9c); }
.district.d2 { background-image: linear-gradient(160deg, #14443f, #2d6b8a); }
.district.d3 { background-image: linear-gradient(160deg, #9c6e30, #2f6bb8); }
.district.d4 { background-image: linear-gradient(160deg, #2a3040, #4a5a5c); }
.district.d5 { background-image: linear-gradient(160deg, #a82f4c, #c98a2a); }
.district.d6 { background-image: linear-gradient(160deg, #3a6fa8, #8fb3cf); }
.district.d7 { background-image: linear-gradient(160deg, #5a1626, #2a1633); }
/* Acte II (session quartiers) */
.districts .acte { grid-column: 1 / -1; margin: 6px 0 -2px; font-size: 20px; color: var(--cream); text-shadow: 0 2px 0 rgba(20, 8, 26, 0.7); }
.district.d8 { background-image: linear-gradient(160deg, #1f4a66, #3d7a8a); }
.district.d9 { background-image: linear-gradient(160deg, #d08a3a, #2f8ab0); }
.district.d10 { background-image: linear-gradient(160deg, #1d5a52, #6fa89a); }
.district.d11 { background-image: linear-gradient(160deg, #6a7a2a, #a8702a); }
.district.d12 { background-image: linear-gradient(160deg, #4a4630, #8a6a20); }
.district.d13 { background-image: linear-gradient(160deg, #3a2a4a, #8a5a3a); }
.district.d14 { background-image: linear-gradient(160deg, #4a78b0, #b8cfe0); }
.district.d15 { background-image: linear-gradient(160deg, #6a4a8a, #c8a04a); }
.district.d16 { background-image: linear-gradient(160deg, #1e5a2a, #2a3a6a); }
.district.d17 { background-image: linear-gradient(160deg, #4a2a6a, #8a5aa8); }
.district:hover:not(.locked) { transform: translateY(-4px) rotate(-0.8deg); }
.district h3 { font-size: 27px; margin: 8px 0 4px; overflow-wrap: anywhere; hyphens: auto; }
.district p { margin: 0 0 8px; font-size: 15px; }
.district ul { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.55; flex: 1; }
.district .lvl { font-family: var(--display); font-stretch: 75%; font-weight: 800; color: var(--ink); text-shadow: none; border: solid transparent; border-width: 8px 10px; border-image: url(ui/plaque_moutarde.webp) 46 58 fill / 8px 10px stretch; padding: 0 4px; align-self: flex-start; font-size: 15px; line-height: 1.05; }
.district .best { font-family: var(--display); font-stretch: 75%; font-weight: 700; font-size: 15px; background: rgba(14, 6, 18, 0.55); border-radius: 4px; padding: 5px 9px; margin-top: 10px; }
.district.locked { filter: var(--drop) grayscale(0.85) brightness(0.55); cursor: not-allowed; }
.district.cata { background-image: linear-gradient(160deg, #5a1424, #1c0c18); cursor: default; }
.district.cata .modes { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }

.spells { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.spell { font: inherit; text-align: left; color: var(--cream); background: rgba(10, 4, 14, 0.45); border: 3px solid #5a3f4f; border-radius: 6px; padding: 9px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; position: relative; min-height: 48px; }
.spell b { font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 20px; color: var(--yellow); padding-right: 54px; }
.spell span { font-size: 14px; line-height: 1.3; color: var(--muted); }
.spell em { position: absolute; top: 9px; right: 10px; font-style: normal; font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 14px; color: var(--cream); background: var(--ink2); border-radius: 4px; padding: 1px 7px; }
.spell.on { border: solid transparent; border-width: 13px 17px; border-image: var(--bi-creme); background: none; padding: 0 0 2px; filter: var(--drop); }
.spell.on b { color: var(--pinkd); } .spell.on span { color: #4a3558; }
.spell.locked { opacity: 0.5; cursor: not-allowed; }
.btn.toggle { border-image: var(--bi-sombre); border-image-width: 10px 13px; color: var(--muted); text-shadow: none; }
.btn.toggle.yes { border-image: url(ui/plaque_creme.webp) 46 58 fill / 10px 13px stretch; color: var(--ink); }

.ups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.up { background: rgba(10, 4, 14, 0.45); border: 3px solid #5a3f4f; border-radius: 6px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.up h3 { font-size: 22px; color: var(--yellow); }
.up p { margin: 3px 0 6px; font-size: 14.5px; color: var(--muted); }
.up .btn { flex: none; }
.pips { display: flex; gap: 4px; }
.pips i { width: 22px; height: 10px; border-radius: 2px; background: rgba(0, 0, 0, 0.5); box-shadow: inset 0 0 0 2px #5a3f4f; }
.pips i.on { background: var(--yellow); box-shadow: inset 0 -3px 0 #a57a18; }
.up.locked { opacity: 0.55; filter: grayscale(0.5); }

.help { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; font-size: 15px; line-height: 1.5; }
.help h3 { color: var(--yellow); font-size: 24px; margin-bottom: 8px; }
.help ol { padding-left: 20px; margin: 0 0 8px; }
.help table { border-spacing: 0 7px; }
.help td { padding-right: 10px; vertical-align: middle; }

/* ---------- Cartes de bonus : cadre de planches, plaque du nom, gros objet peint, plaque de l'effet ---------- */
.cards { display: flex; gap: 14px; flex-wrap: wrap; }
.card { --fam: #fff; font: inherit; text-align: center; width: 236px; min-height: 316px; color: var(--cream); background: none; border: 22px solid transparent; border-image: url(ui/cadre_bois.webp) 52 fill / 22px stretch; padding: 0; position: relative; display: flex; flex-direction: column; cursor: default; filter: var(--drop); }
.card .nom { margin: -10px -12px 0; border: solid transparent; border-width: 12px 16px; border-image: var(--bi-creme); border-image-width: 12px 16px; padding: 0 2px 1px; color: var(--ink); position: relative; z-index: 1; }
.card h3 { font-size: 22px; line-height: 1; overflow-wrap: anywhere; hyphens: auto; }
.card .famn { display: block; font-family: var(--body); font-weight: 800; font-size: 12.5px; color: #6b4f5e; margin-top: 2px; }
.card .ico { flex: 1; display: grid; place-items: center; min-height: 104px; padding: 6px 0; background: radial-gradient(closest-side, color-mix(in srgb, var(--fam) 38%, transparent), transparent); }
.card .ico img { width: 98px; height: 98px; object-fit: contain; filter: drop-shadow(0 4px 0 rgba(10, 4, 14, 0.6)); }
.card p { margin: 0 -12px; border: solid transparent; border-width: 12px 16px; border-image: var(--bi-metal); border-image-width: 12px 16px; padding: 0 2px; font-family: var(--display); font-stretch: 85%; font-weight: 800; font-size: 17px; line-height: 1.12; color: var(--ink); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); }
.card .pied { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin: 7px -6px -8px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.card .lv { white-space: normal; line-height: 1.1; overflow-wrap: anywhere; }   /* « Jusqu'à 5 niveaux » ne doit pas etre coupe */
.card .rar { white-space: nowrap; color: var(--cream); }
.card .rar b { color: #a9a39a; letter-spacing: -1px; font-size: 15px; margin-right: 3px; }
.card.r1 .rar b { color: #74c6ff; } .card.r2 .rar b { color: var(--yellow); text-shadow: 0 0 8px rgba(255, 207, 63, 0.8); }
.card.r2 .ico { background: radial-gradient(closest-side, rgba(255, 207, 63, 0.5), color-mix(in srgb, var(--fam) 25%, transparent) 60%, transparent); }
.card.r2 { filter: var(--drop) drop-shadow(0 0 14px rgba(255, 207, 63, 0.55)); }
.card kbd { position: absolute; top: -26px; left: -26px; z-index: 3; font-size: 15px; }
.card .badge { position: absolute; top: -24px; right: -20px; z-index: 3; font-style: normal; font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 13px; color: var(--ink); border: solid transparent; border-width: 7px 9px; border-image: url(ui/plaque_moutarde.webp) 46 58 fill / 7px 9px stretch; padding: 0 2px; line-height: 1.1; transform: rotate(5deg); white-space: nowrap; }
.card .badge.t2 { border-image-source: url(ui/plaque_metal.webp); } .card .badge.ult { border-image-source: url(ui/plaque_rose.webp); }
.card .badge.duo { border-image-source: url(ui/plaque_creme.webp); } .card .badge.defi { border-image-source: url(ui/plaque_rose.webp); }
.card.evo { filter: var(--drop) drop-shadow(0 0 16px rgba(255, 207, 63, 0.8)); }
.card.unseen, .card.locked { filter: grayscale(0.6) brightness(0.75); }
.card.unseen .ico, .card.locked .ico { font-family: var(--display); font-weight: 800; font-size: 64px; color: #8a7480; background: none; }
.card.unseen p, .card.locked p { font-family: var(--body); font-weight: 700; font-size: 13.5px; }
.collection section { margin-bottom: 22px; }
.collection section > h3 { color: var(--cream); font-size: 28px; display: flex; align-items: center; gap: 8px; text-shadow: 0 2px 0 var(--ink2); }
.collection section > h3 img { width: 40px; height: 40px; object-fit: contain; }
.collection section > h3::after { content: ""; flex: 1; height: 4px; border-radius: 2px; background: var(--fam, #6b4a5a); opacity: 0.7; margin-left: 6px; }
.collection .bonus { display: flex; gap: 18px; font-size: 14px; color: var(--muted); margin: 4px 0 12px; flex-wrap: wrap; }
.collection .cards { gap: 16px 12px; padding-top: 8px; }
.collection .card { width: 196px; min-height: 270px; }
.collection .card h3 { font-size: 19px; } .collection .card p { font-size: 15px; } .collection .card .ico img { width: 78px; height: 78px; }

.levelup { text-align: center; animation: pop 0.28s cubic-bezier(0.2, 1.4, 0.4, 1); }
.levelup h2 { display: inline-block; font-size: 60px; color: var(--cream); border: solid transparent; border-width: 18px 22px; border-image: var(--bi-planche); padding: 0 28px 2px; text-shadow: 0 4px 0 var(--ink2); transform: rotate(-1.5deg); filter: var(--drop); }
.levelup > p { font-family: var(--display); font-stretch: 75%; font-weight: 700; font-size: 22px; margin: 8px 0 20px; text-shadow: 0 2px 0 var(--ink2); }
.pick { justify-content: center; gap: 22px; }
.pick .card { width: 248px; min-height: 340px; cursor: pointer; transition: transform 0.12s; animation: deal 0.38s backwards cubic-bezier(0.2, 1.3, 0.4, 1); }
.pick .card:nth-child(2) { animation-delay: 0.06s; } .pick .card:nth-child(3) { animation-delay: 0.12s; }
.pick .card:hover { transform: translateY(-10px) rotate(-1.2deg) scale(1.03); }
.pick .card h3 { font-size: 25px; } .pick .card p { font-size: 19px; } .pick .card .ico img { width: 116px; height: 116px; }
.levelup .row { display: flex; gap: 18px; justify-content: center; align-items: center; margin-top: 24px; flex-wrap: wrap; }

.fams { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { --fam: #fff; display: flex; align-items: center; gap: 3px; background: rgba(14, 6, 18, 0.72); border: 2px solid #4a3240; color: var(--muted); border-radius: 4px; padding: 1px 7px 1px 3px; font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 16px; }
.chip img { width: 22px; height: 22px; object-fit: contain; }
.chip.on { color: var(--cream); border-color: var(--fam); }
.chip.max { box-shadow: 0 0 0 2px var(--fam), 0 0 12px var(--fam); }
.owned { display: flex; flex-wrap: wrap; gap: 6px; }
.mini { --fam: #fff; display: flex; align-items: center; gap: 6px; color: var(--ink); border: solid transparent; border-width: 8px 10px; border-image: url(ui/plaque_creme.webp) 46 58 fill / 8px 10px stretch; padding: 0 2px; font-size: 14px; font-weight: 800; }
.mini img { width: 22px; height: 22px; object-fit: contain; }
.mini b { font-family: var(--display); font-stretch: 75%; background: var(--ink); color: var(--cream); border-radius: 3px; padding: 0 6px; }
.fambonus { margin-top: 12px; font-size: 13.5px; line-height: 1.7; }
.fambonus b { color: var(--fam); font-family: var(--display); font-stretch: 75%; font-size: 16px; margin-right: 6px; }
.fambonus span { opacity: 0.45; margin-right: 10px; } .fambonus span.ok { opacity: 1; color: var(--goo); }

.end { text-align: center; max-width: 640px; }
.end h1 { display: inline-block; font-size: 50px; color: var(--cream); border: solid transparent; border-width: 18px 22px; border-image: var(--bi-planche); padding: 0 22px 2px; text-shadow: 0 4px 0 var(--ink2); transform: rotate(-1.5deg); margin: 4px 0 4px; }
.end.win h1 { color: var(--goo); } .end.lose h1 { color: #ff8fae; }
.end .sub { margin: 10px 0 16px; font-size: 17px; color: var(--cream); }
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.stats4 div { border: solid transparent; border-width: 12px; border-image: var(--bi-sombre); padding: 0 2px; }
.stats4 b { display: block; font-family: var(--display); font-stretch: 75%; font-size: 32px; color: var(--yellow); } .stats4 span { font-size: 13px; color: var(--muted); }
.bill { width: 100%; border-collapse: collapse; font-size: 16px; }
.bill td { padding: 5px 8px; text-align: left; } .bill td:last-child { text-align: right; font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 19px; }
.bill .tot td { border-top: 3px solid #5a3f4f; font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 25px; color: var(--yellow); padding-top: 9px; }
.unlock { margin-top: 12px; color: var(--ink); font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 20px; border: solid transparent; border-width: 12px 16px; border-image: var(--bi-moutarde); padding: 0 4px; animation: wob 1.6s ease-in-out infinite; }
.unlock.alt { border-image-source: url(ui/plaque_creme.webp); }
.end footer { justify-content: center; }

/* ---------- ATH ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; font-family: var(--display); font-stretch: 75%; font-weight: 800; }
#hud > div { position: absolute; }
.tl { top: 14px; left: 14px; width: min(350px, 31vw); display: flex; flex-direction: column; gap: 4px; padding-left: 54px; }
.tl::before { content: ""; position: absolute; left: 0; top: -4px; width: 62px; height: 62px; background: url(ui/coeur.webp) 52% 55% / 56% no-repeat, url(ui/hublot.webp) center / contain no-repeat; z-index: 2; filter: drop-shadow(0 3px 0 rgba(10, 4, 14, 0.5)); }
.bar { position: relative; height: 38px; border: solid transparent; border-width: 10px 14px; border-image: var(--bi-jauge); filter: drop-shadow(0 3px 0 rgba(10, 4, 14, 0.5)); }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; transition: width 0.15s; border-radius: 2px; }
.bar span { position: absolute; inset: -4px 0; display: flex; align-items: center; justify-content: center; font-size: 17px; color: var(--cream); text-shadow: 0 1px 0 var(--ink2), 0 0 4px var(--ink2), 0 0 2px var(--ink2); }
.bar.hp i { background: linear-gradient(#ff8aa8, #e0336a 60%, #b81f52); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35); }
.bar.hp.low { animation: shake 0.4s infinite; } .bar.hp.low i { background: linear-gradient(#ff6b5c, #c41c1c); }
.bar.xp { height: 26px; border-width: 7px 11px; border-image-width: 7px 11px; margin-left: 4px; }
.bar.xp i { background: linear-gradient(#ffe27a, #e8a923); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4); }
.bar.xp span { font-size: 13px; }
.tl .fams { margin-top: 4px; margin-left: -50px; }

.tc { top: 12px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(540px, 40vw); }
#objective { color: var(--ink); border: solid transparent; border-width: 12px 16px; border-image: var(--bi-creme); padding: 0 6px; font-size: 21px; filter: var(--drop); text-align: center; line-height: 1.05; }
#objective b { color: var(--pinkd); } #objective small { display: block; font-family: var(--body); font-size: 13px; font-weight: 800; color: #6b5478; margin-top: 2px; }
#objective.go { border-image-source: url(ui/plaque_moutarde.webp); animation: wob 1.2s ease-in-out infinite; }
.threat { display: flex; align-items: center; gap: 10px; background: rgba(14, 6, 18, 0.72); border: 2px solid #4a3240; border-radius: 4px; padding: 2px 12px; font-size: 16px; }
.threat b { font-weight: 800; color: #ffb0b0; min-width: 120px; text-align: right; }
.tpips { display: flex; gap: 3px; } .tpips i { width: 12px; height: 10px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); }
.tpips i.on { background: #ff5c5c; box-shadow: 0 0 6px #ff5c5c; }
#bossBar { width: 100%; text-align: center; font-size: 19px; color: #ffb0b0; text-shadow: 0 2px 0 var(--ink2); }
#bossBar div { position: relative; height: 32px; border: solid transparent; border-width: 9px 13px; border-image: url(ui/jauge.webp) 34 46 fill / 9px 13px stretch; margin-top: 2px; }
#bossBar i { position: absolute; inset: 0 auto 0 0; display: block; background: linear-gradient(#ff7b5c, #b81c1c); transition: width 0.15s; border-radius: 2px; }

.tr { top: 14px; right: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.bl { bottom: 14px; left: 14px; pointer-events: none; }
#mini { display: block; width: 236px; height: 236px; border: 14px solid transparent; border-image: url(ui/cadre_bois.webp) 52 / 14px stretch; background: #1c1024; background-clip: padding-box; filter: var(--drop); }
.counters { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 196px; }
.counters div { background: rgba(14, 6, 18, 0.75); border: 2px solid #4a3240; border-radius: 4px; padding: 1px 8px 1px 3px; font-size: 19px; display: flex; align-items: center; gap: 4px; }
.counters .coin { width: 24px; height: 24px; margin: 0; }
.ic { display: inline-block; width: 24px; height: 24px; flex: none; background: center / contain no-repeat; }
.ic.cat { background-image: url(ui/chat.webp); }
.ic.skull { background-image: url(ui/zombie.webp); }
.ic.clock { background-image: url(ui/horloge.webp); }

.br { bottom: 14px; right: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#weapons { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.wslot { display: flex; align-items: center; gap: 8px; border: solid transparent; border-width: 9px 11px; border-image: url(ui/plaque_sombre.webp) 40 fill / 9px 11px stretch; padding: 0 6px 0 0; font-size: 16px; color: var(--muted); }
.wslot .k { background: rgba(255, 255, 255, 0.14); border-radius: 3px; width: 22px; text-align: center; }
.wslot b { font-weight: 800; }
.wslot img { height: 26px; margin: -4px -2px; } .wslot:not(.on) img { height: 18px; opacity: 0.8; }
.wslot.on { border-image: url(ui/plaque_metal.webp) 46 58 fill / 12px 16px stretch; border-width: 12px 16px; color: var(--ink); font-size: 22px; filter: var(--drop); padding: 0 4px; }
.wslot.on .k { background: var(--ink); color: var(--cream); } .wslot.on em { font-style: normal; color: var(--pinkd); min-width: 74px; text-align: right; }
.wslot.empty { opacity: 0.55; }
.abils { display: flex; gap: 6px; }
.ab { position: relative; width: 104px; height: 58px; color: var(--ink); border: solid transparent; border-width: 10px 13px; border-image: url(ui/plaque_metal.webp) 46 58 fill / 10px 13px stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; filter: var(--drop); }
.ab i { position: absolute; left: -4px; right: -4px; bottom: -3px; height: 0; background: rgba(28, 15, 34, 0.72); border-radius: 2px; }
.ab b { font-weight: 800; font-size: 16px; position: relative; line-height: 1; }
.ab span { font-family: var(--body); font-weight: 800; font-size: 11px; position: relative; color: #4a3a52; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bc { bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(660px, 46vw); }
#toasts { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.toast { background: rgba(14, 6, 18, 0.88); border: 2px solid #4a3240; border-left: 7px solid var(--cream); border-radius: 4px; padding: 5px 14px; font-size: 18px; animation: toast 3.8s forwards; text-align: center; }
.toast.good { border-left-color: var(--goo); } .toast.bad { border-left-color: #ff5c5c; color: #ffc9c9; }
#prompt { color: var(--ink); border: solid transparent; border-width: 12px 16px; border-image: var(--bi-moutarde); padding: 0 6px; font-size: 22px; filter: var(--drop); animation: wob 0.9s ease-in-out infinite; }
#prompt kbd { margin-right: 10px; }
#tuto { font-family: var(--body); font-weight: 800; font-size: 14.5px; background: rgba(14, 6, 18, 0.82); border-radius: 4px; padding: 6px 14px; opacity: 0; transition: opacity 1s; text-align: center; }
#tuto.show { opacity: 1; } #tuto b { font-family: var(--display); font-stretch: 75%; font-weight: 800; color: var(--yellow); }

#announce { top: 22%; left: 50%; transform: translateX(-50%); text-align: center; width: 90vw; }
#announce div { animation: announce 2.6s forwards cubic-bezier(0.2, 1.3, 0.4, 1); }
#announce b { display: block; font-weight: 800; font-size: clamp(38px, 5.6vw, 76px); color: var(--yellow); -webkit-text-stroke: 9px var(--ink2); paint-order: stroke fill; transform: rotate(-2deg); line-height: 1.05; }
#announce .bad b { color: #ff6b6b; }
#announce span { font-size: clamp(16px, 1.9vw, 25px); text-shadow: 0 2px 0 var(--ink2), 0 0 8px var(--ink2); }
#combo { right: 26px; top: 46%; text-align: center; opacity: 0; transform: scale(0.6) rotate(6deg); transition: opacity 0.2s, transform 0.2s; }
#combo.show { opacity: 1; transform: scale(1) rotate(6deg); }
#combo b { display: block; font-weight: 800; font-size: 62px; color: var(--goo); -webkit-text-stroke: 7px var(--ink2); paint-order: stroke fill; line-height: 1; }
#combo span { font-size: 18px; text-shadow: 0 2px 0 var(--ink2); }

/* ---------- Manette ---------- */
body.pad, body.pad #game, body.pad .btn, body.pad .card, body.pad .district { cursor: none; }
.padfocus { outline: 5px solid var(--cyan) !important; outline-offset: 4px; transform: translateY(-4px) scale(1.04); z-index: 3; }
.pick .card.padfocus { transform: translateY(-10px) rotate(-1.2deg) scale(1.05); }

@keyframes pop { from { transform: scale(0.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes deal { from { transform: translateY(60px) rotate(6deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wob { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(1deg) scale(1.02); } }
@keyframes logo { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(-0.5deg) scale(1.015); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes toast { 0% { opacity: 0; transform: translateY(10px); } 6%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes announce { 0% { opacity: 0; transform: scale(0.4); } 12% { opacity: 1; transform: scale(1.08); } 20%, 78% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.15); } }

@media (max-width: 900px) {
  .help { grid-template-columns: 1fr; } .ups { grid-template-columns: 1fr; }
  #mini { width: 176px; height: 176px; } .counters { width: 130px; grid-template-columns: 1fr; }
}

/* ---------- Tactile (telephone) ---------- */
/* Principe : le centre de l'ecran reste libre. Infos fines en haut, deux boutons en bas a droite. */
body.touch { touch-action: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; overscroll-behavior: none; }
body.touch #game { cursor: default; }
body.touch #screen { touch-action: pan-y; }
#touch { position: fixed; inset: 0; z-index: 12; --st: var(--sa-t); --sb: var(--sa-b); --sl: var(--sa-l); --sr: var(--sa-r); }
#touch .tzone { position: absolute; top: 0; bottom: 0; touch-action: none; }
#touch .tzone.move { left: 0; width: 100%; }
#touch .tzone.aim { display: none; right: 0; width: 50%; }
#touch.manual .tzone.move { width: 50%; }
#touch.manual .tzone.aim { display: block; }
.tstick { position: absolute; width: 116px; height: 116px; margin: -58px 0 0 -58px; border-radius: 50%; background: url(ui/hublot.webp) center / contain no-repeat; opacity: 0; transition: opacity 0.12s; pointer-events: none; }
.tstick.on { opacity: 0.85; }
.tstick i { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #fff, var(--cream) 45%, #d9c4a0); border: 3px solid var(--ink2); box-shadow: 0 3px 0 var(--ink2); }
#touch .tzone.aim .tstick i { background: radial-gradient(circle at 38% 32%, #ffc0d0, var(--pink) 55%, #b8204f); }

.tbtn { position: absolute; font-family: var(--display); font-stretch: 75%; font-weight: 800; color: var(--ink); border: 0; background: none; touch-action: none; padding: 0; margin: 0; filter: drop-shadow(0 4px 0 rgba(10, 4, 14, 0.55)); }
.tbtn.on { transform: translateY(3px); filter: drop-shadow(0 1px 0 rgba(10, 4, 14, 0.55)); }
.tbtn.round { --cd: 0; --rc: var(--pink); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; overflow: hidden;
  background: radial-gradient(circle closest-side, color-mix(in srgb, var(--rc) 70%, #fff) 0, var(--rc) 45%, color-mix(in srgb, var(--rc) 75%, #000) 70%, transparent 72%), url(ui/hublot.webp) center / 100% 100% no-repeat; }
.tbtn.round svg { width: 40%; height: 40%; position: relative; z-index: 1; }
.tbtn.round span { font-size: 12px; line-height: 1; position: relative; z-index: 1; max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbtn.round::after { content: ""; position: absolute; inset: 13%; border-radius: 50%; background: conic-gradient(rgba(28, 15, 34, 0.78) calc(var(--cd) * 1%), transparent 0); }
.tbtn.dash { right: calc(18px + var(--sr)); bottom: calc(20px + var(--sb)); width: 90px; height: 90px; }
.tbtn.dash em { position: absolute; top: 15px; right: 20px; z-index: 2; font-style: normal; font-size: 15px; color: var(--cream); text-shadow: 0 1px 0 var(--ink2); }
.tbtn.spell { --rc: var(--yellow); right: calc(116px + var(--sr)); bottom: calc(12px + var(--sb)); width: 72px; height: 72px; }
.tbtn.spell.ready { animation: ready 1.4s ease-in-out infinite; }
.tbtn.weapon { right: calc(14px + var(--sr)); bottom: calc(122px + var(--sb)); height: 40px; border: solid transparent; border-width: 9px 12px; border-image: url(ui/plaque_metal.webp) 46 58 fill / 9px 12px stretch; display: flex; align-items: center; gap: 5px; padding: 0 2px; font-size: 13px; }
.tbtn.weapon img { height: 26px; margin: -6px 0; }
.tbtn.weapon b { font-weight: 800; display: none; }
.tbtn.weapon small { font-size: 14px; color: var(--pinkd); min-width: 34px; text-align: right; }
.tbtn.weapon.swap::before { content: "⇄"; font-family: var(--body); font-weight: 800; font-size: 15px; margin-left: 2px; }
.tbtn.act { left: 50%; bottom: calc(28px + var(--sb)); transform: translateX(-50%); border: solid transparent; border-width: 12px 16px; border-image: var(--bi-moutarde); padding: 2px 8px; font-size: 20px; white-space: nowrap; max-width: 62vw; overflow: hidden; text-overflow: ellipsis; animation: ready 1s ease-in-out infinite; }
.tbtn.act.on { transform: translateX(-50%) translateY(3px); }
.tbtn.pause { top: calc(8px + var(--st)); right: calc(8px + var(--sr)); width: 44px; height: 40px; border: solid transparent; border-width: 9px 11px; border-image: url(ui/plaque_metal.webp) 46 58 fill / 9px 11px stretch; display: flex; align-items: center; justify-content: center; gap: 4px; }
.tbtn.pause i { width: 4px; height: 13px; background: var(--ink); border-radius: 1px; }
@keyframes ready { 0%, 100% { filter: drop-shadow(0 4px 0 rgba(10, 4, 14, 0.55)) drop-shadow(0 0 0 rgba(255, 207, 63, 0)); } 50% { filter: drop-shadow(0 4px 0 rgba(10, 4, 14, 0.55)) drop-shadow(0 0 9px rgba(255, 207, 63, 0.85)); } }

/* ATH compact */
body.touch .br, body.touch .threat, body.touch #prompt, body.touch .fams { display: none; }
body.touch .tl { top: calc(6px + var(--sa-t)); left: calc(8px + var(--sa-l)); width: 168px; gap: 1px; padding-left: 34px; }
body.touch .tl::before { width: 40px; height: 40px; top: -2px; }
body.touch .bar { height: 26px; border-width: 7px 10px; border-image-width: 7px 10px; }
body.touch .bar span { font-size: 12.5px; }
body.touch .bar.xp { height: 18px; border-width: 5px 8px; border-image-width: 5px 8px; } body.touch .bar.xp span { font-size: 10.5px; }
body.touch .tc { top: calc(6px + var(--sa-t)); width: auto; max-width: calc(100vw - 340px); gap: 3px; }
body.touch #objective { font-size: 14px; border-width: 8px 11px; border-image-width: 8px 11px; padding: 0 3px; }
body.touch #objective small { display: none; }
body.touch #bossBar { font-size: 13px; min-width: 160px; } body.touch #bossBar div { height: 20px; border-width: 6px 9px; border-image-width: 6px 9px; }
body.touch .tr { top: calc(8px + var(--sa-t)); right: calc(58px + var(--sa-r)); gap: 3px; }
body.touch .bl { bottom: calc(10px + var(--sa-b)); left: calc(10px + var(--sa-l)); }
body.touch #mini { width: 118px; height: 118px; border-width: 9px; border-image-width: 9px; opacity: 0.94; }
body.touch .counters { width: auto; display: flex; gap: 3px; white-space: nowrap; }
body.touch .counters div { flex: 1; font-size: 13px; padding: 0 5px 0 2px; border-width: 1.5px; justify-content: center; }
body.touch .counters div:nth-child(n + 3) { display: none; }
body.touch .counters .coin, body.touch .counters .ic { width: 16px; height: 16px; margin-right: 1px; }
body.touch .bc { bottom: auto; top: calc(46px + var(--sa-t)); width: min(440px, 72vw); gap: 4px; }
body.touch .toast { font-size: 13px; padding: 3px 10px; border-left-width: 5px; }
body.touch #tuto { font-size: 12.5px; padding: 4px 10px; }
body.touch #combo { right: calc(14px + var(--sa-r)); top: 36%; } body.touch #combo b { font-size: 34px; -webkit-text-stroke: 5px var(--ink2); } body.touch #combo span { font-size: 12px; }
body.touch #announce { top: 20%; } body.touch #announce b { font-size: clamp(26px, 6vw, 46px); -webkit-text-stroke: 6px var(--ink2); } body.touch #announce span { font-size: 14px; }

@media (pointer: coarse) and (orientation: portrait) {
  body.touch .tc { top: calc(52px + var(--sa-t)); max-width: 62vw; left: calc(8px + var(--sa-l)); transform: none; align-items: flex-start; }
  body.touch .bc { top: calc(100px + var(--sa-t)); width: 86vw; }
  .tbtn.act { bottom: calc(130px + var(--sb)); }
}
@media (pointer: coarse), (max-height: 540px) {
  .panel { border-width: 16px; border-image-width: 16px; padding: 4px 8px 8px; max-height: none; } .panel h2 { font-size: 28px; } .panel.wide { max-width: 780px; }
  .panel h4 { font-size: 19px; margin-top: 12px; }
  .menu { gap: 6px; } .menu .btn:not(.big):not(.small) { min-width: 220px; font-size: 18px; }
  .btn { font-size: 18px; border-width: 11px 14px; border-image-width: 11px 14px; padding: 1px 8px; min-height: 44px; }
  .btn.big { font-size: 26px; padding: 3px 34px; border-width: 13px 17px; border-image-width: 13px 17px; }
  .btn.small { font-size: 15px; border-width: 9px 12px; border-image-width: 9px 12px; padding: 0 6px; min-height: 40px; }
  .title { gap: 8px; } .tagline { margin: 0; font-size: 15px; }
  .districts, .spells { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 8px; }
  .district { min-height: 0; padding: 4px 6px; border-width: 11px; border-image-width: 11px; } .district h3 { font-size: 20px; margin: 4px 0 2px; } .district p { font-size: 12.5px; margin-bottom: 5px; } .district ul { font-size: 12px; line-height: 1.4; } .district .best { font-size: 12.5px; margin-top: 6px; }
  .spell b { font-size: 16px; } .spell span { font-size: 12px; }
  .levelup h2 { font-size: 34px; border-width: 12px 16px; border-image-width: 12px 16px; padding: 0 16px; } .levelup > p { font-size: 15px; margin: 4px 0 10px; }
  .levelup { width: 100%; max-width: 800px; } .levelup .row { margin-top: 12px; }
  .pick { gap: 10px; } .card kbd { display: none; }
  .pick .card { flex: 1 1 150px; width: auto; max-width: 240px; min-height: 0; border-width: 16px; border-image-width: 16px; }
  .pick .card h3 { font-size: 18px; } .pick .card p { font-size: 15px; } .pick .card .ico { min-height: 64px; } .pick .card .ico img { width: 68px; height: 68px; }
  .card .nom, .card p { border-width: 9px 12px; border-image-width: 9px 12px; margin-left: -8px; margin-right: -8px; }
  .card .pied { font-size: 11px; margin: 5px -4px -4px; }
  .end h1 { font-size: 32px; border-width: 12px 16px; border-image-width: 12px 16px; padding: 0 14px; } .stats4 b { font-size: 22px; } .stats4 span { font-size: 11px; }
  .collection .card { width: calc(50% - 6px); min-height: 0; }
  .logo { width: min(420px, 52vw); }
}
@media (max-height: 520px) {
  #screen { padding-block: calc(8px + var(--sa-t)) calc(8px + var(--sa-b)); }
  .accueil { gap: 12px; grid-template-columns: 0.85fr 1.15fr; }
  .accueil .droite .btn.small { font-size: 13px; min-height: 34px; border-width: 7px 9px; border-image-width: 7px 9px; padding: 0 2px; }
  .langs { flex-basis: auto; }
  .accueil .gauche, .accueil .droite { gap: 6px; }
  .accueil .logo { width: auto; height: 31vh; margin-bottom: -4px; }
  .tagline { display: none; }
  .menu { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px 6px; } .menu .btn.big { flex-basis: 100%; max-width: 280px; font-size: 22px; border-width: 11px 15px; border-image-width: 11px 15px; padding: 0 20px; }
  .accueil .droite .vols { gap: 4px 8px; } .accueil .jour .btn { font-size: 16px; border-width: 9px 12px; border-image-width: 9px 12px; min-height: 40px; }
  .menu .btn:not(.big):not(.small) { min-width: 0; font-size: 16px; border-width: 9px 12px; border-image-width: 9px 12px; padding: 0 4px; min-height: 42px; }
  .accueil .droite { border-width: 14px; border-image-width: 14px; padding: 2px 6px 4px; }
  .accueil .foot { display: none; }
  .perso i { width: 54px; height: 54px; } .perso b { font-size: 13px; margin-top: -8px; border-width: 6px 9px; border-image-width: 6px 9px; } .persos { gap: 10px; }
  .levelup h2 { font-size: 28px; border-width: 10px 14px; border-image-width: 10px 14px; } .levelup > p { margin: 2px 0 4px; font-size: 14px; }
  .pick .card .ico { min-height: 0; padding: 2px 0; } .pick .card .ico img { width: 52px; height: 52px; }
  .levelup .row { margin-top: 6px; }
  .accueil .droite::before { content: none; }
  .wallet { font-size: 19px; } .wallet .coin { width: 20px; height: 20px; vertical-align: -4px; }
  .jour { gap: 6px; margin: 0; } .jour .cadeau { gap: 4px; }
  .serie i { width: 26px; height: 22px; font-size: 10.5px; }
  .quete { font-size: 12px; padding: 0; } .quetes h4 { font-size: 15px; margin: 0; }
  .vols { gap: 4px 10px; font-size: 12.5px; } .vols input { width: 72px; height: 20px; } .vols label { gap: 4px; }
  .langs .btn { font-size: 13px; min-height: 34px; border-width: 7px 9px; border-image-width: 7px 9px; }
}
@media (pointer: coarse) and (orientation: portrait) {
  .pick { flex-direction: column; align-items: stretch; } .pick .card { flex: none; max-width: none; }
  .stats4 { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .tbtn.spell.ready, .tbtn.act, .logo.anim, #objective.go, .unlock, #prompt { animation: none; } }

/* ecran « Revoir une cinematique » */
.cines { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.cines .btn { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; text-align: left; line-height: 1.15; }
.cines .btn b { grid-row: span 2; font-size: 1.3em; min-width: 1.4em; text-align: center; }
.cines .btn small { grid-column: 2; font-size: 0.72em; opacity: 0.75; font-weight: 600; }
.cines .btn span:only-of-type:last-child { grid-row: span 2; }
/* ---------- Cinematique d'ouverture ---------- */
#intro { position: fixed; inset: 0; z-index: 40; background: #120a18; transition: opacity 0.4s; touch-action: none; user-select: none; -webkit-user-select: none; }
#intro.out { opacity: 0; pointer-events: none; }
#intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* cartons facon bulle de BD : plaque creme peinte, en bas, courts */
#intro .carton { position: absolute; left: 50%; bottom: calc(16px + var(--sa-b)); width: max-content; box-sizing: border-box; max-width: min(760px, calc(100vw - 48px)); transform: translate(-50%, 14px) rotate(-0.6deg);
  font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: clamp(17px, 1.6vw + 1.6vh, 30px); line-height: 1.12; color: var(--ink); text-align: center; text-wrap: balance;
  border: solid transparent; border-width: 13px 17px; border-image: var(--bi-creme); padding: 1px 10px 2px; opacity: 0; transition: opacity 0.28s, transform 0.28s cubic-bezier(.2,1.6,.4,1); pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(10,6,24,0.55)); }
#intro .carton.on { opacity: 1; transform: translate(-50%, 0) rotate(-0.6deg); }
/* carton fort : la replique, au milieu, plus grande, en lettres claires */
#intro .carton.fort { bottom: auto; top: 86%; max-width: calc(100vw - 48px); border-image: url(ui/plaque_sombre.webp) 40 fill / 13px 17px stretch; color: var(--cream); font-size: clamp(24px, 3vw + 2.4vh, 48px); transform: translate(-50%, -50%) scale(1.5) rotate(-2deg); text-shadow: 0 2px 0 var(--ink2); }
#intro .carton.haut { bottom: auto; top: calc(10px + var(--sa-t)); max-width: min(640px, calc(100vw - 190px)); }
/* carton en coin (haut gauche) : la replique de mamie sans lui cacher le visage */
#intro .carton.angle { left: calc(16px + var(--sa-l)); bottom: auto; top: calc(14px + var(--sa-t)); max-width: min(420px, 38vw); transform: translate(0, -10px) rotate(-2deg); }
#intro .carton.angle.on { transform: translate(0, 0) rotate(-2deg); }
#intro .carton.fort.on { transform: translate(-50%, -50%) scale(1) rotate(-2deg); }
#intro .skip { position: absolute; top: calc(10px + var(--sa-t)); right: calc(12px + var(--sa-r)); font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 16px; color: var(--cream); background: none; border: solid transparent; border-width: 9px 11px; border-image: url(ui/plaque_sombre.webp) 40 fill / 9px 11px stretch; padding: 0 8px; cursor: pointer; min-height: 44px; min-width: 64px; opacity: 0.85; }
#intro .skip::after { content: " »"; }
@media (orientation: portrait) {
  #intro .carton.angle { max-width: calc(100vw - 120px); }
  #intro .carton, #intro .carton.haut { top: auto; bottom: calc(9vh + var(--sa-b)); }
  #intro .carton.fort { top: auto; bottom: calc(9vh + var(--sa-b)); transform: translate(-50%, 0) scale(1.4) rotate(-2deg); }
  #intro .carton.fort.on { transform: translate(-50%, 0) rotate(-2deg); }
}

.btn.ad { border-image-source: url(ui/plaque_moutarde.webp); }
.btn.ad::before { content: ""; display: inline-block; width: 0; height: 0; border-left: 0.62em solid var(--ink); border-top: 0.4em solid transparent; border-bottom: 0.4em solid transparent; margin-right: 0.5em; }
.end .btn.ad { margin-top: 14px; }

.shopmsg { margin: 14px 0 0; font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 19px; color: var(--goo); }

.langs { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; flex-basis: 100%; }
.langs .btn { font-size: 15px; min-width: 0; border-image: url(ui/plaque_sombre.webp) 40 fill / 9px 11px stretch; border-width: 9px 11px; color: var(--muted); text-shadow: none; padding: 0 3px; min-height: 40px; }
.langs .btn.on { border-image: url(ui/plaque_moutarde.webp) 46 58 fill / 9px 11px stretch; color: var(--ink); }

/* ---- Progression longue ---- */
.jour { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: stretch; margin: 4px 0; max-width: 600px; }
.jour .cadeau { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.jour .cadeau > span { font-weight: 800; color: var(--muted); text-shadow: 0 1px 0 var(--ink2); }
.serie { display: flex; gap: 3px; }
.serie i { font-style: normal; font-size: 11.5px; font-weight: 800; width: 31px; height: 27px; display: grid; place-items: center; border-radius: 3px; background: rgba(14, 6, 18, 0.7); border: 2px solid #4a3240; color: #b9a8b4; }
.serie i.on { background: var(--yellow); color: var(--ink); border-color: #a57a18; } .serie i.auj { outline: 2px solid var(--cream); }
.quetes { border: 14px solid transparent; border-image: url(ui/cadre_bois.webp) 52 fill / 14px stretch; padding: 0 6px 2px; min-width: 280px; text-align: left; filter: var(--drop); }
.quetes h4 { margin: 0 0 4px; font-size: 17px; color: var(--yellow); }
.quete { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; font-size: 13.5px; padding: 2px 0; }
.quete b { font-family: var(--display); font-stretch: 75%; } .quete em { font-style: normal; opacity: 0.75; } .quete.ok span { color: var(--yellow); }
.defis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.defi { position: relative; background: rgba(10, 4, 14, 0.45); border: 3px solid #5a3f4f; border-radius: 5px; padding: 8px 10px 14px; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.defi i { position: absolute; left: 0; bottom: 0; height: 6px; background: var(--yellow); }
.defi em { font-style: normal; font-size: 12.5px; opacity: 0.85; } .defi.ok { border-color: var(--yellow); }

/* ---- Cartes de la nuit du 25/11 : fusions, maudites, synergies, etat en jeu ---- */
.card .badge.fusion { filter: hue-rotate(150deg) saturate(1.3); }
.card .badge.maudite { border-image-source: url(ui/plaque_sombre.webp); color: #ff9aa8; }
.card.maudite { filter: var(--drop) drop-shadow(0 0 12px rgba(200, 30, 60, 0.75)); }
.card.maudite .ico { background: radial-gradient(closest-side, rgba(150, 20, 50, 0.6), color-mix(in srgb, var(--fam) 20%, transparent) 65%, transparent); }
.card.fusion { filter: var(--drop) drop-shadow(0 0 14px color-mix(in srgb, var(--fam) 80%, transparent)); }
.card .syn { margin: 6px -6px -2px; font-family: var(--display); font-stretch: 80%; font-weight: 800; font-size: 13px; line-height: 1.1; color: var(--fam); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7); }
.chip.six { box-shadow: 0 0 0 2px var(--fam), 0 0 18px var(--fam), inset 0 0 8px var(--fam); }
.synact { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.synact span { font-family: var(--display); font-stretch: 80%; font-weight: 800; font-size: 14px; padding: 1px 8px; border-radius: 4px; background: rgba(14, 6, 18, 0.7); border: 2px solid #4fe3f0; color: var(--cream); }
.synact span.mau { border-color: #c81e3c; color: #ff9aa8; }
#cxhud { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
#cxhud .cx { background: rgba(14, 6, 18, 0.72); border: 2px solid #4a3240; border-radius: 4px; padding: 0 7px; font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 15px; color: var(--cream); letter-spacing: 0.5px; }
#cxhud .cx.bingo { border-color: #ff3f7f; color: #ff9ec0; } #cxhud .cx.bingo b { color: #fff; }
#cxhud .cx.musette { border-color: #e0453f; } #cxhud .cx.paroisse { border-color: #f3e3b0; color: #f3e3b0; }
#cxhud .cx.pharma { border-color: #9fe3ff; } #cxhud .cx.dmg { border-color: #ffd23f; color: #ffd23f; }
.tl #cxhud { margin-left: -50px; }
body.touch #cxhud { font-size: 13px; }
.famnav { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 10px; }
.famnav button { --fam: #fff; background: rgba(14, 6, 18, 0.72); border: 2px solid var(--fam); border-radius: 5px; padding: 2px 5px; cursor: pointer; }
.famnav button img { width: 26px; height: 26px; object-fit: contain; display: block; }
.famnav button.txt { font-family: var(--display); font-stretch: 80%; font-weight: 800; color: var(--cream); border-color: #4fe3f0; font-size: 15px; }

/* ---------- Paysage sur telephone (session paysage) ---------- */
/* Telephone tenu en portrait dans un navigateur : panneau « Tourne ton téléphone » (cree par src/paysage.js, jamais sur ordinateur) */
#tourne { display: none; }
@media (orientation: portrait) and (max-width: 760px) {
  #tourne { display: grid; place-items: center; position: fixed; inset: 0; z-index: 100; padding: 24px; touch-action: none;
    background: radial-gradient(ellipse at 50% 40%, #3a2140, #120a18 75%); }
  #tourne .cadre { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; max-width: 320px; border: 24px solid transparent; border-image: var(--bi-bois); padding: 6px 12px 12px; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5)); animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); }
  #tourne .tel { width: 132px; height: 132px; }
  #tourne .tel .tourne { transform-origin: 60px 57px; animation: tourne 2.6s cubic-bezier(0.6, 0, 0.3, 1) infinite; }
  #tourne .tel .fleche { animation: fleche 2.6s ease-in-out infinite; }
  #tourne b { font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 30px; line-height: 1.05; color: var(--ink); border: solid transparent; border-width: 13px 17px; border-image: var(--bi-creme); padding: 0 6px 2px; transform: rotate(-1.5deg); }
  #tourne span { font-size: 16px; color: var(--muted); text-shadow: 0 1px 0 var(--ink2); }
}
@keyframes tourne { 0%, 18% { transform: rotate(0deg); } 50%, 82% { transform: rotate(90deg); } 100% { transform: rotate(0deg); } }
@keyframes fleche { 0%, 18% { opacity: 1; } 40%, 90% { opacity: 0.15; } 100% { opacity: 1; } }

/* ATH tactile en paysage : le bas de l'ecran appartient aux pouces (deplacement a gauche, boutons a droite),
   les infos restent en haut et sur les bords ; la mini-carte passe en haut a droite, loin du pouce gauche. */
@media (orientation: landscape) {
  body.touch .tl { width: 172px; }
  body.touch .tl .fams { display: flex; margin: 3px 0 0 -34px; gap: 3px; max-width: 214px; }
  body.touch .tl .chip { font-size: 12px; padding: 0 4px 0 1px; border-width: 1.5px; gap: 1px; }
  body.touch .tl .chip img { width: 17px; height: 17px; }
  body.touch .tl #cxhud { margin-left: -34px; }
  body.touch .tc { max-width: calc(100vw - 420px - var(--sa-l) - var(--sa-r)); min-width: 200px; }
  body.touch .threat { display: flex; gap: 6px; padding: 0 8px; font-size: 12px; border-width: 1.5px; }
  body.touch .threat b { min-width: 0; }
  body.touch .tpips i { width: 8px; height: 7px; }
  body.touch .tr { right: calc(56px + var(--sa-r)); }
  body.touch .counters { display: grid; grid-template-columns: auto auto; gap: 2px 3px; }
  body.touch .counters div:nth-child(n + 3) { display: flex; }
  body.touch .counters div { font-size: 12.5px; justify-content: flex-start; }
  body.touch .bl { bottom: auto; top: calc(56px + var(--sa-t)); left: auto; right: calc(8px + var(--sa-r)); }
  body.touch #mini { width: 104px; height: 104px; border-width: 8px; border-image-width: 8px; opacity: 0.9; }
  body.touch .bc { top: calc(74px + var(--sa-t)); width: min(440px, 52vw); }
  body.touch #combo { right: auto; left: calc(14px + var(--sa-l)); top: 44%; transform: scale(0.6) rotate(-6deg); }
  body.touch #combo.show { transform: scale(1) rotate(-6deg); }
  body.touch #announce { top: 24%; }
  /* bouton d'action (appeler le bus, prendre une arme) : a portee du pouce droit, a gauche du sort */
  .tbtn.act { left: auto; right: calc(200px + var(--sr)); bottom: calc(22px + var(--sb)); transform: none; max-width: 36vw; }
  .tbtn.act.on { transform: translateY(3px); }
  .tbtn.dash { right: calc(22px + var(--sr)); bottom: calc(22px + var(--sb)); width: 92px; height: 92px; }
  .tbtn.spell { right: calc(124px + var(--sr)); bottom: calc(14px + var(--sb)); width: 72px; height: 72px; }
  .tbtn.weapon { right: calc(18px + var(--sr)); bottom: calc(126px + var(--sb)); height: 44px; font-size: 14px; }
  .tbtn.weapon img { height: 30px; }
}
/* tres petite hauteur (740x360) : boutons un peu plus serres pour garder le centre libre */
@media (orientation: landscape) and (max-height: 380px) {
  .tbtn.dash { width: 84px; height: 84px; bottom: calc(16px + var(--sb)); }
  .tbtn.spell { width: 66px; height: 66px; right: calc(114px + var(--sr)); bottom: calc(10px + var(--sb)); }
  .tbtn.weapon { bottom: calc(112px + var(--sb)); }
  .tbtn.act { right: calc(188px + var(--sr)); bottom: calc(16px + var(--sb)); }
  body.touch #mini { width: 92px; height: 92px; }
}
/* le bouton Sort porte aussi la classe .spell (liste des sorts) : on lui rend l'encre sombre, lisible sur le jaune */
.tbtn.spell span { color: var(--ink); font-size: 12px; line-height: 1; }
@media (orientation: landscape) {
  body.touch .levelup .fams { display: flex; gap: 3px; }
  body.touch .levelup .chip { font-size: 13px; padding: 0 4px 0 1px; }
  body.touch .levelup .chip img { width: 18px; height: 18px; }
}

/* Choix de carte sur petite hauteur (telephone en paysage) : titre et consigne sur une ligne, cartes plus larges et plus basses,
   tout tient sans defiler meme avec les cartes ultimes aux textes longs */
@media (max-height: 540px) and (orientation: landscape) {
  .levelup { max-width: 980px; }
  .levelup h2 { font-size: 24px; padding: 0 12px; border-width: 9px 12px; border-image-width: 9px 12px; vertical-align: middle; }
  .levelup > p { display: inline-block; vertical-align: middle; margin: 0 0 0 12px; font-size: 15px; }
  .pick { gap: 10px; margin-top: 8px; flex-wrap: nowrap; }
  .pick .card { flex: 1 1 0; max-width: 300px; }
  .pick .card h3 { font-size: 17px; } .card .famn { font-size: 11.5px; margin-top: 0; }
  .pick .card .ico { min-height: 0; padding: 1px 0; } .pick .card .ico img { width: 44px; height: 44px; }
  .pick .card p { font-size: 14.5px; line-height: 1.1; font-stretch: 80%; }
  .card .syn { font-size: 12px; margin-top: 4px; }
  .card .badge { top: -20px; right: -14px; font-size: 12px; }
  .levelup .row { margin-top: 6px; gap: 10px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .pick { margin-top: 14px; }
  .pick .card .badge { top: -30px; right: -10px; }
  .pick .card p { font-size: 14px; }
  .pick .card .pied { margin-top: 3px; }
  .levelup h2 { font-size: 22px; border-width: 8px 11px; border-image-width: 8px 11px; }
  .levelup .row { margin-top: 4px; }
}

/* Quartiers : un bloc par acte (titre hors de la grille) */
.panel h4.acte { margin: 8px 0 8px; font-size: 20px; color: var(--cream); text-shadow: 0 2px 0 rgba(20, 8, 26, 0.7); }
/* Petite hauteur : chaque acte devient une bande qui defile horizontalement au pouce, tuiles compactes */
@media (max-height: 540px) and (orientation: landscape) {
  .panel.wide { max-width: 1100px; }
  .panel header { margin-bottom: 4px; }
  .panel h4.acte { margin: 4px 0 4px; font-size: 16px; }
  .districts, .spells { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: #6b4a5a transparent; touch-action: pan-x pan-y; }
  .districts > *, .spells > * { flex: 0 0 auto; scroll-snap-align: start; }
  .district { width: 172px; min-height: 0; }
  .district p { display: none; }
  .district h3 { font-size: 18px; line-height: 1.02; }
  .district ul { font-size: 12px; line-height: 1.35; padding-left: 14px; }
  .district .best { margin-top: 5px; font-size: 12px; padding: 3px 6px; }
  .district.cata { width: 230px; }
  .district.cata .best { font-size: 11.5px; }
  .spell { width: 210px; }
  .panel h4 { margin: 8px 0 4px; }
  .panel footer { margin-top: 10px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .panel h2 { font-size: 24px; }
  .district { padding: 2px 6px 4px; }
  .district .lvl { font-size: 13px; border-width: 6px 8px; border-image-width: 6px 8px; }
  .district h3 { margin: 3px 0 2px; }
  .district ul { list-style: none; padding: 0; flex: 1; }
  .district li { display: inline; } .district li + li::before { content: " · "; }
}
@media (max-height: 540px) and (orientation: landscape) {
  /* buffet et boutique : deux colonnes, lignes basses */
  .ups { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .up { padding: 5px 10px; gap: 8px; }
  .up h3 { font-size: 17px; } .up p { font-size: 12.5px; margin: 1px 0 4px; line-height: 1.25; }
  .pips i { width: 16px; height: 8px; }
  .muted { margin: 2px 0 8px; font-size: 13px; }
  /* aide : trois colonnes serrees */
  .help { grid-template-columns: repeat(3, 1fr); gap: 14px; font-size: 12.5px; line-height: 1.4; }
  .help h3 { font-size: 18px; margin-bottom: 4px; }
  .help table { border-spacing: 0 4px; } .help kbd { font-size: 12px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  /* collection : une bande horizontale par famille, barre des familles toujours visible pour sauter de l'une a l'autre */
  .famnav { position: sticky; top: -8px; z-index: 4; margin: 0 -8px 6px; padding: 4px 8px; background: #2a1a2c; box-shadow: 0 4px 6px rgba(10, 4, 14, 0.5); }
  .famnav button img { width: 22px; height: 22px; }
  .collection section { margin-bottom: 10px; scroll-margin-top: 58px; }
  .collection section > h3 { font-size: 20px; } .collection section > h3 img { width: 28px; height: 28px; }
  .collection .bonus { gap: 4px 12px; font-size: 12px; margin: 2px 0 4px; }
  .collection .cards { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; padding: 22px 4px 6px; gap: 10px; scrollbar-width: thin; scrollbar-color: #6b4a5a transparent; touch-action: pan-x pan-y; }
  .collection .card { flex: 0 0 168px; width: 168px; min-height: 0; border-width: 14px; border-image-width: 14px; }
  .collection .card h3 { font-size: 16px; } .collection .card p { font-size: 13px; line-height: 1.1; }
  .collection .card .ico { min-height: 0; padding: 2px 0; } .collection .card .ico img { width: 44px; height: 44px; }
  .collection .card.unseen .ico, .collection .card.locked .ico { font-size: 36px; }
  .collection .card .badge { top: -22px; right: -10px; font-size: 11.5px; }
  .defis { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; font-size: 13px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .panel { overflow: visible; }   /* c'est #screen qui defile : la barre des familles peut rester collee en haut */
}
/* aide sur telephone : on garde les commandes tactiles, les tableaux clavier et manette ne servent pas (sauf manette branchee) */
body.touch:not(.pad) .help > div:nth-child(2) > p ~ * { display: none; }
@media (max-height: 540px) and (orientation: landscape) {
  /* pause : cartes a gauche (defilent seules), sort + volumes + boutons a droite */
  .panel.pause { max-width: 980px; display: grid; grid-template-columns: 1fr minmax(230px, 32%); grid-template-rows: auto auto 1fr; column-gap: 16px; max-height: calc(100vh - 16px - var(--sa-t) - var(--sa-b)); overflow: hidden; }
  .panel.pause header { grid-column: 1 / -1; margin-bottom: 2px; }
  .panel.pause .pcartes { grid-column: 1; grid-row: 2 / 4; overflow: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: #6b4a5a transparent; }
  .panel.pause .pcartes h4 { margin-top: 0; }
  .panel.pause .pcote { grid-column: 2; }
  .panel.pause .pcote footer { flex-direction: column; align-items: stretch; gap: 6px; margin-top: 8px; }
  .panel.pause .vols { justify-content: flex-start; }
  .mini { font-size: 12.5px; } .mini img { width: 18px; height: 18px; }
  .fambonus { font-size: 12px; line-height: 1.5; }
}
@media (max-height: 540px) and (orientation: landscape) {
  /* fin de partie : bilan a gauche, deblocages et boutons a droite */
  .panel.end { max-width: 900px; display: grid; grid-template-columns: 1.1fr 1fr; column-gap: 18px; align-items: start; }
  .panel.end > h1, .panel.end > .sub { grid-column: 1 / -1; justify-self: center; }
  .panel.end > .sub { margin: 4px 0 8px; font-size: 15px; }
  .end h1 { font-size: 28px; }
  .stats4 { gap: 5px; margin-bottom: 6px; } .stats4 div { border-width: 9px; } .stats4 b { font-size: 20px; } .stats4 span { font-size: 11px; }
  .bill { font-size: 14px; } .bill td { padding: 2px 6px; } .bill td:last-child { font-size: 16px; } .bill .tot td { font-size: 20px; padding-top: 5px; }
  .end .ecol:last-child { display: flex; flex-direction: column; gap: 6px; }
  .unlock { margin-top: 0; font-size: 15px; border-width: 9px 12px; border-image-width: 9px 12px; }
  .end .btn.ad { margin-top: 0; }
  .end footer { margin-top: 4px; gap: 6px; }
  .panel.end:not(:has(.ecol)) { display: block; }   /* relever mamie (pub) : simple panneau */
}
@media (max-height: 540px) and (orientation: landscape) {
  .end .ecol:last-child footer { order: -1; margin: 0 0 4px; }
  .end .ecol:last-child footer .btn.big { font-size: 20px; padding: 0 18px; }
  .unlock { font-size: 13.5px; line-height: 1.1; }
  .end h1 { margin: 0; }
}
@media (max-height: 380px) and (orientation: landscape) {
  .accueil .logo { height: 26vh; }
  .serie i { height: 20px; }
}
@media (max-height: 380px) and (orientation: landscape) {
  #screen { padding-block: calc(4px + var(--sa-t)) calc(4px + var(--sa-b)); }
  .accueil .droite { gap: 4px; padding-top: 0; padding-bottom: 2px; }
}
